vendor: 4,075 bytes, lines 1-108
1/** 2 * @licstart The following is the entire license notice for the 3 * Javascript code in this page 4 * 5 * Copyright 2017 Mozilla Foundation 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * 19 * @licend The above is the entire license notice for the 20 * Javascript code in this page 21 */ 22 23(function webpackUniversalModuleDefinition(root, factory) { 24 if(typeof exports === 'object' && typeof module === 'object') 25 module.exports = factory(); 26 else if(typeof define === 'function' && define.amd) 27 define("pdfjs-dist/build/pdf.worker", [], factory); 28 else if(typeof exports === 'object') 29 exports["pdfjs-dist/build/pdf.worker"] = factory(); 30 else 31 root["pdfjs-dist/build/pdf.worker"] = root.pdfjsDistBuildPdfWorker = factory(); 32})(this, function() { 33return /******/ (function(modules) { // webpackBootstrap 34/******/ // The module cache 35/******/ var installedModules = {}; 36/******/ 37/******/ // The require function 38/******/ function __w_pdfjs_require__(moduleId) { 39/******/ 40/******/ // Check if module is in cache 41/******/ if(installedModules[moduleId]) { 42/******/ return installedModules[moduleId].exports; 43/******/ } 44/******/ // Create a new module (and put it into the cache) 45/******/ var module = installedModules[moduleId] = { 46/******/ i: moduleId, 47/******/ l: false, 48/******/ exports: {} 49/******/ }; 50/******/ 51/******/ // Execute the module function 52/******/ modules[moduleId].call(module.exports, module, module.exports, __w_pdfjs_require__); 53/******/ 54/******/ // Flag the module as loaded 55/******/ module.l = true; 56/******/ 57/******/ // Return the exports of the module 58/******/ return module.exports; 59/******/ } 60/******/ 61/******/ 62/******/ // expose the modules object (__webpack_modules__) 63/******/ __w_pdfjs_require__.m = modules; 64/******/ 65/******/ // expose the module cache 66/******/ __w_pdfjs_require__.c = installedModules; 67/******/ 68/******/ // define getter function for harmony exports 69/******/ __w_pdfjs_require__.d = function(exports, name, getter) { 70/******/ if(!__w_pdfjs_require__.o(exports, name)) { 71/******/ Object.defineProperty(exports, name, { 72/******/ configurable: false, 73/******/ enumerable: true, 74/******/ get: getter 75/******/ }); 76/******/ } 77/******/ }; 78/******/ 79/******/ // getDefaultExport function for compatibility with non-harmony modules 80/******/ __w_pdfjs_require__.n = function(module) { 81/******/ var getter = module && module.__esModule ? 82/******/ function getDefault() { return module['default']; } : 83/******/ function getModuleExports() { return module; }; 84/******/ __w_pdfjs_require__.d(getter, 'a', getter); 85/******/ return getter; 86/******/ }; 87/******/ 88/******/ // Object.prototype.hasOwnProperty.call 89/******/ __w_pdfjs_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 90/******/ 91/******/ // __webpack_public_path__ 92/******/ __w_pdfjs_require__.p = ""; 93/******/ 94/******/ // Load entry module and return exports 95/******/ return __w_pdfjs_require__(__w_pdfjs_require__.s = 72); 96/******/ }) 97/************************************************************************/ 98/******/ ([ 99/* 0 */ 100/***/ (function(module, exports, __w_pdfjs_require__) { 101 102"use strict"; 103 104 105Object.defineProperty(exports, "__esModule", { 106 value: true 107}); 108exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exp
108orts.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined; 109 110var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 111 112__w_pdfjs_require__(74); 113 114var _streams_polyfill = __w_pdfjs_require__(124); 115 116var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; 117var NativeImageDecoding = { 118 NONE: 'none', 119 DECODE: 'decode', 120 DISPLAY: 'display' 121}; 122var TextRenderingMode = { 123 FILL: 0, 124 STROKE: 1, 125 FILL_STROKE: 2, 126 INVISIBLE: 3, 127 FILL_ADD_TO_PATH: 4, 128 STROKE_ADD_TO_PATH: 5, 129 FILL_STROKE_ADD_TO_PATH: 6, 130 ADD_TO_PATH: 7, 131 FILL_STROKE_MASK: 3, 132 ADD_TO_PATH_FLAG: 4 133}; 134var ImageKind = { 135 GRAYSCALE_1BPP: 1, 136 RGB_24BPP: 2, 137 RGBA_32BPP: 3 138}; 139var AnnotationType = { 140 TEXT: 1, 141 LINK: 2, 142 FREETEXT: 3, 143 LINE: 4, 144 SQUARE: 5, 145 CIRCLE: 6, 146 POLYGON: 7, 147 POLYLINE: 8, 148 HIGHLIGHT: 9, 149 UNDERLINE: 10, 150 SQUIGGLY: 11, 151 STRIKEOUT: 12, 152 STAMP: 13, 153 CARET: 14, 154 INK: 15, 155 POPUP: 16, 156 FILEATTACHMENT: 17, 157 SOUND: 18, 158 MOVIE: 19, 159 WIDGET: 20, 160 SCREEN: 21, 161 PRINTERMARK: 22, 162 TRAPNET: 23, 163 WATERMARK: 24, 164 THREED: 25, 165 REDACT: 26 166}; 167var AnnotationFlag = { 168 INVISIBLE: 0x01, 169 HIDDEN: 0x02, 170 PRINT: 0x04, 171 NOZOOM: 0x08, 172 NOROTATE: 0x10, 173 NOVIEW: 0x20, 174 READONLY: 0x40, 175 LOCKED: 0x80, 176 TOGGLENOVIEW: 0x100, 177 LOCKEDCONTENTS: 0x200 178}; 179var AnnotationFieldFlag = { 180 READONLY: 0x0000001, 181 REQUIRED: 0x0000002, 182 NOEXPORT: 0x0000004, 183 MULTILINE: 0x0001000, 184 PASSWORD: 0x0002000, 185 NOTOGGLETOOFF: 0x0004000, 186 RADIO: 0x0008000, 187 PUSHBUTTON: 0x0010000, 188 COMBO: 0x0020000, 189 EDIT: 0x0040000, 190 SORT: 0x0080000, 191 FILESELECT: 0x0100000, 192 MULTISELECT: 0x0200000, 193 DONOTSPELLCHECK: 0x0400000, 194 DONOTSCROLL: 0x0800000, 195 COMB: 0x1000000, 196 RICHTEXT: 0x2000000, 197 RADIOSINUNISON: 0x2000000, 198 COMMITONSELCHANGE: 0x4000000 199}; 200var AnnotationBorderStyleType = { 201 SOLID: 1, 202 DASHED: 2, 203 BEVELED: 3, 204 INSET: 4, 205 UNDERLINE: 5 206}; 207var StreamType = { 208 UNKNOWN: 0, 209 FLATE: 1, 210 LZW: 2, 211 DCT: 3, 212 JPX: 4, 213 JBIG: 5, 214 A85: 6, 215 AHX: 7, 216 CCF: 8, 217 RL: 9 218}; 219var FontType = { 220 UNKNOWN: 0, 221 TYPE1: 1, 222 TYPE1C: 2, 223 CIDFONTTYPE0: 3, 224 CIDFONTTYPE0C: 4, 225 TRUETYPE: 5, 226 CIDFONTTYPE2: 6, 227 TYPE3: 7, 228 OPENTYPE: 8, 229 TYPE0: 9, 230 MMTYPE1: 10 231}; 232var VERBOSITY_LEVELS = { 233 errors: 0, 234 warnings: 1, 235 infos: 5 236}; 237var CMapCompressionType = { 238 NONE: 0, 239 BINARY: 1, 240 STREAM: 2 241}; 242var OPS = { 243 dependency: 1, 244 setLineWidth: 2, 245 setLineCap: 3, 246 setLineJoin: 4, 247 setMiterLimit: 5, 248 setDash: 6, 249 setRenderingIntent: 7, 250 setFlatness: 8, 251 setGState: 9, 252 save: 10, 253 restore: 11, 254 transform: 12, 255 moveTo: 13, 256 lineTo: 14, 257 curveTo: 15, 258 curveTo2: 16, 259 curveTo3: 17, 260 closePath: 18, 261 rectangle: 19, 262 stroke: 20, 263 closeStroke: 21, 264 fill: 22, 265 eoFill: 23, 266 fillStroke: 24, 267 eoFillStroke: 25, 268 closeFillStroke: 26, 269 closeEOFillStroke: 27, 270 endPath: 28,
271 clip: 29, 272 eoClip: 30, 273 beginText: 31, 274 endText: 32, 275 setCharSpacing: 33, 276 setWordSpacing: 34, 277 setHScale: 35, 278 setLeading: 36, 279 setFont: 37, 280 setTextRenderingMode: 38, 281 setTextRise: 39, 282 moveText: 40, 283 setLeadingMoveText: 41, 284 setTextMatrix: 42, 285 nextLine: 43, 286 showText: 44, 287 showSpacedText: 45, 288 nextLineShowText: 46, 289 nextLineSetSpacingShowText: 47, 290 setCharWidth: 48, 291 setCharWidthAndBounds: 49, 292 setStrokeColorSpace: 50, 293 setFillColorSpace: 51, 294 setStrokeColor: 52, 295 setStrokeColorN: 53, 296 setFillColor: 54, 297 setFillColorN: 55, 298 setStrokeGray: 56, 299 setFillGray: 57, 300 setStrokeRGBColor: 58, 301 setFillRGBColor: 59, 302 setStrokeCMYKColor: 60, 303 setFillCMYKColor: 61, 304 shadingFill: 62, 305 beginInlineImage: 63, 306 beginImageData: 64, 307 endInlineImage: 65, 308 paintXObject: 66, 309 markPoint: 67, 310 markPointProps: 68, 311 beginMarkedContent: 69, 312 beginMarkedContentProps: 70, 313 endMarkedContent: 71, 314 beginCompat: 72, 315 endCompat: 73, 316 paintFormXObjectBegin: 74, 317 paintFormXObjectEnd: 75, 318 beginGroup: 76, 319 endGroup: 77, 320 beginAnnotations: 78, 321 endAnnotations: 79, 322 beginAnnotation: 80, 323 endAnnotation: 81, 324 paintJpegXObject: 82, 325 paintImageMaskXObject: 83, 326 paintImageMaskXObjectGroup: 84, 327 paintImageXObject: 85, 328 paintInlineImageXObject: 86, 329 paintInlineImageXObjectGroup: 87, 330 paintImageXObjectRepeat: 88, 331 paintImageMaskXObjectRepeat: 89, 332 paintSolidColorImageMask: 90, 333 constructPath: 91 334}; 335var verbosity = VERBOSITY_LEVELS.warnings; 336function setVerbosityLevel(level) { 337 verbosity = level; 338} 339function getVerbosityLevel() { 340 return verbosity; 341} 342function info(msg) { 343 if (verbosity >= VERBOSITY_LEVELS.infos) { 344 console.log('Info: ' + msg); 345 } 346} 347function warn(msg) { 348 if (verbosity >= VERBOSITY_LEVELS.warnings) { 349 console.log('Warning: ' + msg); 350 } 351} 352function deprecated(details) { 353 console.log('Deprecated API usage: ' + details); 354} 355function unreachable(msg) { 356 throw new Error(msg); 357} 358function assert(cond, msg) { 359 if (!cond) { 360 unreachable(msg); 361 } 362} 363var UNSUPPORTED_FEATURES = { 364 unknown: 'unknown', 365 forms: 'forms', 366 javaScript: 'javaScript', 367 smask: 'smask', 368 shadingPattern: 'shadingPattern', 369 font: 'font' 370}; 371function isSameOrigin(baseUrl, otherUrl) { 372 try { 373 var base = new URL(baseUrl); 374 if (!base.origin || base.origin === 'null') { 375 return false; 376 } 377 } catch (e) { 378 return false; 379 } 380 var other = new URL(otherUrl, base); 381 return base.origin === other.origin; 382} 383function isValidProtocol(url) { 384 if (!url) { 385 return false; 386 } 387 switch (url.protocol) { 388 case 'http:': 389 case 'https:': 390 case 'ftp:': 391 case 'mailto:': 392 case 'tel:': 393 return true; 394 default: 395 return false; 396 } 397} 398function createValidAbsoluteUrl(url, baseUrl) { 399 if (!url) { 400 return null; 401 } 402 try { 403 var absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url); 404 if (isValidProtocol(absoluteUrl)) { 405 return absoluteUrl; 406 } 407 } catch (ex) {} 408 return null; 409} 410function shadow(obj, prop, value) { 411 Object.defineProperty(obj, prop, { 412 value: value, 413 enumerable: true, 414 configurable: true, 415 writable: false 416 }); 417 return value; 418} 419function getLookupTableFactory(initializer) { 420 var lookup; 421 return function () { 422 if (initializer) { 423 lookup = Object.create(null); 424 initializer(lookup); 425 initializer = null; 426 } 427 return lookup; 428 }; 429} 430var PasswordResponses = { 431 NEED_PASSWORD: 1, 432 INCORRECT_PASSWORD: 2 433}; 434var PasswordException = function PasswordExceptionClosure() { 435 function PasswordException(msg, code) { 436 this.name = 'PasswordException'; 437 this.message = msg; 438 this.code = code; 439 } 440 PasswordException.prototype = new Error(); 441 PasswordException.constructor = PasswordException; 442 return PasswordException; 443}(); 444var UnknownErrorException = function UnknownErrorExceptionClosure() { 445 function UnknownErrorException(msg, details) { 446 this.name = 'UnknownErrorException'; 447 this.message = msg; 448 this.details = details; 449 } 450 UnknownErrorException.prototype = new Error(); 451 UnknownErrorException.constructor = UnknownErrorException; 452 return UnknownErrorException; 453}(); 454var InvalidPDFException = function InvalidPDFExceptionClosure() { 455 function InvalidPDFException(msg) { 456 this.name = 'InvalidPDFException'; 457 this.message = msg; 458 } 459 InvalidPDFException.prototype = new Error(); 460 InvalidPDFException.constructor = InvalidPDFException; 461 return InvalidPDFException; 462}(); 463var MissingPDFException = function MissingPDFExceptionClosure() { 464 function MissingPDFException(msg) { 465 this.name = 'MissingPDFException'; 466 this.message = msg; 467 } 468 MissingPDFException.prototype = new Error(); 469 MissingPDFException.constructor = MissingPDFException; 470 return MissingPDFException; 471}(); 472var UnexpectedResponseException = function UnexpectedResponseExceptionClosure() { 473 function UnexpectedResponseException(msg, status) { 474 this.name = 'UnexpectedResponseException'; 475 this.message = msg; 476 this.status = status; 477 } 478 UnexpectedResponseException.prototype = new Error(); 479 UnexpectedResponseException.constructor = UnexpectedResponseException; 480 return UnexpectedResponseException; 481}(); 482var NotImplementedException = function NotImplementedExceptionClosure() { 483 function NotImplementedException(msg) { 484 this.message = msg; 485 } 486 NotImplementedException.prototype = new Error(); 487 NotImplementedException.prototype.name = 'NotImplementedException'; 488 NotImplementedException.constructor = NotImplementedException; 489 return NotImplementedException; 490}(); 491var MissingDataException = function MissingDataExceptionClosure() { 492 function MissingDataException(begin, end) { 493 this.begin = begin; 494 this.end = end; 495 this.message = 'Missing data [' + begin + ', ' + end + ')'; 496 } 497 MissingDataException.prototype = new Error(); 498 MissingDataException.prototype.name = 'MissingDataException'; 499 MissingDataException.constructor = MissingDataException; 500 return MissingDataException; 501}(); 502var XRefParseException = function XRefParseExceptionClosure() { 503 function XRefParseException(msg) { 504 this.message = msg; 505 } 506 XRefParseException.prototype = new Error(); 507 XRefParseException.prototype.name = 'XRefParseException'; 508 XRefParseException.constructor = XRefParseException; 509 return XRefParseException; 510}(); 511var FormatError = function FormatErrorClosure() { 512 function FormatError(msg) { 513 this.message = msg; 514 } 515 FormatError.prototype = new Error(); 516 FormatError.prototype.name = 'FormatError'; 517 FormatError.constructor = FormatError; 518 return FormatError; 519}();
520var AbortException = function AbortExceptionClosure() { 521 function AbortException(msg) { 522 this.name = 'AbortException'; 523 this.message = msg; 524 } 525 AbortException.prototype = new Error(); 526 AbortException.constructor = AbortException; 527 return AbortException; 528}(); 529var NullCharactersRegExp = /\x00/g; 530function removeNullCharacters(str) { 531 if (typeof str !== 'string') { 532 warn('The argument for removeNullCharacters must be a string.'); 533 return str; 534 } 535 return str.replace(NullCharactersRegExp, ''); 536} 537function bytesToString(bytes) { 538 assert(bytes !== null && (typeof bytes === 'undefined' ? 'undefined' : _typeof(bytes)) === 'object' && bytes.length !== undefined, 'Invalid argument for bytesToString'); 539 var length = bytes.length; 540 var MAX_ARGUMENT_COUNT = 8192; 541 if (length < MAX_ARGUMENT_COUNT) { 542 return String.fromCharCode.apply(null, bytes); 543 } 544 var strBuf = []; 545 for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) { 546 var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); 547 var chunk = bytes.subarray(i, chunkEnd); 548 strBuf.push(String.fromCharCode.apply(null, chunk)); 549 } 550 return strBuf.join(''); 551} 552function stringToBytes(str) { 553 assert(typeof str === 'string', 'Invalid argument for stringToBytes'); 554 var length = str.length; 555 var bytes = new Uint8Array(length); 556 for (var i = 0; i < length; ++i) { 557 bytes[i] = str.charCodeAt(i) & 0xFF; 558 } 559 return bytes; 560} 561function arrayByteLength(arr) { 562 if (arr.length !== undefined) { 563 return arr.length; 564 } 565 assert(arr.byteLength !== undefined); 566 return arr.byteLength; 567} 568function arraysToBytes(arr) { 569 if (arr.length === 1 && arr[0] instanceof Uint8Array) { 570 return arr[0]; 571 } 572 var resultLength = 0; 573 var i, 574 ii = arr.length; 575 var item, itemLength; 576 for (i = 0; i < ii; i++) { 577 item = arr[i]; 578 itemLength = arrayByteLength(item); 579 resultLength += itemLength; 580 } 581 var pos = 0; 582 var data = new Uint8Array(resultLength); 583 for (i = 0; i < ii; i++) { 584 item = arr[i]; 585 if (!(item instanceof Uint8Array)) { 586 if (typeof item === 'string') { 587 item = stringToBytes(item); 588 } else { 589 item = new Uint8Array(item); 590 } 591 } 592 itemLength = item.byteLength; 593 data.set(item, pos); 594 pos += itemLength; 595 } 596 return data; 597} 598function string32(value) { 599 return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); 600} 601function log2(x) { 602 if (x <= 0) { 603 return 0; 604 } 605 return Math.ceil(Math.log2(x)); 606} 607function readInt8(data, start) { 608 return data[start] << 24 >> 24; 609} 610function readUint16(data, offset) { 611 return data[offset] << 8 | data[offset + 1]; 612} 613function readUint32(data, offset) { 614 return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0; 615} 616function isLittleEndian() { 617 var buffer8 = new Uint8Array(4); 618 buffer8[0] = 1; 619 var view32 = new Uint32Array(buffer8.buffer, 0, 1); 620 return view32[0] === 1; 621} 622function isEvalSupported() { 623 try { 624 new Function(''); 625 return true; 626 } catch (e) { 627 return false; 628 } 629} 630var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; 631var Util = function UtilClosure() { 632 function Util() {} 633 var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')']; 634 Util.makeCssRgb = function Util_makeCssRgb(r, g, b) { 635 rgbBuf[1] = r; 636 rgbBuf[3] = g; 637 rgbBuf[5] = b; 638 return rgbBuf.join(''); 639 }; 640 Util.transform = function Util_transform(m1, m2) { 641 return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]]; 642 }; 643 Util.applyTransform = function Util_applyTransform(p, m) { 644 var xt = p[0] * m[0] + p[1] * m[2] + m[4]; 645 var yt = p[0] * m[1] + p[1] * m[3] + m[5]; 646 return [xt, yt]; 647 }; 648 Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { 649 var d = m[0] * m[3] - m[1] * m[2]; 650 var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; 651 var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; 652 return [xt, yt]; 653 }; 654 Util.getAxialAlignedBoundingBox = function Util_getAxialAlignedBoundingBox(r, m) { 655 var p1 = Util.applyTransform(r, m); 656 var p2 = Util.applyTransform(r.slice(2, 4), m); 657 var p3 = Util.applyTransform([r[0], r[3]], m); 658 var p4 = Util.applyTransform([r[2], r[1]], m); 659 return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])]; 660 }; 661 Util.inverseTransform = function Util_inverseTransform(m) { 662 var d = m[0] * m[3] - m[1] * m[2]; 663 return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; 664 }; 665 Util.apply3dTransform = function Util_apply3dTransform(m, v) { 666 return [m[0] * v[0] + m[1] * v[1] + m[2] * v[2], m[3] * v[0] + m[4] * v[1] + m[5] * v[2], m[6] * v[0] + m[7] * v[1] + m[8] * v[2]]; 667 }; 668 Util.singularValueDecompose2dScale = function Util_singularValueDecompose2dScale(m) { 669 var transpose = [m[0], m[2], m[1], m[3]]; 670 var a = m[0] * transpose[0] + m[1] * transpose[2]; 671 var b = m[0] * transpose[1] + m[1] * transpose[3]; 672 var c = m[2] * transpose[0] + m[3] * transpose[2]; 673 var d = m[2] * transpose[1] + m[3] * transpose[3]; 674 var first = (a + d) / 2; 675 var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2; 676 var sx = first + second || 1; 677 var sy = first - second || 1; 678 return [Math.sqrt(sx), Math.sqrt(sy)]; 679 }; 680 Util.normalizeRect = function Util_normalizeRect(rect) { 681 var r = rect.slice(0); 682 if (rect[0] > rect[2]) { 683 r[0] = rect[2]; 684 r[2] = rect[0];
vendor: 6,172 bytes, lines 685-857
685 } 686 if (rect[1] > rect[3]) { 687 r[1] = rect[3]; 688 r[3] = rect[1]; 689 } 690 return r; 691 }; 692 Util.intersect = function Util_intersect(rect1, rect2) { 693 function compare(a, b) { 694 return a - b; 695 } 696 var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare), 697 orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare), 698 result = []; 699 rect1 = Util.normalizeRect(rect1); 700 rect2 = Util.normalizeRect(rect2); 701 if (orderedX[0] === rect1[0] && orderedX[1] === rect2[0] || orderedX[0] === rect2[0] && orderedX[1] === rect1[0]) { 702 result[0] = orderedX[1]; 703 result[2] = orderedX[2]; 704 } else { 705 return false; 706 } 707 if (orderedY[0] === rect1[1] && orderedY[1] === rect2[1] || orderedY[0] === rect2[1] && orderedY[1] === rect1[1]) { 708 result[1] = orderedY[1]; 709 result[3] = orderedY[2]; 710 } else { 711 return false; 712 } 713 return result; 714 }; 715 var ROMAN_NUMBER_MAP = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX']; 716 Util.toRoman = function Util_toRoman(number, lowerCase) { 717 assert(Number.isInteger(number) && number > 0, 'The number should be a positive integer.'); 718 var pos, 719 romanBuf = []; 720 while (number >= 1000) { 721 number -= 1000; 722 romanBuf.push('M'); 723 } 724 pos = number / 100 | 0; 725 number %= 100; 726 romanBuf.push(ROMAN_NUMBER_MAP[pos]); 727 pos = number / 10 | 0; 728 number %= 10; 729 romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]); 730 romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); 731 var romanStr = romanBuf.join(''); 732 return lowerCase ? romanStr.toLowerCase() : romanStr; 733 }; 734 Util.appendToArray = function Util_appendToArray(arr1, arr2) { 735 Array.prototype.push.apply(arr1, arr2); 736 }; 737 Util.prependToArray = function Util_prependToArray(arr1, arr2) { 738 Array.prototype.unshift.apply(arr1, arr2); 739 }; 740 Util.extendObj = function extendObj(obj1, obj2) { 741 for (var key in obj2) { 742 obj1[key] = obj2[key]; 743 } 744 }; 745 Util.getInheritableProperty = function Util_getInheritableProperty(dict, name, getArray) { 746 while (dict && !dict.has(name)) { 747 dict = dict.get('Parent'); 748 } 749 if (!dict) { 750 return null; 751 } 752 return getArray ? dict.getArray(name) : dict.get(name); 753 }; 754 Util.inherit = function Util_inherit(sub, base, prototype) { 755 sub.prototype = Object.create(base.prototype); 756 sub.prototype.constructor = sub; 757 for (var prop in prototype) { 758 sub.prototype[prop] = prototype[prop]; 759 } 760 }; 761 Util.loadScript = function Util_loadScript(src, callback) { 762 var script = document.createElement('script'); 763 var loaded = false; 764 script.setAttribute('src', src); 765 if (callback) { 766 script.onload = function () { 767 if (!loaded) { 768 callback(); 769 } 770 loaded = true; 771 }; 772 } 773 document.getElementsByTagName('head')[0].appendChild(script); 774 }; 775 return Util; 776}(); 777var PageViewport = function PageViewportClosure() { 778 function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) { 779 this.viewBox = viewBox; 780 this.scale = scale; 781 this.rotation = rotation; 782 this.offsetX = offsetX; 783 this.offsetY = offsetY; 784 var centerX = (viewBox[2] + viewBox[0]) / 2; 785 var centerY = (viewBox[3] + viewBox[1]) / 2; 786 var rotateA, rotateB, rotateC, rotateD; 787 rotation = rotation % 360; 788 rotation = rotation < 0 ? rotation + 360 : rotation; 789 switch (rotation) { 790 case 180: 791 rotateA = -1; 792 rotateB = 0; 793 rotateC = 0; 794 rotateD = 1; 795 break; 796 case 90: 797 rotateA = 0; 798 rotateB = 1; 799 rotateC = 1; 800 rotateD = 0; 801 break; 802 case 270: 803 rotateA = 0; 804 rotateB = -1; 805 rotateC = -1; 806 rotateD = 0; 807 break; 808 default: 809 rotateA = 1; 810 rotateB = 0; 811 rotateC = 0; 812 rotateD = -1; 813 break; 814 } 815 if (dontFlip) { 816 rotateC = -rotateC; 817 rotateD = -rotateD; 818 } 819 var offsetCanvasX, offsetCanvasY; 820 var width, height; 821 if (rotateA === 0) { 822 offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; 823 offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; 824 width = Math.abs(viewBox[3] - viewBox[1]) * scale; 825 height = Math.abs(viewBox[2] - viewBox[0]) * scale; 826 } else { 827 offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; 828 offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; 829 width = Math.abs(viewBox[2] - viewBox[0]) * scale; 830 height = Math.abs(viewBox[3] - viewBox[1]) * scale; 831 } 832 this.transform = [rotateA * scale, rotateB * scale, rotateC * scale, rotateD * scale, offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY]; 833 this.width = width; 834 this.height = height; 835 this.fontScale = scale; 836 } 837 PageViewport.prototype = { 838 clone: function PageViewPort_clone(args) { 839 args = args || {}; 840 var scale = 'scale' in args ? args.scale : this.scale; 841 var rotation = 'rotation' in args ? args.rotation : this.rotation; 842 return new PageViewport(this.viewBox.slice(), scale, rotation, this.offsetX, this.offsetY, args.dontFlip); 843 }, 844 convertToViewportPoint: function PageViewport_convertToViewportPoint(x, y) { 845 return Util.applyTransform([x, y], this.transform); 846 }, 847 convertToViewportRectangle: function PageViewport_convertToViewportRectangle(rect) { 848 var tl = Util.applyTransform([rect[0], rect[1]], this.transform); 849 var br = Util.applyTransform([rect[2], rect[3]], this.transform); 850 return [tl[0], tl[1], br[0], br[1]]; 851 }, 852 convertToPdfPoint: function PageViewport_convertToPdfPoint(x, y) { 853 return Util.applyInverseTransform([x, y], this.transform); 854 } 855 }; 856 return PageViewport; 857}();
858var PDFStringTranslateTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC]; 859function stringToPDFString(str) { 860 var i, 861 n = str.length, 862 strBuf = []; 863 if (str[0] === '\xFE' && str[1] === '\xFF') { 864 for (i = 2; i < n; i += 2) { 865 strBuf.push(String.fromCharCode(str.charCodeAt(i) << 8 | str.charCodeAt(i + 1))); 866 } 867 } else { 868 for (i = 0; i < n; ++i) { 869 var code = PDFStringTranslateTable[str.charCodeAt(i)]; 870 strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); 871 } 872 } 873 return strBuf.join(''); 874} 875function stringToUTF8String(str) { 876 return decodeURIComponent(escape(str)); 877} 878function utf8StringToString(str) { 879 return unescape(encodeURIComponent(str)); 880} 881function isEmptyObj(obj) { 882 for (var key in obj) { 883 return false; 884 } 885 return true; 886} 887function isBool(v) { 888 return typeof v === 'boolean'; 889} 890function isNum(v) { 891 return typeof v === 'number'; 892} 893function isString(v) { 894 return typeof v === 'string'; 895} 896function isArrayBuffer(v) { 897 return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' && v !== null && v.byteLength !== undefined; 898} 899function isSpace(ch) { 900 return ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A; 901} 902function createPromiseCapability() { 903 var capability = {}; 904 capability.promise = new Promise(function (resolve, reject) { 905 capability.resolve = resolve; 906 capability.reject = reject; 907 }); 908 return capability; 909} 910var createBlob = function createBlob(data, contentType) { 911 if (typeof Blob !== 'undefined') { 912 return new Blob([data], { type: contentType }); 913 } 914 throw new Error('The "Blob" constructor is not supported.'); 915}; 916var createObjectURL = function createObjectURLClosure() { 917 var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; 918 return function createObjectURL(data, contentType) { 919 var forceDataSchema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 920 921 if (!forceDataSchema && URL.createObjectURL) { 922 var blob = createBlob(data, contentType); 923 return URL.createObjectURL(blob); 924 } 925 var buffer = 'data:' + contentType + ';base64,'; 926 for (var i = 0, ii = data.length; i < ii; i += 3) { 927 var b1 = data[i] & 0xFF; 928 var b2 = data[i + 1] & 0xFF; 929 var b3 = data[i + 2] & 0xFF; 930 var d1 = b1 >> 2, 931 d2 = (b1 & 3) << 4 | b2 >> 4; 932 var d3 = i + 1 < ii ? (b2 & 0xF) << 2 | b3 >> 6 : 64; 933 var d4 = i + 2 < ii ? b3 & 0x3F : 64; 934 buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; 935 } 936 return buffer; 937 }; 938}(); 939function resolveCall(fn, args) { 940 var thisArg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; 941 942 if (!fn) { 943 return Promise.resolve(undefined); 944 } 945 return new Promise(function (resolve, reject) { 946 resolve(fn.apply(thisArg, args)); 947 }); 948} 949function wrapReason(reason) { 950 if ((typeof reason === 'undefined' ? 'undefined' : _typeof(reason)) !== 'object') { 951 return reason; 952 } 953 switch (reason.name) { 954 case 'AbortException': 955 return new AbortException(reason.message); 956 case 'MissingPDFException': 957 return new MissingPDFException(reason.message); 958 case 'UnexpectedResponseException': 959 return new UnexpectedResponseException(reason.message, reason.status); 960 default: 961 return new UnknownErrorException(reason.message, reason.details); 962 } 963} 964function makeReasonSerializable(reason) { 965 if (!(reason instanceof Error) || reason instanceof AbortException || reason instanceof MissingPDFException || reason instanceof UnexpectedResponseException || reason instanceof UnknownErrorException) { 966 return reason; 967 } 968 return new UnknownErrorException(reason.message, reason.toString()); 969} 970function resolveOrReject(capability, success, reason) { 971 if (success) { 972 capability.resolve(); 973 } else { 974 capability.reject(reason); 975 } 976} 977function finalize(promise) { 978 return Promise.resolve(promise).catch(function () {}); 979} 980function MessageHandler(sourceName, targetName, comObj) { 981 var _this = this; 982 983 this.sourceName = sourceName; 984 this.targetName = targetName; 985 this.comObj = comObj; 986 this.callbackId = 1; 987 this.streamId = 1; 988 this.postMessageTransfers = true; 989 this.streamSinks = Object.create(null); 990 this.streamControllers = Object.create(null); 991 var callbacksCapabilities = this.callbacksCapabilities = Object.create(null); 992 var ah = this.actionHandler = Object.create(null); 993 this._onComObjOnMessage = function (event) { 994 var data = event.data; 995 if (data.targetName !== _this.sourceName) { 996 return; 997 } 998 if (data.stream) { 999 _this._processStreamMessage(data); 1000 } else if (data.isReply) { 1001 var callbackId = data.callbackId; 1002 if (data.callbackId in callbacksCapabilities) { 1003 var callback = callbacksCapabilities[callbackId]; 1004 delete callbacksCapabilities[callbackId]; 1005 if ('error' in data) { 1006 callback.reject(wrapReason(data.error)); 1007 } else { 1008 callback.resolve(data.data); 1009 } 1010 } else { 1011 throw new Error('Cannot resolve callback ' + callbackId); 1012 } 1013 } else if (data.action in ah) { 1014 var action = ah[data.action]; 1015 if (data.callbackId) { 1016 var _sourceName = _this.sourceName; 1017 var _targetName = data.sourceName; 1018 Promise.resolve().then(function () { 1019 return action[0].call(action[1], data.data); 1020 }).then(function (result) { 1021 comObj.postMessage({ 1022 sourceName: _sourceName, 1023 targetName: _targetName, 1024 isReply: true, 1025 callbackId: data.callbackId, 1026 data: result 1027 }); 1028 }, function (reason) { 1029 comObj.postMessage({ 1030 sourceName: _sourceName, 1031 targetName: _targetName, 1032 isReply: true, 1033 callbackId: data.callbackId, 1034 error: makeReasonSerializable(reason) 1035 }); 1036 }); 1037 } else if (data.streamId) { 1038 _this._createStreamSink(data); 1039 } else { 1040 action[0].call(action[1], data.data); 1041 } 1042 } else { 1043 throw new Error('Unknown action from worker: ' + data.action); 1044 } 1045 }; 1046 comObj.addEventListener('message', this._onComObjOnMessage); 1047} 1048MessageHandler.prototype = { 1049 on: function on(actionName, handler, scope) { 1050 var ah = this.actionHandler; 1051 if (ah[actionName]) { 1052 throw new Error('There is already an actionName called "' + actionName + '"'); 1053 } 1054 ah[actionName] = [handler, scope]; 1055 }, 1056 send: function send(actionName, data, transfers) { 1057 var message = { 1058 sourceName: this.sourceName, 1059 targetName: this.targetName, 1060 action: actionName, 1061 data: data 1062 }; 1063 this.postMessage(message, transfers); 1064 },
1065 sendWithPromise: function sendWithPromise(actionName, data, transfers) { 1066 var callbackId = this.callbackId++; 1067 var message = { 1068 sourceName: this.sourceName, 1069 targetName: this.targetName, 1070 action: actionName, 1071 data: data, 1072 callbackId: callbackId 1073 }; 1074 var capability = createPromiseCapability(); 1075 this.callbacksCapabilities[callbackId] = capability; 1076 try { 1077 this.postMessage(message, transfers); 1078 } catch (e) { 1079 capability.reject(e); 1080 } 1081 return capability.promise; 1082 }, 1083 sendWithStream: function sendWithStream(actionName, data, queueingStrategy, transfers) { 1084 var _this2 = this; 1085 1086 var streamId = this.streamId++; 1087 var sourceName = this.sourceName; 1088 var targetName = this.targetName; 1089 return new _streams_polyfill.ReadableStream({ 1090 start: function start(controller) { 1091 var startCapability = createPromiseCapability(); 1092 _this2.streamControllers[streamId] = { 1093 controller: controller, 1094 startCall: startCapability, 1095 isClosed: false 1096 }; 1097 _this2.postMessage({ 1098 sourceName: sourceName, 1099 targetName: targetName, 1100 action: actionName, 1101 streamId: streamId, 1102 data: data, 1103 desiredSize: controller.desiredSize 1104 }); 1105 return startCapability.promise; 1106 }, 1107 pull: function pull(controller) { 1108 var pullCapability = createPromiseCapability(); 1109 _this2.streamControllers[streamId].pullCall = pullCapability; 1110 _this2.postMessage({ 1111 sourceName: sourceName, 1112 targetName: targetName, 1113 stream: 'pull', 1114 streamId: streamId, 1115 desiredSize: controller.desiredSize 1116 }); 1117 return pullCapability.promise; 1118 }, 1119 cancel: function cancel(reason) { 1120 var cancelCapability = createPromiseCapability(); 1121 _this2.streamControllers[streamId].cancelCall = cancelCapability; 1122 _this2.streamControllers[streamId].isClosed = true; 1123 _this2.postMessage({ 1124 sourceName: sourceName, 1125 targetName: targetName, 1126 stream: 'cancel', 1127 reason: reason, 1128 streamId: streamId 1129 }); 1130 return cancelCapability.promise; 1131 } 1132 }, queueingStrategy); 1133 }, 1134 _createStreamSink: function _createStreamSink(data) { 1135 var _this3 = this; 1136 1137 var self = this; 1138 var action = this.actionHandler[data.action]; 1139 var streamId = data.streamId; 1140 var desiredSize = data.desiredSize; 1141 var sourceName = this.sourceName; 1142 var targetName = data.sourceName; 1143 var capability = createPromiseCapability(); 1144 var sendStreamRequest = function sendStreamRequest(_ref) { 1145 var stream = _ref.stream, 1146 chunk = _ref.chunk, 1147 transfers = _ref.transfers, 1148 success = _ref.success, 1149 reason = _ref.reason; 1150 1151 _this3.postMessage({ 1152 sourceName: sourceName, 1153 targetName: targetName, 1154 stream: stream, 1155 streamId: streamId, 1156 chunk: chunk, 1157 success: success, 1158 reason: reason 1159 }, transfers); 1160 }; 1161 var streamSink = { 1162 enqueue: function enqueue(chunk) { 1163 var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; 1164 var transfers = arguments[2]; 1165 1166 if (this.isCancelled) { 1167 return; 1168 } 1169 var lastDesiredSize = this.desiredSize; 1170 this.desiredSize -= size; 1171 if (lastDesiredSize > 0 && this.desiredSize <= 0) { 1172 this.sinkCapability = createPromiseCapability(); 1173 this.ready = this.sinkCapability.promise; 1174 } 1175 sendStreamRequest({ 1176 stream: 'enqueue', 1177 chunk: chunk, 1178 transfers: transfers 1179 }); 1180 }, 1181 close: function close() { 1182 if (this.isCancelled) { 1183 return; 1184 } 1185 this.isCancelled = true; 1186 sendStreamRequest({ stream: 'close' }); 1187 delete self.streamSinks[streamId]; 1188 }, 1189 error: function error(reason) { 1190 if (this.isCancelled) { 1191 return; 1192 } 1193 this.isCancelled = true;
vendor: 7,331 bytes, lines 1194-1389
1194 sendStreamRequest({ 1195 stream: 'error', 1196 reason: reason 1197 }); 1198 }, 1199 1200 sinkCapability: capability, 1201 onPull: null, 1202 onCancel: null, 1203 isCancelled: false, 1204 desiredSize: desiredSize, 1205 ready: null 1206 }; 1207 streamSink.sinkCapability.resolve(); 1208 streamSink.ready = streamSink.sinkCapability.promise; 1209 this.streamSinks[streamId] = streamSink; 1210 resolveCall(action[0], [data.data, streamSink], action[1]).then(function () { 1211 sendStreamRequest({ 1212 stream: 'start_complete', 1213 success: true 1214 }); 1215 }, function (reason) { 1216 sendStreamRequest({ 1217 stream: 'start_complete', 1218 success: false, 1219 reason: reason 1220 }); 1221 }); 1222 }, 1223 _processStreamMessage: function _processStreamMessage(data) { 1224 var _this4 = this; 1225 1226 var sourceName = this.sourceName; 1227 var targetName = data.sourceName; 1228 var streamId = data.streamId; 1229 var sendStreamResponse = function sendStreamResponse(_ref2) { 1230 var stream = _ref2.stream, 1231 success = _ref2.success, 1232 reason = _ref2.reason; 1233 1234 _this4.comObj.postMessage({ 1235 sourceName: sourceName, 1236 targetName: targetName, 1237 stream: stream, 1238 success: success, 1239 streamId: streamId, 1240 reason: reason 1241 }); 1242 }; 1243 var deleteStreamController = function deleteStreamController() { 1244 Promise.all([_this4.streamControllers[data.streamId].startCall, _this4.streamControllers[data.streamId].pullCall, _this4.streamControllers[data.streamId].cancelCall].map(function (capability) { 1245 return capability && finalize(capability.promise); 1246 })).then(function () { 1247 delete _this4.streamControllers[data.streamId]; 1248 }); 1249 }; 1250 switch (data.stream) { 1251 case 'start_complete': 1252 resolveOrReject(this.streamControllers[data.streamId].startCall, data.success, wrapReason(data.reason)); 1253 break; 1254 case 'pull_complete': 1255 resolveOrReject(this.streamControllers[data.streamId].pullCall, data.success, wrapReason(data.reason)); 1256 break; 1257 case 'pull': 1258 if (!this.streamSinks[data.streamId]) { 1259 sendStreamResponse({ 1260 stream: 'pull_complete', 1261 success: true 1262 }); 1263 break; 1264 } 1265 if (this.streamSinks[data.streamId].desiredSize <= 0 && data.desiredSize > 0) { 1266 this.streamSinks[data.streamId].sinkCapability.resolve(); 1267 } 1268 this.streamSinks[data.streamId].desiredSize = data.desiredSize; 1269 resolveCall(this.streamSinks[data.streamId].onPull).then(function () { 1270 sendStreamResponse({ 1271 stream: 'pull_complete', 1272 success: true 1273 }); 1274 }, function (reason) { 1275 sendStreamResponse({ 1276 stream: 'pull_complete', 1277 success: false, 1278 reason: reason 1279 }); 1280 }); 1281 break; 1282 case 'enqueue': 1283 assert(this.streamControllers[data.streamId], 'enqueue should have stream controller'); 1284 if (!this.streamControllers[data.streamId].isClosed) { 1285 this.streamControllers[data.streamId].controller.enqueue(data.chunk); 1286 } 1287 break; 1288 case 'close': 1289 assert(this.streamControllers[data.streamId], 'close should have stream controller'); 1290 if (this.streamControllers[data.streamId].isClosed) { 1291 break; 1292 } 1293 this.streamControllers[data.streamId].isClosed = true; 1294 this.streamControllers[data.streamId].controller.close(); 1295 deleteStreamController(); 1296 break; 1297 case 'error': 1298 assert(this.streamControllers[data.streamId], 'error should have stream controller'); 1299 this.streamControllers[data.streamId].controller.error(wrapReason(data.reason)); 1300 deleteStreamController(); 1301 break; 1302 case 'cancel_complete': 1303 resolveOrReject(this.streamControllers[data.streamId].cancelCall, data.success, wrapReason(data.reason)); 1304 deleteStreamController(); 1305 break; 1306 case 'cancel': 1307 if (!this.streamSinks[data.streamId]) { 1308 break; 1309 } 1310 resolveCall(this.streamSinks[data.streamId].onCancel, [wrapReason(data.reason)]).then(function () { 1311 sendStreamResponse({ 1312 stream: 'cancel_complete', 1313 success: true 1314 }); 1315 }, function (reason) { 1316 sendStreamResponse({ 1317 stream: 'cancel_complete', 1318 success: false, 1319 reason: reason 1320 }); 1321 }); 1322 this.streamSinks[data.streamId].sinkCapability.reject(wrapReason(data.reason)); 1323 this.streamSinks[data.streamId].isCancelled = true; 1324 delete this.streamSinks[data.streamId]; 1325 break; 1326 default: 1327 throw new Error('Unexpected stream case'); 1328 } 1329 }, 1330 postMessage: function postMessage(message, transfers) { 1331 if (transfers && this.postMessageTransfers) { 1332 this.comObj.postMessage(message, transfers); 1333 } else { 1334 this.comObj.postMessage(message); 1335 } 1336 }, 1337 destroy: function destroy() { 1338 this.comObj.removeEventListener('message', this._onComObjOnMessage); 1339 } 1340}; 1341function loadJpegStream(id, imageUrl, objs) { 1342 var img = new Image(); 1343 img.onload = function loadJpegStream_onloadClosure() { 1344 objs.resolve(id, img); 1345 }; 1346 img.onerror = function loadJpegStream_onerrorClosure() { 1347 objs.resolve(id, null); 1348 warn('Error during JPEG image loading'); 1349 }; 1350 img.src = imageUrl; 1351} 1352exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX; 1353exports.IDENTITY_MATRIX = IDENTITY_MATRIX; 1354exports.OPS = OPS; 1355exports.VERBOSITY_LEVELS = VERBOSITY_LEVELS; 1356exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; 1357exports.AnnotationBorderStyleType = AnnotationBorderStyleType; 1358exports.AnnotationFieldFlag = AnnotationFieldFlag; 1359exports.AnnotationFlag = AnnotationFlag; 1360exports.AnnotationType = AnnotationType; 1361exports.FontType = FontType; 1362exports.ImageKind = ImageKind; 1363exports.CMapCompressionType = CMapCompressionType; 1364exports.AbortException = AbortException; 1365exports.InvalidPDFException = InvalidPDFException; 1366exports.MessageHandler = MessageHandler; 1367exports.MissingDataException = MissingDataException; 1368exports.MissingPDFException = MissingPDFException; 1369exports.NativeImageDecoding = NativeImageDecoding; 1370exports.NotImplementedException = NotImplementedException; 1371exports.PageViewport = PageViewport; 1372exports.PasswordException = PasswordException; 1373exports.PasswordResponses = PasswordResponses; 1374exports.StreamType = StreamType; 1375exports.TextRenderingMode = TextRenderingMode; 1376exports.UnexpectedResponseException = UnexpectedResponseException; 1377exports.UnknownErrorException = UnknownErrorException; 1378exports.Util = Util; 1379exports.XRefParseException = XRefParseException; 1380exports.FormatError = FormatError; 1381exports.arrayByteLength = arrayByteLength; 1382exports.arraysToBytes = arraysToBytes; 1383exports.assert = assert; 1384exports.bytesToString = bytesToString; 1385exports.createBlob = createBlob; 1386exports.createPromiseCapability = createPromiseCapability; 1387exports.createObjectURL = createObjectURL; 1388exports.deprecated = deprecated; 1389exports.getLookupTableFactory = getLookupTableFactory;
1390exports.getVerbosityLevel = getVerbosityLevel; 1391exports.info = info; 1392exports.isArrayBuffer = isArrayBuffer; 1393exports.isBool = isBool; 1394exports.isEmptyObj = isEmptyObj; 1395exports.isNum = isNum; 1396exports.isString = isString; 1397exports.isSpace = isSpace; 1398exports.isSameOrigin = isSameOrigin; 1399exports.createValidAbsoluteUrl = createValidAbsoluteUrl; 1400exports.isLittleEndian = isLittleEndian; 1401exports.isEvalSupported = isEvalSupported; 1402exports.loadJpegStream = loadJpegStream; 1403exports.log2 = log2; 1404exports.readInt8 = readInt8; 1405exports.readUint16 = readUint16; 1406exports.readUint32 = readUint32; 1407exports.removeNullCharacters = removeNullCharacters; 1408exports.ReadableStream = _streams_polyfill.ReadableStream; 1409exports.setVerbosityLevel = setVerbosityLevel; 1410exports.shadow = shadow; 1411exports.string32 = string32; 1412exports.stringToBytes = stringToBytes; 1413exports.stringToPDFString = stringToPDFString; 1414exports.stringToUTF8String = stringToUTF8String; 1415exports.utf8StringToString = utf8StringToString; 1416exports.warn = warn; 1417exports.unreachable = unreachable; 1418 1419/***/ }), 1420/* 1 */ 1421/***/ (function(module, exports, __w_pdfjs_require__) { 1422 1423"use strict"; 1424 1425 1426Object.defineProperty(exports, "__esModule", { 1427 value: true 1428}); 1429 1430var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 1431 1432var EOF = {}; 1433var Name = function NameClosure() { 1434 function Name(name) { 1435 this.name = name; 1436 } 1437 Name.prototype = {}; 1438 var nameCache = Object.create(null); 1439 Name.get = function Name_get(name) { 1440 var nameValue = nameCache[name]; 1441 return nameValue ? nameValue : nameCache[name] = new Name(name); 1442 }; 1443 return Name; 1444}(); 1445var Cmd = function CmdClosure() { 1446 function Cmd(cmd) { 1447 this.cmd = cmd; 1448 } 1449 Cmd.prototype = {}; 1450 var cmdCache = Object.create(null); 1451 Cmd.get = function Cmd_get(cmd) { 1452 var cmdValue = cmdCache[cmd]; 1453 return cmdValue ? cmdValue : cmdCache[cmd] = new Cmd(cmd); 1454 }; 1455 return Cmd; 1456}(); 1457var Dict = function DictClosure() { 1458 var nonSerializable = function nonSerializableClosure() { 1459 return nonSerializable; 1460 }; 1461 function Dict(xref) { 1462 this._map = Object.create(null); 1463 this.xref = xref; 1464 this.objId = null; 1465 this.suppressEncryption = false; 1466 this.__nonSerializable__ = nonSerializable; 1467 } 1468 Dict.prototype = { 1469 assignXref: function Dict_assignXref(newXref) { 1470 this.xref = newXref; 1471 }, 1472 get: function Dict_get(key1, key2, key3) { 1473 var value; 1474 var xref = this.xref, 1475 suppressEncryption = this.suppressEncryption; 1476 if (typeof (value = this._map[key1]) !== 'undefined' || key1 in this._map || typeof key2 === 'undefined') { 1477 return xref ? xref.fetchIfRef(value, suppressEncryption) : value; 1478 } 1479 if (typeof (value = this._map[key2]) !== 'undefined' || key2 in this._map || typeof key3 === 'undefined') { 1480 return xref ? xref.fetchIfRef(value, suppressEncryption) : value; 1481 } 1482 value = this._map[key3] || null; 1483 return xref ? xref.fetchIfRef(value, suppressEncryption) : value; 1484 }, 1485 getAsync: function Dict_getAsync(key1, key2, key3) { 1486 var value; 1487 var xref = this.xref, 1488 suppressEncryption = this.suppressEncryption; 1489 if (typeof (value = this._map[key1]) !== 'undefined' || key1 in this._map || typeof key2 === 'undefined') { 1490 if (xref) { 1491 return xref.fetchIfRefAsync(value, suppressEncryption); 1492 } 1493 return Promise.resolve(value); 1494 } 1495 if (typeof (value = this._map[key2]) !== 'undefined' || key2 in this._map || typeof key3 === 'undefined') { 1496 if (xref) { 1497 return xref.fetchIfRefAsync(value, suppressEncryption); 1498 } 1499 return Promise.resolve(value); 1500 } 1501 value = this._map[key3] || null; 1502 if (xref) { 1503 return xref.fetchIfRefAsync(value, suppressEncryption); 1504 } 1505 return Promise.resolve(value); 1506 }, 1507 getArray: function Dict_getArray(key1, key2, key3) { 1508 var value = this.get(key1, key2, key3); 1509 var xref = this.xref, 1510 suppressEncryption = this.suppressEncryption; 1511 if (!Array.isArray(value) || !xref) { 1512 return value; 1513 } 1514 value = value.slice(); 1515 for (var i = 0, ii = value.length; i < ii; i++) { 1516 if (!isRef(value[i])) { 1517 continue; 1518 } 1519 value[i] = xref.fetch(value[i], suppressEncryption); 1520 } 1521 return value; 1522 }, 1523 getRaw: function Dict_getRaw(key) { 1524 return this._map[key]; 1525 }, 1526 getKeys: function Dict_getKeys() { 1527 return Object.keys(this._map); 1528 }, 1529 set: function Dict_set(key, value) { 1530 this._map[key] = value; 1531 }, 1532 has: function Dict_has(key) { 1533 return key in this._map; 1534 },
1535 forEach: function Dict_forEach(callback) { 1536 for (var key in this._map) { 1537 callback(key, this.get(key)); 1538 } 1539 } 1540 }; 1541 Dict.empty = new Dict(null); 1542 Dict.merge = function (xref, dictArray) { 1543 var mergedDict = new Dict(xref); 1544 for (var i = 0, ii = dictArray.length; i < ii; i++) { 1545 var dict = dictArray[i]; 1546 if (!isDict(dict)) { 1547 continue; 1548 } 1549 for (var keyName in dict._map) { 1550 if (mergedDict._map[keyName] !== undefined) { 1551 continue; 1552 } 1553 mergedDict._map[keyName] = dict._map[keyName]; 1554 } 1555 } 1556 return mergedDict; 1557 }; 1558 return Dict; 1559}(); 1560var Ref = function RefClosure() { 1561 function Ref(num, gen) { 1562 this.num = num; 1563 this.gen = gen; 1564 } 1565 Ref.prototype = { 1566 toString: function Ref_toString() { 1567 var str = this.num + 'R'; 1568 if (this.gen !== 0) { 1569 str += this.gen; 1570 } 1571 return str; 1572 } 1573 }; 1574 return Ref; 1575}(); 1576var RefSet = function RefSetClosure() { 1577 function RefSet() { 1578 this.dict = Object.create(null); 1579 } 1580 RefSet.prototype = { 1581 has: function RefSet_has(ref) { 1582 return ref.toString() in this.dict; 1583 }, 1584 put: function RefSet_put(ref) { 1585 this.dict[ref.toString()] = true; 1586 }, 1587 remove: function RefSet_remove(ref) { 1588 delete this.dict[ref.toString()]; 1589 } 1590 }; 1591 return RefSet; 1592}(); 1593var RefSetCache = function RefSetCacheClosure() { 1594 function RefSetCache() { 1595 this.dict = Object.create(null); 1596 } 1597 RefSetCache.prototype = { 1598 get: function RefSetCache_get(ref) { 1599 return this.dict[ref.toString()]; 1600 }, 1601 has: function RefSetCache_has(ref) { 1602 return ref.toString() in this.dict; 1603 }, 1604 put: function RefSetCache_put(ref, obj) { 1605 this.dict[ref.toString()] = obj; 1606 }, 1607 putAlias: function RefSetCache_putAlias(ref, aliasRef) { 1608 this.dict[ref.toString()] = this.get(aliasRef); 1609 }, 1610 forEach: function RefSetCache_forEach(fn, thisArg) { 1611 for (var i in this.dict) { 1612 fn.call(thisArg, this.dict[i]); 1613 } 1614 }, 1615 clear: function RefSetCache_clear() { 1616 this.dict = Object.create(null); 1617 } 1618 }; 1619 return RefSetCache; 1620}(); 1621function isEOF(v) { 1622 return v === EOF; 1623} 1624function isName(v, name) { 1625 return v instanceof Name && (name === undefined || v.name === name); 1626} 1627function isCmd(v, cmd) { 1628 return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); 1629} 1630function isDict(v, type) { 1631 return v instanceof Dict && (type === undefined || isName(v.get('Type'), type)); 1632} 1633function isRef(v) { 1634 return v instanceof Ref; 1635} 1636function isRefsEqual(v1, v2) { 1637 return v1.num === v2.num && v1.gen === v2.gen; 1638} 1639function isStream(v) { 1640 return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' && v !== null && v.getBytes !== undefined; 1641} 1642exports.EOF = EOF; 1643exports.Cmd = Cmd; 1644exports.Dict = Dict; 1645exports.Name = Name; 1646exports.Ref = Ref; 1647exports.RefSet = RefSet; 1648exports.RefSetCache = RefSetCache; 1649exports.isEOF = isEOF; 1650exports.isCmd = isCmd; 1651exports.isDict = isDict; 1652exports.isName = isName; 1653exports.isRef = isRef; 1654exports.isRefsEqual = isRefsEqual; 1655exports.isStream = isStream; 1656 1657/***/ }), 1658/* 2 */ 1659/***/ (function(module, exports, __w_pdfjs_require__) { 1660 1661"use strict"; 1662 1663 1664Object.defineProperty(exports, "__esModule", { 1665 value: true 1666}); 1667exports.LZWStream = exports.StringStream = exports.StreamsSequenceStream = exports.Stream = exports.RunLengthStream = exports.PredictorStream = exports.NullStream = exports.FlateStream = exports.DecodeStream = exports.DecryptStream = exports.AsciiHexStream = exports.Ascii85Stream = undefined; 1668 1669var _util = __w_pdfjs_require__(0); 1670 1671var _primitives = __w_pdfjs_require__(1); 1672 1673var Stream = function StreamClosure() { 1674 function Stream(arrayBuffer, start, length, dict) { 1675 this.bytes = arrayBuffer instanceof Uint8Array ? arrayBuffer : new Uint8Array(arrayBuffer); 1676 this.start = start || 0; 1677 this.pos = this.start; 1678 this.end = start + length || this.bytes.length; 1679 this.dict = dict; 1680 } 1681 Stream.prototype = { 1682 get length() {
vendor: 11,704 bytes, lines 1683-1911
1683 return this.end - this.start; 1684 }, 1685 get isEmpty() { 1686 return this.length === 0; 1687 }, 1688 getByte: function Stream_getByte() { 1689 if (this.pos >= this.end) { 1690 return -1; 1691 } 1692 return this.bytes[this.pos++]; 1693 }, 1694 getUint16: function Stream_getUint16() { 1695 var b0 = this.getByte(); 1696 var b1 = this.getByte(); 1697 if (b0 === -1 || b1 === -1) { 1698 return -1; 1699 } 1700 return (b0 << 8) + b1; 1701 }, 1702 getInt32: function Stream_getInt32() { 1703 var b0 = this.getByte(); 1704 var b1 = this.getByte(); 1705 var b2 = this.getByte(); 1706 var b3 = this.getByte(); 1707 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 1708 }, 1709 getBytes: function Stream_getBytes(length) { 1710 var bytes = this.bytes; 1711 var pos = this.pos; 1712 var strEnd = this.end; 1713 if (!length) { 1714 return bytes.subarray(pos, strEnd); 1715 } 1716 var end = pos + length; 1717 if (end > strEnd) { 1718 end = strEnd; 1719 } 1720 this.pos = end; 1721 return bytes.subarray(pos, end); 1722 }, 1723 peekByte: function Stream_peekByte() { 1724 var peekedByte = this.getByte(); 1725 this.pos--; 1726 return peekedByte; 1727 }, 1728 peekBytes: function Stream_peekBytes(length) { 1729 var bytes = this.getBytes(length); 1730 this.pos -= bytes.length; 1731 return bytes; 1732 }, 1733 skip: function Stream_skip(n) { 1734 if (!n) { 1735 n = 1; 1736 } 1737 this.pos += n; 1738 }, 1739 reset: function Stream_reset() { 1740 this.pos = this.start; 1741 }, 1742 moveStart: function Stream_moveStart() { 1743 this.start = this.pos; 1744 }, 1745 makeSubStream: function Stream_makeSubStream(start, length, dict) { 1746 return new Stream(this.bytes.buffer, start, length, dict); 1747 } 1748 }; 1749 return Stream; 1750}(); 1751var StringStream = function StringStreamClosure() { 1752 function StringStream(str) { 1753 var bytes = (0, _util.stringToBytes)(str); 1754 Stream.call(this, bytes); 1755 } 1756 StringStream.prototype = Stream.prototype; 1757 return StringStream; 1758}(); 1759var DecodeStream = function DecodeStreamClosure() { 1760 var emptyBuffer = new Uint8Array(0); 1761 function DecodeStream(maybeMinBufferLength) { 1762 this.pos = 0; 1763 this.bufferLength = 0; 1764 this.eof = false; 1765 this.buffer = emptyBuffer; 1766 this.minBufferLength = 512; 1767 if (maybeMinBufferLength) { 1768 while (this.minBufferLength < maybeMinBufferLength) { 1769 this.minBufferLength *= 2; 1770 } 1771 } 1772 } 1773 DecodeStream.prototype = { 1774 get isEmpty() { 1775 while (!this.eof && this.bufferLength === 0) { 1776 this.readBlock(); 1777 } 1778 return this.bufferLength === 0; 1779 }, 1780 ensureBuffer: function DecodeStream_ensureBuffer(requested) { 1781 var buffer = this.buffer; 1782 if (requested <= buffer.byteLength) { 1783 return buffer; 1784 } 1785 var size = this.minBufferLength; 1786 while (size < requested) { 1787 size *= 2; 1788 } 1789 var buffer2 = new Uint8Array(size); 1790 buffer2.set(buffer); 1791 return this.buffer = buffer2; 1792 }, 1793 getByte: function DecodeStream_getByte() { 1794 var pos = this.pos; 1795 while (this.bufferLength <= pos) { 1796 if (this.eof) { 1797 return -1; 1798 } 1799 this.readBlock(); 1800 } 1801 return this.buffer[this.pos++]; 1802 }, 1803 getUint16: function DecodeStream_getUint16() { 1804 var b0 = this.getByte(); 1805 var b1 = this.getByte(); 1806 if (b0 === -1 || b1 === -1) { 1807 return -1; 1808 } 1809 return (b0 << 8) + b1; 1810 }, 1811 getInt32: function DecodeStream_getInt32() { 1812 var b0 = this.getByte(); 1813 var b1 = this.getByte(); 1814 var b2 = this.getByte(); 1815 var b3 = this.getByte(); 1816 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 1817 }, 1818 getBytes: function DecodeStream_getBytes(length) { 1819 var end, 1820 pos = this.pos; 1821 if (length) { 1822 this.ensureBuffer(pos + length); 1823 end = pos + length; 1824 while (!this.eof && this.bufferLength < end) { 1825 this.readBlock(); 1826 } 1827 var bufEnd = this.bufferLength; 1828 if (end > bufEnd) { 1829 end = bufEnd; 1830 } 1831 } else { 1832 while (!this.eof) { 1833 this.readBlock(); 1834 } 1835 end = this.bufferLength; 1836 } 1837 this.pos = end; 1838 return this.buffer.subarray(pos, end); 1839 }, 1840 peekByte: function DecodeStream_peekByte() { 1841 var peekedByte = this.getByte(); 1842 this.pos--; 1843 return peekedByte; 1844 }, 1845 peekBytes: function DecodeStream_peekBytes(length) { 1846 var bytes = this.getBytes(length); 1847 this.pos -= bytes.length; 1848 return bytes; 1849 }, 1850 makeSubStream: function DecodeStream_makeSubStream(start, length, dict) { 1851 var end = start + length; 1852 while (this.bufferLength <= end && !this.eof) { 1853 this.readBlock(); 1854 } 1855 return new Stream(this.buffer, start, length, dict); 1856 }, 1857 skip: function DecodeStream_skip(n) { 1858 if (!n) { 1859 n = 1; 1860 } 1861 this.pos += n; 1862 }, 1863 reset: function DecodeStream_reset() { 1864 this.pos = 0; 1865 }, 1866 getBaseStreams: function DecodeStream_getBaseStreams() { 1867 if (this.str && this.str.getBaseStreams) { 1868 return this.str.getBaseStreams(); 1869 } 1870 return []; 1871 } 1872 }; 1873 return DecodeStream; 1874}(); 1875var StreamsSequenceStream = function StreamsSequenceStreamClosure() { 1876 function StreamsSequenceStream(streams) { 1877 this.streams = streams; 1878 DecodeStream.call(this, null); 1879 } 1880 StreamsSequenceStream.prototype = Object.create(DecodeStream.prototype); 1881 StreamsSequenceStream.prototype.readBlock = function streamSequenceStreamReadBlock() { 1882 var streams = this.streams; 1883 if (streams.length === 0) { 1884 this.eof = true; 1885 return; 1886 } 1887 var stream = streams.shift(); 1888 var chunk = stream.getBytes(); 1889 var bufferLength = this.bufferLength; 1890 var newLength = bufferLength + chunk.length; 1891 var buffer = this.ensureBuffer(newLength); 1892 buffer.set(chunk, bufferLength); 1893 this.bufferLength = newLength; 1894 }; 1895 StreamsSequenceStream.prototype.getBaseStreams = function StreamsSequenceStream_getBaseStreams() { 1896 var baseStreams = []; 1897 for (var i = 0, ii = this.streams.length; i < ii; i++) { 1898 var stream = this.streams[i]; 1899 if (stream.getBaseStreams) { 1900 _util.Util.appendToArray(baseStreams, stream.getBaseStreams()); 1901 } 1902 } 1903 return baseStreams; 1904 }; 1905 return StreamsSequenceStream; 1906}(); 1907var FlateStream = function FlateStreamClosure() { 1908 var codeLenCodeMap = new Int32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); 1909 var lengthDecode = new Int32Array([0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a, 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f, 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073, 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102]); 1910 var distDecode = new Int32Array([0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d, 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1, 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01, 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001]); 1911 var fixedLitCodeTab = [new Int32Array([0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0, 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0, 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0, 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8, 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8, 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8, 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4, 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4, 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4, 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc, 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec, 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc, 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2, 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2, 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2, 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca, 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea, 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da, 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6, 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6, 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6, 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce, 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee, 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de, 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe, 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1, 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1, 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1, 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9, 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9, 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9, 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5, 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5, 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5, 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd, 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed, 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd, 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3, 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3, 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3, 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb, 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb, 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db, 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7, 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7, 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7, 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b,
vendor: 5,288 bytes, lines 1911-2057
19110x900f7, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf, 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef, 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df, 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff]), 9]; 1912 var fixedDistCodeTab = [new Int32Array([0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c, 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000, 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d, 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000]), 5]; 1913 function FlateStream(str, maybeLength) { 1914 this.str = str; 1915 this.dict = str.dict; 1916 var cmf = str.getByte(); 1917 var flg = str.getByte(); 1918 if (cmf === -1 || flg === -1) { 1919 throw new _util.FormatError('Invalid header in flate stream: ' + cmf + ', ' + flg); 1920 } 1921 if ((cmf & 0x0f) !== 0x08) { 1922 throw new _util.FormatError('Unknown compression method in flate stream: ' + cmf + ', ' + flg); 1923 } 1924 if (((cmf << 8) + flg) % 31 !== 0) { 1925 throw new _util.FormatError('Bad FCHECK in flate stream: ' + cmf + ', ' + flg); 1926 } 1927 if (flg & 0x20) { 1928 throw new _util.FormatError('FDICT bit set in flate stream: ' + cmf + ', ' + flg); 1929 } 1930 this.codeSize = 0; 1931 this.codeBuf = 0; 1932 DecodeStream.call(this, maybeLength); 1933 } 1934 FlateStream.prototype = Object.create(DecodeStream.prototype); 1935 FlateStream.prototype.getBits = function FlateStream_getBits(bits) { 1936 var str = this.str; 1937 var codeSize = this.codeSize; 1938 var codeBuf = this.codeBuf; 1939 var b; 1940 while (codeSize < bits) { 1941 if ((b = str.getByte()) === -1) { 1942 throw new _util.FormatError('Bad encoding in flate stream'); 1943 } 1944 codeBuf |= b << codeSize; 1945 codeSize += 8; 1946 } 1947 b = codeBuf & (1 << bits) - 1; 1948 this.codeBuf = codeBuf >> bits; 1949 this.codeSize = codeSize -= bits; 1950 return b; 1951 }; 1952 FlateStream.prototype.getCode = function FlateStream_getCode(table) { 1953 var str = this.str; 1954 var codes = table[0]; 1955 var maxLen = table[1]; 1956 var codeSize = this.codeSize; 1957 var codeBuf = this.codeBuf; 1958 var b; 1959 while (codeSize < maxLen) { 1960 if ((b = str.getByte()) === -1) { 1961 break; 1962 } 1963 codeBuf |= b << codeSize; 1964 codeSize += 8; 1965 } 1966 var code = codes[codeBuf & (1 << maxLen) - 1]; 1967 var codeLen = code >> 16; 1968 var codeVal = code & 0xffff; 1969 if (codeLen < 1 || codeSize < codeLen) { 1970 throw new _util.FormatError('Bad encoding in flate stream'); 1971 } 1972 this.codeBuf = codeBuf >> codeLen; 1973 this.codeSize = codeSize - codeLen; 1974 return codeVal; 1975 }; 1976 FlateStream.prototype.generateHuffmanTable = function flateStreamGenerateHuffmanTable(lengths) { 1977 var n = lengths.length; 1978 var maxLen = 0; 1979 var i; 1980 for (i = 0; i < n; ++i) { 1981 if (lengths[i] > maxLen) { 1982 maxLen = lengths[i]; 1983 } 1984 } 1985 var size = 1 << maxLen; 1986 var codes = new Int32Array(size); 1987 for (var len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) { 1988 for (var val = 0; val < n; ++val) { 1989 if (lengths[val] === len) { 1990 var code2 = 0; 1991 var t = code; 1992 for (i = 0; i < len; ++i) { 1993 code2 = code2 << 1 | t & 1; 1994 t >>= 1; 1995 } 1996 for (i = code2; i < size; i += skip) { 1997 codes[i] = len << 16 | val; 1998 } 1999 ++code; 2000 } 2001 } 2002 } 2003 return [codes, maxLen]; 2004 }; 2005 FlateStream.prototype.readBlock = function FlateStream_readBlock() { 2006 var buffer, len; 2007 var str = this.str; 2008 var hdr = this.getBits(3); 2009 if (hdr & 1) { 2010 this.eof = true; 2011 } 2012 hdr >>= 1; 2013 if (hdr === 0) { 2014 var b; 2015 if ((b = str.getByte()) === -1) { 2016 throw new _util.FormatError('Bad block header in flate stream'); 2017 } 2018 var blockLen = b; 2019 if ((b = str.getByte()) === -1) { 2020 throw new _util.FormatError('Bad block header in flate stream'); 2021 } 2022 blockLen |= b << 8; 2023 if ((b = str.getByte()) === -1) { 2024 throw new _util.FormatError('Bad block header in flate stream'); 2025 } 2026 var check = b; 2027 if ((b = str.getByte()) === -1) { 2028 throw new _util.FormatError('Bad block header in flate stream'); 2029 } 2030 check |= b << 8; 2031 if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) { 2032 throw new _util.FormatError('Bad uncompressed block length in flate stream'); 2033 } 2034 this.codeBuf = 0; 2035 this.codeSize = 0; 2036 var bufferLength = this.bufferLength; 2037 buffer = this.ensureBuffer(bufferLength + blockLen); 2038 var end = bufferLength + blockLen; 2039 this.bufferLength = end; 2040 if (blockLen === 0) { 2041 if (str.peekByte() === -1) { 2042 this.eof = true; 2043 } 2044 } else { 2045 for (var n = bufferLength; n < end; ++n) { 2046 if ((b = str.getByte()) === -1) { 2047 this.eof = true; 2048 break; 2049 } 2050 buffer[n] = b; 2051 } 2052 } 2053 return; 2054 } 2055 var litCodeTable; 2056 var distCodeTable; 2057 if (hdr === 1) {
vendor: 17,169 bytes, lines 2058-2593
2058 litCodeTable = fixedLitCodeTab; 2059 distCodeTable = fixedDistCodeTab; 2060 } else if (hdr === 2) { 2061 var numLitCodes = this.getBits(5) + 257; 2062 var numDistCodes = this.getBits(5) + 1; 2063 var numCodeLenCodes = this.getBits(4) + 4; 2064 var codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length); 2065 var i; 2066 for (i = 0; i < numCodeLenCodes; ++i) { 2067 codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3); 2068 } 2069 var codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths); 2070 len = 0; 2071 i = 0; 2072 var codes = numLitCodes + numDistCodes; 2073 var codeLengths = new Uint8Array(codes); 2074 var bitsLength, bitsOffset, what; 2075 while (i < codes) { 2076 var code = this.getCode(codeLenCodeTab); 2077 if (code === 16) { 2078 bitsLength = 2; 2079 bitsOffset = 3; 2080 what = len; 2081 } else if (code === 17) { 2082 bitsLength = 3; 2083 bitsOffset = 3; 2084 what = len = 0; 2085 } else if (code === 18) { 2086 bitsLength = 7; 2087 bitsOffset = 11; 2088 what = len = 0; 2089 } else { 2090 codeLengths[i++] = len = code; 2091 continue; 2092 } 2093 var repeatLength = this.getBits(bitsLength) + bitsOffset; 2094 while (repeatLength-- > 0) { 2095 codeLengths[i++] = what; 2096 } 2097 } 2098 litCodeTable = this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes)); 2099 distCodeTable = this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes)); 2100 } else { 2101 throw new _util.FormatError('Unknown block type in flate stream'); 2102 } 2103 buffer = this.buffer; 2104 var limit = buffer ? buffer.length : 0; 2105 var pos = this.bufferLength; 2106 while (true) { 2107 var code1 = this.getCode(litCodeTable); 2108 if (code1 < 256) { 2109 if (pos + 1 >= limit) { 2110 buffer = this.ensureBuffer(pos + 1); 2111 limit = buffer.length; 2112 } 2113 buffer[pos++] = code1; 2114 continue; 2115 } 2116 if (code1 === 256) { 2117 this.bufferLength = pos; 2118 return; 2119 } 2120 code1 -= 257; 2121 code1 = lengthDecode[code1]; 2122 var code2 = code1 >> 16; 2123 if (code2 > 0) { 2124 code2 = this.getBits(code2); 2125 } 2126 len = (code1 & 0xffff) + code2; 2127 code1 = this.getCode(distCodeTable); 2128 code1 = distDecode[code1]; 2129 code2 = code1 >> 16; 2130 if (code2 > 0) { 2131 code2 = this.getBits(code2); 2132 } 2133 var dist = (code1 & 0xffff) + code2; 2134 if (pos + len >= limit) { 2135 buffer = this.ensureBuffer(pos + len); 2136 limit = buffer.length; 2137 } 2138 for (var k = 0; k < len; ++k, ++pos) { 2139 buffer[pos] = buffer[pos - dist]; 2140 } 2141 } 2142 }; 2143 return FlateStream; 2144}(); 2145var PredictorStream = function PredictorStreamClosure() { 2146 function PredictorStream(str, maybeLength, params) { 2147 if (!(0, _primitives.isDict)(params)) { 2148 return str; 2149 } 2150 var predictor = this.predictor = params.get('Predictor') || 1; 2151 if (predictor <= 1) { 2152 return str; 2153 } 2154 if (predictor !== 2 && (predictor < 10 || predictor > 15)) { 2155 throw new _util.FormatError('Unsupported predictor: ' + predictor); 2156 } 2157 if (predictor === 2) { 2158 this.readBlock = this.readBlockTiff; 2159 } else { 2160 this.readBlock = this.readBlockPng; 2161 } 2162 this.str = str; 2163 this.dict = str.dict; 2164 var colors = this.colors = params.get('Colors') || 1; 2165 var bits = this.bits = params.get('BitsPerComponent') || 8; 2166 var columns = this.columns = params.get('Columns') || 1; 2167 this.pixBytes = colors * bits + 7 >> 3; 2168 this.rowBytes = columns * colors * bits + 7 >> 3; 2169 DecodeStream.call(this, maybeLength); 2170 return this; 2171 } 2172 PredictorStream.prototype = Object.create(DecodeStream.prototype); 2173 PredictorStream.prototype.readBlockTiff = function predictorStreamReadBlockTiff() { 2174 var rowBytes = this.rowBytes; 2175 var bufferLength = this.bufferLength; 2176 var buffer = this.ensureBuffer(bufferLength + rowBytes); 2177 var bits = this.bits; 2178 var colors = this.colors; 2179 var rawBytes = this.str.getBytes(rowBytes); 2180 this.eof = !rawBytes.length; 2181 if (this.eof) { 2182 return; 2183 } 2184 var inbuf = 0, 2185 outbuf = 0; 2186 var inbits = 0, 2187 outbits = 0; 2188 var pos = bufferLength; 2189 var i; 2190 if (bits === 1 && colors === 1) { 2191 for (i = 0; i < rowBytes; ++i) { 2192 var c = rawBytes[i] ^ inbuf; 2193 c ^= c >> 1; 2194 c ^= c >> 2; 2195 c ^= c >> 4; 2196 inbuf = (c & 1) << 7; 2197 buffer[pos++] = c; 2198 } 2199 } else if (bits === 8) { 2200 for (i = 0; i < colors; ++i) { 2201 buffer[pos++] = rawBytes[i]; 2202 } 2203 for (; i < rowBytes; ++i) { 2204 buffer[pos] = buffer[pos - colors] + rawBytes[i]; 2205 pos++; 2206 } 2207 } else if (bits === 16) { 2208 var bytesPerPixel = colors * 2; 2209 for (i = 0; i < bytesPerPixel; ++i) { 2210 buffer[pos++] = rawBytes[i]; 2211 } 2212 for (; i < rowBytes; i += 2) { 2213 var sum = ((rawBytes[i] & 0xFF) << 8) + (rawBytes[i + 1] & 0xFF) + ((buffer[pos - bytesPerPixel] & 0xFF) << 8) + (buffer[pos - bytesPerPixel + 1] & 0xFF); 2214 buffer[pos++] = sum >> 8 & 0xFF; 2215 buffer[pos++] = sum & 0xFF; 2216 } 2217 } else { 2218 var compArray = new Uint8Array(colors + 1); 2219 var bitMask = (1 << bits) - 1; 2220 var j = 0, 2221 k = bufferLength; 2222 var columns = this.columns; 2223 for (i = 0; i < columns; ++i) { 2224 for (var kk = 0; kk < colors; ++kk) { 2225 if (inbits < bits) { 2226 inbuf = inbuf << 8 | rawBytes[j++] & 0xFF; 2227 inbits += 8; 2228 } 2229 compArray[kk] = compArray[kk] + (inbuf >> inbits - bits) & bitMask; 2230 inbits -= bits; 2231 outbuf = outbuf << bits | compArray[kk]; 2232 outbits += bits; 2233 if (outbits >= 8) { 2234 buffer[k++] = outbuf >> outbits - 8 & 0xFF; 2235 outbits -= 8; 2236 } 2237 } 2238 } 2239 if (outbits > 0) { 2240 buffer[k++] = (outbuf << 8 - outbits) + (inbuf & (1 << 8 - outbits) - 1); 2241 } 2242 } 2243 this.bufferLength += rowBytes; 2244 }; 2245 PredictorStream.prototype.readBlockPng = function predictorStreamReadBlockPng() { 2246 var rowBytes = this.rowBytes; 2247 var pixBytes = this.pixBytes; 2248 var predictor = this.str.getByte(); 2249 var rawBytes = this.str.getBytes(rowBytes); 2250 this.eof = !rawBytes.length; 2251 if (this.eof) { 2252 return; 2253 } 2254 var bufferLength = this.bufferLength; 2255 var buffer = this.ensureBuffer(bufferLength + rowBytes); 2256 var prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength); 2257 if (prevRow.length === 0) { 2258 prevRow = new Uint8Array(rowBytes); 2259 } 2260 var i, 2261 j = bufferLength, 2262 up, 2263 c; 2264 switch (predictor) { 2265 case 0: 2266 for (i = 0; i < rowBytes; ++i) { 2267 buffer[j++] = rawBytes[i]; 2268 } 2269 break; 2270 case 1: 2271 for (i = 0; i < pixBytes; ++i) { 2272 buffer[j++] = rawBytes[i]; 2273 } 2274 for (; i < rowBytes; ++i) { 2275 buffer[j] = buffer[j - pixBytes] + rawBytes[i] & 0xFF; 2276 j++; 2277 } 2278 break; 2279 case 2: 2280 for (i = 0; i < rowBytes; ++i) { 2281 buffer[j++] = prevRow[i] + rawBytes[i] & 0xFF; 2282 } 2283 break; 2284 case 3: 2285 for (i = 0; i < pixBytes; ++i) { 2286 buffer[j++] = (prevRow[i] >> 1) + rawBytes[i]; 2287 } 2288 for (; i < rowBytes; ++i) { 2289 buffer[j] = (prevRow[i] + buffer[j - pixBytes] >> 1) + rawBytes[i] & 0xFF; 2290 j++; 2291 } 2292 break; 2293 case 4: 2294 for (i = 0; i < pixBytes; ++i) { 2295 up = prevRow[i]; 2296 c = rawBytes[i]; 2297 buffer[j++] = up + c; 2298 } 2299 for (; i < rowBytes; ++i) { 2300 up = prevRow[i]; 2301 var upLeft = prevRow[i - pixBytes]; 2302 var left = buffer[j - pixBytes]; 2303 var p = left + up - upLeft; 2304 var pa = p - left; 2305 if (pa < 0) { 2306 pa = -pa; 2307 } 2308 var pb = p - up; 2309 if (pb < 0) { 2310 pb = -pb; 2311 } 2312 var pc = p - upLeft; 2313 if (pc < 0) { 2314 pc = -pc; 2315 } 2316 c = rawBytes[i]; 2317 if (pa <= pb && pa <= pc) { 2318 buffer[j++] = left + c; 2319 } else if (pb <= pc) { 2320 buffer[j++] = up + c; 2321 } else { 2322 buffer[j++] = upLeft + c; 2323 } 2324 } 2325 break; 2326 default: 2327 throw new _util.FormatError('Unsupported predictor: ' + predictor); 2328 } 2329 this.bufferLength += rowBytes; 2330 }; 2331 return PredictorStream; 2332}(); 2333var DecryptStream = function DecryptStreamClosure() { 2334 function DecryptStream(str, maybeLength, decrypt) { 2335 this.str = str; 2336 this.dict = str.dict; 2337 this.decrypt = decrypt; 2338 this.nextChunk = null; 2339 this.initialized = false; 2340 DecodeStream.call(this, maybeLength); 2341 } 2342 var chunkSize = 512; 2343 DecryptStream.prototype = Object.create(DecodeStream.prototype); 2344 DecryptStream.prototype.readBlock = function DecryptStream_readBlock() { 2345 var chunk; 2346 if (this.initialized) { 2347 chunk = this.nextChunk; 2348 } else { 2349 chunk = this.str.getBytes(chunkSize); 2350 this.initialized = true; 2351 } 2352 if (!chunk || chunk.length === 0) { 2353 this.eof = true; 2354 return; 2355 } 2356 this.nextChunk = this.str.getBytes(chunkSize); 2357 var hasMoreData = this.nextChunk && this.nextChunk.length > 0; 2358 var decrypt = this.decrypt; 2359 chunk = decrypt(chunk, !hasMoreData); 2360 var bufferLength = this.bufferLength; 2361 var i, 2362 n = chunk.length; 2363 var buffer = this.ensureBuffer(bufferLength + n); 2364 for (i = 0; i < n; i++) { 2365 buffer[bufferLength++] = chunk[i]; 2366 } 2367 this.bufferLength = bufferLength; 2368 }; 2369 return DecryptStream; 2370}(); 2371var Ascii85Stream = function Ascii85StreamClosure() { 2372 function Ascii85Stream(str, maybeLength) { 2373 this.str = str; 2374 this.dict = str.dict; 2375 this.input = new Uint8Array(5); 2376 if (maybeLength) { 2377 maybeLength = 0.8 * maybeLength; 2378 } 2379 DecodeStream.call(this, maybeLength); 2380 } 2381 Ascii85Stream.prototype = Object.create(DecodeStream.prototype); 2382 Ascii85Stream.prototype.readBlock = function Ascii85Stream_readBlock() { 2383 var TILDA_CHAR = 0x7E; 2384 var Z_LOWER_CHAR = 0x7A; 2385 var EOF = -1; 2386 var str = this.str; 2387 var c = str.getByte(); 2388 while ((0, _util.isSpace)(c)) { 2389 c = str.getByte(); 2390 } 2391 if (c === EOF || c === TILDA_CHAR) { 2392 this.eof = true; 2393 return; 2394 } 2395 var bufferLength = this.bufferLength, 2396 buffer; 2397 var i; 2398 if (c === Z_LOWER_CHAR) { 2399 buffer = this.ensureBuffer(bufferLength + 4); 2400 for (i = 0; i < 4; ++i) { 2401 buffer[bufferLength + i] = 0; 2402 } 2403 this.bufferLength += 4; 2404 } else { 2405 var input = this.input; 2406 input[0] = c; 2407 for (i = 1; i < 5; ++i) { 2408 c = str.getByte(); 2409 while ((0, _util.isSpace)(c)) { 2410 c = str.getByte(); 2411 } 2412 input[i] = c; 2413 if (c === EOF || c === TILDA_CHAR) { 2414 break; 2415 } 2416 } 2417 buffer = this.ensureBuffer(bufferLength + i - 1); 2418 this.bufferLength += i - 1; 2419 if (i < 5) { 2420 for (; i < 5; ++i) { 2421 input[i] = 0x21 + 84; 2422 } 2423 this.eof = true; 2424 } 2425 var t = 0; 2426 for (i = 0; i < 5; ++i) { 2427 t = t * 85 + (input[i] - 0x21); 2428 } 2429 for (i = 3; i >= 0; --i) { 2430 buffer[bufferLength + i] = t & 0xFF; 2431 t >>= 8; 2432 } 2433 } 2434 }; 2435 return Ascii85Stream; 2436}(); 2437var AsciiHexStream = function AsciiHexStreamClosure() { 2438 function AsciiHexStream(str, maybeLength) { 2439 this.str = str; 2440 this.dict = str.dict; 2441 this.firstDigit = -1; 2442 if (maybeLength) { 2443 maybeLength = 0.5 * maybeLength; 2444 } 2445 DecodeStream.call(this, maybeLength); 2446 } 2447 AsciiHexStream.prototype = Object.create(DecodeStream.prototype); 2448 AsciiHexStream.prototype.readBlock = function AsciiHexStream_readBlock() { 2449 var UPSTREAM_BLOCK_SIZE = 8000; 2450 var bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); 2451 if (!bytes.length) { 2452 this.eof = true; 2453 return; 2454 } 2455 var maxDecodeLength = bytes.length + 1 >> 1; 2456 var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); 2457 var bufferLength = this.bufferLength; 2458 var firstDigit = this.firstDigit; 2459 for (var i = 0, ii = bytes.length; i < ii; i++) { 2460 var ch = bytes[i], 2461 digit; 2462 if (ch >= 0x30 && ch <= 0x39) { 2463 digit = ch & 0x0F; 2464 } else if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { 2465 digit = (ch & 0x0F) + 9; 2466 } else if (ch === 0x3E) { 2467 this.eof = true; 2468 break; 2469 } else { 2470 continue; 2471 } 2472 if (firstDigit < 0) { 2473 firstDigit = digit; 2474 } else { 2475 buffer[bufferLength++] = firstDigit << 4 | digit; 2476 firstDigit = -1; 2477 } 2478 } 2479 if (firstDigit >= 0 && this.eof) { 2480 buffer[bufferLength++] = firstDigit << 4; 2481 firstDigit = -1; 2482 } 2483 this.firstDigit = firstDigit; 2484 this.bufferLength = bufferLength; 2485 }; 2486 return AsciiHexStream; 2487}(); 2488var RunLengthStream = function RunLengthStreamClosure() { 2489 function RunLengthStream(str, maybeLength) { 2490 this.str = str; 2491 this.dict = str.dict; 2492 DecodeStream.call(this, maybeLength); 2493 } 2494 RunLengthStream.prototype = Object.create(DecodeStream.prototype); 2495 RunLengthStream.prototype.readBlock = function RunLengthStream_readBlock() { 2496 var repeatHeader = this.str.getBytes(2); 2497 if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { 2498 this.eof = true; 2499 return; 2500 } 2501 var buffer; 2502 var bufferLength = this.bufferLength; 2503 var n = repeatHeader[0]; 2504 if (n < 128) { 2505 buffer = this.ensureBuffer(bufferLength + n + 1); 2506 buffer[bufferLength++] = repeatHeader[1]; 2507 if (n > 0) { 2508 var source = this.str.getBytes(n); 2509 buffer.set(source, bufferLength); 2510 bufferLength += n; 2511 } 2512 } else { 2513 n = 257 - n; 2514 var b = repeatHeader[1]; 2515 buffer = this.ensureBuffer(bufferLength + n + 1); 2516 for (var i = 0; i < n; i++) { 2517 buffer[bufferLength++] = b; 2518 } 2519 } 2520 this.bufferLength = bufferLength; 2521 }; 2522 return RunLengthStream; 2523}(); 2524var LZWStream = function LZWStreamClosure() { 2525 function LZWStream(str, maybeLength, earlyChange) { 2526 this.str = str; 2527 this.dict = str.dict; 2528 this.cachedData = 0; 2529 this.bitsCached = 0; 2530 var maxLzwDictionarySize = 4096; 2531 var lzwState = { 2532 earlyChange: earlyChange, 2533 codeLength: 9, 2534 nextCode: 258, 2535 dictionaryValues: new Uint8Array(maxLzwDictionarySize), 2536 dictionaryLengths: new Uint16Array(maxLzwDictionarySize), 2537 dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize), 2538 currentSequence: new Uint8Array(maxLzwDictionarySize), 2539 currentSequenceLength: 0 2540 }; 2541 for (var i = 0; i < 256; ++i) { 2542 lzwState.dictionaryValues[i] = i; 2543 lzwState.dictionaryLengths[i] = 1; 2544 } 2545 this.lzwState = lzwState; 2546 DecodeStream.call(this, maybeLength); 2547 } 2548 LZWStream.prototype = Object.create(DecodeStream.prototype); 2549 LZWStream.prototype.readBits = function LZWStream_readBits(n) { 2550 var bitsCached = this.bitsCached; 2551 var cachedData = this.cachedData; 2552 while (bitsCached < n) { 2553 var c = this.str.getByte(); 2554 if (c === -1) { 2555 this.eof = true; 2556 return null; 2557 } 2558 cachedData = cachedData << 8 | c; 2559 bitsCached += 8; 2560 } 2561 this.bitsCached = bitsCached -= n; 2562 this.cachedData = cachedData; 2563 this.lastCode = null; 2564 return cachedData >>> bitsCached & (1 << n) - 1; 2565 }; 2566 LZWStream.prototype.readBlock = function LZWStream_readBlock() { 2567 var blockSize = 512; 2568 var estimatedDecodedSize = blockSize * 2, 2569 decodedSizeDelta = blockSize; 2570 var i, j, q; 2571 var lzwState = this.lzwState; 2572 if (!lzwState) { 2573 return; 2574 } 2575 var earlyChange = lzwState.earlyChange; 2576 var nextCode = lzwState.nextCode; 2577 var dictionaryValues = lzwState.dictionaryValues; 2578 var dictionaryLengths = lzwState.dictionaryLengths; 2579 var dictionaryPrevCodes = lzwState.dictionaryPrevCodes; 2580 var codeLength = lzwState.codeLength; 2581 var prevCode = lzwState.prevCode; 2582 var currentSequence = lzwState.currentSequence; 2583 var currentSequenceLength = lzwState.currentSequenceLength; 2584 var decodedLength = 0; 2585 var currentBufferLength = this.bufferLength; 2586 var buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); 2587 for (i = 0; i < blockSize; i++) { 2588 var code = this.readBits(codeLength); 2589 var hasPrev = currentSequenceLength > 0; 2590 if (code < 256) { 2591 currentSequence[0] = code; 2592 currentSequenceLength = 1; 2593 } else if (code >= 258) {
2594 if (code < nextCode) { 2595 currentSequenceLength = dictionaryLengths[code]; 2596 for (j = currentSequenceLength - 1, q = code; j >= 0; j--) { 2597 currentSequence[j] = dictionaryValues[q]; 2598 q = dictionaryPrevCodes[q]; 2599 } 2600 } else { 2601 currentSequence[currentSequenceLength++] = currentSequence[0]; 2602 } 2603 } else if (code === 256) { 2604 codeLength = 9; 2605 nextCode = 258; 2606 currentSequenceLength = 0; 2607 continue; 2608 } else { 2609 this.eof = true; 2610 delete this.lzwState; 2611 break; 2612 } 2613 if (hasPrev) { 2614 dictionaryPrevCodes[nextCode] = prevCode; 2615 dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1; 2616 dictionaryValues[nextCode] = currentSequence[0]; 2617 nextCode++; 2618 codeLength = nextCode + earlyChange & nextCode + earlyChange - 1 ? codeLength : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0; 2619 } 2620 prevCode = code; 2621 decodedLength += currentSequenceLength; 2622 if (estimatedDecodedSize < decodedLength) { 2623 do { 2624 estimatedDecodedSize += decodedSizeDelta; 2625 } while (estimatedDecodedSize < decodedLength); 2626 buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); 2627 } 2628 for (j = 0; j < currentSequenceLength; j++) { 2629 buffer[currentBufferLength++] = currentSequence[j]; 2630 } 2631 } 2632 lzwState.nextCode = nextCode; 2633 lzwState.codeLength = codeLength; 2634 lzwState.prevCode = prevCode; 2635 lzwState.currentSequenceLength = currentSequenceLength; 2636 this.bufferLength = currentBufferLength; 2637 }; 2638 return LZWStream; 2639}(); 2640var NullStream = function NullStreamClosure() { 2641 function NullStream() { 2642 Stream.call(this, new Uint8Array(0)); 2643 } 2644 NullStream.prototype = Stream.prototype; 2645 return NullStream; 2646}(); 2647exports.Ascii85Stream = Ascii85Stream; 2648exports.AsciiHexStream = AsciiHexStream; 2649exports.DecryptStream = DecryptStream; 2650exports.DecodeStream = DecodeStream; 2651exports.FlateStream = FlateStream; 2652exports.NullStream = NullStream; 2653exports.PredictorStream = PredictorStream; 2654exports.RunLengthStream = RunLengthStream; 2655exports.Stream = Stream; 2656exports.StreamsSequenceStream = StreamsSequenceStream; 2657exports.StringStream = StringStream; 2658exports.LZWStream = LZWStream; 2659 2660/***/ }), 2661/* 3 */ 2662/***/ (function(module, exports, __w_pdfjs_require__) { 2663 2664"use strict"; 2665 2666 2667var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 2668 2669module.exports = function (it) { 2670 return (typeof it === 'undefined' ? 'undefined' : _typeof(it)) === 'object' ? it !== null : typeof it === 'function'; 2671}; 2672 2673/***/ }), 2674/* 4 */ 2675/***/ (function(module, exports, __w_pdfjs_require__) { 2676 2677"use strict"; 2678 2679 2680var store = __w_pdfjs_require__(48)('wks'); 2681var uid = __w_pdfjs_require__(22); 2682var _Symbol = __w_pdfjs_require__(5).Symbol; 2683var USE_SYMBOL = typeof _Symbol == 'function'; 2684var $exports = module.exports = function (name) { 2685 return store[name] || (store[name] = USE_SYMBOL && _Symbol[name] || (USE_SYMBOL ? _Symbol : uid)('Symbol.' + name)); 2686}; 2687$exports.store = store; 2688 2689/***/ }), 2690/* 5 */ 2691/***/ (function(module, exports, __w_pdfjs_require__) { 2692 2693"use strict"; 2694 2695 2696var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); 2697if (typeof __g == 'number') __g = global; 2698 2699/***/ }), 2700/* 6 */ 2701/***/ (function(module, exports, __w_pdfjs_require__) { 2702 2703"use strict"; 2704 2705 2706var global = __w_pdfjs_require__(5); 2707var core = __w_pdfjs_require__(7); 2708var hide = __w_pdfjs_require__(12); 2709var redefine = __w_pdfjs_require__(10); 2710var ctx = __w_pdfjs_require__(11); 2711var PROTOTYPE = 'prototype'; 2712var $export = function $export(type, name, source) { 2713 var IS_FORCED = type & $export.F; 2714 var IS_GLOBAL = type & $export.G; 2715 var IS_STATIC = type & $export.S; 2716 var IS_PROTO = type & $export.P; 2717 var IS_BIND = type & $export.B; 2718 var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
vendor: 5,992 bytes, lines 2719-2977
2719 var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); 2720 var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); 2721 var key, own, out, exp; 2722 if (IS_GLOBAL) source = name; 2723 for (key in source) { 2724 own = !IS_FORCED && target && target[key] !== undefined; 2725 out = (own ? target : source)[key]; 2726 exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; 2727 if (target) redefine(target, key, out, type & $export.U); 2728 if (exports[key] != out) hide(exports, key, exp); 2729 if (IS_PROTO && expProto[key] != out) expProto[key] = out; 2730 } 2731}; 2732global.core = core; 2733$export.F = 1; 2734$export.G = 2; 2735$export.S = 4; 2736$export.P = 8; 2737$export.B = 16; 2738$export.W = 32; 2739$export.U = 64; 2740$export.R = 128; 2741module.exports = $export; 2742 2743/***/ }), 2744/* 7 */ 2745/***/ (function(module, exports, __w_pdfjs_require__) { 2746 2747"use strict"; 2748 2749 2750var core = module.exports = { version: '2.5.1' }; 2751if (typeof __e == 'number') __e = core; 2752 2753/***/ }), 2754/* 8 */ 2755/***/ (function(module, exports, __w_pdfjs_require__) { 2756 2757"use strict"; 2758 2759 2760var isObject = __w_pdfjs_require__(3); 2761module.exports = function (it) { 2762 if (!isObject(it)) throw TypeError(it + ' is not an object!'); 2763 return it; 2764}; 2765 2766/***/ }), 2767/* 9 */ 2768/***/ (function(module, exports, __w_pdfjs_require__) { 2769 2770"use strict"; 2771 2772 2773var hasOwnProperty = {}.hasOwnProperty; 2774module.exports = function (it, key) { 2775 return hasOwnProperty.call(it, key); 2776}; 2777 2778/***/ }), 2779/* 10 */ 2780/***/ (function(module, exports, __w_pdfjs_require__) { 2781 2782"use strict"; 2783 2784 2785var global = __w_pdfjs_require__(5); 2786var hide = __w_pdfjs_require__(12); 2787var has = __w_pdfjs_require__(9); 2788var SRC = __w_pdfjs_require__(22)('src'); 2789var TO_STRING = 'toString'; 2790var $toString = Function[TO_STRING]; 2791var TPL = ('' + $toString).split(TO_STRING); 2792__w_pdfjs_require__(7).inspectSource = function (it) { 2793 return $toString.call(it); 2794}; 2795(module.exports = function (O, key, val, safe) { 2796 var isFunction = typeof val == 'function'; 2797 if (isFunction) has(val, 'name') || hide(val, 'name', key); 2798 if (O[key] === val) return; 2799 if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); 2800 if (O === global) { 2801 O[key] = val; 2802 } else if (!safe) { 2803 delete O[key]; 2804 hide(O, key, val); 2805 } else if (O[key]) { 2806 O[key] = val; 2807 } else { 2808 hide(O, key, val); 2809 } 2810})(Function.prototype, TO_STRING, function toString() { 2811 return typeof this == 'function' && this[SRC] || $toString.call(this); 2812}); 2813 2814/***/ }), 2815/* 11 */ 2816/***/ (function(module, exports, __w_pdfjs_require__) { 2817 2818"use strict"; 2819 2820 2821var aFunction = __w_pdfjs_require__(16); 2822module.exports = function (fn, that, length) { 2823 aFunction(fn); 2824 if (that === undefined) return fn; 2825 switch (length) { 2826 case 1: 2827 return function (a) { 2828 return fn.call(that, a); 2829 }; 2830 case 2: 2831 return function (a, b) { 2832 return fn.call(that, a, b); 2833 }; 2834 case 3: 2835 return function (a, b, c) { 2836 return fn.call(that, a, b, c); 2837 }; 2838 } 2839 return function () { 2840 return fn.apply(that, arguments); 2841 }; 2842}; 2843 2844/***/ }), 2845/* 12 */ 2846/***/ (function(module, exports, __w_pdfjs_require__) { 2847 2848"use strict"; 2849 2850 2851var dP = __w_pdfjs_require__(15); 2852var createDesc = __w_pdfjs_require__(28); 2853module.exports = __w_pdfjs_require__(13) ? function (object, key, value) { 2854 return dP.f(object, key, createDesc(1, value)); 2855} : function (object, key, value) { 2856 object[key] = value; 2857 return object; 2858}; 2859 2860/***/ }), 2861/* 13 */ 2862/***/ (function(module, exports, __w_pdfjs_require__) { 2863 2864"use strict"; 2865 2866 2867module.exports = !__w_pdfjs_require__(14)(function () { 2868 return Object.defineProperty({}, 'a', { 2869 get: function get() { 2870 return 7; 2871 } 2872 }).a != 7; 2873}); 2874 2875/***/ }), 2876/* 14 */ 2877/***/ (function(module, exports, __w_pdfjs_require__) { 2878 2879"use strict"; 2880 2881 2882module.exports = function (exec) { 2883 try { 2884 return !!exec(); 2885 } catch (e) { 2886 return true; 2887 } 2888}; 2889 2890/***/ }), 2891/* 15 */ 2892/***/ (function(module, exports, __w_pdfjs_require__) { 2893 2894"use strict"; 2895 2896 2897var anObject = __w_pdfjs_require__(8); 2898var IE8_DOM_DEFINE = __w_pdfjs_require__(45); 2899var toPrimitive = __w_pdfjs_require__(46); 2900var dP = Object.defineProperty; 2901exports.f = __w_pdfjs_require__(13) ? Object.defineProperty : function defineProperty(O, P, Attributes) { 2902 anObject(O); 2903 P = toPrimitive(P, true); 2904 anObject(Attributes); 2905 if (IE8_DOM_DEFINE) try { 2906 return dP(O, P, Attributes); 2907 } catch (e) {} 2908 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); 2909 if ('value' in Attributes) O[P] = Attributes.value; 2910 return O; 2911}; 2912 2913/***/ }), 2914/* 16 */ 2915/***/ (function(module, exports, __w_pdfjs_require__) { 2916 2917"use strict"; 2918 2919 2920module.exports = function (it) { 2921 if (typeof it != 'function') throw TypeError(it + ' is not a function!'); 2922 return it; 2923}; 2924 2925/***/ }), 2926/* 17 */ 2927/***/ (function(module, exports, __w_pdfjs_require__) { 2928 2929"use strict"; 2930 2931 2932var IObject = __w_pdfjs_require__(29); 2933var defined = __w_pdfjs_require__(30); 2934module.exports = function (it) { 2935 return IObject(defined(it)); 2936}; 2937 2938/***/ }), 2939/* 18 */ 2940/***/ (function(module, exports, __w_pdfjs_require__) { 2941 2942"use strict"; 2943 2944 2945var toString = {}.toString; 2946module.exports = function (it) { 2947 return toString.call(it).slice(8, -1); 2948}; 2949 2950/***/ }), 2951/* 19 */ 2952/***/ (function(module, exports, __w_pdfjs_require__) { 2953 2954"use strict"; 2955 2956 2957module.exports = {}; 2958 2959/***/ }), 2960/* 20 */ 2961/***/ (function(module, exports, __w_pdfjs_require__) { 2962 2963"use strict"; 2964 2965 2966Object.defineProperty(exports, "__esModule", { 2967 value: true 2968}); 2969exports.ColorSpace = undefined; 2970 2971var _util = __w_pdfjs_require__(0); 2972 2973var _primitives = __w_pdfjs_require__(1); 2974 2975var ColorSpace = function ColorSpaceClosure() { 2976 function resizeRgbImage(src, bpc, w1, h1, w2, h2, alpha01, dest) { 2977 var COMPONENTS = 3;
vendor: 5,758 bytes, lines 2978-3128
2978 alpha01 = alpha01 !== 1 ? 0 : alpha01; 2979 var xRatio = w1 / w2; 2980 var yRatio = h1 / h2; 2981 var i, 2982 j, 2983 py, 2984 newIndex = 0, 2985 oldIndex; 2986 var xScaled = new Uint16Array(w2); 2987 var w1Scanline = w1 * COMPONENTS; 2988 for (i = 0; i < w2; i++) { 2989 xScaled[i] = Math.floor(i * xRatio) * COMPONENTS; 2990 } 2991 for (i = 0; i < h2; i++) { 2992 py = Math.floor(i * yRatio) * w1Scanline; 2993 for (j = 0; j < w2; j++) { 2994 oldIndex = py + xScaled[j]; 2995 dest[newIndex++] = src[oldIndex++]; 2996 dest[newIndex++] = src[oldIndex++]; 2997 dest[newIndex++] = src[oldIndex++]; 2998 newIndex += alpha01; 2999 } 3000 } 3001 } 3002 function ColorSpace() { 3003 (0, _util.unreachable)('should not call ColorSpace constructor'); 3004 } 3005 ColorSpace.prototype = { 3006 getRgb: function ColorSpace_getRgb(src, srcOffset) { 3007 var rgb = new Uint8Array(3); 3008 this.getRgbItem(src, srcOffset, rgb, 0); 3009 return rgb; 3010 }, 3011 getRgbItem: function ColorSpace_getRgbItem(src, srcOffset, dest, destOffset) { 3012 (0, _util.unreachable)('Should not call ColorSpace.getRgbItem'); 3013 }, 3014 getRgbBuffer: function ColorSpace_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 3015 (0, _util.unreachable)('Should not call ColorSpace.getRgbBuffer'); 3016 }, 3017 getOutputLength: function ColorSpace_getOutputLength(inputLength, alpha01) { 3018 (0, _util.unreachable)('Should not call ColorSpace.getOutputLength'); 3019 }, 3020 isPassthrough: function ColorSpace_isPassthrough(bits) { 3021 return false; 3022 }, 3023 fillRgb: function ColorSpace_fillRgb(dest, originalWidth, originalHeight, width, height, actualHeight, bpc, comps, alpha01) { 3024 var count = originalWidth * originalHeight; 3025 var rgbBuf = null; 3026 var numComponentColors = 1 << bpc; 3027 var needsResizing = originalHeight !== height || originalWidth !== width; 3028 var i, ii; 3029 if (this.isPassthrough(bpc)) { 3030 rgbBuf = comps; 3031 } else if (this.numComps === 1 && count > numComponentColors && this.name !== 'DeviceGray' && this.name !== 'DeviceRGB') { 3032 var allColors = bpc <= 8 ? new Uint8Array(numComponentColors) : new Uint16Array(numComponentColors); 3033 var key; 3034 for (i = 0; i < numComponentColors; i++) { 3035 allColors[i] = i; 3036 } 3037 var colorMap = new Uint8Array(numComponentColors * 3); 3038 this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, 0); 3039 var destPos, rgbPos; 3040 if (!needsResizing) { 3041 destPos = 0; 3042 for (i = 0; i < count; ++i) { 3043 key = comps[i] * 3; 3044 dest[destPos++] = colorMap[key]; 3045 dest[destPos++] = colorMap[key + 1]; 3046 dest[destPos++] = colorMap[key + 2]; 3047 destPos += alpha01; 3048 } 3049 } else { 3050 rgbBuf = new Uint8Array(count * 3); 3051 rgbPos = 0; 3052 for (i = 0; i < count; ++i) { 3053 key = comps[i] * 3; 3054 rgbBuf[rgbPos++] = colorMap[key]; 3055 rgbBuf[rgbPos++] = colorMap[key + 1]; 3056 rgbBuf[rgbPos++] = colorMap[key + 2]; 3057 } 3058 } 3059 } else { 3060 if (!needsResizing) { 3061 this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, alpha01); 3062 } else { 3063 rgbBuf = new Uint8Array(count * 3); 3064 this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, 0); 3065 } 3066 } 3067 if (rgbBuf) { 3068 if (needsResizing) { 3069 resizeRgbImage(rgbBuf, bpc, originalWidth, originalHeight, width, height, alpha01, dest); 3070 } else { 3071 rgbPos = 0; 3072 destPos = 0; 3073 for (i = 0, ii = width * actualHeight; i < ii; i++) { 3074 dest[destPos++] = rgbBuf[rgbPos++]; 3075 dest[destPos++] = rgbBuf[rgbPos++]; 3076 dest[destPos++] = rgbBuf[rgbPos++]; 3077 destPos += alpha01; 3078 } 3079 } 3080 } 3081 }, 3082 usesZeroToOneRange: true 3083 }; 3084 ColorSpace.parse = function (cs, xref, res, pdfFunctionFactory) { 3085 var IR = ColorSpace.parseToIR(cs, xref, res, pdfFunctionFactory); 3086 return ColorSpace.fromIR(IR, pdfFunctionFactory); 3087 }; 3088 ColorSpace.fromIR = function (IR, pdfFunctionFactory) { 3089 var name = Array.isArray(IR) ? IR[0] : IR; 3090 var whitePoint, blackPoint, gamma; 3091 switch (name) { 3092 case 'DeviceGrayCS': 3093 return this.singletons.gray; 3094 case 'DeviceRgbCS': 3095 return this.singletons.rgb; 3096 case 'DeviceCmykCS': 3097 return this.singletons.cmyk; 3098 case 'CalGrayCS': 3099 whitePoint = IR[1]; 3100 blackPoint = IR[2]; 3101 gamma = IR[3]; 3102 return new CalGrayCS(whitePoint, blackPoint, gamma); 3103 case 'CalRGBCS': 3104 whitePoint = IR[1]; 3105 blackPoint = IR[2]; 3106 gamma = IR[3]; 3107 var matrix = IR[4]; 3108 return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); 3109 case 'PatternCS': 3110 var basePatternCS = IR[1]; 3111 if (basePatternCS) { 3112 basePatternCS = ColorSpace.fromIR(basePatternCS, pdfFunctionFactory); 3113 } 3114 return new PatternCS(basePatternCS); 3115 case 'IndexedCS': 3116 var baseIndexedCS = IR[1]; 3117 var hiVal = IR[2]; 3118 var lookup = IR[3]; 3119 return new IndexedCS(ColorSpace.fromIR(baseIndexedCS, pdfFunctionFactory), hiVal, lookup); 3120 case 'AlternateCS': 3121 var numComps = IR[1]; 3122 var alt = IR[2]; 3123 var tintFnIR = IR[3]; 3124 return new AlternateCS(numComps, ColorSpace.fromIR(alt, pdfFunctionFactory), pdfFunctionFactory.createFromIR(tintFnIR)); 3125 case 'LabCS': 3126 whitePoint = IR[1]; 3127 blackPoint = IR[2]; 3128 var range = IR[3];
3129 return new LabCS(whitePoint, blackPoint, range); 3130 default: 3131 throw new _util.FormatError('Unknown colorspace name: ' + name); 3132 } 3133 }; 3134 ColorSpace.parseToIR = function (cs, xref) { 3135 var res = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; 3136 var pdfFunctionFactory = arguments[3]; 3137 3138 cs = xref.fetchIfRef(cs); 3139 if ((0, _primitives.isName)(cs)) { 3140 switch (cs.name) { 3141 case 'DeviceGray': 3142 case 'G': 3143 return 'DeviceGrayCS'; 3144 case 'DeviceRGB': 3145 case 'RGB': 3146 return 'DeviceRgbCS'; 3147 case 'DeviceCMYK': 3148 case 'CMYK': 3149 return 'DeviceCmykCS'; 3150 case 'Pattern': 3151 return ['PatternCS', null]; 3152 default: 3153 if ((0, _primitives.isDict)(res)) { 3154 var colorSpaces = res.get('ColorSpace'); 3155 if ((0, _primitives.isDict)(colorSpaces)) { 3156 var resCS = colorSpaces.get(cs.name); 3157 if (resCS) { 3158 if ((0, _primitives.isName)(resCS)) { 3159 return ColorSpace.parseToIR(resCS, xref, res, pdfFunctionFactory); 3160 } 3161 cs = resCS; 3162 break; 3163 } 3164 } 3165 } 3166 throw new _util.FormatError('unrecognized colorspace ' + cs.name); 3167 } 3168 } 3169 if (Array.isArray(cs)) { 3170 var mode = xref.fetchIfRef(cs[0]).name; 3171 var numComps, params, alt, whitePoint, blackPoint, gamma; 3172 switch (mode) { 3173 case 'DeviceGray': 3174 case 'G': 3175 return 'DeviceGrayCS'; 3176 case 'DeviceRGB': 3177 case 'RGB': 3178 return 'DeviceRgbCS'; 3179 case 'DeviceCMYK': 3180 case 'CMYK': 3181 return 'DeviceCmykCS'; 3182 case 'CalGray': 3183 params = xref.fetchIfRef(cs[1]); 3184 whitePoint = params.getArray('WhitePoint'); 3185 blackPoint = params.getArray('BlackPoint'); 3186 gamma = params.get('Gamma'); 3187 return ['CalGrayCS', whitePoint, blackPoint, gamma]; 3188 case 'CalRGB': 3189 params = xref.fetchIfRef(cs[1]); 3190 whitePoint = params.getArray('WhitePoint'); 3191 blackPoint = params.getArray('BlackPoint'); 3192 gamma = params.getArray('Gamma'); 3193 var matrix = params.getArray('Matrix'); 3194 return ['CalRGBCS', whitePoint, blackPoint, gamma, matrix]; 3195 case 'ICCBased': 3196 var stream = xref.fetchIfRef(cs[1]); 3197 var dict = stream.dict; 3198 numComps = dict.get('N'); 3199 alt = dict.get('Alternate'); 3200 if (alt) { 3201 var altIR = ColorSpace.parseToIR(alt, xref, res, pdfFunctionFactory); 3202 var altCS = ColorSpace.fromIR(altIR, pdfFunctionFactory); 3203 if (altCS.numComps === numComps) { 3204 return altIR; 3205 } 3206 (0, _util.warn)('ICCBased color space: Ignoring incorrect /Alternate entry.'); 3207 } 3208 if (numComps === 1) { 3209 return 'DeviceGrayCS'; 3210 } else if (numComps === 3) { 3211 return 'DeviceRgbCS'; 3212 } else if (numComps === 4) { 3213 return 'DeviceCmykCS'; 3214 } 3215 break; 3216 case 'Pattern': 3217 var basePatternCS = cs[1] || null; 3218 if (basePatternCS) { 3219 basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res, pdfFunctionFactory); 3220 } 3221 return ['PatternCS', basePatternCS]; 3222 case 'Indexed': 3223 case 'I': 3224 var baseIndexedCS = ColorSpace.parseToIR(cs[1], xref, res, pdfFunctionFactory); 3225 var hiVal = xref.fetchIfRef(cs[2]) + 1; 3226 var lookup = xref.fetchIfRef(cs[3]); 3227 if ((0, _primitives.isStream)(lookup)) { 3228 lookup = lookup.getBytes(); 3229 } 3230 return ['IndexedCS', baseIndexedCS, hiVal, lookup]; 3231 case 'Separation': 3232 case 'DeviceN': 3233 var name = xref.fetchIfRef(cs[1]); 3234 numComps = Array.isArray(name) ? name.length : 1; 3235 alt = ColorSpace.parseToIR(cs[2], xref, res, pdfFunctionFactory); 3236 var tintFnIR = pdfFunctionFactory.createIR(xref.fetchIfRef(cs[3])); 3237 return ['AlternateCS', numComps, alt, tintFnIR]; 3238 case 'Lab': 3239 params = xref.fetchIfRef(cs[1]); 3240 whitePoint = params.getArray('WhitePoint'); 3241 blackPoint = params.getArray('BlackPoint'); 3242 var range = params.getArray('Range'); 3243 return ['LabCS', whitePoint, blackPoint, range]; 3244 default: 3245 throw new _util.FormatError('unimplemented color space object "' + mode + '"'); 3246 } 3247 } 3248 throw new _util.FormatError('unrecognized color space object: "' + cs + '"'); 3249 }; 3250 ColorSpace.isDefaultDecode = function ColorSpace_isDefaultDecode(decode, n) { 3251 if (!Array.isArray(decode)) { 3252 return true; 3253 } 3254 if (n * 2 !== decode.length) { 3255 (0, _util.warn)('The decode map is not the correct length'); 3256 return true; 3257 } 3258 for (var i = 0, ii = decode.length; i < ii; i += 2) { 3259 if (decode[i] !== 0 || decode[i + 1] !== 1) { 3260 return false; 3261 } 3262 } 3263 return true; 3264 }; 3265 ColorSpace.singletons = { 3266 get gray() { 3267 return (0, _util.shadow)(this, 'gray', new DeviceGrayCS()); 3268 }, 3269 get rgb() { 3270 return (0, _util.shadow)(this, 'rgb', new DeviceRgbCS()); 3271 }, 3272 get cmyk() { 3273 return (0, _util.shadow)(this, 'cmyk', new DeviceCmykCS()); 3274 } 3275 }; 3276 return ColorSpace; 3277}();
3278var AlternateCS = function AlternateCSClosure() { 3279 function AlternateCS(numComps, base, tintFn) { 3280 this.name = 'Alternate'; 3281 this.numComps = numComps; 3282 this.defaultColor = new Float32Array(numComps); 3283 for (var i = 0; i < numComps; ++i) { 3284 this.defaultColor[i] = 1; 3285 } 3286 this.base = base; 3287 this.tintFn = tintFn; 3288 this.tmpBuf = new Float32Array(base.numComps); 3289 } 3290 AlternateCS.prototype = { 3291 getRgb: ColorSpace.prototype.getRgb, 3292 getRgbItem: function AlternateCS_getRgbItem(src, srcOffset, dest, destOffset) { 3293 var tmpBuf = this.tmpBuf; 3294 this.tintFn(src, srcOffset, tmpBuf, 0); 3295 this.base.getRgbItem(tmpBuf, 0, dest, destOffset); 3296 }, 3297 getRgbBuffer: function AlternateCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 3298 var tintFn = this.tintFn; 3299 var base = this.base; 3300 var scale = 1 / ((1 << bits) - 1); 3301 var baseNumComps = base.numComps; 3302 var usesZeroToOneRange = base.usesZeroToOneRange; 3303 var isPassthrough = (base.isPassthrough(8) || !usesZeroToOneRange) && alpha01 === 0; 3304 var pos = isPassthrough ? destOffset : 0; 3305 var baseBuf = isPassthrough ? dest : new Uint8Array(baseNumComps * count); 3306 var numComps = this.numComps; 3307 var scaled = new Float32Array(numComps); 3308 var tinted = new Float32Array(baseNumComps); 3309 var i, j; 3310 for (i = 0; i < count; i++) { 3311 for (j = 0; j < numComps; j++) { 3312 scaled[j] = src[srcOffset++] * scale; 3313 } 3314 tintFn(scaled, 0, tinted, 0); 3315 if (usesZeroToOneRange) { 3316 for (j = 0; j < baseNumComps; j++) { 3317 baseBuf[pos++] = tinted[j] * 255; 3318 } 3319 } else { 3320 base.getRgbItem(tinted, 0, baseBuf, pos); 3321 pos += baseNumComps; 3322 } 3323 } 3324 if (!isPassthrough) { 3325 base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01); 3326 } 3327 }, 3328 getOutputLength: function AlternateCS_getOutputLength(inputLength, alpha01) { 3329 return this.base.getOutputLength(inputLength * this.base.numComps / this.numComps, alpha01); 3330 }, 3331 isPassthrough: ColorSpace.prototype.isPassthrough, 3332 fillRgb: ColorSpace.prototype.fillRgb, 3333 isDefaultDecode: function AlternateCS_isDefaultDecode(decodeMap) { 3334 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 3335 }, 3336 usesZeroToOneRange: true 3337 }; 3338 return AlternateCS; 3339}(); 3340var PatternCS = function PatternCSClosure() { 3341 function PatternCS(baseCS) { 3342 this.name = 'Pattern'; 3343 this.base = baseCS; 3344 } 3345 PatternCS.prototype = {}; 3346 return PatternCS; 3347}(); 3348var IndexedCS = function IndexedCSClosure() { 3349 function IndexedCS(base, highVal, lookup) { 3350 this.name = 'Indexed'; 3351 this.numComps = 1; 3352 this.defaultColor = new Uint8Array(this.numComps); 3353 this.base = base; 3354 this.highVal = highVal; 3355 var baseNumComps = base.numComps; 3356 var length = baseNumComps * highVal; 3357 if ((0, _primitives.isStream)(lookup)) { 3358 this.lookup = new Uint8Array(length); 3359 var bytes = lookup.getBytes(length); 3360 this.lookup.set(bytes); 3361 } else if ((0, _util.isString)(lookup)) { 3362 this.lookup = new Uint8Array(length); 3363 for (var i = 0; i < length; ++i) { 3364 this.lookup[i] = lookup.charCodeAt(i); 3365 } 3366 } else if (lookup instanceof Uint8Array) { 3367 this.lookup = lookup; 3368 } else { 3369 throw new _util.FormatError('Unrecognized lookup table: ' + lookup); 3370 } 3371 } 3372 IndexedCS.prototype = { 3373 getRgb: ColorSpace.prototype.getRgb, 3374 getRgbItem: function IndexedCS_getRgbItem(src, srcOffset, dest, destOffset) { 3375 var numComps = this.base.numComps; 3376 var start = src[srcOffset] * numComps; 3377 this.base.getRgbBuffer(this.lookup, start, 1, dest, destOffset, 8, 0); 3378 }, 3379 getRgbBuffer: function IndexedCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 3380 var base = this.base; 3381 var numComps = base.numComps; 3382 var outputDelta = base.getOutputLength(numComps, alpha01); 3383 var lookup = this.lookup; 3384 for (var i = 0; i < count; ++i) {
3385 var lookupPos = src[srcOffset++] * numComps; 3386 base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01); 3387 destOffset += outputDelta; 3388 } 3389 }, 3390 getOutputLength: function IndexedCS_getOutputLength(inputLength, alpha01) { 3391 return this.base.getOutputLength(inputLength * this.base.numComps, alpha01); 3392 }, 3393 isPassthrough: ColorSpace.prototype.isPassthrough, 3394 fillRgb: ColorSpace.prototype.fillRgb, 3395 isDefaultDecode: function IndexedCS_isDefaultDecode(decodeMap) { 3396 return true; 3397 }, 3398 usesZeroToOneRange: true 3399 }; 3400 return IndexedCS; 3401}(); 3402var DeviceGrayCS = function DeviceGrayCSClosure() { 3403 function DeviceGrayCS() { 3404 this.name = 'DeviceGray'; 3405 this.numComps = 1; 3406 this.defaultColor = new Float32Array(this.numComps); 3407 } 3408 DeviceGrayCS.prototype = { 3409 getRgb: ColorSpace.prototype.getRgb, 3410 getRgbItem: function DeviceGrayCS_getRgbItem(src, srcOffset, dest, destOffset) { 3411 var c = src[srcOffset] * 255 | 0; 3412 c = c < 0 ? 0 : c > 255 ? 255 : c; 3413 dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c; 3414 }, 3415 getRgbBuffer: function DeviceGrayCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 3416 var scale = 255 / ((1 << bits) - 1); 3417 var j = srcOffset, 3418 q = destOffset; 3419 for (var i = 0; i < count; ++i) { 3420 var c = scale * src[j++] | 0; 3421 dest[q++] = c; 3422 dest[q++] = c; 3423 dest[q++] = c; 3424 q += alpha01; 3425 } 3426 }, 3427 getOutputLength: function DeviceGrayCS_getOutputLength(inputLength, alpha01) { 3428 return inputLength * (3 + alpha01); 3429 }, 3430 isPassthrough: ColorSpace.prototype.isPassthrough, 3431 fillRgb: ColorSpace.prototype.fillRgb, 3432 isDefaultDecode: function DeviceGrayCS_isDefaultDecode(decodeMap) { 3433 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 3434 }, 3435 usesZeroToOneRange: true 3436 }; 3437 return DeviceGrayCS; 3438}(); 3439var DeviceRgbCS = function DeviceRgbCSClosure() { 3440 function DeviceRgbCS() { 3441 this.name = 'DeviceRGB'; 3442 this.numComps = 3; 3443 this.defaultColor = new Float32Array(this.numComps); 3444 } 3445 DeviceRgbCS.prototype = { 3446 getRgb: ColorSpace.prototype.getRgb, 3447 getRgbItem: function DeviceRgbCS_getRgbItem(src, srcOffset, dest, destOffset) { 3448 var r = src[srcOffset] * 255 | 0; 3449 var g = src[srcOffset + 1] * 255 | 0; 3450 var b = src[srcOffset + 2] * 255 | 0; 3451 dest[destOffset] = r < 0 ? 0 : r > 255 ? 255 : r; 3452 dest[destOffset + 1] = g < 0 ? 0 : g > 255 ? 255 : g; 3453 dest[destOffset + 2] = b < 0 ? 0 : b > 255 ? 255 : b; 3454 }, 3455 getRgbBuffer: function DeviceRgbCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 3456 if (bits === 8 && alpha01 === 0) { 3457 dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset); 3458 return; 3459 } 3460 var scale = 255 / ((1 << bits) - 1); 3461 var j = srcOffset, 3462 q = destOffset; 3463 for (var i = 0; i < count; ++i) { 3464 dest[q++] = scale * src[j++] | 0; 3465 dest[q++] = scale * src[j++] | 0; 3466 dest[q++] = scale * src[j++] | 0; 3467 q += alpha01; 3468 } 3469 }, 3470 getOutputLength: function DeviceRgbCS_getOutputLength(inputLength, alpha01) { 3471 return inputLength * (3 + alpha01) / 3 | 0; 3472 }, 3473 isPassthrough: function DeviceRgbCS_isPassthrough(bits) { 3474 return bits === 8; 3475 }, 3476 fillRgb: ColorSpace.prototype.fillRgb, 3477 isDefaultDecode: function DeviceRgbCS_isDefaultDecode(decodeMap) { 3478 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 3479 }, 3480 usesZeroToOneRange: true 3481 }; 3482 return DeviceRgbCS; 3483}(); 3484var DeviceCmykCS = function DeviceCmykCSClosure() { 3485 function convertToRgb(src, srcOffset, srcScale, dest, destOffset) { 3486 var c = src[srcOffset + 0] * srcScale; 3487 var m = src[srcOffset + 1] * srcScale; 3488 var y = src[srcOffset + 2] * srcScale; 3489 var k = src[srcOffset + 3] * srcScale; 3490 var r = c * (-4.387332384609988 * c + 54.48615194189176 * m + 18.82290502165302 * y + 212.25662451639585 * k + -285.2331026137004) + m * (1.7149763477362134 * m - 5.6096736904047315 * y + -17.873870861415444 * k - 5.497006427196366) + y * (-2.5217340131683033 * y - 21.248923337353073 * k + 17.5119270841813) + k * (-21.86122147463605 * k - 189.48180835922747) + 255 | 0;
vendor: 4,139 bytes, lines 3491-3574
3491 var g = c * (8.841041422036149 * c + 60.118027045597366 * m + 6.871425592049007 * y + 31.159100130055922 * k + -79.2970844816548) + m * (-15.310361306967817 * m + 17.575251261109482 * y + 131.35250912493976 * k - 190.9453302588951) + y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) + k * (-20.737325471181034 * k - 187.80453709719578) + 255 | 0; 3492 var b = c * (0.8842522430003296 * c + 8.078677503112928 * m + 30.89978309703729 * y - 0.23883238689178934 * k + -14.183576799673286) + m * (10.49593273432072 * m + 63.02378494754052 * y + 50.606957656360734 * k - 112.23884253719248) + y * (0.03296041114873217 * y + 115.60384449646641 * k + -193.58209356861505) + k * (-22.33816807309886 * k - 180.12613974708367) + 255 | 0; 3493 dest[destOffset] = r > 255 ? 255 : r < 0 ? 0 : r; 3494 dest[destOffset + 1] = g > 255 ? 255 : g < 0 ? 0 : g; 3495 dest[destOffset + 2] = b > 255 ? 255 : b < 0 ? 0 : b; 3496 } 3497 function DeviceCmykCS() { 3498 this.name = 'DeviceCMYK'; 3499 this.numComps = 4; 3500 this.defaultColor = new Float32Array(this.numComps); 3501 this.defaultColor[3] = 1; 3502 } 3503 DeviceCmykCS.prototype = { 3504 getRgb: ColorSpace.prototype.getRgb, 3505 getRgbItem: function DeviceCmykCS_getRgbItem(src, srcOffset, dest, destOffset) { 3506 convertToRgb(src, srcOffset, 1, dest, destOffset); 3507 }, 3508 getRgbBuffer: function DeviceCmykCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 3509 var scale = 1 / ((1 << bits) - 1); 3510 for (var i = 0; i < count; i++) { 3511 convertToRgb(src, srcOffset, scale, dest, destOffset); 3512 srcOffset += 4; 3513 destOffset += 3 + alpha01; 3514 } 3515 }, 3516 getOutputLength: function DeviceCmykCS_getOutputLength(inputLength, alpha01) { 3517 return inputLength / 4 * (3 + alpha01) | 0; 3518 }, 3519 isPassthrough: ColorSpace.prototype.isPassthrough, 3520 fillRgb: ColorSpace.prototype.fillRgb, 3521 isDefaultDecode: function DeviceCmykCS_isDefaultDecode(decodeMap) { 3522 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 3523 }, 3524 usesZeroToOneRange: true 3525 }; 3526 return DeviceCmykCS; 3527}(); 3528var CalGrayCS = function CalGrayCSClosure() { 3529 function CalGrayCS(whitePoint, blackPoint, gamma) { 3530 this.name = 'CalGray'; 3531 this.numComps = 1; 3532 this.defaultColor = new Float32Array(this.numComps); 3533 if (!whitePoint) { 3534 throw new _util.FormatError('WhitePoint missing - required for color space CalGray'); 3535 } 3536 blackPoint = blackPoint || [0, 0, 0]; 3537 gamma = gamma || 1; 3538 this.XW = whitePoint[0]; 3539 this.YW = whitePoint[1]; 3540 this.ZW = whitePoint[2]; 3541 this.XB = blackPoint[0]; 3542 this.YB = blackPoint[1]; 3543 this.ZB = blackPoint[2]; 3544 this.G = gamma; 3545 if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { 3546 throw new _util.FormatError('Invalid WhitePoint components for ' + this.name + ', no fallback available'); 3547 } 3548 if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { 3549 (0, _util.info)('Invalid BlackPoint for ' + this.name + ', falling back to default'); 3550 this.XB = this.YB = this.ZB = 0; 3551 } 3552 if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) { 3553 (0, _util.warn)(this.name + ', BlackPoint: XB: ' + this.XB + ', YB: ' + this.YB + ', ZB: ' + this.ZB + ', only default values are supported.'); 3554 } 3555 if (this.G < 1) { 3556 (0, _util.info)('Invalid Gamma: ' + this.G + ' for ' + this.name + ', falling back to default'); 3557 this.G = 1; 3558 } 3559 } 3560 function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { 3561 var A = src[srcOffset] * scale; 3562 var AG = Math.pow(A, cs.G); 3563 var L = cs.YW * AG; 3564 var val = Math.max(295.8 * Math.pow(L, 0.333333333333333333) - 40.8, 0) | 0; 3565 dest[destOffset] = val; 3566 dest[destOffset + 1] = val; 3567 dest[destOffset + 2] = val; 3568 } 3569 CalGrayCS.prototype = { 3570 getRgb: ColorSpace.prototype.getRgb, 3571 getRgbItem: function CalGrayCS_getRgbItem(src, srcOffset, dest, destOffset) { 3572 convertToRgb(this, src, srcOffset, dest, destOffset, 1); 3573 }, 3574 getRgbBuffer: function CalGrayCS_getRgbBuffer(src, srcOffset, count, dest, destOff
vendor: 5,466 bytes, lines 3574-3700
3574set, bits, alpha01) { 3575 var scale = 1 / ((1 << bits) - 1); 3576 for (var i = 0; i < count; ++i) { 3577 convertToRgb(this, src, srcOffset, dest, destOffset, scale); 3578 srcOffset += 1; 3579 destOffset += 3 + alpha01; 3580 } 3581 }, 3582 getOutputLength: function CalGrayCS_getOutputLength(inputLength, alpha01) { 3583 return inputLength * (3 + alpha01); 3584 }, 3585 isPassthrough: ColorSpace.prototype.isPassthrough, 3586 fillRgb: ColorSpace.prototype.fillRgb, 3587 isDefaultDecode: function CalGrayCS_isDefaultDecode(decodeMap) { 3588 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 3589 }, 3590 usesZeroToOneRange: true 3591 }; 3592 return CalGrayCS; 3593}(); 3594var CalRGBCS = function CalRGBCSClosure() { 3595 var BRADFORD_SCALE_MATRIX = new Float32Array([0.8951, 0.2664, -0.1614, -0.7502, 1.7135, 0.0367, 0.0389, -0.0685, 1.0296]); 3596 var BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([0.9869929, -0.1470543, 0.1599627, 0.4323053, 0.5183603, 0.0492912, -0.0085287, 0.0400428, 0.9684867]); 3597 var SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([3.2404542, -1.5371385, -0.4985314, -0.9692660, 1.8760108, 0.0415560, 0.0556434, -0.2040259, 1.0572252]); 3598 var FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]); 3599 var tempNormalizeMatrix = new Float32Array(3); 3600 var tempConvertMatrix1 = new Float32Array(3); 3601 var tempConvertMatrix2 = new Float32Array(3); 3602 var DECODE_L_CONSTANT = Math.pow((8 + 16) / 116, 3) / 8.0; 3603 function CalRGBCS(whitePoint, blackPoint, gamma, matrix) { 3604 this.name = 'CalRGB'; 3605 this.numComps = 3; 3606 this.defaultColor = new Float32Array(this.numComps); 3607 if (!whitePoint) { 3608 throw new _util.FormatError('WhitePoint missing - required for color space CalRGB'); 3609 } 3610 blackPoint = blackPoint || new Float32Array(3); 3611 gamma = gamma || new Float32Array([1, 1, 1]); 3612 matrix = matrix || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); 3613 var XW = whitePoint[0]; 3614 var YW = whitePoint[1]; 3615 var ZW = whitePoint[2]; 3616 this.whitePoint = whitePoint; 3617 var XB = blackPoint[0]; 3618 var YB = blackPoint[1]; 3619 var ZB = blackPoint[2]; 3620 this.blackPoint = blackPoint; 3621 this.GR = gamma[0]; 3622 this.GG = gamma[1]; 3623 this.GB = gamma[2]; 3624 this.MXA = matrix[0]; 3625 this.MYA = matrix[1]; 3626 this.MZA = matrix[2]; 3627 this.MXB = matrix[3]; 3628 this.MYB = matrix[4]; 3629 this.MZB = matrix[5]; 3630 this.MXC = matrix[6]; 3631 this.MYC = matrix[7]; 3632 this.MZC = matrix[8]; 3633 if (XW < 0 || ZW < 0 || YW !== 1) { 3634 throw new _util.FormatError('Invalid WhitePoint components for ' + this.name + ', no fallback available'); 3635 } 3636 if (XB < 0 || YB < 0 || ZB < 0) { 3637 (0, _util.info)('Invalid BlackPoint for ' + this.name + ' [' + XB + ', ' + YB + ', ' + ZB + '], falling back to default'); 3638 this.blackPoint = new Float32Array(3); 3639 } 3640 if (this.GR < 0 || this.GG < 0 || this.GB < 0) { 3641 (0, _util.info)('Invalid Gamma [' + this.GR + ', ' + this.GG + ', ' + this.GB + '] for ' + this.name + ', falling back to default'); 3642 this.GR = this.GG = this.GB = 1; 3643 } 3644 if (this.MXA < 0 || this.MYA < 0 || this.MZA < 0 || this.MXB < 0 || this.MYB < 0 || this.MZB < 0 || this.MXC < 0 || this.MYC < 0 || this.MZC < 0) { 3645 (0, _util.info)('Invalid Matrix for ' + this.name + ' [' + this.MXA + ', ' + this.MYA + ', ' + this.MZA + this.MXB + ', ' + this.MYB + ', ' + this.MZB + this.MXC + ', ' + this.MYC + ', ' + this.MZC + '], falling back to default'); 3646 this.MXA = this.MYB = this.MZC = 1; 3647 this.MXB = this.MYA = this.MZA = this.MXC = this.MYC = this.MZB = 0; 3648 } 3649 } 3650 function matrixProduct(a, b, result) { 3651 result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; 3652 result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2]; 3653 result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2]; 3654 } 3655 function convertToFlat(sourceWhitePoint, LMS, result) { 3656 result[0] = LMS[0] * 1 / sourceWhitePoint[0]; 3657 result[1] = LMS[1] * 1 / sourceWhitePoint[1]; 3658 result[2] = LMS[2] * 1 / sourceWhitePoint[2]; 3659 } 3660 function convertToD65(sourceWhitePoint, LMS, result) { 3661 var D65X = 0.95047; 3662 var D65Y = 1; 3663 var D65Z = 1.08883; 3664 result[0] = LMS[0] * D65X / sourceWhitePoint[0]; 3665 result[1] = LMS[1] * D65Y / sourceWhitePoint[1]; 3666 result[2] = LMS[2] * D65Z / sourceWhitePoint[2]; 3667 } 3668 function sRGBTransferFunction(color) { 3669 if (color <= 0.0031308) { 3670 return adjustToRange(0, 1, 12.92 * color); 3671 } 3672 return adjustToRange(0, 1, (1 + 0.055) * Math.pow(color, 1 / 2.4) - 0.055); 3673 } 3674 function adjustToRange(min, max, value) { 3675 return Math.max(min, Math.min(max, value)); 3676 } 3677 function decodeL(L) { 3678 if (L < 0) { 3679 return -decodeL(-L); 3680 } 3681 if (L > 8.0) { 3682 return Math.pow((L + 16) / 116, 3); 3683 } 3684 return L * DECODE_L_CONSTANT; 3685 } 3686 function compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) { 3687 if (sourceBlackPoint[0] === 0 && sourceBlackPoint[1] === 0 && sourceBlackPoint[2] === 0) { 3688 result[0] = XYZ_Flat[0]; 3689 result[1] = XYZ_Flat[1]; 3690 result[2] = XYZ_Flat[2]; 3691 return; 3692 } 3693 var zeroDecodeL = decodeL(0); 3694 var X_DST = zeroDecodeL; 3695 var X_SRC = decodeL(sourceBlackPoint[0]); 3696 var Y_DST = zeroDecodeL; 3697 var Y_SRC = decodeL(sourceBlackPoint[1]); 3698 var Z_DST = zeroDecodeL; 3699 var Z_SRC = decodeL(sourceBlackPoint[2]); 3700 var X_Scale = (1 - X_DST) / (1 - X_SRC);
vendor: 5,096 bytes, lines 3701-3831
3701 var X_Offset = 1 - X_Scale; 3702 var Y_Scale = (1 - Y_DST) / (1 - Y_SRC); 3703 var Y_Offset = 1 - Y_Scale; 3704 var Z_Scale = (1 - Z_DST) / (1 - Z_SRC); 3705 var Z_Offset = 1 - Z_Scale; 3706 result[0] = XYZ_Flat[0] * X_Scale + X_Offset; 3707 result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset; 3708 result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset; 3709 } 3710 function normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) { 3711 if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) { 3712 result[0] = XYZ_In[0]; 3713 result[1] = XYZ_In[1]; 3714 result[2] = XYZ_In[2]; 3715 return; 3716 } 3717 var LMS = result; 3718 matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); 3719 var LMS_Flat = tempNormalizeMatrix; 3720 convertToFlat(sourceWhitePoint, LMS, LMS_Flat); 3721 matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_Flat, result); 3722 } 3723 function normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) { 3724 var LMS = result; 3725 matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); 3726 var LMS_D65 = tempNormalizeMatrix; 3727 convertToD65(sourceWhitePoint, LMS, LMS_D65); 3728 matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_D65, result); 3729 } 3730 function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { 3731 var A = adjustToRange(0, 1, src[srcOffset] * scale); 3732 var B = adjustToRange(0, 1, src[srcOffset + 1] * scale); 3733 var C = adjustToRange(0, 1, src[srcOffset + 2] * scale); 3734 var AGR = Math.pow(A, cs.GR); 3735 var BGG = Math.pow(B, cs.GG); 3736 var CGB = Math.pow(C, cs.GB); 3737 var X = cs.MXA * AGR + cs.MXB * BGG + cs.MXC * CGB; 3738 var Y = cs.MYA * AGR + cs.MYB * BGG + cs.MYC * CGB; 3739 var Z = cs.MZA * AGR + cs.MZB * BGG + cs.MZC * CGB; 3740 var XYZ = tempConvertMatrix1; 3741 XYZ[0] = X; 3742 XYZ[1] = Y; 3743 XYZ[2] = Z; 3744 var XYZ_Flat = tempConvertMatrix2; 3745 normalizeWhitePointToFlat(cs.whitePoint, XYZ, XYZ_Flat); 3746 var XYZ_Black = tempConvertMatrix1; 3747 compensateBlackPoint(cs.blackPoint, XYZ_Flat, XYZ_Black); 3748 var XYZ_D65 = tempConvertMatrix2; 3749 normalizeWhitePointToD65(FLAT_WHITEPOINT_MATRIX, XYZ_Black, XYZ_D65); 3750 var SRGB = tempConvertMatrix1; 3751 matrixProduct(SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB); 3752 var sR = sRGBTransferFunction(SRGB[0]); 3753 var sG = sRGBTransferFunction(SRGB[1]); 3754 var sB = sRGBTransferFunction(SRGB[2]); 3755 dest[destOffset] = Math.round(sR * 255); 3756 dest[destOffset + 1] = Math.round(sG * 255); 3757 dest[destOffset + 2] = Math.round(sB * 255); 3758 } 3759 CalRGBCS.prototype = { 3760 getRgb: ColorSpace.prototype.getRgb, 3761 getRgbItem: function CalRGBCS_getRgbItem(src, srcOffset, dest, destOffset) { 3762 convertToRgb(this, src, srcOffset, dest, destOffset, 1); 3763 }, 3764 getRgbBuffer: function CalRGBCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 3765 var scale = 1 / ((1 << bits) - 1); 3766 for (var i = 0; i < count; ++i) { 3767 convertToRgb(this, src, srcOffset, dest, destOffset, scale); 3768 srcOffset += 3; 3769 destOffset += 3 + alpha01; 3770 } 3771 }, 3772 getOutputLength: function CalRGBCS_getOutputLength(inputLength, alpha01) { 3773 return inputLength * (3 + alpha01) / 3 | 0; 3774 }, 3775 isPassthrough: ColorSpace.prototype.isPassthrough, 3776 fillRgb: ColorSpace.prototype.fillRgb, 3777 isDefaultDecode: function CalRGBCS_isDefaultDecode(decodeMap) { 3778 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 3779 }, 3780 usesZeroToOneRange: true 3781 }; 3782 return CalRGBCS; 3783}(); 3784var LabCS = function LabCSClosure() { 3785 function LabCS(whitePoint, blackPoint, range) { 3786 this.name = 'Lab'; 3787 this.numComps = 3; 3788 this.defaultColor = new Float32Array(this.numComps); 3789 if (!whitePoint) { 3790 throw new _util.FormatError('WhitePoint missing - required for color space Lab'); 3791 } 3792 blackPoint = blackPoint || [0, 0, 0]; 3793 range = range || [-100, 100, -100, 100]; 3794 this.XW = whitePoint[0]; 3795 this.YW = whitePoint[1]; 3796 this.ZW = whitePoint[2]; 3797 this.amin = range[0]; 3798 this.amax = range[1]; 3799 this.bmin = range[2]; 3800 this.bmax = range[3]; 3801 this.XB = blackPoint[0]; 3802 this.YB = blackPoint[1]; 3803 this.ZB = blackPoint[2]; 3804 if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { 3805 throw new _util.FormatError('Invalid WhitePoint components, no fallback available'); 3806 } 3807 if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { 3808 (0, _util.info)('Invalid BlackPoint, falling back to default'); 3809 this.XB = this.YB = this.ZB = 0; 3810 } 3811 if (this.amin > this.amax || this.bmin > this.bmax) { 3812 (0, _util.info)('Invalid Range, falling back to defaults'); 3813 this.amin = -100; 3814 this.amax = 100; 3815 this.bmin = -100; 3816 this.bmax = 100; 3817 } 3818 } 3819 function fn_g(x) { 3820 var result; 3821 if (x >= 6 / 29) { 3822 result = x * x * x; 3823 } else { 3824 result = 108 / 841 * (x - 4 / 29); 3825 } 3826 return result; 3827 } 3828 function decode(value, high1, low2, high2) { 3829 return low2 + value * (high2 - low2) / high1; 3830 } 3831 function convertToRgb(cs, src, srcOffset, maxVal, dest, destOff
vendor: 9,890 bytes, lines 3831-3901
3831set) { 3832 var Ls = src[srcOffset]; 3833 var as = src[srcOffset + 1]; 3834 var bs = src[srcOffset + 2]; 3835 if (maxVal !== false) { 3836 Ls = decode(Ls, maxVal, 0, 100); 3837 as = decode(as, maxVal, cs.amin, cs.amax); 3838 bs = decode(bs, maxVal, cs.bmin, cs.bmax); 3839 } 3840 as = as > cs.amax ? cs.amax : as < cs.amin ? cs.amin : as; 3841 bs = bs > cs.bmax ? cs.bmax : bs < cs.bmin ? cs.bmin : bs; 3842 var M = (Ls + 16) / 116; 3843 var L = M + as / 500; 3844 var N = M - bs / 200; 3845 var X = cs.XW * fn_g(L); 3846 var Y = cs.YW * fn_g(M); 3847 var Z = cs.ZW * fn_g(N); 3848 var r, g, b; 3849 if (cs.ZW < 1) { 3850 r = X * 3.1339 + Y * -1.6170 + Z * -0.4906; 3851 g = X * -0.9785 + Y * 1.9160 + Z * 0.0333; 3852 b = X * 0.0720 + Y * -0.2290 + Z * 1.4057; 3853 } else { 3854 r = X * 3.2406 + Y * -1.5372 + Z * -0.4986; 3855 g = X * -0.9689 + Y * 1.8758 + Z * 0.0415; 3856 b = X * 0.0557 + Y * -0.2040 + Z * 1.0570; 3857 } 3858 dest[destOffset] = r <= 0 ? 0 : r >= 1 ? 255 : Math.sqrt(r) * 255 | 0; 3859 dest[destOffset + 1] = g <= 0 ? 0 : g >= 1 ? 255 : Math.sqrt(g) * 255 | 0; 3860 dest[destOffset + 2] = b <= 0 ? 0 : b >= 1 ? 255 : Math.sqrt(b) * 255 | 0; 3861 } 3862 LabCS.prototype = { 3863 getRgb: ColorSpace.prototype.getRgb, 3864 getRgbItem: function LabCS_getRgbItem(src, srcOffset, dest, destOffset) { 3865 convertToRgb(this, src, srcOffset, false, dest, destOffset); 3866 }, 3867 getRgbBuffer: function LabCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 3868 var maxVal = (1 << bits) - 1; 3869 for (var i = 0; i < count; i++) { 3870 convertToRgb(this, src, srcOffset, maxVal, dest, destOffset); 3871 srcOffset += 3; 3872 destOffset += 3 + alpha01; 3873 } 3874 }, 3875 getOutputLength: function LabCS_getOutputLength(inputLength, alpha01) { 3876 return inputLength * (3 + alpha01) / 3 | 0; 3877 }, 3878 isPassthrough: ColorSpace.prototype.isPassthrough, 3879 fillRgb: ColorSpace.prototype.fillRgb, 3880 isDefaultDecode: function LabCS_isDefaultDecode(decodeMap) { 3881 return true; 3882 }, 3883 usesZeroToOneRange: false 3884 }; 3885 return LabCS; 3886}(); 3887exports.ColorSpace = ColorSpace; 3888 3889/***/ }), 3890/* 21 */ 3891/***/ (function(module, exports, __w_pdfjs_require__) { 3892 3893"use strict"; 3894 3895 3896Object.defineProperty(exports, "__esModule", { 3897 value: true 3898}); 3899var ExpertEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclamsmall', 'Hungarumlautsmall', '', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'questionsmall', '', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', '', '', '', 'isuperior', '', '', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', '', '', 'rsuperior', 'ssuperior', 'tsuperior', '', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', 'Tildesmall', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', '', '', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', '', 'Dotaccentsmall', '', '', 'Macronsmall', '', '', 'figuredash', 'hypheninferior', '', '', 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', '', '', '', 'onequarter', 'onehalf', 'threequarters', 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', '', '', 'zerosuperior', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', 'Ydieresissmall']; 3900var MacExpertEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclamsmall', 'Hungarumlautsmall', 'centoldstyle', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', '', 'threequartersemdash', '', 'questionsmall', '', '', '', '', 'Ethsmall', '', '', 'onequarter', 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', '', '', '', '', '', '', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', 'parenrightinferior', 'Circumflexsmall', 'hypheninferior', 'Gravesmall', 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', 'Tildesmall', '', '', 'asuperior', 'centsuperior', '', '', '', '', 'Aacutesmall', 'Agravesmall', 'Acircumflexsmall', 'Adieresissmall', 'Atildesmall', 'Aringsmall', 'Ccedillasmall', 'Eacutesmall', 'Egravesmall', 'Ecircumflexsmall', 'Edieresissmall', 'Iacutesmall', 'Igravesmall', 'Icircumflexsmall', 'Idieresissmall', 'Ntildesmall', 'Oacutesmall', 'Ogravesmall', 'Ocircumflexsmall', 'Odieresissmall', 'Otildesmall', 'Uacutesmall', 'Ugravesmall', 'Ucircumflexsmall', 'Udieresissmall', '', 'eightsuperior', 'fourinferior', 'threeinferior', 'sixinferior', 'eightinferior', 'seveninferior', 'Scaronsmall', '', 'centinferior', 'twoinferior', '', 'Dieresissmall', '', 'Caronsmall', 'osuperior', 'fiveinferior', '', 'commainferior', 'periodinferior', 'Yacutesmall', '', 'dollarinferior', '', '', 'Thornsmall', '', 'nineinferior', 'zeroinferior', 'Zcaronsmall', 'AEsmall', 'Oslashsmall', 'questiondownsmall', 'oneinferior', 'Lslashsmall', '', '', '', '', '', '', 'Cedillasmall', '', '', '', '', '', 'OEsmall', 'figuredash', 'hyphensuperior', '', '', '', '', 'exclamdownsmall', '', 'Ydieresissmall', '', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'ninesuperior', 'zerosuperior', '', 'esuperior', 'rsuperior', 'tsuperior', '', '', 'isuperior', 'ssuperior', 'dsuperior', '', '', '', '', '', 'lsuperior', 'Ogoneksmall', 'Brevesmall', 'Macronsmall', 'bsuperior', 'nsuperior', 'msuperior', 'commasuperior', 'periodsuperior', 'Dotaccentsmall', 'Ringsmall', '', '', '', '']; 3901var MacRomanEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', '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', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'grave', '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', 'braceleft', 'bar', 'braceright', 'asciitilde', '', 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', 'Odieresis', 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', 'atilde', 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', 'ograve', 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', 'ucircumflex', 'udieresis', 'dagger', 'degree', 'cent', 'sterling', 'section', 'bullet', 'paragraph', 'germandbls', 'registered', 'copyright', 'trademark', 'acute', 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', 'plusminus', 'lessequal', 'greaterequal', 'yen', 'mu', 'partialdiff', 'summation', 'product', 'pi', 'integral', 'ordfeminine', 'ordmasculine', 'Omega', 'ae', 'oslash', 'questiondown', 'exclamdown', 'logicalnot', 'radical', 'florin', 'approxequal', 'Delta', 'guillemotleft', 'guillemotright', 'ellipsis', 'space', 'Agrave', 'Atilde', 'Otilde', 'OE', 'oe', 'endash', 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', 'quoteright', 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', 'currency', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', 'periodce
3901ntered', 'quotesinglbase', 'quotedblbase', 'perthousand', 'Acircumflex', 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', 'Ograve', 'Uacute', 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron']; 3902var StandardEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', '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', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'quoteleft', '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', 'braceleft', 'bar', 'braceright', 'asciitilde', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdown', 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', '', 'endash', 'dagger', 'daggerdbl', 'periodcentered', '', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', '', 'questiondown', '', 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', '', 'ring', 'cedilla', '', 'hungarumlaut', 'ogonek', 'caron', 'emdash', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'AE', '', 'ordfeminine', '', '', '', '', 'Lslash', 'Oslash', 'OE', 'ordmasculine', '', '', '', '', '', 'ae', '', '', '', 'dotlessi', '', '', 'lslash', 'oslash', 'oe', 'germandbls', '', '', '', '']; 3903var WinAnsiEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', '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', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'grave', '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', 'braceleft', 'bar', 'braceright', 'asciitilde', 'bullet', 'Euro', 'bullet', 'quotesinglbase', 'florin', 'quotedblbase', 'ellipsis', 'dagger', 'daggerdbl', 'circumflex', 'perthousand', 'Scaron', 'guilsinglleft', 'OE', 'bullet', 'Zcaron', 'bullet', 'bullet', 'quoteleft', 'quoteright', 'quotedblleft', 'quotedblright', 'bullet', 'endash', 'emdash', 'tilde', 'trademark', 'scaron', 'guilsinglright', 'oe', 'bullet', 'zcaron', 'Ydieresis', 'space', 'exclamdown', 'cent', 'sterling', 'currency', 'yen', 'brokenbar', 'section', 'dieresis', 'copyright', 'ordfeminine', 'guillemotleft', 'logicalnot', 'hyphen', 'registered', 'macron', 'degree', 'plusminus', 'twosuperior', 'threesuperior', 'acute', 'mu', 'paragraph', 'periodcentered', 'cedilla', 'onesuperior', 'ordmasculine', 'guillemotright', 'onequarter', 'onehalf', 'threequarters', 'questiondown', 'Agrave', 'Aacute', 'Acircumflex', 'Atilde', 'Adieresis', 'Aring', 'AE', 'Ccedilla', 'Egrave', 'Eacute', 'Ecircumflex', 'Edieresis', 'Igrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Eth', 'Ntilde', 'Ograve', 'Oacute', 'Ocircumflex', 'Otilde', 'Odieresis', 'multiply', 'Oslash', 'Ugrave', 'Uacute', 'Ucircumflex', 'Udieresis', 'Yacute', 'Thorn', 'germandbls', 'agrave', 'aacute', 'acircumflex', 'atilde', 'adieresis', 'aring', 'ae', 'ccedilla', 'egrave', 'eacute', 'ecircumflex', 'edieresis', 'igrave', 'iacute', 'icircumflex', 'idieresis', 'eth', 'ntilde', 'ograve', 'oacute', 'ocircumflex', 'otilde', 'odieresis', 'divi
vendor: 6,407 bytes, lines 3903-3987
3903de', 'oslash', 'ugrave', 'uacute', 'ucircumflex', 'udieresis', 'yacute', 'thorn', 'ydieresis']; 3904var SymbolSetEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclam', 'universal', 'numbersign', 'existential', 'percent', 'ampersand', 'suchthat', 'parenleft', 'parenright', 'asteriskmath', 'plus', 'comma', 'minus', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'congruent', 'Alpha', 'Beta', 'Chi', 'Delta', 'Epsilon', 'Phi', 'Gamma', 'Eta', 'Iota', 'theta1', 'Kappa', 'Lambda', 'Mu', 'Nu', 'Omicron', 'Pi', 'Theta', 'Rho', 'Sigma', 'Tau', 'Upsilon', 'sigma1', 'Omega', 'Xi', 'Psi', 'Zeta', 'bracketleft', 'therefore', 'bracketright', 'perpendicular', 'underscore', 'radicalex', 'alpha', 'beta', 'chi', 'delta', 'epsilon', 'phi', 'gamma', 'eta', 'iota', 'phi1', 'kappa', 'lambda', 'mu', 'nu', 'omicron', 'pi', 'theta', 'rho', 'sigma', 'tau', 'upsilon', 'omega1', 'omega', 'xi', 'psi', 'zeta', 'braceleft', 'bar', 'braceright', 'similar', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'Euro', 'Upsilon1', 'minute', 'lessequal', 'fraction', 'infinity', 'florin', 'club', 'diamond', 'heart', 'spade', 'arrowboth', 'arrowleft', 'arrowup', 'arrowright', 'arrowdown', 'degree', 'plusminus', 'second', 'greaterequal', 'multiply', 'proportional', 'partialdiff', 'bullet', 'divide', 'notequal', 'equivalence', 'approxequal', 'ellipsis', 'arrowvertex', 'arrowhorizex', 'carriagereturn', 'aleph', 'Ifraktur', 'Rfraktur', 'weierstrass', 'circlemultiply', 'circleplus', 'emptyset', 'intersection', 'union', 'propersuperset', 'reflexsuperset', 'notsubset', 'propersubset', 'reflexsubset', 'element', 'notelement', 'angle', 'gradient', 'registerserif', 'copyrightserif', 'trademarkserif', 'product', 'radical', 'dotmath', 'logicalnot', 'logicaland', 'logicalor', 'arrowdblboth', 'arrowdblleft', 'arrowdblup', 'arrowdblright', 'arrowdbldown', 'lozenge', 'angleleft', 'registersans', 'copyrightsans', 'trademarksans', 'summation', 'parenlefttp', 'parenleftex', 'parenleftbt', 'bracketlefttp', 'bracketleftex', 'bracketleftbt', 'bracelefttp', 'braceleftmid', 'braceleftbt', 'braceex', '', 'angleright', 'integral', 'integraltp', 'integralex', 'integralbt', 'parenrighttp', 'parenrightex', 'parenrightbt', 'bracketrighttp', 'bracketrightex', 'bracketrightbt', 'bracerighttp', 'bracerightmid', 'bracerightbt', '']; 3905var ZapfDingbatsEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'a1', 'a2', 'a202', 'a3', 'a4', 'a5', 'a119', 'a118', 'a117', 'a11', 'a12', 'a13', 'a14', 'a15', 'a16', 'a105', 'a17', 'a18', 'a19', 'a20', 'a21', 'a22', 'a23', 'a24', 'a25', 'a26', 'a27', 'a28', 'a6', 'a7', 'a8', 'a9', 'a10', 'a29', 'a30', 'a31', 'a32', 'a33', 'a34', 'a35', 'a36', 'a37', 'a38', 'a39', 'a40', 'a41', 'a42', 'a43', 'a44', 'a45', 'a46', 'a47', 'a48', 'a49', 'a50', 'a51', 'a52', 'a53', 'a54', 'a55', 'a56', 'a57', 'a58', 'a59', 'a60', 'a61', 'a62', 'a63', 'a64', 'a65', 'a66', 'a67', 'a68', 'a69', 'a70', 'a71', 'a72', 'a73', 'a74', 'a203', 'a75', 'a204', 'a76', 'a77', 'a78', 'a79', 'a81', 'a82', 'a83', 'a84', 'a97', 'a98', 'a99', 'a100', '', 'a89', 'a90', 'a93', 'a94', 'a91', 'a92', 'a205', 'a85', 'a206', 'a86', 'a87', 'a88', 'a95', 'a96', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'a101', 'a102', 'a103', 'a104', 'a106', 'a107', 'a108', 'a112', 'a111', 'a110', 'a109', 'a120', 'a121', 'a122', 'a123', 'a124', 'a125', 'a126', 'a127', 'a128', 'a129', 'a130', 'a131', 'a132', 'a133', 'a134', 'a135', 'a136', 'a137', 'a138', 'a139', 'a140', 'a141', 'a142', 'a143', 'a144', 'a145', 'a146', 'a147', 'a148', 'a149', 'a150', 'a151', 'a152', 'a153', 'a154', 'a155', 'a156', 'a157', 'a158', 'a159', 'a160', 'a161', 'a163', 'a164', 'a196', 'a165', 'a192', 'a166', 'a167', 'a168', 'a169', 'a170', 'a171', 'a172', 'a173', 'a162', 'a174', 'a175', 'a176', 'a177', 'a178', 'a179', 'a193', 'a180', 'a199', 'a181', 'a200', 'a182', '', 'a201', 'a183', 'a184', 'a197', 'a185', 'a194', 'a198', 'a186', 'a195', 'a187', 'a188', 'a189', 'a190', 'a191', '']; 3906function getEncoding(encodingName) { 3907 switch (encodingName) { 3908 case 'WinAnsiEncoding': 3909 return WinAnsiEncoding; 3910 case 'StandardEncoding': 3911 return StandardEncoding; 3912 case 'MacRomanEncoding': 3913 return MacRomanEncoding; 3914 case 'SymbolSetEncoding': 3915 return SymbolSetEncoding; 3916 case 'ZapfDingbatsEncoding': 3917 return ZapfDingbatsEncoding; 3918 case 'ExpertEncoding': 3919 return ExpertEncoding; 3920 case 'MacExpertEncoding': 3921 return MacExpertEncoding; 3922 default: 3923 return null; 3924 } 3925} 3926exports.WinAnsiEncoding = WinAnsiEncoding; 3927exports.StandardEncoding = StandardEncoding; 3928exports.MacRomanEncoding = MacRomanEncoding; 3929exports.SymbolSetEncoding = SymbolSetEncoding; 3930exports.ZapfDingbatsEncoding = ZapfDingbatsEncoding; 3931exports.ExpertEncoding = ExpertEncoding; 3932exports.getEncoding = getEncoding; 3933 3934/***/ }), 3935/* 22 */ 3936/***/ (function(module, exports, __w_pdfjs_require__) { 3937 3938"use strict"; 3939 3940 3941var id = 0; 3942var px = Math.random(); 3943module.exports = function (key) { 3944 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); 3945}; 3946 3947/***/ }), 3948/* 23 */ 3949/***/ (function(module, exports, __w_pdfjs_require__) { 3950 3951"use strict"; 3952 3953 3954var $keys = __w_pdfjs_require__(79); 3955var enumBugKeys = __w_pdfjs_require__(49); 3956module.exports = Object.keys || function keys(O) { 3957 return $keys(O, enumBugKeys); 3958}; 3959 3960/***/ }), 3961/* 24 */ 3962/***/ (function(module, exports, __w_pdfjs_require__) { 3963 3964"use strict"; 3965 3966 3967var def = __w_pdfjs_require__(15).f; 3968var has = __w_pdfjs_require__(9); 3969var TAG = __w_pdfjs_require__(4)('toStringTag'); 3970module.exports = function (it, tag, stat) { 3971 if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { 3972 configurable: true, 3973 value: tag 3974 }); 3975}; 3976 3977/***/ }), 3978/* 25 */ 3979/***/ (function(module, exports, __w_pdfjs_require__) { 3980 3981"use strict"; 3982 3983 3984var ctx = __w_pdfjs_require__(11); 3985var call = __w_pdfjs_require__(100); 3986var isArrayIter = __w_pdfjs_require__(101); 3987var anObject = __w_pdfjs_require__(8);
3988var toLength = __w_pdfjs_require__(31); 3989var getIterFn = __w_pdfjs_require__(102); 3990var BREAK = {}; 3991var RETURN = {}; 3992var _exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { 3993 var iterFn = ITERATOR ? function () { 3994 return iterable; 3995 } : getIterFn(iterable); 3996 var f = ctx(fn, that, entries ? 2 : 1); 3997 var index = 0; 3998 var length, step, iterator, result; 3999 if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); 4000 if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { 4001 result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); 4002 if (result === BREAK || result === RETURN) return result; 4003 } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { 4004 result = call(iterator, f, step.value, entries); 4005 if (result === BREAK || result === RETURN) return result; 4006 } 4007}; 4008_exports.BREAK = BREAK; 4009_exports.RETURN = RETURN; 4010 4011/***/ }), 4012/* 26 */ 4013/***/ (function(module, exports, __w_pdfjs_require__) { 4014 4015"use strict"; 4016 4017 4018Object.defineProperty(exports, "__esModule", { 4019 value: true 4020}); 4021exports.Parser = exports.Linearization = exports.Lexer = undefined; 4022 4023var _stream = __w_pdfjs_require__(2); 4024 4025var _util = __w_pdfjs_require__(0); 4026 4027var _primitives = __w_pdfjs_require__(1); 4028 4029var _ccitt_stream = __w_pdfjs_require__(128); 4030 4031var _jbig2_stream = __w_pdfjs_require__(130); 4032 4033var _jpeg_stream = __w_pdfjs_require__(41); 4034 4035var _jpx_stream = __w_pdfjs_require__(133); 4036 4037var MAX_LENGTH_TO_CACHE = 1000; 4038var Parser = function ParserClosure() { 4039 function Parser(lexer, allowStreams, xref, recoveryMode) { 4040 this.lexer = lexer; 4041 this.allowStreams = allowStreams; 4042 this.xref = xref; 4043 this.recoveryMode = recoveryMode || false; 4044 this.imageCache = Object.create(null); 4045 this.refill(); 4046 } 4047 Parser.prototype = { 4048 refill: function Parser_refill() { 4049 this.buf1 = this.lexer.getObj(); 4050 this.buf2 = this.lexer.getObj(); 4051 }, 4052 shift: function Parser_shift() { 4053 if ((0, _primitives.isCmd)(this.buf2, 'ID')) { 4054 this.buf1 = this.buf2; 4055 this.buf2 = null; 4056 } else { 4057 this.buf1 = this.buf2; 4058 this.buf2 = this.lexer.getObj(); 4059 } 4060 }, 4061 tryShift: function Parser_tryShift() { 4062 try { 4063 this.shift(); 4064 return true; 4065 } catch (e) { 4066 if (e instanceof _util.MissingDataException) { 4067 throw e; 4068 } 4069 return false; 4070 } 4071 }, 4072 getObj: function Parser_getObj(cipherTransform) { 4073 var buf1 = this.buf1; 4074 this.shift(); 4075 if (buf1 instanceof _primitives.Cmd) { 4076 switch (buf1.cmd) { 4077 case 'BI': 4078 return this.makeInlineImage(cipherTransform); 4079 case '[': 4080 var array = []; 4081 while (!(0, _primitives.isCmd)(this.buf1, ']') && !(0, _primitives.isEOF)(this.buf1)) { 4082 array.push(this.getObj(cipherTransform)); 4083 } 4084 if ((0, _primitives.isEOF)(this.buf1)) { 4085 if (!this.recoveryMode) { 4086 throw new _util.FormatError('End of file inside array'); 4087 } 4088 return array; 4089 } 4090 this.shift(); 4091 return array; 4092 case '<<': 4093 var dict = new _primitives.Dict(this.xref); 4094 while (!(0, _primitives.isCmd)(this.buf1, '>>') && !(0, _primitives.isEOF)(this.buf1)) { 4095 if (!(0, _primitives.isName)(this.buf1)) { 4096 (0, _util.info)('Malformed dictionary: key must be a name object'); 4097 this.shift(); 4098 continue; 4099 } 4100 var key = this.buf1.name; 4101 this.shift(); 4102 if ((0, _primitives.isEOF)(this.buf1)) { 4103 break; 4104 } 4105 dict.set(key, this.getObj(cipherTransform)); 4106 } 4107 if ((0, _primitives.isEOF)(this.buf1)) { 4108 if (!this.recoveryMode) { 4109 throw new _util.FormatError('End of file inside dictionary'); 4110 } 4111 return dict; 4112 } 4113 if ((0, _primitives.isCmd)(this.buf2, 'stream')) { 4114 return this.allowStreams ? this.makeStream(dict, cipherTransform) : dict; 4115 } 4116 this.shift(); 4117 return dict; 4118 default: 4119 return buf1; 4120 } 4121 } 4122 if (Number.isInteger(buf1)) { 4123 var num = buf1; 4124 if (Number.isInteger(this.buf1) && (0, _primitives.isCmd)(this.buf2, 'R')) { 4125 var ref = new _primitives.Ref(num, this.buf1); 4126 this.shift(); 4127 this.shift(); 4128 return ref; 4129 } 4130 return num; 4131 } 4132 if ((0, _util.isString)(buf1)) { 4133 var str = buf1; 4134 if (cipherTransform) { 4135 str = cipherTransform.decryptString(str); 4136 } 4137 return str; 4138 } 4139 return buf1; 4140 }, 4141 findDefaultInlineStreamEnd: function findDefaultInlineStreamEnd(stream) { 4142 var E = 0x45, 4143 I = 0x49, 4144 SPACE = 0x20, 4145 LF = 0xA, 4146 CR = 0xD; 4147 var n = 10, 4148 NUL = 0x0; 4149 var startPos = stream.pos, 4150 state = 0, 4151 ch = void 0, 4152 maybeEIPos = void 0; 4153 while ((ch = stream.getByte()) !== -1) { 4154 if (state === 0) { 4155 state = ch === E ? 1 : 0; 4156 } else if (state === 1) { 4157 state = ch === I ? 2 : 0; 4158 } else { 4159 (0, _util.assert)(state === 2); 4160 if (ch === SPACE || ch === LF || ch === CR) { 4161 maybeEIPos = stream.pos; 4162 var followingBytes = stream.peekBytes(n); 4163 for (var i = 0, ii = followingBytes.length; i < ii; i++) { 4164 ch = followingBytes[i]; 4165 if (ch === NUL && followingBytes[i + 1] !== NUL) { 4166 continue; 4167 } 4168 if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7F)) { 4169 state = 0; 4170 break; 4171 } 4172 } 4173 if (state === 2) { 4174 break; 4175 } 4176 } else { 4177 state = 0; 4178 } 4179 } 4180 } 4181 if (ch === -1) { 4182 (0, _util.warn)('findDefaultInlineStreamEnd: ' + 'Reached the end of the stream without finding a valid EI marker'); 4183 if (maybeEIPos) {
4184 (0, _util.warn)('... trying to recover by using the last "EI" occurrence.'); 4185 stream.skip(-(stream.pos - maybeEIPos)); 4186 } 4187 } 4188 return stream.pos - 4 - startPos; 4189 }, 4190 4191 findDCTDecodeInlineStreamEnd: function Parser_findDCTDecodeInlineStreamEnd(stream) { 4192 var startPos = stream.pos, 4193 foundEOI = false, 4194 b, 4195 markerLength, 4196 length; 4197 while ((b = stream.getByte()) !== -1) { 4198 if (b !== 0xFF) { 4199 continue; 4200 } 4201 switch (stream.getByte()) { 4202 case 0x00: 4203 break; 4204 case 0xFF: 4205 stream.skip(-1); 4206 break; 4207 case 0xD9: 4208 foundEOI = true; 4209 break; 4210 case 0xC0: 4211 case 0xC1: 4212 case 0xC2: 4213 case 0xC3: 4214 case 0xC5: 4215 case 0xC6: 4216 case 0xC7: 4217 case 0xC9: 4218 case 0xCA: 4219 case 0xCB: 4220 case 0xCD: 4221 case 0xCE: 4222 case 0xCF: 4223 case 0xC4: 4224 case 0xCC: 4225 case 0xDA: 4226 case 0xDB: 4227 case 0xDC: 4228 case 0xDD: 4229 case 0xDE: 4230 case 0xDF: 4231 case 0xE0: 4232 case 0xE1: 4233 case 0xE2: 4234 case 0xE3: 4235 case 0xE4: 4236 case 0xE5: 4237 case 0xE6: 4238 case 0xE7: 4239 case 0xE8: 4240 case 0xE9: 4241 case 0xEA: 4242 case 0xEB: 4243 case 0xEC: 4244 case 0xED: 4245 case 0xEE: 4246 case 0xEF: 4247 case 0xFE: 4248 markerLength = stream.getUint16(); 4249 if (markerLength > 2) { 4250 stream.skip(markerLength - 2); 4251 } else { 4252 stream.skip(-2); 4253 } 4254 break; 4255 } 4256 if (foundEOI) { 4257 break; 4258 } 4259 } 4260 length = stream.pos - startPos; 4261 if (b === -1) { 4262 (0, _util.warn)('Inline DCTDecode image stream: ' + 'EOI marker not found, searching for /EI/ instead.'); 4263 stream.skip(-length); 4264 return this.findDefaultInlineStreamEnd(stream); 4265 } 4266 this.inlineStreamSkipEI(stream); 4267 return length; 4268 }, 4269 findASCII85DecodeInlineStreamEnd: function Parser_findASCII85DecodeInlineStreamEnd(stream) { 4270 var TILDE = 0x7E, 4271 GT = 0x3E; 4272 var startPos = stream.pos, 4273 ch, 4274 length; 4275 while ((ch = stream.getByte()) !== -1) { 4276 if (ch === TILDE && stream.peekByte() === GT) { 4277 stream.skip(); 4278 break; 4279 } 4280 } 4281 length = stream.pos - startPos; 4282 if (ch === -1) { 4283 (0, _util.warn)('Inline ASCII85Decode image stream: ' + 'EOD marker not found, searching for /EI/ instead.'); 4284 stream.skip(-length); 4285 return this.findDefaultInlineStreamEnd(stream); 4286 } 4287 this.inlineStreamSkipEI(stream); 4288 return length; 4289 }, 4290 findASCIIHexDecodeInlineStreamEnd: function Parser_findASCIIHexDecodeInlineStreamEnd(stream) { 4291 var GT = 0x3E; 4292 var startPos = stream.pos, 4293 ch, 4294 length; 4295 while ((ch = stream.getByte()) !== -1) { 4296 if (ch === GT) { 4297 break; 4298 } 4299 } 4300 length = stream.pos - startPos; 4301 if (ch === -1) { 4302 (0, _util.warn)('Inline ASCIIHexDecode image stream: ' + 'EOD marker not found, searching for /EI/ instead.'); 4303 stream.skip(-length); 4304 return this.findDefaultInlineStreamEnd(stream); 4305 } 4306 this.inlineStreamSkipEI(stream); 4307 return length; 4308 }, 4309 inlineStreamSkipEI: function Parser_inlineStreamSkipEI(stream) { 4310 var E = 0x45, 4311 I = 0x49; 4312 var state = 0, 4313 ch; 4314 while ((ch = stream.getByte()) !== -1) { 4315 if (state === 0) { 4316 state = ch === E ? 1 : 0; 4317 } else if (state === 1) { 4318 state = ch === I ? 2 : 0; 4319 } else if (state === 2) { 4320 break; 4321 } 4322 } 4323 }, 4324 makeInlineImage: function Parser_makeInlineImage(cipherTransform) { 4325 var lexer = this.lexer; 4326 var stream = lexer.stream; 4327 var dict = new _primitives.Dict(this.xref); 4328 while (!(0, _primitives.isCmd)(this.buf1, 'ID') && !(0, _primitives.isEOF)(this.buf1)) { 4329 if (!(0, _primitives.isName)(this.buf1)) { 4330 throw new _util.FormatError('Dictionary key must be a name object'); 4331 } 4332 var key = this.buf1.name; 4333 this.shift(); 4334 if ((0, _primitives.isEOF)(this.buf1)) { 4335 break; 4336 } 4337 dict.set(key, this.getObj(cipherTransform)); 4338 } 4339 var filter = dict.get('Filter', 'F'), 4340 filterName; 4341 if ((0, _primitives.isName)(filter)) { 4342 filterName = filter.name; 4343 } else if (Array.isArray(filter)) { 4344 var filterZero = this.xref.fetchIfRef(filter[0]); 4345 if ((0, _primitives.isName)(filterZero)) { 4346 filterName = filterZero.name; 4347 } 4348 } 4349 var startPos = stream.pos, 4350 length, 4351 i, 4352 ii; 4353 if (filterName === 'DCTDecode' || filterName === 'DCT') { 4354 length = this.findDCTDecodeInlineStreamEnd(stream); 4355 } else if (filterName === 'ASCII85Decode' || filterName === 'A85') { 4356 length = this.findASCII85DecodeInlineStreamEnd(stream); 4357 } else if (filterName === 'ASCIIHexDecode' || filterName === 'AHx') { 4358 length = this.findASCIIHexDecodeInlineStreamEnd(stream); 4359 } else { 4360 length = this.findDefaultInlineStreamEnd(stream); 4361 } 4362 var imageStream = stream.makeSubStream(startPos, length, dict); 4363 var adler32; 4364 if (length < MAX_LENGTH_TO_CACHE) { 4365 var imageBytes = imageStream.getBytes(); 4366 imageStream.reset(); 4367 var a = 1; 4368 var b = 0; 4369 for (i = 0, ii = imageBytes.length; i < ii; ++i) { 4370 a += imageBytes[i] & 0xff; 4371 b += a; 4372 } 4373 adler32 = b % 65521 << 16 | a % 65521; 4374 var cacheEntry = this.imageCache[adler32]; 4375 if (cacheEntry !== undefined) { 4376 this.buf2 = _primitives.Cmd.get('EI'); 4377 this.shift(); 4378 cacheEntry.reset(); 4379 return cacheEntry; 4380 } 4381 } 4382 if (cipherTransform) { 4383 imageStream = cipherTransform.createStream(imageStream, length); 4384 } 4385 imageStream = this.filter(imageStream, dict, length); 4386 imageStream.dict = dict; 4387 if (adler32 !== undefined) { 4388 imageStream.cacheKey = 'inline_' + length + '_' + adler32; 4389 this.imageCache[adler32] = imageStream; 4390 } 4391 this.buf2 = _primitives.Cmd.get('EI'); 4392 this.shift(); 4393 return imageStream; 4394 }, 4395 makeStream: function Parser_makeStream(dict, cipherTransform) { 4396 var lexer = this.lexer; 4397 var stream = lexer.stream; 4398 lexer.skipToNextLine(); 4399 var pos = stream.pos - 1; 4400 var length = dict.get('Length'); 4401 if (!Number.isInteger(length)) { 4402 (0, _util.info)('Bad ' + length + ' attribute in stream'); 4403 length = 0; 4404 } 4405 stream.pos = pos + length; 4406 lexer.nextChar(); 4407 if (this.tryShift() && (0, _primitives.isCmd)(this.buf2, 'endstream')) { 4408 this.shift(); 4409 } else { 4410 stream.pos = pos; 4411 var SCAN_BLOCK_SIZE = 2048; 4412 var ENDSTREAM_SIGNATURE_LENGTH = 9; 4413 var ENDSTREAM_SIGNATURE = [0x65, 0x6E, 0x64, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6D]; 4414 var skipped = 0, 4415 found = false, 4416 i, 4417 j; 4418 while (stream.pos < stream.end) { 4419 var scanBytes = stream.peekBytes(SCAN_BLOCK_SIZE); 4420 var scanLength = scanBytes.length - ENDSTREAM_SIGNATURE_LENGTH; 4421 if (scanLength <= 0) { 4422 break; 4423 } 4424 found = false; 4425 i = 0; 4426 while (i < scanLength) { 4427 j = 0; 4428 while (j < ENDSTREAM_SIGNATURE_LENGTH && scanBytes[i + j] === ENDSTREAM_SIGNATURE[j]) { 4429 j++; 4430 } 4431 if (j >= ENDSTREAM_SIGNATURE_LENGTH) { 4432 found = true; 4433 break; 4434 } 4435 i++; 4436 } 4437 if (found) { 4438 skipped += i; 4439 stream.pos += i; 4440 break; 4441 } 4442 skipped += scanLength; 4443 stream.pos += scanLength; 4444 } 4445 if (!found) { 4446 throw new _util.FormatError('Missing endstream'); 4447 } 4448 length = skipped; 4449 lexer.nextChar(); 4450 this.shift(); 4451 this.shift(); 4452 } 4453 this.shift(); 4454 stream = stream.makeSubStream(pos, length, dict); 4455 if (cipherTransform) { 4456 stream = cipherTransform.createStream(stream, length); 4457 } 4458 stream = this.filter(stream, dict, length); 4459 stream.dict = dict; 4460 return stream; 4461 }, 4462 filter: function Parser_filter(stream, dict, length) { 4463 var filter = dict.get('Filter', 'F'); 4464 var params = dict.get('DecodeParms', 'DP'); 4465 if ((0, _primitives.isName)(filter)) { 4466 if (Array.isArray(params)) { 4467 (0, _util.warn)('/DecodeParms should not contain an Array, ' + 'when /Filter contains a Name.'); 4468 } 4469 return this.makeFilter(stream, filter.name, length, params); 4470 } 4471 var maybeLength = length; 4472 if (Array.isArray(filter)) { 4473 var filterArray = filter; 4474 var paramsArray = params; 4475 for (var i = 0, ii = filterArray.length; i < ii; ++i) { 4476 filter = this.xref.fetchIfRef(filterArray[i]); 4477 if (!(0, _primitives.isName)(filter)) { 4478 throw new _util.FormatError('Bad filter name: ' + filter); 4479 } 4480 params = null; 4481 if (Array.isArray(paramsArray) && i in paramsArray) { 4482 params = this.xref.fetchIfRef(paramsArray[i]); 4483 } 4484 stream = this.makeFilter(stream, filter.name, maybeLength, params); 4485 maybeLength = null; 4486 } 4487 } 4488 return stream; 4489 }, 4490 makeFilter: function Parser_makeFilter(stream, name, maybeLength, params) { 4491 if (maybeLength === 0) {
vendor: 10,584 bytes, lines 4492-4784
4492 (0, _util.warn)('Empty "' + name + '" stream.'); 4493 return new _stream.NullStream(); 4494 } 4495 try { 4496 var xrefStreamStats = this.xref.stats.streamTypes; 4497 if (name === 'FlateDecode' || name === 'Fl') { 4498 xrefStreamStats[_util.StreamType.FLATE] = true; 4499 if (params) { 4500 return new _stream.PredictorStream(new _stream.FlateStream(stream, maybeLength), maybeLength, params); 4501 } 4502 return new _stream.FlateStream(stream, maybeLength); 4503 } 4504 if (name === 'LZWDecode' || name === 'LZW') { 4505 xrefStreamStats[_util.StreamType.LZW] = true; 4506 var earlyChange = 1; 4507 if (params) { 4508 if (params.has('EarlyChange')) { 4509 earlyChange = params.get('EarlyChange'); 4510 } 4511 return new _stream.PredictorStream(new _stream.LZWStream(stream, maybeLength, earlyChange), maybeLength, params); 4512 } 4513 return new _stream.LZWStream(stream, maybeLength, earlyChange); 4514 } 4515 if (name === 'DCTDecode' || name === 'DCT') { 4516 xrefStreamStats[_util.StreamType.DCT] = true; 4517 return new _jpeg_stream.JpegStream(stream, maybeLength, stream.dict, params); 4518 } 4519 if (name === 'JPXDecode' || name === 'JPX') { 4520 xrefStreamStats[_util.StreamType.JPX] = true; 4521 return new _jpx_stream.JpxStream(stream, maybeLength, stream.dict, params); 4522 } 4523 if (name === 'ASCII85Decode' || name === 'A85') { 4524 xrefStreamStats[_util.StreamType.A85] = true; 4525 return new _stream.Ascii85Stream(stream, maybeLength); 4526 } 4527 if (name === 'ASCIIHexDecode' || name === 'AHx') { 4528 xrefStreamStats[_util.StreamType.AHX] = true; 4529 return new _stream.AsciiHexStream(stream, maybeLength); 4530 } 4531 if (name === 'CCITTFaxDecode' || name === 'CCF') { 4532 xrefStreamStats[_util.StreamType.CCF] = true; 4533 return new _ccitt_stream.CCITTFaxStream(stream, maybeLength, params); 4534 } 4535 if (name === 'RunLengthDecode' || name === 'RL') { 4536 xrefStreamStats[_util.StreamType.RL] = true; 4537 return new _stream.RunLengthStream(stream, maybeLength); 4538 } 4539 if (name === 'JBIG2Decode') { 4540 xrefStreamStats[_util.StreamType.JBIG] = true; 4541 return new _jbig2_stream.Jbig2Stream(stream, maybeLength, stream.dict, params); 4542 } 4543 (0, _util.warn)('filter "' + name + '" not supported yet'); 4544 return stream; 4545 } catch (ex) { 4546 if (ex instanceof _util.MissingDataException) { 4547 throw ex; 4548 } 4549 (0, _util.warn)('Invalid stream: \"' + ex + '\"'); 4550 return new _stream.NullStream(); 4551 } 4552 } 4553 }; 4554 return Parser; 4555}(); 4556var Lexer = function LexerClosure() { 4557 function Lexer(stream, knownCommands) { 4558 this.stream = stream; 4559 this.nextChar(); 4560 this.strBuf = []; 4561 this.knownCommands = knownCommands; 4562 } 4563 var specialChars = [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; 4564 function toHexDigit(ch) { 4565 if (ch >= 0x30 && ch <= 0x39) { 4566 return ch & 0x0F; 4567 } 4568 if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { 4569 return (ch & 0x0F) + 9; 4570 } 4571 return -1; 4572 } 4573 Lexer.prototype = { 4574 nextChar: function Lexer_nextChar() { 4575 return this.currentChar = this.stream.getByte(); 4576 }, 4577 peekChar: function Lexer_peekChar() { 4578 return this.stream.peekByte(); 4579 }, 4580 getNumber: function Lexer_getNumber() { 4581 var ch = this.currentChar; 4582 var eNotation = false; 4583 var divideBy = 0; 4584 var sign = 1; 4585 if (ch === 0x2D) { 4586 sign = -1; 4587 ch = this.nextChar(); 4588 if (ch === 0x2D) { 4589 ch = this.nextChar(); 4590 } 4591 } else if (ch === 0x2B) { 4592 ch = this.nextChar(); 4593 } 4594 if (ch === 0x2E) { 4595 divideBy = 10; 4596 ch = this.nextChar(); 4597 } 4598 if (ch === 0x0A || ch === 0x0D) { 4599 do { 4600 ch = this.nextChar(); 4601 } while (ch === 0x0A || ch === 0x0D); 4602 } 4603 if (ch < 0x30 || ch > 0x39) { 4604 throw new _util.FormatError('Invalid number: ' + String.fromCharCode(ch) + ' (charCode ' + ch + ')'); 4605 } 4606 var baseValue = ch - 0x30; 4607 var powerValue = 0; 4608 var powerValueSign = 1; 4609 while ((ch = this.nextChar()) >= 0) { 4610 if (0x30 <= ch && ch <= 0x39) { 4611 var currentDigit = ch - 0x30; 4612 if (eNotation) { 4613 powerValue = powerValue * 10 + currentDigit; 4614 } else { 4615 if (divideBy !== 0) { 4616 divideBy *= 10; 4617 } 4618 baseValue = baseValue * 10 + currentDigit; 4619 } 4620 } else if (ch === 0x2E) { 4621 if (divideBy === 0) { 4622 divideBy = 1; 4623 } else { 4624 break; 4625 } 4626 } else if (ch === 0x2D) { 4627 (0, _util.warn)('Badly formatted number'); 4628 } else if (ch === 0x45 || ch === 0x65) { 4629 ch = this.peekChar(); 4630 if (ch === 0x2B || ch === 0x2D) { 4631 powerValueSign = ch === 0x2D ? -1 : 1; 4632 this.nextChar(); 4633 } else if (ch < 0x30 || ch > 0x39) { 4634 break; 4635 } 4636 eNotation = true; 4637 } else { 4638 break; 4639 } 4640 } 4641 if (divideBy !== 0) { 4642 baseValue /= divideBy; 4643 } 4644 if (eNotation) { 4645 baseValue *= Math.pow(10, powerValueSign * powerValue); 4646 } 4647 return sign * baseValue; 4648 }, 4649 getString: function Lexer_getString() { 4650 var numParen = 1; 4651 var done = false; 4652 var strBuf = this.strBuf; 4653 strBuf.length = 0; 4654 var ch = this.nextChar(); 4655 while (true) { 4656 var charBuffered = false; 4657 switch (ch | 0) { 4658 case -1: 4659 (0, _util.warn)('Unterminated string'); 4660 done = true; 4661 break; 4662 case 0x28: 4663 ++numParen; 4664 strBuf.push('('); 4665 break; 4666 case 0x29: 4667 if (--numParen === 0) { 4668 this.nextChar(); 4669 done = true; 4670 } else { 4671 strBuf.push(')'); 4672 } 4673 break; 4674 case 0x5C: 4675 ch = this.nextChar(); 4676 switch (ch) { 4677 case -1: 4678 (0, _util.warn)('Unterminated string'); 4679 done = true; 4680 break; 4681 case 0x6E: 4682 strBuf.push('\n'); 4683 break; 4684 case 0x72: 4685 strBuf.push('\r'); 4686 break; 4687 case 0x74: 4688 strBuf.push('\t'); 4689 break; 4690 case 0x62: 4691 strBuf.push('\b'); 4692 break; 4693 case 0x66: 4694 strBuf.push('\f'); 4695 break; 4696 case 0x5C: 4697 case 0x28: 4698 case 0x29: 4699 strBuf.push(String.fromCharCode(ch)); 4700 break; 4701 case 0x30: 4702 case 0x31: 4703 case 0x32: 4704 case 0x33: 4705 case 0x34: 4706 case 0x35: 4707 case 0x36: 4708 case 0x37: 4709 var x = ch & 0x0F; 4710 ch = this.nextChar(); 4711 charBuffered = true; 4712 if (ch >= 0x30 && ch <= 0x37) { 4713 x = (x << 3) + (ch & 0x0F); 4714 ch = this.nextChar(); 4715 if (ch >= 0x30 && ch <= 0x37) { 4716 charBuffered = false; 4717 x = (x << 3) + (ch & 0x0F); 4718 } 4719 } 4720 strBuf.push(String.fromCharCode(x)); 4721 break; 4722 case 0x0D: 4723 if (this.peekChar() === 0x0A) { 4724 this.nextChar(); 4725 } 4726 break; 4727 case 0x0A: 4728 break; 4729 default: 4730 strBuf.push(String.fromCharCode(ch)); 4731 break; 4732 } 4733 break; 4734 default: 4735 strBuf.push(String.fromCharCode(ch)); 4736 break; 4737 } 4738 if (done) { 4739 break; 4740 } 4741 if (!charBuffered) { 4742 ch = this.nextChar(); 4743 } 4744 } 4745 return strBuf.join(''); 4746 }, 4747 getName: function Lexer_getName() { 4748 var ch, previousCh; 4749 var strBuf = this.strBuf; 4750 strBuf.length = 0; 4751 while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { 4752 if (ch === 0x23) { 4753 ch = this.nextChar(); 4754 if (specialChars[ch]) { 4755 (0, _util.warn)('Lexer_getName: ' + 'NUMBER SIGN (#) should be followed by a hexadecimal number.'); 4756 strBuf.push('#'); 4757 break; 4758 } 4759 var x = toHexDigit(ch); 4760 if (x !== -1) { 4761 previousCh = ch; 4762 ch = this.nextChar(); 4763 var x2 = toHexDigit(ch); 4764 if (x2 === -1) { 4765 (0, _util.warn)('Lexer_getName: Illegal digit (' + String.fromCharCode(ch) + ') in hexadecimal number.'); 4766 strBuf.push('#', String.fromCharCode(previousCh)); 4767 if (specialChars[ch]) { 4768 break; 4769 } 4770 strBuf.push(String.fromCharCode(ch)); 4771 continue; 4772 } 4773 strBuf.push(String.fromCharCode(x << 4 | x2)); 4774 } else { 4775 strBuf.push('#', String.fromCharCode(ch)); 4776 } 4777 } else { 4778 strBuf.push(String.fromCharCode(ch)); 4779 } 4780 } 4781 if (strBuf.length > 127) { 4782 (0, _util.warn)('name token is longer than allowed by the spec: ' + strBuf.length); 4783 } 4784 return _primitives.Name.get(strBuf.join(''));
vendor: 4,465 bytes, lines 4785-4936
4785 }, 4786 getHexString: function Lexer_getHexString() { 4787 var strBuf = this.strBuf; 4788 strBuf.length = 0; 4789 var ch = this.currentChar; 4790 var isFirstHex = true; 4791 var firstDigit; 4792 var secondDigit; 4793 while (true) { 4794 if (ch < 0) { 4795 (0, _util.warn)('Unterminated hex string'); 4796 break; 4797 } else if (ch === 0x3E) { 4798 this.nextChar(); 4799 break; 4800 } else if (specialChars[ch] === 1) { 4801 ch = this.nextChar(); 4802 continue; 4803 } else { 4804 if (isFirstHex) { 4805 firstDigit = toHexDigit(ch); 4806 if (firstDigit === -1) { 4807 (0, _util.warn)('Ignoring invalid character "' + ch + '" in hex string'); 4808 ch = this.nextChar(); 4809 continue; 4810 } 4811 } else { 4812 secondDigit = toHexDigit(ch); 4813 if (secondDigit === -1) { 4814 (0, _util.warn)('Ignoring invalid character "' + ch + '" in hex string'); 4815 ch = this.nextChar(); 4816 continue; 4817 } 4818 strBuf.push(String.fromCharCode(firstDigit << 4 | secondDigit)); 4819 } 4820 isFirstHex = !isFirstHex; 4821 ch = this.nextChar(); 4822 } 4823 } 4824 return strBuf.join(''); 4825 }, 4826 getObj: function Lexer_getObj() { 4827 var comment = false; 4828 var ch = this.currentChar; 4829 while (true) { 4830 if (ch < 0) { 4831 return _primitives.EOF; 4832 } 4833 if (comment) { 4834 if (ch === 0x0A || ch === 0x0D) { 4835 comment = false; 4836 } 4837 } else if (ch === 0x25) { 4838 comment = true; 4839 } else if (specialChars[ch] !== 1) { 4840 break; 4841 } 4842 ch = this.nextChar(); 4843 } 4844 switch (ch | 0) { 4845 case 0x30: 4846 case 0x31: 4847 case 0x32: 4848 case 0x33: 4849 case 0x34: 4850 case 0x35: 4851 case 0x36: 4852 case 0x37: 4853 case 0x38: 4854 case 0x39: 4855 case 0x2B: 4856 case 0x2D: 4857 case 0x2E: 4858 return this.getNumber(); 4859 case 0x28: 4860 return this.getString(); 4861 case 0x2F: 4862 return this.getName(); 4863 case 0x5B: 4864 this.nextChar(); 4865 return _primitives.Cmd.get('['); 4866 case 0x5D: 4867 this.nextChar(); 4868 return _primitives.Cmd.get(']'); 4869 case 0x3C: 4870 ch = this.nextChar(); 4871 if (ch === 0x3C) { 4872 this.nextChar(); 4873 return _primitives.Cmd.get('<<'); 4874 } 4875 return this.getHexString(); 4876 case 0x3E: 4877 ch = this.nextChar(); 4878 if (ch === 0x3E) { 4879 this.nextChar(); 4880 return _primitives.Cmd.get('>>'); 4881 } 4882 return _primitives.Cmd.get('>'); 4883 case 0x7B: 4884 this.nextChar(); 4885 return _primitives.Cmd.get('{'); 4886 case 0x7D: 4887 this.nextChar(); 4888 return _primitives.Cmd.get('}'); 4889 case 0x29: 4890 this.nextChar(); 4891 throw new _util.FormatError('Illegal character: ' + ch); 4892 } 4893 var str = String.fromCharCode(ch); 4894 var knownCommands = this.knownCommands; 4895 var knownCommandFound = knownCommands && knownCommands[str] !== undefined; 4896 while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { 4897 var possibleCommand = str + String.fromCharCode(ch); 4898 if (knownCommandFound && knownCommands[possibleCommand] === undefined) { 4899 break; 4900 } 4901 if (str.length === 128) { 4902 throw new _util.FormatError('Command token too long: ' + str.length); 4903 } 4904 str = possibleCommand; 4905 knownCommandFound = knownCommands && knownCommands[str] !== undefined; 4906 } 4907 if (str === 'true') { 4908 return true; 4909 } 4910 if (str === 'false') { 4911 return false; 4912 } 4913 if (str === 'null') { 4914 return null; 4915 } 4916 return _primitives.Cmd.get(str); 4917 }, 4918 skipToNextLine: function Lexer_skipToNextLine() { 4919 var ch = this.currentChar; 4920 while (ch >= 0) { 4921 if (ch === 0x0D) { 4922 ch = this.nextChar(); 4923 if (ch === 0x0A) { 4924 this.nextChar(); 4925 } 4926 break; 4927 } else if (ch === 0x0A) { 4928 this.nextChar(); 4929 break; 4930 } 4931 ch = this.nextChar(); 4932 } 4933 } 4934 }; 4935 return Lexer; 4936}();
4937var Linearization = { 4938 create: function LinearizationCreate(stream) { 4939 function getInt(name, allowZeroValue) { 4940 var obj = linDict.get(name); 4941 if (Number.isInteger(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) { 4942 return obj; 4943 } 4944 throw new Error('The "' + name + '" parameter in the linearization ' + 'dictionary is invalid.'); 4945 } 4946 function getHints() { 4947 var hints = linDict.get('H'), 4948 hintsLength, 4949 item; 4950 if (Array.isArray(hints) && ((hintsLength = hints.length) === 2 || hintsLength === 4)) { 4951 for (var index = 0; index < hintsLength; index++) { 4952 if (!(Number.isInteger(item = hints[index]) && item > 0)) { 4953 throw new Error('Hint (' + index + ') in the linearization dictionary is invalid.'); 4954 } 4955 } 4956 return hints; 4957 } 4958 throw new Error('Hint array in the linearization dictionary is invalid.'); 4959 } 4960 var parser = new Parser(new Lexer(stream), false, null); 4961 var obj1 = parser.getObj(); 4962 var obj2 = parser.getObj(); 4963 var obj3 = parser.getObj(); 4964 var linDict = parser.getObj(); 4965 var obj, length; 4966 if (!(Number.isInteger(obj1) && Number.isInteger(obj2) && (0, _primitives.isCmd)(obj3, 'obj') && (0, _primitives.isDict)(linDict) && (0, _util.isNum)(obj = linDict.get('Linearized')) && obj > 0)) { 4967 return null; 4968 } else if ((length = getInt('L')) !== stream.length) { 4969 throw new Error('The "L" parameter in the linearization dictionary ' + 'does not equal the stream length.'); 4970 } 4971 return { 4972 length: length, 4973 hints: getHints(), 4974 objectNumberFirst: getInt('O'), 4975 endFirst: getInt('E'), 4976 numPages: getInt('N'), 4977 mainXRefEntriesOffset: getInt('T'), 4978 pageFirst: linDict.has('P') ? getInt('P', true) : 0 4979 }; 4980 } 4981}; 4982exports.Lexer = Lexer; 4983exports.Linearization = Linearization; 4984exports.Parser = Parser; 4985 4986/***/ }), 4987/* 27 */ 4988/***/ (function(module, exports, __w_pdfjs_require__) { 4989 4990"use strict"; 4991 4992 4993var isObject = __w_pdfjs_require__(3); 4994var document = __w_pdfjs_require__(5).document; 4995var is = isObject(document) && isObject(document.createElement); 4996module.exports = function (it) { 4997 return is ? document.createElement(it) : {}; 4998}; 4999 5000/***/ }), 5001/* 28 */ 5002/***/ (function(module, exports, __w_pdfjs_require__) { 5003 5004"use strict"; 5005 5006 5007module.exports = function (bitmap, value) { 5008 return { 5009 enumerable: !(bitmap & 1), 5010 configurable: !(bitmap & 2), 5011 writable: !(bitmap & 4), 5012 value: value 5013 }; 5014}; 5015 5016/***/ }), 5017/* 29 */ 5018/***/ (function(module, exports, __w_pdfjs_require__) { 5019 5020"use strict"; 5021 5022 5023var cof = __w_pdfjs_require__(18); 5024module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { 5025 return cof(it) == 'String' ? it.split('') : Object(it); 5026}; 5027 5028/***/ }), 5029/* 30 */ 5030/***/ (function(module, exports, __w_pdfjs_require__) { 5031 5032"use strict"; 5033 5034 5035module.exports = function (it) { 5036 if (it == undefined) throw TypeError("Can't call method on " + it); 5037 return it; 5038}; 5039 5040/***/ }), 5041/* 31 */ 5042/***/ (function(module, exports, __w_pdfjs_require__) { 5043 5044"use strict"; 5045 5046 5047var toInteger = __w_pdfjs_require__(32); 5048var min = Math.min; 5049module.exports = function (it) { 5050 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; 5051}; 5052 5053/***/ }), 5054/* 32 */ 5055/***/ (function(module, exports, __w_pdfjs_require__) { 5056 5057"use strict"; 5058 5059 5060var ceil = Math.ceil; 5061var floor = Math.floor; 5062module.exports = function (it) { 5063 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); 5064}; 5065 5066/***/ }), 5067/* 33 */ 5068/***/ (function(module, exports, __w_pdfjs_require__) { 5069 5070"use strict"; 5071 5072 5073var shared = __w_pdfjs_require__(48)('keys'); 5074var uid = __w_pdfjs_require__(22); 5075module.exports = function (key) {
5076 return shared[key] || (shared[key] = uid(key)); 5077}; 5078 5079/***/ }), 5080/* 34 */ 5081/***/ (function(module, exports, __w_pdfjs_require__) { 5082 5083"use strict"; 5084 5085 5086exports.f = {}.propertyIsEnumerable; 5087 5088/***/ }), 5089/* 35 */ 5090/***/ (function(module, exports, __w_pdfjs_require__) { 5091 5092"use strict"; 5093 5094 5095var cof = __w_pdfjs_require__(18); 5096var TAG = __w_pdfjs_require__(4)('toStringTag'); 5097var ARG = cof(function () { 5098 return arguments; 5099}()) == 'Arguments'; 5100var tryGet = function tryGet(it, key) { 5101 try { 5102 return it[key]; 5103 } catch (e) {} 5104}; 5105module.exports = function (it) { 5106 var O, T, B; 5107 return it === undefined ? 'Undefined' : it === null ? 'Null' : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T : ARG ? cof(O) : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; 5108}; 5109 5110/***/ }), 5111/* 36 */ 5112/***/ (function(module, exports, __w_pdfjs_require__) { 5113 5114"use strict"; 5115 5116 5117var defined = __w_pdfjs_require__(30); 5118module.exports = function (it) { 5119 return Object(defined(it)); 5120}; 5121 5122/***/ }), 5123/* 37 */ 5124/***/ (function(module, exports, __w_pdfjs_require__) { 5125 5126"use strict"; 5127 5128 5129module.exports = function (it, Constructor, name, forbiddenField) { 5130 if (!(it instanceof Constructor) || forbiddenField !== undefined && forbiddenField in it) { 5131 throw TypeError(name + ': incorrect invocation!'); 5132 } 5133 return it; 5134}; 5135 5136/***/ }), 5137/* 38 */ 5138/***/ (function(module, exports, __w_pdfjs_require__) { 5139 5140"use strict"; 5141 5142 5143var aFunction = __w_pdfjs_require__(16); 5144function PromiseCapability(C) { 5145 var resolve, reject; 5146 this.promise = new C(function ($$resolve, $$reject) { 5147 if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); 5148 resolve = $$resolve; 5149 reject = $$reject; 5150 }); 5151 this.resolve = aFunction(resolve); 5152 this.reject = aFunction(reject); 5153} 5154module.exports.f = function (C) { 5155 return new PromiseCapability(C); 5156}; 5157 5158/***/ }), 5159/* 39 */ 5160/***/ (function(module, exports, __w_pdfjs_require__) { 5161 5162"use strict"; 5163 5164 5165var redefine = __w_pdfjs_require__(10); 5166module.exports = function (target, src, safe) { 5167 for (var key in src) { 5168 redefine(target, key, src[key], safe); 5169 }return target; 5170}; 5171 5172/***/ }), 5173/* 40 */ 5174/***/ (function(module, exports, __w_pdfjs_require__) { 5175 5176"use strict"; 5177 5178 5179var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 5180 5181var META = __w_pdfjs_require__(22)('meta'); 5182var isObject = __w_pdfjs_require__(3); 5183var has = __w_pdfjs_require__(9); 5184var setDesc = __w_pdfjs_require__(15).f; 5185var id = 0; 5186var isExtensible = Object.isExtensible || function () { 5187 return true; 5188}; 5189var FREEZE = !__w_pdfjs_require__(14)(function () { 5190 return isExtensible(Object.preventExtensions({})); 5191}); 5192var setMeta = function setMeta(it) { 5193 setDesc(it, META, { 5194 value: { 5195 i: 'O' + ++id, 5196 w: {} 5197 } 5198 }); 5199}; 5200var fastKey = function fastKey(it, create) { 5201 if (!isObject(it)) return (typeof it === 'undefined' ? 'undefined' : _typeof(it)) == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; 5202 if (!has(it, META)) { 5203 if (!isExtensible(it)) return 'F'; 5204 if (!create) return 'E'; 5205 setMeta(it); 5206 } 5207 return it[META].i; 5208}; 5209var getWeak = function getWeak(it, create) { 5210 if (!has(it, META)) { 5211 if (!isExtensible(it)) return true; 5212 if (!create) return false; 5213 setMeta(it); 5214 } 5215 return it[META].w; 5216}; 5217var onFreeze = function onFreeze(it) { 5218 if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); 5219 return it; 5220}; 5221var meta = module.exports = { 5222 KEY: META, 5223 NEED: false, 5224 fastKey: fastKey, 5225 getWeak: getWeak, 5226 onFreeze: onFreeze 5227}; 5228 5229/***/ }), 5230/* 41 */ 5231/***/ (function(module, exports, __w_pdfjs_require__) { 5232 5233"use strict"; 5234 5235 5236Object.defineProperty(exports, "__esModule", { 5237 value: true 5238}); 5239exports.JpegStream = undefined; 5240 5241var _util = __w_pdfjs_require__(0); 5242 5243var _stream = __w_pdfjs_require__(2); 5244 5245var _primitives = __w_pdfjs_require__(1); 5246 5247var _jpg = __w_pdfjs_require__(132); 5248 5249var JpegStream = function JpegStreamClosure() { 5250 function JpegStream(stream, maybeLength, dict, params) { 5251 var ch = void 0; 5252 while ((ch = stream.getByte()) !== -1) { 5253 if (ch === 0xFF) { 5254 stream.skip(-1); 5255 break; 5256 } 5257 } 5258 this.stream = stream; 5259 this.maybeLength = maybeLength; 5260 this.dict = dict; 5261 this.params = params; 5262 _stream.DecodeStream.call(this, maybeLength); 5263 } 5264 JpegStream.prototype = Object.create(_stream.DecodeStream.prototype); 5265 Object.defineProperty(JpegStream.prototype, 'bytes', { 5266 get: function JpegStream_bytes() { 5267 return (0, _util.shadow)(this, 'bytes', this.stream.getBytes(this.maybeLength)); 5268 }, 5269 configurable: true 5270 }); 5271 JpegStream.prototype.ensureBuffer = function (requested) {}; 5272 JpegStream.prototype.readBlock = function () { 5273 if (this.eof) { 5274 return; 5275 } 5276 var jpegImage = new _jpg.JpegImage(); 5277 var decodeArr = this.dict.getArray('Decode', 'D'); 5278 if (this.forceRGB && Array.isArray(decodeArr)) { 5279 var bitsPerComponent = this.dict.get('BitsPerComponent') || 8; 5280 var decodeArrLength = decodeArr.length; 5281 var transform = new Int32Array(decodeArrLength); 5282 var transformNeeded = false; 5283 var maxValue = (1 << bitsPerComponent) - 1; 5284 for (var i = 0; i < decodeArrLength; i += 2) { 5285 transform[i] = (decodeArr[i + 1] - decodeArr[i]) * 256 | 0; 5286 transform[i + 1] = decodeArr[i] * maxValue | 0; 5287 if (transform[i] !== 256 || transform[i + 1] !== 0) { 5288 transformNeeded = true; 5289 } 5290 } 5291 if (transformNeeded) { 5292 jpegImage.decodeTransform = transform; 5293 } 5294 } 5295 if ((0, _primitives.isDict)(this.params)) { 5296 var colorTransform = this.params.get('ColorTransform'); 5297 if (Number.isInteger(colorTransform)) { 5298 jpegImage.colorTransform = colorTransform; 5299 } 5300 } 5301 jpegImage.parse(this.bytes); 5302 var data = jpegImage.getData(this.drawWidth, this.drawHeight, this.forceRGB); 5303 this.buffer = data; 5304 this.bufferLength = data.length; 5305 this.eof = true; 5306 }; 5307 JpegStream.prototype.getIR = function () { 5308 var forceDataSchema = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 5309 5310 return (0, _util.createObjectURL)(this.bytes, 'image/jpeg', forceDataSchema); 5311 }; 5312 return JpegStream; 5313}();
vendor: 8,440 bytes, lines 5314-5529
5314exports.JpegStream = JpegStream; 5315 5316/***/ }), 5317/* 42 */ 5318/***/ (function(module, exports, __w_pdfjs_require__) { 5319 5320"use strict"; 5321 5322 5323Object.defineProperty(exports, "__esModule", { 5324 value: true 5325}); 5326exports.OperatorList = undefined; 5327 5328var _util = __w_pdfjs_require__(0); 5329 5330var QueueOptimizer = function QueueOptimizerClosure() { 5331 function addState(parentState, pattern, checkFn, iterateFn, processFn) { 5332 var state = parentState; 5333 for (var i = 0, ii = pattern.length - 1; i < ii; i++) { 5334 var item = pattern[i]; 5335 state = state[item] || (state[item] = []); 5336 } 5337 state[pattern[pattern.length - 1]] = { 5338 checkFn: checkFn, 5339 iterateFn: iterateFn, 5340 processFn: processFn 5341 }; 5342 } 5343 function handlePaintSolidColorImageMask(iFirstSave, count, fnArray, argsArray) { 5344 var iFirstPIMXO = iFirstSave + 2; 5345 for (var i = 0; i < count; i++) { 5346 var arg = argsArray[iFirstPIMXO + 4 * i]; 5347 var imageMask = arg.length === 1 && arg[0]; 5348 if (imageMask && imageMask.width === 1 && imageMask.height === 1 && (!imageMask.data.length || imageMask.data.length === 1 && imageMask.data[0] === 0)) { 5349 fnArray[iFirstPIMXO + 4 * i] = _util.OPS.paintSolidColorImageMask; 5350 continue; 5351 } 5352 break; 5353 } 5354 return count - i; 5355 } 5356 var InitialState = []; 5357 addState(InitialState, [_util.OPS.save, _util.OPS.transform, _util.OPS.paintInlineImageXObject, _util.OPS.restore], null, function iterateInlineImageGroup(context, i) { 5358 var fnArray = context.fnArray; 5359 var iFirstSave = context.iCurr - 3; 5360 var pos = (i - iFirstSave) % 4; 5361 switch (pos) { 5362 case 0: 5363 return fnArray[i] === _util.OPS.save; 5364 case 1: 5365 return fnArray[i] === _util.OPS.transform; 5366 case 2: 5367 return fnArray[i] === _util.OPS.paintInlineImageXObject; 5368 case 3: 5369 return fnArray[i] === _util.OPS.restore; 5370 } 5371 }, function foundInlineImageGroup(context, i) { 5372 var MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10; 5373 var MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200; 5374 var MAX_WIDTH = 1000; 5375 var IMAGE_PADDING = 1; 5376 var fnArray = context.fnArray, 5377 argsArray = context.argsArray; 5378 var curr = context.iCurr; 5379 var iFirstSave = curr - 3; 5380 var iFirstTransform = curr - 2; 5381 var iFirstPIIXO = curr - 1; 5382 var count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_INLINE_IMAGES_BLOCK); 5383 if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) { 5384 return i - (i - iFirstSave) % 4; 5385 } 5386 var maxX = 0; 5387 var map = [], 5388 maxLineHeight = 0; 5389 var currentX = IMAGE_PADDING, 5390 currentY = IMAGE_PADDING; 5391 var q; 5392 for (q = 0; q < count; q++) { 5393 var transform = argsArray[iFirstTransform + (q << 2)]; 5394 var img = argsArray[iFirstPIIXO + (q << 2)][0]; 5395 if (currentX + img.width > MAX_WIDTH) { 5396 maxX = Math.max(maxX, currentX); 5397 currentY += maxLineHeight + 2 * IMAGE_PADDING; 5398 currentX = 0; 5399 maxLineHeight = 0; 5400 } 5401 map.push({ 5402 transform: transform, 5403 x: currentX, 5404 y: currentY, 5405 w: img.width, 5406 h: img.height 5407 }); 5408 currentX += img.width + 2 * IMAGE_PADDING; 5409 maxLineHeight = Math.max(maxLineHeight, img.height); 5410 } 5411 var imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING; 5412 var imgHeight = currentY + maxLineHeight + IMAGE_PADDING; 5413 var imgData = new Uint8Array(imgWidth * imgHeight * 4); 5414 var imgRowSize = imgWidth << 2; 5415 for (q = 0; q < count; q++) { 5416 var data = argsArray[iFirstPIIXO + (q << 2)][0].data; 5417 var rowSize = map[q].w << 2; 5418 var dataOffset = 0; 5419 var offset = map[q].x + map[q].y * imgWidth << 2; 5420 imgData.set(data.subarray(0, rowSize), offset - imgRowSize); 5421 for (var k = 0, kk = map[q].h; k < kk; k++) { 5422 imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset); 5423 dataOffset += rowSize; 5424 offset += imgRowSize; 5425 } 5426 imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset); 5427 while (offset >= 0) { 5428 data[offset - 4] = data[offset]; 5429 data[offset - 3] = data[offset + 1]; 5430 data[offset - 2] = data[offset + 2]; 5431 data[offset - 1] = data[offset + 3]; 5432 data[offset + rowSize] = data[offset + rowSize - 4]; 5433 data[offset + rowSize + 1] = data[offset + rowSize - 3]; 5434 data[offset + rowSize + 2] = data[offset + rowSize - 2]; 5435 data[offset + rowSize + 3] = data[offset + rowSize - 1]; 5436 offset -= imgRowSize; 5437 } 5438 } 5439 fnArray.splice(iFirstSave, count * 4, _util.OPS.paintInlineImageXObjectGroup); 5440 argsArray.splice(iFirstSave, count * 4, [{ 5441 width: imgWidth, 5442 height: imgHeight, 5443 kind: _util.ImageKind.RGBA_32BPP, 5444 data: imgData 5445 }, map]); 5446 return iFirstSave + 1; 5447 }); 5448 addState(InitialState, [_util.OPS.save, _util.OPS.transform, _util.OPS.paintImageMaskXObject, _util.OPS.restore], null, function iterateImageMaskGroup(context, i) { 5449 var fnArray = context.fnArray; 5450 var iFirstSave = context.iCurr - 3; 5451 var pos = (i - iFirstSave) % 4; 5452 switch (pos) { 5453 case 0: 5454 return fnArray[i] === _util.OPS.save; 5455 case 1: 5456 return fnArray[i] === _util.OPS.transform; 5457 case 2: 5458 return fnArray[i] === _util.OPS.paintImageMaskXObject; 5459 case 3: 5460 return fnArray[i] === _util.OPS.restore; 5461 } 5462 }, function foundImageMaskGroup(context, i) { 5463 var MIN_IMAGES_IN_MASKS_BLOCK = 10; 5464 var MAX_IMAGES_IN_MASKS_BLOCK = 100; 5465 var MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000; 5466 var fnArray = context.fnArray, 5467 argsArray = context.argsArray; 5468 var curr = context.iCurr; 5469 var iFirstSave = curr - 3; 5470 var iFirstTransform = curr - 2; 5471 var iFirstPIMXO = curr - 1; 5472 var count = Math.floor((i - iFirstSave) / 4); 5473 count = handlePaintSolidColorImageMask(iFirstSave, count, fnArray, argsArray); 5474 if (count < MIN_IMAGES_IN_MASKS_BLOCK) { 5475 return i - (i - iFirstSave) % 4; 5476 } 5477 var q; 5478 var isSameImage = false; 5479 var iTransform, transformArgs; 5480 var firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; 5481 if (argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0) { 5482 isSameImage = true; 5483 var firstTransformArg0 = argsArray[iFirstTransform][0]; 5484 var firstTransformArg3 = argsArray[iFirstTransform][3]; 5485 iTransform = iFirstTransform + 4; 5486 var iPIMXO = iFirstPIMXO + 4; 5487 for (q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { 5488 transformArgs = argsArray[iTransform]; 5489 if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || transformArgs[0] !== firstTransformArg0 || transformArgs[1] !== 0 || transformArgs[2] !== 0 || transformArgs[3] !== firstTransformArg3) { 5490 if (q < MIN_IMAGES_IN_MASKS_BLOCK) { 5491 isSameImage = false; 5492 } else { 5493 count = q; 5494 } 5495 break; 5496 } 5497 } 5498 } 5499 if (isSameImage) { 5500 count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK); 5501 var positions = new Float32Array(count * 2); 5502 iTransform = iFirstTransform; 5503 for (q = 0; q < count; q++, iTransform += 4) { 5504 transformArgs = argsArray[iTransform]; 5505 positions[q << 1] = transformArgs[4]; 5506 positions[(q << 1) + 1] = transformArgs[5]; 5507 } 5508 fnArray.splice(iFirstSave, count * 4, _util.OPS.paintImageMaskXObjectRepeat); 5509 argsArray.splice(iFirstSave, count * 4, [firstPIMXOArg0, firstTransformArg0, firstTransformArg3, positions]); 5510 } else { 5511 count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); 5512 var images = []; 5513 for (q = 0; q < count; q++) { 5514 transformArgs = argsArray[iFirstTransform + (q << 2)]; 5515 var maskParams = argsArray[iFirstPIMXO + (q << 2)][0]; 5516 images.push({ 5517 data: maskParams.data, 5518 width: maskParams.width, 5519 height: maskParams.height, 5520 transform: transformArgs 5521 }); 5522 } 5523 fnArray.splice(iFirstSave, count * 4, _util.OPS.paintImageMaskXObjectGroup); 5524 argsArray.splice(iFirstSave, count * 4, [images]); 5525 } 5526 return iFirstSave + 1; 5527 }); 5528 addState(InitialState, [_util.OPS.save, _util.OPS.transform, _util.OPS.paintImageXObject, _util.OPS.restore], function (context) { 5529 var argsArray = context.argsArray;
5530 var iFirstTransform = context.iCurr - 2; 5531 return argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0; 5532 }, function (context, i) { 5533 var fnArray = context.fnArray, 5534 argsArray = context.argsArray; 5535 var iFirstSave = context.iCurr - 3; 5536 var pos = (i - iFirstSave) % 4; 5537 switch (pos) { 5538 case 0: 5539 return fnArray[i] === _util.OPS.save; 5540 case 1: 5541 if (fnArray[i] !== _util.OPS.transform) { 5542 return false; 5543 } 5544 var iFirstTransform = context.iCurr - 2; 5545 var firstTransformArg0 = argsArray[iFirstTransform][0]; 5546 var firstTransformArg3 = argsArray[iFirstTransform][3]; 5547 if (argsArray[i][0] !== firstTransformArg0 || argsArray[i][1] !== 0 || argsArray[i][2] !== 0 || argsArray[i][3] !== firstTransformArg3) { 5548 return false; 5549 } 5550 return true; 5551 case 2: 5552 if (fnArray[i] !== _util.OPS.paintImageXObject) { 5553 return false; 5554 } 5555 var iFirstPIXO = context.iCurr - 1; 5556 var firstPIXOArg0 = argsArray[iFirstPIXO][0]; 5557 if (argsArray[i][0] !== firstPIXOArg0) { 5558 return false; 5559 } 5560 return true; 5561 case 3: 5562 return fnArray[i] === _util.OPS.restore; 5563 } 5564 }, function (context, i) { 5565 var MIN_IMAGES_IN_BLOCK = 3; 5566 var MAX_IMAGES_IN_BLOCK = 1000; 5567 var fnArray = context.fnArray, 5568 argsArray = context.argsArray; 5569 var curr = context.iCurr; 5570 var iFirstSave = curr - 3; 5571 var iFirstTransform = curr - 2; 5572 var iFirstPIXO = curr - 1; 5573 var firstPIXOArg0 = argsArray[iFirstPIXO][0]; 5574 var firstTransformArg0 = argsArray[iFirstTransform][0]; 5575 var firstTransformArg3 = argsArray[iFirstTransform][3]; 5576 var count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_BLOCK); 5577 if (count < MIN_IMAGES_IN_BLOCK) { 5578 return i - (i - iFirstSave) % 4; 5579 } 5580 var positions = new Float32Array(count * 2); 5581 var iTransform = iFirstTransform; 5582 for (var q = 0; q < count; q++, iTransform += 4) { 5583 var transformArgs = argsArray[iTransform]; 5584 positions[q << 1] = transformArgs[4]; 5585 positions[(q << 1) + 1] = transformArgs[5]; 5586 } 5587 var args = [firstPIXOArg0, firstTransformArg0, firstTransformArg3, positions]; 5588 fnArray.splice(iFirstSave, count * 4, _util.OPS.paintImageXObjectRepeat); 5589 argsArray.splice(iFirstSave, count * 4, args); 5590 return iFirstSave + 1; 5591 }); 5592 addState(InitialState, [_util.OPS.beginText, _util.OPS.setFont, _util.OPS.setTextMatrix, _util.OPS.showText, _util.OPS.endText], null, function (context, i) { 5593 var fnArray = context.fnArray, 5594 argsArray = context.argsArray;
5595 var iFirstSave = context.iCurr - 4; 5596 var pos = (i - iFirstSave) % 5; 5597 switch (pos) { 5598 case 0: 5599 return fnArray[i] === _util.OPS.beginText; 5600 case 1: 5601 return fnArray[i] === _util.OPS.setFont; 5602 case 2: 5603 return fnArray[i] === _util.OPS.setTextMatrix; 5604 case 3: 5605 if (fnArray[i] !== _util.OPS.showText) { 5606 return false; 5607 } 5608 var iFirstSetFont = context.iCurr - 3; 5609 var firstSetFontArg0 = argsArray[iFirstSetFont][0]; 5610 var firstSetFontArg1 = argsArray[iFirstSetFont][1]; 5611 if (argsArray[i][0] !== firstSetFontArg0 || argsArray[i][1] !== firstSetFontArg1) { 5612 return false; 5613 } 5614 return true; 5615 case 4: 5616 return fnArray[i] === _util.OPS.endText; 5617 } 5618 }, function (context, i) { 5619 var MIN_CHARS_IN_BLOCK = 3; 5620 var MAX_CHARS_IN_BLOCK = 1000; 5621 var fnArray = context.fnArray, 5622 argsArray = context.argsArray; 5623 var curr = context.iCurr; 5624 var iFirstBeginText = curr - 4; 5625 var iFirstSetFont = curr - 3; 5626 var iFirstSetTextMatrix = curr - 2; 5627 var iFirstShowText = curr - 1; 5628 var iFirstEndText = curr; 5629 var firstSetFontArg0 = argsArray[iFirstSetFont][0]; 5630 var firstSetFontArg1 = argsArray[iFirstSetFont][1]; 5631 var count = Math.min(Math.floor((i - iFirstBeginText) / 5), MAX_CHARS_IN_BLOCK); 5632 if (count < MIN_CHARS_IN_BLOCK) { 5633 return i - (i - iFirstBeginText) % 5; 5634 } 5635 var iFirst = iFirstBeginText; 5636 if (iFirstBeginText >= 4 && fnArray[iFirstBeginText - 4] === fnArray[iFirstSetFont] && fnArray[iFirstBeginText - 3] === fnArray[iFirstSetTextMatrix] && fnArray[iFirstBeginText - 2] === fnArray[iFirstShowText] && fnArray[iFirstBeginText - 1] === fnArray[iFirstEndText] && argsArray[iFirstBeginText - 4][0] === firstSetFontArg0 && argsArray[iFirstBeginText - 4][1] === firstSetFontArg1) { 5637 count++; 5638 iFirst -= 5; 5639 } 5640 var iEndText = iFirst + 4; 5641 for (var q = 1; q < count; q++) { 5642 fnArray.splice(iEndText, 3); 5643 argsArray.splice(iEndText, 3); 5644 iEndText += 2; 5645 } 5646 return iEndText + 1; 5647 }); 5648 function QueueOptimizer(queue) { 5649 this.queue = queue; 5650 this.state = null; 5651 this.context = { 5652 iCurr: 0, 5653 fnArray: queue.fnArray, 5654 argsArray: queue.argsArray 5655 }; 5656 this.match = null; 5657 this.lastProcessed = 0; 5658 } 5659 QueueOptimizer.prototype = { 5660 _optimize: function _optimize() { 5661 var fnArray = this.queue.fnArray; 5662 var i = this.lastProcessed, 5663 ii = fnArray.length; 5664 var state = this.state; 5665 var match = this.match; 5666 if (!state && !match && i + 1 === ii && !InitialState[fnArray[i]]) { 5667 this.lastProcessed = ii; 5668 return; 5669 } 5670 var context = this.context; 5671 while (i < ii) { 5672 if (match) { 5673 var iterate = (0, match.iterateFn)(context, i); 5674 if (iterate) { 5675 i++; 5676 continue; 5677 } 5678 i = (0, match.processFn)(context, i + 1); 5679 ii = fnArray.length; 5680 match = null; 5681 state = null; 5682 if (i >= ii) { 5683 break; 5684 } 5685 } 5686 state = (state || InitialState)[fnArray[i]]; 5687 if (!state || Array.isArray(state)) { 5688 i++; 5689 continue; 5690 } 5691 context.iCurr = i; 5692 i++; 5693 if (state.checkFn && !(0, state.checkFn)(context)) { 5694 state = null; 5695 continue; 5696 } 5697 match = state; 5698 state = null; 5699 } 5700 this.state = state; 5701 this.match = match; 5702 this.lastProcessed = i; 5703 }, 5704 push: function push(fn, args) { 5705 this.queue.fnArray.push(fn); 5706 this.queue.argsArray.push(args); 5707 this._optimize(); 5708 }, 5709 flush: function flush() { 5710 while (this.match) { 5711 var length = this.queue.fnArray.length; 5712 this.lastProcessed = (0, this.match.processFn)(this.context, length); 5713 this.match = null; 5714 this.state = null; 5715 this._optimize(); 5716 } 5717 }, 5718 reset: function reset() { 5719 this.state = null; 5720 this.match = null; 5721 this.lastProcessed = 0; 5722 } 5723 }; 5724 return QueueOptimizer; 5725}();
5726var NullOptimizer = function NullOptimizerClosure() { 5727 function NullOptimizer(queue) { 5728 this.queue = queue; 5729 } 5730 NullOptimizer.prototype = { 5731 push: function push(fn, args) { 5732 this.queue.fnArray.push(fn); 5733 this.queue.argsArray.push(args); 5734 }, 5735 flush: function flush() {} 5736 }; 5737 return NullOptimizer; 5738}(); 5739var OperatorList = function OperatorListClosure() { 5740 var CHUNK_SIZE = 1000; 5741 var CHUNK_SIZE_ABOUT = CHUNK_SIZE - 5; 5742 function getTransfers(queue) { 5743 var transfers = []; 5744 var fnArray = queue.fnArray, 5745 argsArray = queue.argsArray; 5746 for (var i = 0, ii = queue.length; i < ii; i++) { 5747 switch (fnArray[i]) { 5748 case _util.OPS.paintInlineImageXObject: 5749 case _util.OPS.paintInlineImageXObjectGroup: 5750 case _util.OPS.paintImageMaskXObject: 5751 var arg = argsArray[i][0]; 5752 if (!arg.cached) { 5753 transfers.push(arg.data.buffer); 5754 } 5755 break; 5756 } 5757 } 5758 return transfers; 5759 } 5760 function OperatorList(intent, messageHandler, pageIndex) { 5761 this.messageHandler = messageHandler; 5762 this.fnArray = []; 5763 this.argsArray = []; 5764 if (messageHandler && this.intent !== 'oplist') { 5765 this.optimizer = new QueueOptimizer(this); 5766 } else { 5767 this.optimizer = new NullOptimizer(this); 5768 } 5769 this.dependencies = Object.create(null); 5770 this._totalLength = 0; 5771 this.pageIndex = pageIndex; 5772 this.intent = intent; 5773 this.weight = 0; 5774 } 5775 OperatorList.prototype = { 5776 get length() { 5777 return this.argsArray.length; 5778 }, 5779 get totalLength() { 5780 return this._totalLength + this.length; 5781 }, 5782 addOp: function addOp(fn, args) { 5783 this.optimizer.push(fn, args); 5784 this.weight++; 5785 if (this.messageHandler) { 5786 if (this.weight >= CHUNK_SIZE) { 5787 this.flush(); 5788 } else if (this.weight >= CHUNK_SIZE_ABOUT && (fn === _util.OPS.restore || fn === _util.OPS.endText)) { 5789 this.flush(); 5790 } 5791 } 5792 }, 5793 addDependency: function addDependency(dependency) { 5794 if (dependency in this.dependencies) { 5795 return; 5796 } 5797 this.dependencies[dependency] = true; 5798 this.addOp(_util.OPS.dependency, [dependency]); 5799 }, 5800 addDependencies: function addDependencies(dependencies) { 5801 for (var key in dependencies) { 5802 this.addDependency(key); 5803 } 5804 }, 5805 addOpList: function addOpList(opList) { 5806 _util.Util.extendObj(this.dependencies, opList.dependencies); 5807 for (var i = 0, ii = opList.length; i < ii; i++) { 5808 this.addOp(opList.fnArray[i], opList.argsArray[i]); 5809 } 5810 }, 5811 getIR: function getIR() { 5812 return { 5813 fnArray: this.fnArray, 5814 argsArray: this.argsArray, 5815 length: this.length 5816 }; 5817 }, 5818 flush: function flush(lastChunk) { 5819 this.optimizer.flush(); 5820 var transfers = getTransfers(this); 5821 var length = this.length; 5822 this._totalLength += length; 5823 this.messageHandler.send('RenderPageChunk', { 5824 operatorList: { 5825 fnArray: this.fnArray, 5826 argsArray: this.argsArray, 5827 lastChunk: lastChunk, 5828 length: length 5829 }, 5830 pageIndex: this.pageIndex, 5831 intent: this.intent 5832 }, transfers); 5833 this.dependencies = Object.create(null); 5834 this.fnArray.length = 0; 5835 this.argsArray.length = 0; 5836 this.weight = 0; 5837 this.optimizer.reset(); 5838 } 5839 }; 5840 return OperatorList; 5841}(); 5842exports.OperatorList = OperatorList; 5843 5844/***/ }), 5845/* 43 */ 5846/***/ (function(module, exports, __w_pdfjs_require__) { 5847 5848var getLookupTableFactory = __w_pdfjs_require__(0).getLookupTableFactory; 5849var getGlyphsUnicode = getLookupTableFactory(function (t) { 5850 t['A'] = 0x0041; 5851 t['AE'] = 0x00C6; 5852 t['AEacute'] = 0x01FC; 5853 t['AEmacron'] = 0x01E2; 5854 t['AEsmall'] = 0xF7E6; 5855 t['Aacute'] = 0x00C1; 5856 t['Aacutesmall'] = 0xF7E1; 5857 t['Abreve'] = 0x0102; 5858 t['Abreveacute'] = 0x1EAE; 5859 t['Abrevecyrillic'] = 0x04D0; 5860 t['Abrevedotbelow'] = 0x1EB6; 5861 t['Abrevegrave'] = 0x1EB0; 5862 t['Abrevehookabove'] = 0x1EB2; 5863 t['Abrevetilde'] = 0x1EB4; 5864 t['Acaron'] = 0x01CD; 5865 t['Acircle'] = 0x24B6; 5866 t['Acircumflex'] = 0x00C2; 5867 t['Acircumflexacute'] = 0x1EA4; 5868 t['Acircumflexdotbelow'] = 0x1EAC; 5869 t['Acircumflexgrave'] = 0x1EA6; 5870 t['Acircumflexhookabove'] = 0x1EA8; 5871 t['Acircumflexsmall'] = 0xF7E2; 5872 t['Acircumflextilde'] = 0x1EAA; 5873 t['Acute'] = 0xF6C9; 5874 t['Acutesmall'] = 0xF7B4; 5875 t['Acyrillic'] = 0x0410; 5876 t['Adblgrave'] = 0x0200; 5877 t['Adieresis'] = 0x00C4; 5878 t['Adieresiscyrillic'] = 0x04D2; 5879 t['Adieresismacron'] = 0x01DE; 5880 t['Adieresissmall'] = 0xF7E4; 5881 t['Adotbelow'] = 0x1EA0;
5882 t['Adotmacron'] = 0x01E0; 5883 t['Agrave'] = 0x00C0; 5884 t['Agravesmall'] = 0xF7E0; 5885 t['Ahookabove'] = 0x1EA2; 5886 t['Aiecyrillic'] = 0x04D4; 5887 t['Ainvertedbreve'] = 0x0202; 5888 t['Alpha'] = 0x0391; 5889 t['Alphatonos'] = 0x0386; 5890 t['Amacron'] = 0x0100; 5891 t['Amonospace'] = 0xFF21; 5892 t['Aogonek'] = 0x0104; 5893 t['Aring'] = 0x00C5; 5894 t['Aringacute'] = 0x01FA; 5895 t['Aringbelow'] = 0x1E00; 5896 t['Aringsmall'] = 0xF7E5; 5897 t['Asmall'] = 0xF761; 5898 t['Atilde'] = 0x00C3; 5899 t['Atildesmall'] = 0xF7E3; 5900 t['Aybarmenian'] = 0x0531; 5901 t['B'] = 0x0042; 5902 t['Bcircle'] = 0x24B7; 5903 t['Bdotaccent'] = 0x1E02; 5904 t['Bdotbelow'] = 0x1E04; 5905 t['Becyrillic'] = 0x0411; 5906 t['Benarmenian'] = 0x0532; 5907 t['Beta'] = 0x0392; 5908 t['Bhook'] = 0x0181; 5909 t['Blinebelow'] = 0x1E06; 5910 t['Bmonospace'] = 0xFF22; 5911 t['Brevesmall'] = 0xF6F4; 5912 t['Bsmall'] = 0xF762; 5913 t['Btopbar'] = 0x0182; 5914 t['C'] = 0x0043; 5915 t['Caarmenian'] = 0x053E; 5916 t['Cacute'] = 0x0106; 5917 t['Caron'] = 0xF6CA; 5918 t['Caronsmall'] = 0xF6F5; 5919 t['Ccaron'] = 0x010C; 5920 t['Ccedilla'] = 0x00C7; 5921 t['Ccedillaacute'] = 0x1E08; 5922 t['Ccedillasmall'] = 0xF7E7; 5923 t['Ccircle'] = 0x24B8; 5924 t['Ccircumflex'] = 0x0108; 5925 t['Cdot'] = 0x010A; 5926 t['Cdotaccent'] = 0x010A; 5927 t['Cedillasmall'] = 0xF7B8; 5928 t['Chaarmenian'] = 0x0549; 5929 t['Cheabkhasiancyrillic'] = 0x04BC; 5930 t['Checyrillic'] = 0x0427; 5931 t['Chedescenderabkhasiancyrillic'] = 0x04BE; 5932 t['Chedescendercyrillic'] = 0x04B6; 5933 t['Chedieresiscyrillic'] = 0x04F4; 5934 t['Cheharmenian'] = 0x0543; 5935 t['Chekhakassiancyrillic'] = 0x04CB; 5936 t['Cheverticalstrokecyrillic'] = 0x04B8; 5937 t['Chi'] = 0x03A7; 5938 t['Chook'] = 0x0187; 5939 t['Circumflexsmall'] = 0xF6F6; 5940 t['Cmonospace'] = 0xFF23; 5941 t['Coarmenian'] = 0x0551; 5942 t['Csmall'] = 0xF763; 5943 t['D'] = 0x0044; 5944 t['DZ'] = 0x01F1; 5945 t['DZcaron'] = 0x01C4; 5946 t['Daarmenian'] = 0x0534; 5947 t['Dafrican'] = 0x0189; 5948 t['Dcaron'] = 0x010E; 5949 t['Dcedilla'] = 0x1E10; 5950 t['Dcircle'] = 0x24B9; 5951 t['Dcircumflexbelow'] = 0x1E12; 5952 t['Dcroat'] = 0x0110; 5953 t['Ddotaccent'] = 0x1E0A; 5954 t['Ddotbelow'] = 0x1E0C; 5955 t['Decyrillic'] = 0x0414; 5956 t['Deicoptic'] = 0x03EE; 5957 t['Delta'] = 0x2206; 5958 t['Deltagreek'] = 0x0394; 5959 t['Dhook'] = 0x018A; 5960 t['Dieresis'] = 0xF6CB; 5961 t['DieresisAcute'] = 0xF6CC; 5962 t['DieresisGrave'] = 0xF6CD; 5963 t['Dieresissmall'] = 0xF7A8; 5964 t['Digammagreek'] = 0x03DC; 5965 t['Djecyrillic'] = 0x0402; 5966 t['Dlinebelow'] = 0x1E0E; 5967 t['Dmonospace'] = 0xFF24; 5968 t['Dotaccentsmall'] = 0xF6F7; 5969 t['Dslash'] = 0x0110; 5970 t['Dsmall'] = 0xF764; 5971 t['Dtopbar'] = 0x018B; 5972 t['Dz'] = 0x01F2; 5973 t['Dzcaron'] = 0x01C5; 5974 t['Dzeabkhasiancyrillic'] = 0x04E0; 5975 t['Dzecyrillic'] = 0x0405; 5976 t['Dzhecyrillic'] = 0x040F; 5977 t['E'] = 0x0045; 5978 t['Eacute'] = 0x00C9; 5979 t['Eacutesmall'] = 0xF7E9; 5980 t['Ebreve'] = 0x0114; 5981 t['Ecaron'] = 0x011A; 5982 t['Ecedillabreve'] = 0x1E1C; 5983 t['Echarmenian'] = 0x0535; 5984 t['Ecircle'] = 0x24BA; 5985 t['Ecircumflex'] = 0x00CA; 5986 t['Ecircumflexacute'] = 0x1EBE; 5987 t['Ecircumflexbelow'] = 0x1E18; 5988 t['Ecircumflexdotbelow'] = 0x1EC6; 5989 t['Ecircumflexgrave'] = 0x1EC0; 5990 t['Ecircumflexhookabove'] = 0x1EC2; 5991 t['Ecircumflexsmall'] = 0xF7EA; 5992 t['Ecircumflextilde'] = 0x1EC4; 5993 t['Ecyrillic'] = 0x0404; 5994 t['Edblgrave'] = 0x0204; 5995 t['Edieresis'] = 0x00CB; 5996 t['Edieresissmall'] = 0xF7EB; 5997 t['Edot'] = 0x0116; 5998 t['Edotaccent'] = 0x0116; 5999 t['Edotbelow'] = 0x1EB8; 6000 t['Efcyrillic'] = 0x0424; 6001 t['Egrave'] = 0x00C8; 6002 t['Egravesmall'] = 0xF7E8; 6003 t['Eharmenian'] = 0x0537; 6004 t['Ehookabove'] = 0x1EBA; 6005 t['Eightroman'] = 0x2167; 6006 t['Einvertedbreve'] = 0x0206; 6007 t['Eiotifiedcyrillic'] = 0x0464; 6008 t['Elcyrillic'] = 0x041B; 6009 t['Elevenroman'] = 0x216A; 6010 t['Emacron'] = 0x0112; 6011 t['Emacronacute'] = 0x1E16; 6012 t['Emacrongrave'] = 0x1E14; 6013 t['Emcyrillic'] = 0x041C; 6014 t['Emonospace'] = 0xFF25; 6015 t['Encyrillic'] = 0x041D; 6016 t['Endescendercyrillic'] = 0x04A2; 6017 t['Eng'] = 0x014A; 6018 t['Enghecyrillic'] = 0x04A4; 6019 t['Enhookcyrillic'] = 0x04C7;
6020 t['Eogonek'] = 0x0118; 6021 t['Eopen'] = 0x0190; 6022 t['Epsilon'] = 0x0395; 6023 t['Epsilontonos'] = 0x0388; 6024 t['Ercyrillic'] = 0x0420; 6025 t['Ereversed'] = 0x018E; 6026 t['Ereversedcyrillic'] = 0x042D; 6027 t['Escyrillic'] = 0x0421; 6028 t['Esdescendercyrillic'] = 0x04AA; 6029 t['Esh'] = 0x01A9; 6030 t['Esmall'] = 0xF765; 6031 t['Eta'] = 0x0397; 6032 t['Etarmenian'] = 0x0538; 6033 t['Etatonos'] = 0x0389; 6034 t['Eth'] = 0x00D0; 6035 t['Ethsmall'] = 0xF7F0; 6036 t['Etilde'] = 0x1EBC; 6037 t['Etildebelow'] = 0x1E1A; 6038 t['Euro'] = 0x20AC; 6039 t['Ezh'] = 0x01B7; 6040 t['Ezhcaron'] = 0x01EE; 6041 t['Ezhreversed'] = 0x01B8; 6042 t['F'] = 0x0046; 6043 t['Fcircle'] = 0x24BB; 6044 t['Fdotaccent'] = 0x1E1E; 6045 t['Feharmenian'] = 0x0556; 6046 t['Feicoptic'] = 0x03E4; 6047 t['Fhook'] = 0x0191; 6048 t['Fitacyrillic'] = 0x0472; 6049 t['Fiveroman'] = 0x2164; 6050 t['Fmonospace'] = 0xFF26; 6051 t['Fourroman'] = 0x2163; 6052 t['Fsmall'] = 0xF766; 6053 t['G'] = 0x0047; 6054 t['GBsquare'] = 0x3387; 6055 t['Gacute'] = 0x01F4; 6056 t['Gamma'] = 0x0393; 6057 t['Gammaafrican'] = 0x0194; 6058 t['Gangiacoptic'] = 0x03EA; 6059 t['Gbreve'] = 0x011E; 6060 t['Gcaron'] = 0x01E6; 6061 t['Gcedilla'] = 0x0122; 6062 t['Gcircle'] = 0x24BC; 6063 t['Gcircumflex'] = 0x011C; 6064 t['Gcommaaccent'] = 0x0122; 6065 t['Gdot'] = 0x0120; 6066 t['Gdotaccent'] = 0x0120; 6067 t['Gecyrillic'] = 0x0413; 6068 t['Ghadarmenian'] = 0x0542; 6069 t['Ghemiddlehookcyrillic'] = 0x0494; 6070 t['Ghestrokecyrillic'] = 0x0492;
6071 t['Gheupturncyrillic'] = 0x0490; 6072 t['Ghook'] = 0x0193; 6073 t['Gimarmenian'] = 0x0533; 6074 t['Gjecyrillic'] = 0x0403; 6075 t['Gmacron'] = 0x1E20; 6076 t['Gmonospace'] = 0xFF27; 6077 t['Grave'] = 0xF6CE; 6078 t['Gravesmall'] = 0xF760; 6079 t['Gsmall'] = 0xF767; 6080 t['Gsmallhook'] = 0x029B; 6081 t['Gstroke'] = 0x01E4; 6082 t['H'] = 0x0048; 6083 t['H18533'] = 0x25CF; 6084 t['H18543'] = 0x25AA; 6085 t['H18551'] = 0x25AB; 6086 t['H22073'] = 0x25A1; 6087 t['HPsquare'] = 0x33CB; 6088 t['Haabkhasiancyrillic'] = 0x04A8; 6089 t['Hadescendercyrillic'] = 0x04B2; 6090 t['Hardsigncyrillic'] = 0x042A; 6091 t['Hbar'] = 0x0126; 6092 t['Hbrevebelow'] = 0x1E2A; 6093 t['Hcedilla'] = 0x1E28; 6094 t['Hcircle'] = 0x24BD; 6095 t['Hcircumflex'] = 0x0124; 6096 t['Hdieresis'] = 0x1E26; 6097 t['Hdotaccent'] = 0x1E22; 6098 t['Hdotbelow'] = 0x1E24; 6099 t['Hmonospace'] = 0xFF28; 6100 t['Hoarmenian'] = 0x0540; 6101 t['Horicoptic'] = 0x03E8; 6102 t['Hsmall'] = 0xF768; 6103 t['Hungarumlaut'] = 0xF6CF; 6104 t['Hungarumlautsmall'] = 0xF6F8; 6105 t['Hzsquare'] = 0x3390; 6106 t['I'] = 0x0049; 6107 t['IAcyrillic'] = 0x042F; 6108 t['IJ'] = 0x0132; 6109 t['IUcyrillic'] = 0x042E; 6110 t['Iacute'] = 0x00CD; 6111 t['Iacutesmall'] = 0xF7ED; 6112 t['Ibreve'] = 0x012C; 6113 t['Icaron'] = 0x01CF; 6114 t['Icircle'] = 0x24BE; 6115 t['Icircumflex'] = 0x00CE; 6116 t['Icircumflexsmall'] = 0xF7EE; 6117 t['Icyrillic'] = 0x0406; 6118 t['Idblgrave'] = 0x0208; 6119 t['Idieresis'] = 0x00CF; 6120 t['Idieresisacute'] = 0x1E2E; 6121 t['Idieresiscyrillic'] = 0x04E4; 6122 t['Idieresissmall'] = 0xF7EF; 6123 t['Idot'] = 0x0130; 6124 t['Idotaccent'] = 0x0130; 6125 t['Idotbelow'] = 0x1ECA; 6126 t['Iebrevecyrillic'] = 0x04D6; 6127 t['Iecyrillic'] = 0x0415; 6128 t['Ifraktur'] = 0x2111; 6129 t['Igrave'] = 0x00CC; 6130 t['Igravesmall'] = 0xF7EC; 6131 t['Ihookabove'] = 0x1EC8; 6132 t['Iicyrillic'] = 0x0418; 6133 t['Iinvertedbreve'] = 0x020A; 6134 t['Iishortcyrillic'] = 0x0419; 6135 t['Imacron'] = 0x012A; 6136 t['Imacroncyrillic'] = 0x04E2; 6137 t['Imonospace'] = 0xFF29; 6138 t['Iniarmenian'] = 0x053B; 6139 t['Iocyrillic'] = 0x0401; 6140 t['Iogonek'] = 0x012E; 6141 t['Iota'] = 0x0399; 6142 t['Iotaafrican'] = 0x0196; 6143 t['Iotadieresis'] = 0x03AA; 6144 t['Iotatonos'] = 0x038A; 6145 t['Ismall'] = 0xF769; 6146 t['Istroke'] = 0x0197; 6147 t['Itilde'] = 0x0128; 6148 t['Itildebelow'] = 0x1E2C; 6149 t['Izhitsacyrillic'] = 0x0474; 6150 t['Izhitsadblgravecyrillic'] = 0x0476; 6151 t['J'] = 0x004A; 6152 t['Jaarmenian'] = 0x0541; 6153 t['Jcircle'] = 0x24BF; 6154 t['Jcircumflex'] = 0x0134; 6155 t['Jecyrillic'] = 0x0408; 6156 t['Jheharmenian'] = 0x054B; 6157 t['Jmonospace'] = 0xFF2A; 6158 t['Jsmall'] = 0xF76A; 6159 t['K'] = 0x004B; 6160 t['KBsquare'] = 0x3385; 6161 t['KKsquare'] = 0x33CD; 6162 t['Kabashkircyrillic'] = 0x04A0; 6163 t['Kacute'] = 0x1E30; 6164 t['Kacyrillic'] = 0x041A; 6165 t['Kadescendercyrillic'] = 0x049A; 6166 t['Kahookcyrillic'] = 0x04C3; 6167 t['Kappa'] = 0x039A; 6168 t['Kastrokecyrillic'] = 0x049E;
6169 t['Kaverticalstrokecyrillic'] = 0x049C; 6170 t['Kcaron'] = 0x01E8; 6171 t['Kcedilla'] = 0x0136; 6172 t['Kcircle'] = 0x24C0; 6173 t['Kcommaaccent'] = 0x0136; 6174 t['Kdotbelow'] = 0x1E32; 6175 t['Keharmenian'] = 0x0554; 6176 t['Kenarmenian'] = 0x053F; 6177 t['Khacyrillic'] = 0x0425; 6178 t['Kheicoptic'] = 0x03E6; 6179 t['Khook'] = 0x0198; 6180 t['Kjecyrillic'] = 0x040C; 6181 t['Klinebelow'] = 0x1E34; 6182 t['Kmonospace'] = 0xFF2B; 6183 t['Koppacyrillic'] = 0x0480; 6184 t['Koppagreek'] = 0x03DE; 6185 t['Ksicyrillic'] = 0x046E; 6186 t['Ksmall'] = 0xF76B; 6187 t['L'] = 0x004C; 6188 t['LJ'] = 0x01C7; 6189 t['LL'] = 0xF6BF; 6190 t['Lacute'] = 0x0139; 6191 t['Lambda'] = 0x039B; 6192 t['Lcaron'] = 0x013D; 6193 t['Lcedilla'] = 0x013B; 6194 t['Lcircle'] = 0x24C1; 6195 t['Lcircumflexbelow'] = 0x1E3C; 6196 t['Lcommaaccent'] = 0x013B; 6197 t['Ldot'] = 0x013F; 6198 t['Ldotaccent'] = 0x013F; 6199 t['Ldotbelow'] = 0x1E36; 6200 t['Ldotbelowmacron'] = 0x1E38; 6201 t['Liwnarmenian'] = 0x053C; 6202 t['Lj'] = 0x01C8; 6203 t['Ljecyrillic'] = 0x0409; 6204 t['Llinebelow'] = 0x1E3A; 6205 t['Lmonospace'] = 0xFF2C; 6206 t['Lslash'] = 0x0141; 6207 t['Lslashsmall'] = 0xF6F9; 6208 t['Lsmall'] = 0xF76C; 6209 t['M'] = 0x004D; 6210 t['MBsquare'] = 0x3386; 6211 t['Macron'] = 0xF6D0; 6212 t['Macronsmall'] = 0xF7AF; 6213 t['Macute'] = 0x1E3E; 6214 t['Mcircle'] = 0x24C2; 6215 t['Mdotaccent'] = 0x1E40; 6216 t['Mdotbelow'] = 0x1E42; 6217 t['Menarmenian'] = 0x0544; 6218 t['Mmonospace'] = 0xFF2D; 6219 t['Msmall'] = 0xF76D; 6220 t['Mturned'] = 0x019C; 6221 t['Mu'] = 0x039C; 6222 t['N'] = 0x004E; 6223 t['NJ'] = 0x01CA; 6224 t['Nacute'] = 0x0143; 6225 t['Ncaron'] = 0x0147; 6226 t['Ncedilla'] = 0x0145; 6227 t['Ncircle'] = 0x24C3; 6228 t['Ncircumflexbelow'] = 0x1E4A; 6229 t['Ncommaaccent'] = 0x0145; 6230 t['Ndotaccent'] = 0x1E44; 6231 t['Ndotbelow'] = 0x1E46; 6232 t['Nhookleft'] = 0x019D; 6233 t['Nineroman'] = 0x2168; 6234 t['Nj'] = 0x01CB; 6235 t['Njecyrillic'] = 0x040A; 6236 t['Nlinebelow'] = 0x1E48; 6237 t['Nmonospace'] = 0xFF2E; 6238 t['Nowarmenian'] = 0x0546; 6239 t['Nsmall'] = 0xF76E; 6240 t['Ntilde'] = 0x00D1; 6241 t['Ntildesmall'] = 0xF7F1; 6242 t['Nu'] = 0x039D; 6243 t['O'] = 0x004F; 6244 t['OE'] = 0x0152; 6245 t['OEsmall'] = 0xF6FA; 6246 t['Oacute'] = 0x00D3; 6247 t['Oacutesmall'] = 0xF7F3; 6248 t['Obarredcyrillic'] = 0x04E8; 6249 t['Obarreddieresiscyrillic'] = 0x04EA; 6250 t['Obreve'] = 0x014E; 6251 t['Ocaron'] = 0x01D1; 6252 t['Ocenteredtilde'] = 0x019F; 6253 t['Ocircle'] = 0x24C4; 6254 t['Ocircumflex'] = 0x00D4; 6255 t['Ocircumflexacute'] = 0x1ED0; 6256 t['Ocircumflexdotbelow'] = 0x1ED8; 6257 t['Ocircumflexgrave'] = 0x1ED2; 6258 t['Ocircumflexhookabove'] = 0x1ED4; 6259 t['Ocircumflexsmall'] = 0xF7F4; 6260 t['Ocircumflextilde'] = 0x1ED6; 6261 t['Ocyrillic'] = 0x041E; 6262 t['Odblacute'] = 0x0150; 6263 t['Odblgrave'] = 0x020C; 6264 t['Odieresis'] = 0x00D6; 6265 t['Odieresiscyrillic'] = 0x04E6; 6266 t['Odieresissmall'] = 0xF7F6; 6267 t['Odotbelow'] = 0x1ECC; 6268 t['Ogoneksmall'] = 0xF6FB; 6269 t['Ograve'] = 0x00D2; 6270 t['Ogravesmall'] = 0xF7F2; 6271 t['Oharmenian'] = 0x0555; 6272 t['Ohm'] = 0x2126; 6273 t['Ohookabove'] = 0x1ECE; 6274 t['Ohorn'] = 0x01A0; 6275 t['Ohornacute'] = 0x1EDA; 6276 t['Ohorndotbelow'] = 0x1EE2; 6277 t['Ohorngrave'] = 0x1EDC; 6278 t['Ohornhookabove'] = 0x1EDE; 6279 t['Ohorntilde'] = 0x1EE0; 6280 t['Ohungarumlaut'] = 0x0150; 6281 t['Oi'] = 0x01A2; 6282 t['Oinvertedbreve'] = 0x020E; 6283 t['Omacron'] = 0x014C; 6284 t['Omacronacute'] = 0x1E52; 6285 t['Omacrongrave'] = 0x1E50; 6286 t['Omega'] = 0x2126; 6287 t['Omegacyrillic'] = 0x0460; 6288 t['Omegagreek'] = 0x03A9; 6289 t['Omegaroundcyrillic'] = 0x047A; 6290 t['Omegatitlocyrillic'] = 0x047C; 6291 t['Omegatonos'] = 0x038F; 6292 t['Omicron'] = 0x039F; 6293 t['Omicrontonos'] = 0x038C; 6294 t['Omonospace'] = 0xFF2F; 6295 t['Oneroman'] = 0x2160; 6296 t['Oogonek'] = 0x01EA; 6297 t['Oogonekmacron'] = 0x01EC; 6298 t['Oopen'] = 0x0186; 6299 t['Oslash'] = 0x00D8; 6300 t['Oslashacute'] = 0x01FE; 6301 t['Oslashsmall'] = 0xF7F8; 6302 t['Osmall'] = 0xF76F; 6303 t['Ostrokeacute'] = 0x01FE; 6304 t['Otcyrillic'] = 0x047E; 6305 t['Otilde'] = 0x00D5; 6306 t['Otildeacute'] = 0x1E4C; 6307 t['Otildedieresis'] = 0x1E4E; 6308 t['Otildesmall'] = 0xF7F5; 6309 t['P'] = 0x0050; 6310 t['Pacute'] = 0x1E54; 6311 t['Pcircle'] = 0x24C5; 6312 t['Pdotaccent'] = 0x1E56; 6313 t['Pecyrillic'] = 0x041F; 6314 t['Peharmenian'] = 0x054A; 6315 t['Pemiddlehookcyrillic'] = 0x04A6; 6316 t['Phi'] = 0x03A6; 6317 t['Phook'] = 0x01A4; 6318 t['Pi'] = 0x03A0; 6319 t['Piwrarmenian'] = 0x0553; 6320 t['Pmonospace'] = 0xFF30; 6321 t['Psi'] = 0x03A8; 6322 t['Psicyrillic'] = 0x0470; 6323 t['Psmall'] = 0xF770; 6324 t['Q'] = 0x0051; 6325 t['Qcircle'] = 0x24C6; 6326 t['Qmonospace'] = 0xFF31; 6327 t['Qsmall'] = 0xF771; 6328 t['R'] = 0x0052; 6329 t['Raarmenian'] = 0x054C; 6330 t['Racute'] = 0x0154; 6331 t['Rcaron'] = 0x0158; 6332 t['Rcedilla'] = 0x0156; 6333 t['Rcircle'] = 0x24C7; 6334 t['Rcommaaccent'] = 0x0156; 6335 t['Rdblgrave'] = 0x0210; 6336 t['Rdotaccent'] = 0x1E58; 6337 t['Rdotbelow'] = 0x1E5A; 6338 t['Rdotbelowmacron'] = 0x1E5C; 6339 t['Reharmenian'] = 0x0550; 6340 t['Rfraktur'] = 0x211C; 6341 t['Rho'] = 0x03A1; 6342 t['Ringsmall'] = 0xF6FC; 6343 t['Rinvertedbreve'] = 0x0212; 6344 t['Rlinebelow'] = 0x1E5E; 6345 t['Rmonospace'] = 0xFF32; 6346 t['Rsmall'] = 0xF772; 6347 t['Rsmallinverted'] = 0x0281; 6348 t['Rsmallinvertedsuperior'] = 0x02B6; 6349 t['S'] = 0x0053; 6350 t['SF010000'] = 0x250C; 6351 t['SF020000'] = 0x2514; 6352 t['SF030000'] = 0x2510; 6353 t['SF040000'] = 0x2518; 6354 t['SF050000'] = 0x253C; 6355 t['SF060000'] = 0x252C; 6356 t['SF070000'] = 0x2534; 6357 t['SF080000'] = 0x251C; 6358 t['SF090000'] = 0x2524; 6359 t['SF100000'] = 0x2500; 6360 t['SF110000'] = 0x2502; 6361 t['SF190000'] = 0x2561; 6362 t['SF200000'] = 0x2562; 6363 t['SF210000'] = 0x2556; 6364 t['SF220000'] = 0x2555; 6365 t['SF230000'] = 0x2563; 6366 t['SF240000'] = 0x2551; 6367 t['SF250000'] = 0x2557; 6368 t['SF260000'] = 0x255D; 6369 t['SF270000'] = 0x255C; 6370 t['SF280000'] = 0x255B; 6371 t['SF360000'] = 0x255E; 6372 t['SF370000'] = 0x255F; 6373 t['SF380000'] = 0x255A; 6374 t['SF390000'] = 0x2554; 6375 t['SF400000'] = 0x2569; 6376 t['SF410000'] = 0x2566; 6377 t['SF420000'] = 0x2560; 6378 t['SF430000'] = 0x2550; 6379 t['SF440000'] = 0x256C; 6380 t['SF450000'] = 0x2567; 6381 t['SF460000'] = 0x2568; 6382 t['SF470000'] = 0x2564; 6383 t['SF480000'] = 0x2565; 6384 t['SF490000'] = 0x2559; 6385 t['SF500000'] = 0x2558; 6386 t['SF510000'] = 0x2552; 6387 t['SF520000'] = 0x2553; 6388 t['SF530000'] = 0x256B;
6389 t['SF540000'] = 0x256A; 6390 t['Sacute'] = 0x015A; 6391 t['Sacutedotaccent'] = 0x1E64; 6392 t['Sampigreek'] = 0x03E0; 6393 t['Scaron'] = 0x0160; 6394 t['Scarondotaccent'] = 0x1E66; 6395 t['Scaronsmall'] = 0xF6FD; 6396 t['Scedilla'] = 0x015E; 6397 t['Schwa'] = 0x018F; 6398 t['Schwacyrillic'] = 0x04D8; 6399 t['Schwadieresiscyrillic'] = 0x04DA; 6400 t['Scircle'] = 0x24C8; 6401 t['Scircumflex'] = 0x015C; 6402 t['Scommaaccent'] = 0x0218; 6403 t['Sdotaccent'] = 0x1E60; 6404 t['Sdotbelow'] = 0x1E62; 6405 t['Sdotbelowdotaccent'] = 0x1E68; 6406 t['Seharmenian'] = 0x054D; 6407 t['Sevenroman'] = 0x2166; 6408 t['Shaarmenian'] = 0x0547; 6409 t['Shacyrillic'] = 0x0428; 6410 t['Shchacyrillic'] = 0x0429; 6411 t['Sheicoptic'] = 0x03E2; 6412 t['Shhacyrillic'] = 0x04BA; 6413 t['Shimacoptic'] = 0x03EC; 6414 t['Sigma'] = 0x03A3; 6415 t['Sixroman'] = 0x2165; 6416 t['Smonospace'] = 0xFF33; 6417 t['Softsigncyrillic'] = 0x042C; 6418 t['Ssmall'] = 0xF773; 6419 t['Stigmagreek'] = 0x03DA; 6420 t['T'] = 0x0054; 6421 t['Tau'] = 0x03A4; 6422 t['Tbar'] = 0x0166; 6423 t['Tcaron'] = 0x0164; 6424 t['Tcedilla'] = 0x0162; 6425 t['Tcircle'] = 0x24C9; 6426 t['Tcircumflexbelow'] = 0x1E70; 6427 t['Tcommaaccent'] = 0x0162; 6428 t['Tdotaccent'] = 0x1E6A; 6429 t['Tdotbelow'] = 0x1E6C; 6430 t['Tecyrillic'] = 0x0422; 6431 t['Tedescendercyrillic'] = 0x04AC; 6432 t['Tenroman'] = 0x2169; 6433 t['Tetsecyrillic'] = 0x04B4; 6434 t['Theta'] = 0x0398; 6435 t['Thook'] = 0x01AC; 6436 t['Thorn'] = 0x00DE; 6437 t['Thornsmall'] = 0xF7FE; 6438 t['Threeroman'] = 0x2162; 6439 t['Tildesmall'] = 0xF6FE; 6440 t['Tiwnarmenian'] = 0x054F; 6441 t['Tlinebelow'] = 0x1E6E; 6442 t['Tmonospace'] = 0xFF34; 6443 t['Toarmenian'] = 0x0539; 6444 t['Tonefive'] = 0x01BC; 6445 t['Tonesix'] = 0x0184; 6446 t['Tonetwo'] = 0x01A7; 6447 t['Tretroflexhook'] = 0x01AE; 6448 t['Tsecyrillic'] = 0x0426; 6449 t['Tshecyrillic'] = 0x040B; 6450 t['Tsmall'] = 0xF774; 6451 t['Twelveroman'] = 0x216B; 6452 t['Tworoman'] = 0x2161; 6453 t['U'] = 0x0055; 6454 t['Uacute'] = 0x00DA; 6455 t['Uacutesmall'] = 0xF7FA; 6456 t['Ubreve'] = 0x016C; 6457 t['Ucaron'] = 0x01D3; 6458 t['Ucircle'] = 0x24CA; 6459 t['Ucircumflex'] = 0x00DB; 6460 t['Ucircumflexbelow'] = 0x1E76; 6461 t['Ucircumflexsmall'] = 0xF7FB; 6462 t['Ucyrillic'] = 0x0423; 6463 t['Udblacute'] = 0x0170; 6464 t['Udblgrave'] = 0x0214; 6465 t['Udieresis'] = 0x00DC; 6466 t['Udieresisacute'] = 0x01D7;
6467 t['Udieresisbelow'] = 0x1E72; 6468 t['Udieresiscaron'] = 0x01D9; 6469 t['Udieresiscyrillic'] = 0x04F0; 6470 t['Udieresisgrave'] = 0x01DB; 6471 t['Udieresismacron'] = 0x01D5; 6472 t['Udieresissmall'] = 0xF7FC; 6473 t['Udotbelow'] = 0x1EE4; 6474 t['Ugrave'] = 0x00D9; 6475 t['Ugravesmall'] = 0xF7F9; 6476 t['Uhookabove'] = 0x1EE6; 6477 t['Uhorn'] = 0x01AF; 6478 t['Uhornacute'] = 0x1EE8; 6479 t['Uhorndotbelow'] = 0x1EF0; 6480 t['Uhorngrave'] = 0x1EEA; 6481 t['Uhornhookabove'] = 0x1EEC; 6482 t['Uhorntilde'] = 0x1EEE; 6483 t['Uhungarumlaut'] = 0x0170; 6484 t['Uhungarumlautcyrillic'] = 0x04F2; 6485 t['Uinvertedbreve'] = 0x0216; 6486 t['Ukcyrillic'] = 0x0478; 6487 t['Umacron'] = 0x016A; 6488 t['Umacroncyrillic'] = 0x04EE; 6489 t['Umacrondieresis'] = 0x1E7A; 6490 t['Umonospace'] = 0xFF35; 6491 t['Uogonek'] = 0x0172; 6492 t['Upsilon'] = 0x03A5; 6493 t['Upsilon1'] = 0x03D2; 6494 t['Upsilonacutehooksymbolgreek'] = 0x03D3; 6495 t['Upsilonafrican'] = 0x01B1; 6496 t['Upsilondieresis'] = 0x03AB; 6497 t['Upsilondieresishooksymbolgreek'] = 0x03D4; 6498 t['Upsilonhooksymbol'] = 0x03D2; 6499 t['Upsilontonos'] = 0x038E; 6500 t['Uring'] = 0x016E; 6501 t['Ushortcyrillic'] = 0x040E; 6502 t['Usmall'] = 0xF775; 6503 t['Ustraightcyrillic'] = 0x04AE; 6504 t['Ustraightstrokecyrillic'] = 0x04B0; 6505 t['Utilde'] = 0x0168; 6506 t['Utildeacute'] = 0x1E78; 6507 t['Utildebelow'] = 0x1E74; 6508 t['V'] = 0x0056; 6509 t['Vcircle'] = 0x24CB; 6510 t['Vdotbelow'] = 0x1E7E; 6511 t['Vecyrillic'] = 0x0412; 6512 t['Vewarmenian'] = 0x054E; 6513 t['Vhook'] = 0x01B2; 6514 t['Vmonospace'] = 0xFF36; 6515 t['Voarmenian'] = 0x0548; 6516 t['Vsmall'] = 0xF776; 6517 t['Vtilde'] = 0x1E7C; 6518 t['W'] = 0x0057; 6519 t['Wacute'] = 0x1E82; 6520 t['Wcircle'] = 0x24CC; 6521 t['Wcircumflex'] = 0x0174; 6522 t['Wdieresis'] = 0x1E84; 6523 t['Wdotaccent'] = 0x1E86; 6524 t['Wdotbelow'] = 0x1E88; 6525 t['Wgrave'] = 0x1E80; 6526 t['Wmonospace'] = 0xFF37; 6527 t['Wsmall'] = 0xF777; 6528 t['X'] = 0x0058; 6529 t['Xcircle'] = 0x24CD; 6530 t['Xdieresis'] = 0x1E8C; 6531 t['Xdotaccent'] = 0x1E8A; 6532 t['Xeharmenian'] = 0x053D; 6533 t['Xi'] = 0x039E; 6534 t['Xmonospace'] = 0xFF38; 6535 t['Xsmall'] = 0xF778; 6536 t['Y'] = 0x0059; 6537 t['Yacute'] = 0x00DD; 6538 t['Yacutesmall'] = 0xF7FD; 6539 t['Yatcyrillic'] = 0x0462; 6540 t['Ycircle'] = 0x24CE; 6541 t['Ycircumflex'] = 0x0176; 6542 t['Ydieresis'] = 0x0178; 6543 t['Ydieresissmall'] = 0xF7FF; 6544 t['Ydotaccent'] = 0x1E8E; 6545 t['Ydotbelow'] = 0x1EF4; 6546 t['Yericyrillic'] = 0x042B; 6547 t['Yerudieresiscyrillic'] = 0x04F8; 6548 t['Ygrave'] = 0x1EF2; 6549 t['Yhook'] = 0x01B3; 6550 t['Yhookabove'] = 0x1EF6; 6551 t['Yiarmenian'] = 0x0545; 6552 t['Yicyrillic'] = 0x0407; 6553 t['Yiwnarmenian'] = 0x0552; 6554 t['Ymonospace'] = 0xFF39; 6555 t['Ysmall'] = 0xF779; 6556 t['Ytilde'] = 0x1EF8; 6557 t['Yusbigcyrillic'] = 0x046A; 6558 t['Yusbigiotifiedcyrillic'] = 0x046C; 6559 t['Yuslittlecyrillic'] = 0x0466; 6560 t['Yuslittleiotifiedcyrillic'] = 0x0468; 6561 t['Z'] = 0x005A; 6562 t['Zaarmenian'] = 0x0536; 6563 t['Zacute'] = 0x0179; 6564 t['Zcaron'] = 0x017D; 6565 t['Zcaronsmall'] = 0xF6FF; 6566 t['Zcircle'] = 0x24CF; 6567 t['Zcircumflex'] = 0x1E90; 6568 t['Zdot'] = 0x017B; 6569 t['Zdotaccent'] = 0x017B; 6570 t['Zdotbelow'] = 0x1E92; 6571 t['Zecyrillic'] = 0x0417; 6572 t['Zedescendercyrillic'] = 0x0498; 6573 t['Zedieresiscyrillic'] = 0x04DE; 6574 t['Zeta'] = 0x0396; 6575 t['Zhearmenian'] = 0x053A; 6576 t['Zhebrevecyrillic'] = 0x04C1; 6577 t['Zhecyrillic'] = 0x0416; 6578 t['Zhedescendercyrillic'] = 0x0496; 6579 t['Zhedieresiscyrillic'] = 0x04DC; 6580 t['Zlinebelow'] = 0x1E94; 6581 t['Zmonospace'] = 0xFF3A; 6582 t['Zsmall'] = 0xF77A; 6583 t['Zstroke'] = 0x01B5; 6584 t['a'] = 0x0061; 6585 t['aabengali'] = 0x0986; 6586 t['aacute'] = 0x00E1; 6587 t['aadeva'] = 0x0906; 6588 t['aagujarati'] = 0x0A86; 6589 t['aagurmukhi'] = 0x0A06; 6590 t['aamatragurmukhi'] = 0x0A3E; 6591 t['aarusquare'] = 0x3303; 6592 t['aavowelsignbengali'] = 0x09BE; 6593 t['aavowelsigndeva'] = 0x093E; 6594 t['aavowelsigngujarati'] = 0x0ABE; 6595 t['abbreviationmarkarmenian'] = 0x055F; 6596 t['abbreviationsigndeva'] = 0x0970; 6597 t['abengali'] = 0x0985; 6598 t['abopomofo'] = 0x311A; 6599 t['abreve'] = 0x0103; 6600 t['abreveacute'] = 0x1EAF; 6601 t['abrevecyrillic'] = 0x04D1; 6602 t['abrevedotbelow'] = 0x1EB7; 6603 t['abrevegrave'] = 0x1EB1; 6604 t['abrevehookabove'] = 0x1EB3; 6605 t['abrevetilde'] = 0x1EB5; 6606 t['acaron'] = 0x01CE; 6607 t['acircle'] = 0x24D0; 6608 t['acircumflex'] = 0x00E2; 6609 t['acircumflexacute'] = 0x1EA5; 6610 t['acircumflexdotbelow'] = 0x1EAD; 6611 t['acircumflexgrave'] = 0x1EA7; 6612 t['acircumflexhookabove'] = 0x1EA9; 6613 t['acircumflextilde'] = 0x1EAB; 6614 t['acute'] = 0x00B4; 6615 t['acutebelowcmb'] = 0x0317;
6616 t['acutecmb'] = 0x0301; 6617 t['acutecomb'] = 0x0301; 6618 t['acutedeva'] = 0x0954; 6619 t['acutelowmod'] = 0x02CF; 6620 t['acutetonecmb'] = 0x0341; 6621 t['acyrillic'] = 0x0430; 6622 t['adblgrave'] = 0x0201; 6623 t['addakgurmukhi'] = 0x0A71; 6624 t['adeva'] = 0x0905; 6625 t['adieresis'] = 0x00E4; 6626 t['adieresiscyrillic'] = 0x04D3; 6627 t['adieresismacron'] = 0x01DF; 6628 t['adotbelow'] = 0x1EA1; 6629 t['adotmacron'] = 0x01E1; 6630 t['ae'] = 0x00E6; 6631 t['aeacute'] = 0x01FD; 6632 t['aekorean'] = 0x3150; 6633 t['aemacron'] = 0x01E3; 6634 t['afii00208'] = 0x2015; 6635 t['afii08941'] = 0x20A4; 6636 t['afii10017'] = 0x0410; 6637 t['afii10018'] = 0x0411; 6638 t['afii10019'] = 0x0412; 6639 t['afii10020'] = 0x0413; 6640 t['afii10021'] = 0x0414; 6641 t['afii10022'] = 0x0415; 6642 t['afii10023'] = 0x0401; 6643 t['afii10024'] = 0x0416; 6644 t['afii10025'] = 0x0417; 6645 t['afii10026'] = 0x0418; 6646 t['afii10027'] = 0x0419; 6647 t['afii10028'] = 0x041A; 6648 t['afii10029'] = 0x041B; 6649 t['afii10030'] = 0x041C; 6650 t['afii10031'] = 0x041D; 6651 t['afii10032'] = 0x041E; 6652 t['afii10033'] = 0x041F; 6653 t['afii10034'] = 0x0420; 6654 t['afii10035'] = 0x0421; 6655 t['afii10036'] = 0x0422; 6656 t['afii10037'] = 0x0423; 6657 t['afii10038'] = 0x0424; 6658 t['afii10039'] = 0x0425; 6659 t['afii10040'] = 0x0426; 6660 t['afii10041'] = 0x0427; 6661 t['afii10042'] = 0x0428; 6662 t['afii10043'] = 0x0429; 6663 t['afii10044'] = 0x042A; 6664 t['afii10045'] = 0x042B; 6665 t['afii10046'] = 0x042C; 6666 t['afii10047'] = 0x042D; 6667 t['afii10048'] = 0x042E; 6668 t['afii10049'] = 0x042F; 6669 t['afii10050'] = 0x0490; 6670 t['afii10051'] = 0x0402; 6671 t['afii10052'] = 0x0403; 6672 t['afii10053'] = 0x0404; 6673 t['afii10054'] = 0x0405; 6674 t['afii10055'] = 0x0406; 6675 t['afii10056'] = 0x0407; 6676 t['afii10057'] = 0x0408; 6677 t['afii10058'] = 0x0409; 6678 t['afii10059'] = 0x040A; 6679 t['afii10060'] = 0x040B; 6680 t['afii10061'] = 0x040C; 6681 t['afii10062'] = 0x040E; 6682 t['afii10063'] = 0xF6C4; 6683 t['afii10064'] = 0xF6C5; 6684 t['afii10065'] = 0x0430; 6685 t['afii10066'] = 0x0431; 6686 t['afii10067'] = 0x0432; 6687 t['afii10068'] = 0x0433; 6688 t['afii10069'] = 0x0434; 6689 t['afii10070'] = 0x0435; 6690 t['afii10071'] = 0x0451; 6691 t['afii10072'] = 0x0436; 6692 t['afii10073'] = 0x0437; 6693 t['afii10074'] = 0x0438; 6694 t['afii10075'] = 0x0439; 6695 t['afii10076'] = 0x043A; 6696 t['afii10077'] = 0x043B; 6697 t['afii10078'] = 0x043C; 6698 t['afii10079'] = 0x043D; 6699 t['afii10080'] = 0x043E; 6700 t['afii10081'] = 0x043F; 6701 t['afii10082'] = 0x0440; 6702 t['afii10083'] = 0x0441; 6703 t['afii10084'] = 0x0442; 6704 t['afii10085'] = 0x0443; 6705 t['afii10086'] = 0x0444; 6706 t['afii10087'] = 0x0445; 6707 t['afii10088'] = 0x0446; 6708 t['afii10089'] = 0x0447; 6709 t['afii10090'] = 0x0448; 6710 t['afii10091'] = 0x0449; 6711 t['afii10092'] = 0x044A; 6712 t['afii10093'] = 0x044B; 6713 t['afii10094'] = 0x044C; 6714 t['afii10095'] = 0x044D; 6715 t['afii10096'] = 0x044E; 6716 t['afii10097'] = 0x044F; 6717 t['afii10098'] = 0x0491; 6718 t['afii10099'] = 0x0452; 6719 t['afii10100'] = 0x0453; 6720 t['afii10101'] = 0x0454; 6721 t['afii10102'] = 0x0455; 6722 t['afii10103'] = 0x0456; 6723 t['afii10104'] = 0x0457; 6724 t['afii10105'] = 0x0458; 6725 t['afii10106'] = 0x0459; 6726 t['afii10107'] = 0x045A; 6727 t['afii10108'] = 0x045B; 6728 t['afii10109'] = 0x045C; 6729 t['afii10110'] = 0x045E; 6730 t['afii10145'] = 0x040F; 6731 t['afii10146'] = 0x0462; 6732 t['afii10147'] = 0x0472; 6733 t['afii10148'] = 0x0474; 6734 t['afii10192'] = 0xF6C6; 6735 t['afii10193'] = 0x045F; 6736 t['afii10194'] = 0x0463; 6737 t['afii10195'] = 0x0473; 6738 t['afii10196'] = 0x0475; 6739 t['afii10831'] = 0xF6C7; 6740 t['afii10832'] = 0xF6C8; 6741 t['afii10846'] = 0x04D9; 6742 t['afii299'] = 0x200E; 6743 t['afii300'] = 0x200F; 6744 t['afii301'] = 0x200D; 6745 t['afii57381'] = 0x066A; 6746 t['afii57388'] = 0x060C; 6747 t['afii57392'] = 0x0660; 6748 t['afii57393'] = 0x0661; 6749 t['afii57394'] = 0x0662; 6750 t['afii57395'] = 0x0663; 6751 t['afii57396'] = 0x0664; 6752 t['afii57397'] = 0x0665; 6753 t['afii57398'] = 0x0666; 6754 t['afii57399'] = 0x0667; 6755 t['afii57400'] = 0x0668; 6756 t['afii57401'] = 0x0669; 6757 t['afii57403'] = 0x061B; 6758 t['afii57407'] = 0x061F; 6759 t['afii57409'] = 0x0621; 6760 t['afii57410'] = 0x0622; 6761 t['afii57411'] = 0x0623; 6762 t['afii57412'] = 0x0624; 6763 t['afii57413'] = 0x0625; 6764 t['afii57414'] = 0x0626; 6765 t['afii57415'] = 0x0627; 6766 t['afii57416'] = 0x0628; 6767 t['afii57417'] = 0x0629; 6768 t['afii57418'] = 0x062A; 6769 t['afii57419'] = 0x062B; 6770 t['afii57420'] = 0x062C; 6771 t['afii57421'] = 0x062D; 6772 t['afii57422'] = 0x062E; 6773 t['afii57423'] = 0x062F; 6774 t['afii57424'] = 0x0630; 6775 t['afii57425'] = 0x0631;
6776 t['afii57426'] = 0x0632; 6777 t['afii57427'] = 0x0633; 6778 t['afii57428'] = 0x0634; 6779 t['afii57429'] = 0x0635; 6780 t['afii57430'] = 0x0636; 6781 t['afii57431'] = 0x0637; 6782 t['afii57432'] = 0x0638; 6783 t['afii57433'] = 0x0639; 6784 t['afii57434'] = 0x063A; 6785 t['afii57440'] = 0x0640; 6786 t['afii57441'] = 0x0641; 6787 t['afii57442'] = 0x0642; 6788 t['afii57443'] = 0x0643; 6789 t['afii57444'] = 0x0644; 6790 t['afii57445'] = 0x0645; 6791 t['afii57446'] = 0x0646; 6792 t['afii57448'] = 0x0648; 6793 t['afii57449'] = 0x0649; 6794 t['afii57450'] = 0x064A; 6795 t['afii57451'] = 0x064B; 6796 t['afii57452'] = 0x064C; 6797 t['afii57453'] = 0x064D; 6798 t['afii57454'] = 0x064E; 6799 t['afii57455'] = 0x064F; 6800 t['afii57456'] = 0x0650; 6801 t['afii57457'] = 0x0651; 6802 t['afii57458'] = 0x0652; 6803 t['afii57470'] = 0x0647; 6804 t['afii57505'] = 0x06A4; 6805 t['afii57506'] = 0x067E; 6806 t['afii57507'] = 0x0686; 6807 t['afii57508'] = 0x0698; 6808 t['afii57509'] = 0x06AF; 6809 t['afii57511'] = 0x0679; 6810 t['afii57512'] = 0x0688; 6811 t['afii57513'] = 0x0691; 6812 t['afii57514'] = 0x06BA; 6813 t['afii57519'] = 0x06D2; 6814 t['afii57534'] = 0x06D5; 6815 t['afii57636'] = 0x20AA; 6816 t['afii57645'] = 0x05BE; 6817 t['afii57658'] = 0x05C3; 6818 t['afii57664'] = 0x05D0; 6819 t['afii57665'] = 0x05D1; 6820 t['afii57666'] = 0x05D2; 6821 t['afii57667'] = 0x05D3; 6822 t['afii57668'] = 0x05D4; 6823 t['afii57669'] = 0x05D5; 6824 t['afii57670'] = 0x05D6; 6825 t['afii57671'] = 0x05D7; 6826 t['afii57672'] = 0x05D8; 6827 t['afii57673'] = 0x05D9; 6828 t['afii57674'] = 0x05DA; 6829 t['afii57675'] = 0x05DB; 6830 t['afii57676'] = 0x05DC; 6831 t['afii57677'] = 0x05DD; 6832 t['afii57678'] = 0x05DE; 6833 t['afii57679'] = 0x05DF; 6834 t['afii57680'] = 0x05E0; 6835 t['afii57681'] = 0x05E1; 6836 t['afii57682'] = 0x05E2; 6837 t['afii57683'] = 0x05E3; 6838 t['afii57684'] = 0x05E4; 6839 t['afii57685'] = 0x05E5; 6840 t['afii57686'] = 0x05E6; 6841 t['afii57687'] = 0x05E7; 6842 t['afii57688'] = 0x05E8; 6843 t['afii57689'] = 0x05E9; 6844 t['afii57690'] = 0x05EA; 6845 t['afii57694'] = 0xFB2A; 6846 t['afii57695'] = 0xFB2B; 6847 t['afii57700'] = 0xFB4B; 6848 t['afii57705'] = 0xFB1F; 6849 t['afii57716'] = 0x05F0; 6850 t['afii57717'] = 0x05F1; 6851 t['afii57718'] = 0x05F2; 6852 t['afii57723'] = 0xFB35; 6853 t['afii57793'] = 0x05B4; 6854 t['afii57794'] = 0x05B5; 6855 t['afii57795'] = 0x05B6; 6856 t['afii57796'] = 0x05BB; 6857 t['afii57797'] = 0x05B8; 6858 t['afii57798'] = 0x05B7; 6859 t['afii57799'] = 0x05B0; 6860 t['afii57800'] = 0x05B2; 6861 t['afii57801'] = 0x05B1; 6862 t['afii57802'] = 0x05B3; 6863 t['afii57803'] = 0x05C2; 6864 t['afii57804'] = 0x05C1; 6865 t['afii57806'] = 0x05B9; 6866 t['afii57807'] = 0x05BC; 6867 t['afii57839'] = 0x05BD; 6868 t['afii57841'] = 0x05BF; 6869 t['afii57842'] = 0x05C0; 6870 t['afii57929'] = 0x02BC; 6871 t['afii61248'] = 0x2105; 6872 t['afii61289'] = 0x2113; 6873 t['afii61352'] = 0x2116; 6874 t['afii61573'] = 0x202C; 6875 t['afii61574'] = 0x202D; 6876 t['afii61575'] = 0x202E; 6877 t['afii61664'] = 0x200C; 6878 t['afii63167'] = 0x066D; 6879 t['afii64937'] = 0x02BD; 6880 t['agrave'] = 0x00E0; 6881 t['agujarati'] = 0x0A85; 6882 t['agurmukhi'] = 0x0A05; 6883 t['ahiragana'] = 0x3042; 6884 t['ahookabove'] = 0x1EA3; 6885 t['aibengali'] = 0x0990; 6886 t['aibopomofo'] = 0x311E; 6887 t['aideva'] = 0x0910; 6888 t['aiecyrillic'] = 0x04D5; 6889 t['aigujarati'] = 0x0A90; 6890 t['aigurmukhi'] = 0x0A10; 6891 t['aimatragurmukhi'] = 0x0A48; 6892 t['ainarabic'] = 0x0639; 6893 t['ainfinalarabic'] = 0xFECA; 6894 t['aininitialarabic'] = 0xFECB; 6895 t['ainmedialarabic'] = 0xFECC; 6896 t['ainvertedbreve'] = 0x0203; 6897 t['aivowelsignbengali'] = 0x09C8; 6898 t['aivowelsigndeva'] = 0x0948; 6899 t['aivowelsigngujarati'] = 0x0AC8; 6900 t['akatakana'] = 0x30A2; 6901 t['akatakanahalfwidth'] = 0xFF71; 6902 t['akorean'] = 0x314F; 6903 t['alef'] = 0x05D0; 6904 t['alefarabic'] = 0x0627; 6905 t['alefdageshhebrew'] = 0xFB30; 6906 t['aleffinalarabic'] = 0xFE8E; 6907 t['alefhamzaabovearabic'] = 0x0623; 6908 t['alefhamzaabovefinalarabic'] = 0xFE84; 6909 t['alefhamzabelowarabic'] = 0x0625; 6910 t['alefhamzabelowfinalarabic'] = 0xFE88; 6911 t['alefhebrew'] = 0x05D0; 6912 t['aleflamedhebrew'] = 0xFB4F; 6913 t['alefmaddaabovearabic'] = 0x0622; 6914 t['alefmaddaabovefinalarabic'] = 0xFE82; 6915 t['alefmaksuraarabic'] = 0x0649; 6916 t['alefmaksurafinalarabic'] = 0xFEF0; 6917 t['alefmaksurainitialarabic'] = 0xFEF3; 6918 t['alefmaksuramedialarabic'] = 0xFEF4; 6919 t['alefpatahhebrew'] = 0xFB2E; 6920 t['alefqamatshebrew'] = 0xFB2F; 6921 t['aleph'] = 0x2135; 6922 t['allequal'] = 0x224C;
6923 t['alpha'] = 0x03B1; 6924 t['alphatonos'] = 0x03AC; 6925 t['amacron'] = 0x0101; 6926 t['amonospace'] = 0xFF41; 6927 t['ampersand'] = 0x0026; 6928 t['ampersandmonospace'] = 0xFF06; 6929 t['ampersandsmall'] = 0xF726; 6930 t['amsquare'] = 0x33C2; 6931 t['anbopomofo'] = 0x3122; 6932 t['angbopomofo'] = 0x3124; 6933 t['angbracketleft'] = 0x3008; 6934 t['angbracketright'] = 0x3009; 6935 t['angkhankhuthai'] = 0x0E5A; 6936 t['angle'] = 0x2220; 6937 t['anglebracketleft'] = 0x3008; 6938 t['anglebracketleftvertical'] = 0xFE3F; 6939 t['anglebracketright'] = 0x3009; 6940 t['anglebracketrightvertical'] = 0xFE40; 6941 t['angleleft'] = 0x2329; 6942 t['angleright'] = 0x232A; 6943 t['angstrom'] = 0x212B; 6944 t['anoteleia'] = 0x0387; 6945 t['anudattadeva'] = 0x0952; 6946 t['anusvarabengali'] = 0x0982; 6947 t['anusvaradeva'] = 0x0902; 6948 t['anusvaragujarati'] = 0x0A82; 6949 t['aogonek'] = 0x0105; 6950 t['apaatosquare'] = 0x3300; 6951 t['aparen'] = 0x249C; 6952 t['apostrophearmenian'] = 0x055A; 6953 t['apostrophemod'] = 0x02BC; 6954 t['apple'] = 0xF8FF; 6955 t['approaches'] = 0x2250; 6956 t['approxequal'] = 0x2248; 6957 t['approxequalorimage'] = 0x2252; 6958 t['approximatelyequal'] = 0x2245; 6959 t['araeaekorean'] = 0x318E; 6960 t['araeakorean'] = 0x318D; 6961 t['arc'] = 0x2312; 6962 t['arighthalfring'] = 0x1E9A; 6963 t['aring'] = 0x00E5; 6964 t['aringacute'] = 0x01FB; 6965 t['aringbelow'] = 0x1E01; 6966 t['arrowboth'] = 0x2194; 6967 t['arrowdashdown'] = 0x21E3; 6968 t['arrowdashleft'] = 0x21E0; 6969 t['arrowdashright'] = 0x21E2; 6970 t['arrowdashup'] = 0x21E1; 6971 t['arrowdblboth'] = 0x21D4; 6972 t['arrowdbldown'] = 0x21D3; 6973 t['arrowdblleft'] = 0x21D0; 6974 t['arrowdblright'] = 0x21D2; 6975 t['arrowdblup'] = 0x21D1; 6976 t['arrowdown'] = 0x2193; 6977 t['arrowdownleft'] = 0x2199; 6978 t['arrowdownright'] = 0x2198; 6979 t['arrowdownwhite'] = 0x21E9; 6980 t['arrowheaddownmod'] = 0x02C5; 6981 t['arrowheadleftmod'] = 0x02C2; 6982 t['arrowheadrightmod'] = 0x02C3; 6983 t['arrowheadupmod'] = 0x02C4; 6984 t['arrowhorizex'] = 0xF8E7; 6985 t['arrowleft'] = 0x2190;
6986 t['arrowleftdbl'] = 0x21D0; 6987 t['arrowleftdblstroke'] = 0x21CD; 6988 t['arrowleftoverright'] = 0x21C6; 6989 t['arrowleftwhite'] = 0x21E6; 6990 t['arrowright'] = 0x2192; 6991 t['arrowrightdblstroke'] = 0x21CF; 6992 t['arrowrightheavy'] = 0x279E; 6993 t['arrowrightoverleft'] = 0x21C4; 6994 t['arrowrightwhite'] = 0x21E8; 6995 t['arrowtableft'] = 0x21E4; 6996 t['arrowtabright'] = 0x21E5; 6997 t['arrowup'] = 0x2191; 6998 t['arrowupdn'] = 0x2195; 6999 t['arrowupdnbse'] = 0x21A8; 7000 t['arrowupdownbase'] = 0x21A8; 7001 t['arrowupleft'] = 0x2196; 7002 t['arrowupleftofdown'] = 0x21C5; 7003 t['arrowupright'] = 0x2197; 7004 t['arrowupwhite'] = 0x21E7; 7005 t['arrowvertex'] = 0xF8E6; 7006 t['asciicircum'] = 0x005E; 7007 t['asciicircummonospace'] = 0xFF3E; 7008 t['asciitilde'] = 0x007E; 7009 t['asciitildemonospace'] = 0xFF5E; 7010 t['ascript'] = 0x0251; 7011 t['ascriptturned'] = 0x0252; 7012 t['asmallhiragana'] = 0x3041; 7013 t['asmallkatakana'] = 0x30A1; 7014 t['asmallkatakanahalfwidth'] = 0xFF67; 7015 t['asterisk'] = 0x002A; 7016 t['asteriskaltonearabic'] = 0x066D; 7017 t['asteriskarabic'] = 0x066D; 7018 t['asteriskmath'] = 0x2217; 7019 t['asteriskmonospace'] = 0xFF0A; 7020 t['asterisksmall'] = 0xFE61; 7021 t['asterism'] = 0x2042; 7022 t['asuperior'] = 0xF6E9; 7023 t['asymptoticallyequal'] = 0x2243; 7024 t['at'] = 0x0040; 7025 t['atilde'] = 0x00E3; 7026 t['atmonospace'] = 0xFF20; 7027 t['atsmall'] = 0xFE6B; 7028 t['aturned'] = 0x0250; 7029 t['aubengali'] = 0x0994; 7030 t['aubopomofo'] = 0x3120; 7031 t['audeva'] = 0x0914; 7032 t['augujarati'] = 0x0A94; 7033 t['augurmukhi'] = 0x0A14; 7034 t['aulengthmarkbengali'] = 0x09D7; 7035 t['aumatragurmukhi'] = 0x0A4C; 7036 t['auvowelsignbengali'] = 0x09CC; 7037 t['auvowelsigndeva'] = 0x094C; 7038 t['auvowelsigngujarati'] = 0x0ACC; 7039 t['avagrahadeva'] = 0x093D; 7040 t['aybarmenian'] = 0x0561; 7041 t['ayin'] = 0x05E2; 7042 t['ayinaltonehebrew'] = 0xFB20; 7043 t['ayinhebrew'] = 0x05E2; 7044 t['b'] = 0x0062; 7045 t['babengali'] = 0x09AC; 7046 t['backslash'] = 0x005C; 7047 t['backslashmonospace'] = 0xFF3C; 7048 t['badeva'] = 0x092C; 7049 t['bagujarati'] = 0x0AAC; 7050 t['bagurmukhi'] = 0x0A2C; 7051 t['bahiragana'] = 0x3070; 7052 t['bahtthai'] = 0x0E3F; 7053 t['bakatakana'] = 0x30D0; 7054 t['bar'] = 0x007C; 7055 t['barmonospace'] = 0xFF5C; 7056 t['bbopomofo'] = 0x3105; 7057 t['bcircle'] = 0x24D1; 7058 t['bdotaccent'] = 0x1E03; 7059 t['bdotbelow'] = 0x1E05; 7060 t['beamedsixteenthnotes'] = 0x266C; 7061 t['because'] = 0x2235; 7062 t['becyrillic'] = 0x0431; 7063 t['beharabic'] = 0x0628; 7064 t['behfinalarabic'] = 0xFE90; 7065 t['behinitialarabic'] = 0xFE91; 7066 t['behiragana'] = 0x3079; 7067 t['behmedialarabic'] = 0xFE92; 7068 t['behmeeminitialarabic'] = 0xFC9F; 7069 t['behmeemisolatedarabic'] = 0xFC08; 7070 t['behnoonfinalarabic'] = 0xFC6D; 7071 t['bekatakana'] = 0x30D9; 7072 t['benarmenian'] = 0x0562; 7073 t['bet'] = 0x05D1; 7074 t['beta'] = 0x03B2; 7075 t['betasymbolgreek'] = 0x03D0; 7076 t['betdagesh'] = 0xFB31; 7077 t['betdageshhebrew'] = 0xFB31; 7078 t['bethebrew'] = 0x05D1; 7079 t['betrafehebrew'] = 0xFB4C; 7080 t['bhabengali'] = 0x09AD; 7081 t['bhadeva'] = 0x092D; 7082 t['bhagujarati'] = 0x0AAD; 7083 t['bhagurmukhi'] = 0x0A2D; 7084 t['bhook'] = 0x0253; 7085 t['bihiragana'] = 0x3073; 7086 t['bikatakana'] = 0x30D3; 7087 t['bilabialclick'] = 0x0298; 7088 t['bindigurmukhi'] = 0x0A02; 7089 t['birusquare'] = 0x3331; 7090 t['blackcircle'] = 0x25CF; 7091 t['blackdiamond'] = 0x25C6; 7092 t['blackdownpointingtriangle'] = 0x25BC; 7093 t['blackleftpointingpointer'] = 0x25C4; 7094 t['blackleftpointingtriangle'] = 0x25C0; 7095 t['blacklenticularbracketleft'] = 0x3010; 7096 t['blacklenticularbracketleftvertical'] = 0xFE3B; 7097 t['blacklenticularbracketright'] = 0x3011; 7098 t['blacklenticularbracketrightvertical'] = 0xFE3C; 7099 t['blacklowerlefttriangle'] = 0x25E3; 7100 t['blacklowerrighttriangle'] = 0x25E2; 7101 t['blackrectangle'] = 0x25AC; 7102 t['blackrightpointingpointer'] = 0x25BA; 7103 t['blackrightpointingtriangle'] = 0x25B6; 7104 t['blacksmallsquare'] = 0x25AA; 7105 t['blacksmilingface'] = 0x263B; 7106 t['blacksquare'] = 0x25A0; 7107 t['blackstar'] = 0x2605; 7108 t['blackupperlefttriangle'] = 0x25E4; 7109 t['blackupperrighttriangle'] = 0x25E5; 7110 t['blackuppointingsmalltriangle'] = 0x25B4; 7111 t['blackuppointingtriangle'] = 0x25B2; 7112 t['blank'] = 0x2423; 7113 t['blinebelow'] = 0x1E07; 7114 t['block'] = 0x2588; 7115 t['bmonospace'] = 0xFF42; 7116 t['bobaimaithai'] = 0x0E1A; 7117 t['bohiragana'] = 0x307C; 7118 t['bokatakana'] = 0x30DC; 7119 t['bparen'] = 0x249D; 7120 t['bqsquare'] = 0x33C3; 7121 t['braceex'] = 0xF8F4; 7122 t['braceleft'] = 0x007B; 7123 t['braceleftbt'] = 0xF8F3; 7124 t['braceleftmid'] = 0xF8F2; 7125 t['braceleftmonospace'] = 0xFF5B; 7126 t['braceleftsmall'] = 0xFE5B; 7127 t['bracelefttp'] = 0xF8F1; 7128 t['braceleftvertical'] = 0xFE37; 7129 t['braceright'] = 0x007D; 7130 t['bracerightbt'] = 0xF8FE; 7131 t['bracerightmid'] = 0xF8FD; 7132 t['bracerightmonospace'] = 0xFF5D; 7133 t['bracerightsmall'] = 0xFE5C; 7134 t['bracerighttp'] = 0xF8FC; 7135 t['bracerightvertical'] = 0xFE38; 7136 t['bracketleft'] = 0x005B; 7137 t['bracketleftbt'] = 0xF8F0; 7138 t['bracketleftex'] = 0xF8EF; 7139 t['bracketleftmonospace'] = 0xFF3B; 7140 t['bracketlefttp'] = 0xF8EE; 7141 t['bracketright'] = 0x005D; 7142 t['bracketrightbt'] = 0xF8FB; 7143 t['bracketrightex'] = 0xF8FA; 7144 t['bracketrightmonospace'] = 0xFF3D; 7145 t['bracketrighttp'] = 0xF8F9; 7146 t['breve'] = 0x02D8; 7147 t['brevebelowcmb'] = 0x032E; 7148 t['brevecmb'] = 0x0306; 7149 t['breveinvertedbelowcmb'] = 0x032F; 7150 t['breveinvertedcmb'] = 0x0311; 7151 t['breveinverteddoublecmb'] = 0x0361; 7152 t['bridgebelowcmb'] = 0x032A; 7153 t['bridgeinvertedbelowcmb'] = 0x033A; 7154 t['brokenbar'] = 0x00A6;
7155 t['bstroke'] = 0x0180; 7156 t['bsuperior'] = 0xF6EA; 7157 t['btopbar'] = 0x0183; 7158 t['buhiragana'] = 0x3076; 7159 t['bukatakana'] = 0x30D6; 7160 t['bullet'] = 0x2022; 7161 t['bulletinverse'] = 0x25D8; 7162 t['bulletoperator'] = 0x2219; 7163 t['bullseye'] = 0x25CE; 7164 t['c'] = 0x0063; 7165 t['caarmenian'] = 0x056E; 7166 t['cabengali'] = 0x099A; 7167 t['cacute'] = 0x0107; 7168 t['cadeva'] = 0x091A; 7169 t['cagujarati'] = 0x0A9A; 7170 t['cagurmukhi'] = 0x0A1A; 7171 t['calsquare'] = 0x3388; 7172 t['candrabindubengali'] = 0x0981; 7173 t['candrabinducmb'] = 0x0310; 7174 t['candrabindudeva'] = 0x0901; 7175 t['candrabindugujarati'] = 0x0A81; 7176 t['capslock'] = 0x21EA; 7177 t['careof'] = 0x2105; 7178 t['caron'] = 0x02C7; 7179 t['caronbelowcmb'] = 0x032C; 7180 t['caroncmb'] = 0x030C; 7181 t['carriagereturn'] = 0x21B5; 7182 t['cbopomofo'] = 0x3118; 7183 t['ccaron'] = 0x010D; 7184 t['ccedilla'] = 0x00E7; 7185 t['ccedillaacute'] = 0x1E09; 7186 t['ccircle'] = 0x24D2; 7187 t['ccircumflex'] = 0x0109; 7188 t['ccurl'] = 0x0255; 7189 t['cdot'] = 0x010B; 7190 t['cdotaccent'] = 0x010B; 7191 t['cdsquare'] = 0x33C5; 7192 t['cedilla'] = 0x00B8; 7193 t['cedillacmb'] = 0x0327; 7194 t['cent'] = 0x00A2; 7195 t['centigrade'] = 0x2103; 7196 t['centinferior'] = 0xF6DF; 7197 t['centmonospace'] = 0xFFE0; 7198 t['centoldstyle'] = 0xF7A2; 7199 t['centsuperior'] = 0xF6E0; 7200 t['chaarmenian'] = 0x0579; 7201 t['chabengali'] = 0x099B; 7202 t['chadeva'] = 0x091B; 7203 t['chagujarati'] = 0x0A9B; 7204 t['chagurmukhi'] = 0x0A1B; 7205 t['chbopomofo'] = 0x3114; 7206 t['cheabkhasiancyrillic'] = 0x04BD; 7207 t['checkmark'] = 0x2713; 7208 t['checyrillic'] = 0x0447; 7209 t['chedescenderabkhasiancyrillic'] = 0x04BF; 7210 t['chedescendercyrillic'] = 0x04B7; 7211 t['chedieresiscyrillic'] = 0x04F5; 7212 t['cheharmenian'] = 0x0573; 7213 t['chekhakassiancyrillic'] = 0x04CC; 7214 t['cheverticalstrokecyrillic'] = 0x04B9; 7215 t['chi'] = 0x03C7; 7216 t['chieuchacirclekorean'] = 0x3277; 7217 t['chieuchaparenkorean'] = 0x3217; 7218 t['chieuchcirclekorean'] = 0x3269; 7219 t['chieuchkorean'] = 0x314A; 7220 t['chieuchparenkorean'] = 0x3209; 7221 t['chochangthai'] = 0x0E0A; 7222 t['chochanthai'] = 0x0E08; 7223 t['chochingthai'] = 0x0E09; 7224 t['chochoethai'] = 0x0E0C; 7225 t['chook'] = 0x0188; 7226 t['cieucacirclekorean'] = 0x3276; 7227 t['cieucaparenkorean'] = 0x3216; 7228 t['cieuccirclekorean'] = 0x3268; 7229 t['cieuckorean'] = 0x3148; 7230 t['cieucparenkorean'] = 0x3208; 7231 t['cieucuparenkorean'] = 0x321C; 7232 t['circle'] = 0x25CB; 7233 t['circlecopyrt'] = 0x00A9; 7234 t['circlemultiply'] = 0x2297; 7235 t['circleot'] = 0x2299; 7236 t['circleplus'] = 0x2295; 7237 t['circlepostalmark'] = 0x3036; 7238 t['circlewithlefthalfblack'] = 0x25D0; 7239 t['circlewithrighthalfblack'] = 0x25D1; 7240 t['circumflex'] = 0x02C6; 7241 t['circumflexbelowcmb'] = 0x032D; 7242 t['circumflexcmb'] = 0x0302; 7243 t['clear'] = 0x2327; 7244 t['clickalveolar'] = 0x01C2; 7245 t['clickdental'] = 0x01C0; 7246 t['clicklateral'] = 0x01C1; 7247 t['clickretroflex'] = 0x01C3; 7248 t['club'] = 0x2663; 7249 t['clubsuitblack'] = 0x2663; 7250 t['clubsuitwhite'] = 0x2667; 7251 t['cmcubedsquare'] = 0x33A4; 7252 t['cmonospace'] = 0xFF43; 7253 t['cmsquaredsquare'] = 0x33A0; 7254 t['coarmenian'] = 0x0581; 7255 t['colon'] = 0x003A; 7256 t['colonmonetary'] = 0x20A1; 7257 t['colonmonospace'] = 0xFF1A; 7258 t['colonsign'] = 0x20A1; 7259 t['colonsmall'] = 0xFE55; 7260 t['colontriangularhalfmod'] = 0x02D1; 7261 t['colontriangularmod'] = 0x02D0; 7262 t['comma'] = 0x002C; 7263 t['commaabovecmb'] = 0x0313; 7264 t['commaaboverightcmb'] = 0x0315; 7265 t['commaaccent'] = 0xF6C3; 7266 t['commaarabic'] = 0x060C; 7267 t['commaarmenian'] = 0x055D; 7268 t['commainferior'] = 0xF6E1; 7269 t['commamonospace'] = 0xFF0C; 7270 t['commareversedabovecmb'] = 0x0314; 7271 t['commareversedmod'] = 0x02BD; 7272 t['commasmall'] = 0xFE50; 7273 t['commasuperior'] = 0xF6E2; 7274 t['commaturnedabovecmb'] = 0x0312; 7275 t['commaturnedmod'] = 0x02BB; 7276 t['compass'] = 0x263C; 7277 t['congruent'] = 0x2245; 7278 t['contourintegral'] = 0x222E; 7279 t['control'] = 0x2303; 7280 t['controlACK'] = 0x0006; 7281 t['controlBEL'] = 0x0007; 7282 t['controlBS'] = 0x0008; 7283 t['controlCAN'] = 0x0018; 7284 t['controlCR'] = 0x000D; 7285 t['controlDC1'] = 0x0011; 7286 t['controlDC2'] = 0x0012; 7287 t['controlDC3'] = 0x0013; 7288 t['controlDC4'] = 0x0014; 7289 t['controlDEL'] = 0x007F; 7290 t['controlDLE'] = 0x0010; 7291 t['controlEM'] = 0x0019; 7292 t['controlENQ'] = 0x0005; 7293 t['controlEOT'] = 0x0004; 7294 t['controlESC'] = 0x001B; 7295 t['controlETB'] = 0x0017; 7296 t['controlETX'] = 0x0003; 7297 t['controlFF'] = 0x000C; 7298 t['controlFS'] = 0x001C; 7299 t['controlGS'] = 0x001D;
7300 t['controlHT'] = 0x0009; 7301 t['controlLF'] = 0x000A; 7302 t['controlNAK'] = 0x0015; 7303 t['controlNULL'] = 0x0000; 7304 t['controlRS'] = 0x001E; 7305 t['controlSI'] = 0x000F; 7306 t['controlSO'] = 0x000E; 7307 t['controlSOT'] = 0x0002; 7308 t['controlSTX'] = 0x0001; 7309 t['controlSUB'] = 0x001A; 7310 t['controlSYN'] = 0x0016; 7311 t['controlUS'] = 0x001F; 7312 t['controlVT'] = 0x000B; 7313 t['copyright'] = 0x00A9; 7314 t['copyrightsans'] = 0xF8E9; 7315 t['copyrightserif'] = 0xF6D9; 7316 t['cornerbracketleft'] = 0x300C; 7317 t['cornerbracketlefthalfwidth'] = 0xFF62; 7318 t['cornerbracketleftvertical'] = 0xFE41; 7319 t['cornerbracketright'] = 0x300D; 7320 t['cornerbracketrighthalfwidth'] = 0xFF63; 7321 t['cornerbracketrightvertical'] = 0xFE42; 7322 t['corporationsquare'] = 0x337F; 7323 t['cosquare'] = 0x33C7; 7324 t['coverkgsquare'] = 0x33C6; 7325 t['cparen'] = 0x249E; 7326 t['cruzeiro'] = 0x20A2; 7327 t['cstretched'] = 0x0297; 7328 t['curlyand'] = 0x22CF; 7329 t['curlyor'] = 0x22CE; 7330 t['currency'] = 0x00A4; 7331 t['cyrBreve'] = 0xF6D1; 7332 t['cyrFlex'] = 0xF6D2; 7333 t['cyrbreve'] = 0xF6D4; 7334 t['cyrflex'] = 0xF6D5; 7335 t['d'] = 0x0064; 7336 t['daarmenian'] = 0x0564; 7337 t['dabengali'] = 0x09A6; 7338 t['dadarabic'] = 0x0636; 7339 t['dadeva'] = 0x0926; 7340 t['dadfinalarabic'] = 0xFEBE; 7341 t['dadinitialarabic'] = 0xFEBF; 7342 t['dadmedialarabic'] = 0xFEC0; 7343 t['dagesh'] = 0x05BC; 7344 t['dageshhebrew'] = 0x05BC; 7345 t['dagger'] = 0x2020; 7346 t['daggerdbl'] = 0x2021; 7347 t['dagujarati'] = 0x0AA6; 7348 t['dagurmukhi'] = 0x0A26; 7349 t['dahiragana'] = 0x3060; 7350 t['dakatakana'] = 0x30C0; 7351 t['dalarabic'] = 0x062F; 7352 t['dalet'] = 0x05D3; 7353 t['daletdagesh'] = 0xFB33; 7354 t['daletdageshhebrew'] = 0xFB33; 7355 t['dalethebrew'] = 0x05D3; 7356 t['dalfinalarabic'] = 0xFEAA; 7357 t['dammaarabic'] = 0x064F; 7358 t['dammalowarabic'] = 0x064F; 7359 t['dammatanaltonearabic'] = 0x064C; 7360 t['dammatanarabic'] = 0x064C; 7361 t['danda'] = 0x0964; 7362 t['dargahebrew'] = 0x05A7; 7363 t['dargalefthebrew'] = 0x05A7; 7364 t['dasiapneumatacyrilliccmb'] = 0x0485; 7365 t['dblGrave'] = 0xF6D3; 7366 t['dblanglebracketleft'] = 0x300A; 7367 t['dblanglebracketleftvertical'] = 0xFE3D; 7368 t['dblanglebracketright'] = 0x300B; 7369 t['dblanglebracketrightvertical'] = 0xFE3E; 7370 t['dblarchinvertedbelowcmb'] = 0x032B; 7371 t['dblarrowleft'] = 0x21D4; 7372 t['dblarrowright'] = 0x21D2; 7373 t['dbldanda'] = 0x0965; 7374 t['dblgrave'] = 0xF6D6; 7375 t['dblgravecmb'] = 0x030F; 7376 t['dblintegral'] = 0x222C; 7377 t['dbllowline'] = 0x2017; 7378 t['dbllowlinecmb'] = 0x0333; 7379 t['dbloverlinecmb'] = 0x033F; 7380 t['dblprimemod'] = 0x02BA; 7381 t['dblverticalbar'] = 0x2016; 7382 t['dblverticallineabovecmb'] = 0x030E; 7383 t['dbopomofo'] = 0x3109; 7384 t['dbsquare'] = 0x33C8; 7385 t['dcaron'] = 0x010F; 7386 t['dcedilla'] = 0x1E11; 7387 t['dcircle'] = 0x24D3; 7388 t['dcircumflexbelow'] = 0x1E13; 7389 t['dcroat'] = 0x0111; 7390 t['ddabengali'] = 0x09A1; 7391 t['ddadeva'] = 0x0921; 7392 t['ddagujarati'] = 0x0AA1; 7393 t['ddagurmukhi'] = 0x0A21; 7394 t['ddalarabic'] = 0x0688; 7395 t['ddalfinalarabic'] = 0xFB89; 7396 t['dddhadeva'] = 0x095C; 7397 t['ddhabengali'] = 0x09A2; 7398 t['ddhadeva'] = 0x0922; 7399 t['ddhagujarati'] = 0x0AA2; 7400 t['ddhagurmukhi'] = 0x0A22; 7401 t['ddotaccent'] = 0x1E0B; 7402 t['ddotbelow'] = 0x1E0D; 7403 t['decimalseparatorarabic'] = 0x066B; 7404 t['decimalseparatorpersian'] = 0x066B; 7405 t['decyrillic'] = 0x0434; 7406 t['degree'] = 0x00B0; 7407 t['dehihebrew'] = 0x05AD; 7408 t['dehiragana'] = 0x3067; 7409 t['deicoptic'] = 0x03EF; 7410 t['dekatakana'] = 0x30C7; 7411 t['deleteleft'] = 0x232B; 7412 t['deleteright'] = 0x2326; 7413 t['delta'] = 0x03B4; 7414 t['deltaturned'] = 0x018D;
7415 t['denominatorminusonenumeratorbengali'] = 0x09F8; 7416 t['dezh'] = 0x02A4; 7417 t['dhabengali'] = 0x09A7; 7418 t['dhadeva'] = 0x0927; 7419 t['dhagujarati'] = 0x0AA7; 7420 t['dhagurmukhi'] = 0x0A27; 7421 t['dhook'] = 0x0257; 7422 t['dialytikatonos'] = 0x0385; 7423 t['dialytikatonoscmb'] = 0x0344; 7424 t['diamond'] = 0x2666; 7425 t['diamondsuitwhite'] = 0x2662; 7426 t['dieresis'] = 0x00A8; 7427 t['dieresisacute'] = 0xF6D7; 7428 t['dieresisbelowcmb'] = 0x0324; 7429 t['dieresiscmb'] = 0x0308; 7430 t['dieresisgrave'] = 0xF6D8; 7431 t['dieresistonos'] = 0x0385; 7432 t['dihiragana'] = 0x3062; 7433 t['dikatakana'] = 0x30C2; 7434 t['dittomark'] = 0x3003; 7435 t['divide'] = 0x00F7; 7436 t['divides'] = 0x2223; 7437 t['divisionslash'] = 0x2215; 7438 t['djecyrillic'] = 0x0452; 7439 t['dkshade'] = 0x2593; 7440 t['dlinebelow'] = 0x1E0F; 7441 t['dlsquare'] = 0x3397; 7442 t['dmacron'] = 0x0111; 7443 t['dmonospace'] = 0xFF44; 7444 t['dnblock'] = 0x2584; 7445 t['dochadathai'] = 0x0E0E; 7446 t['dodekthai'] = 0x0E14; 7447 t['dohiragana'] = 0x3069; 7448 t['dokatakana'] = 0x30C9; 7449 t['dollar'] = 0x0024; 7450 t['dollarinferior'] = 0xF6E3; 7451 t['dollarmonospace'] = 0xFF04; 7452 t['dollaroldstyle'] = 0xF724; 7453 t['dollarsmall'] = 0xFE69; 7454 t['dollarsuperior'] = 0xF6E4; 7455 t['dong'] = 0x20AB; 7456 t['dorusquare'] = 0x3326; 7457 t['dotaccent'] = 0x02D9; 7458 t['dotaccentcmb'] = 0x0307; 7459 t['dotbelowcmb'] = 0x0323; 7460 t['dotbelowcomb'] = 0x0323;
7461 t['dotkatakana'] = 0x30FB; 7462 t['dotlessi'] = 0x0131; 7463 t['dotlessj'] = 0xF6BE; 7464 t['dotlessjstrokehook'] = 0x0284; 7465 t['dotmath'] = 0x22C5; 7466 t['dottedcircle'] = 0x25CC; 7467 t['doubleyodpatah'] = 0xFB1F; 7468 t['doubleyodpatahhebrew'] = 0xFB1F; 7469 t['downtackbelowcmb'] = 0x031E; 7470 t['downtackmod'] = 0x02D5; 7471 t['dparen'] = 0x249F; 7472 t['dsuperior'] = 0xF6EB; 7473 t['dtail'] = 0x0256; 7474 t['dtopbar'] = 0x018C; 7475 t['duhiragana'] = 0x3065; 7476 t['dukatakana'] = 0x30C5; 7477 t['dz'] = 0x01F3; 7478 t['dzaltone'] = 0x02A3; 7479 t['dzcaron'] = 0x01C6; 7480 t['dzcurl'] = 0x02A5; 7481 t['dzeabkhasiancyrillic'] = 0x04E1; 7482 t['dzecyrillic'] = 0x0455; 7483 t['dzhecyrillic'] = 0x045F; 7484 t['e'] = 0x0065; 7485 t['eacute'] = 0x00E9; 7486 t['earth'] = 0x2641; 7487 t['ebengali'] = 0x098F; 7488 t['ebopomofo'] = 0x311C; 7489 t['ebreve'] = 0x0115; 7490 t['ecandradeva'] = 0x090D; 7491 t['ecandragujarati'] = 0x0A8D; 7492 t['ecandravowelsigndeva'] = 0x0945; 7493 t['ecandravowelsigngujarati'] = 0x0AC5; 7494 t['ecaron'] = 0x011B; 7495 t['ecedillabreve'] = 0x1E1D; 7496 t['echarmenian'] = 0x0565; 7497 t['echyiwnarmenian'] = 0x0587; 7498 t['ecircle'] = 0x24D4; 7499 t['ecircumflex'] = 0x00EA; 7500 t['ecircumflexacute'] = 0x1EBF; 7501 t['ecircumflexbelow'] = 0x1E19; 7502 t['ecircumflexdotbelow'] = 0x1EC7; 7503 t['ecircumflexgrave'] = 0x1EC1; 7504 t['ecircumflexhookabove'] = 0x1EC3; 7505 t['ecircumflextilde'] = 0x1EC5; 7506 t['ecyrillic'] = 0x0454; 7507 t['edblgrave'] = 0x0205; 7508 t['edeva'] = 0x090F; 7509 t['edieresis'] = 0x00EB; 7510 t['edot'] = 0x0117; 7511 t['edotaccent'] = 0x0117; 7512 t['edotbelow'] = 0x1EB9; 7513 t['eegurmukhi'] = 0x0A0F; 7514 t['eematragurmukhi'] = 0x0A47; 7515 t['efcyrillic'] = 0x0444; 7516 t['egrave'] = 0x00E8; 7517 t['egujarati'] = 0x0A8F; 7518 t['eharmenian'] = 0x0567; 7519 t['ehbopomofo'] = 0x311D; 7520 t['ehiragana'] = 0x3048; 7521 t['ehookabove'] = 0x1EBB; 7522 t['eibopomofo'] = 0x311F; 7523 t['eight'] = 0x0038; 7524 t['eightarabic'] = 0x0668; 7525 t['eightbengali'] = 0x09EE; 7526 t['eightcircle'] = 0x2467; 7527 t['eightcircleinversesansserif'] = 0x2791; 7528 t['eightdeva'] = 0x096E; 7529 t['eighteencircle'] = 0x2471; 7530 t['eighteenparen'] = 0x2485; 7531 t['eighteenperiod'] = 0x2499; 7532 t['eightgujarati'] = 0x0AEE; 7533 t['eightgurmukhi'] = 0x0A6E; 7534 t['eighthackarabic'] = 0x0668; 7535 t['eighthangzhou'] = 0x3028; 7536 t['eighthnotebeamed'] = 0x266B; 7537 t['eightideographicparen'] = 0x3227; 7538 t['eightinferior'] = 0x2088; 7539 t['eightmonospace'] = 0xFF18; 7540 t['eightoldstyle'] = 0xF738; 7541 t['eightparen'] = 0x247B; 7542 t['eightperiod'] = 0x248F; 7543 t['eightpersian'] = 0x06F8; 7544 t['eightroman'] = 0x2177; 7545 t['eightsuperior'] = 0x2078; 7546 t['eightthai'] = 0x0E58; 7547 t['einvertedbreve'] = 0x0207; 7548 t['eiotifiedcyrillic'] = 0x0465; 7549 t['ekatakana'] = 0x30A8; 7550 t['ekatakanahalfwidth'] = 0xFF74; 7551 t['ekonkargurmukhi'] = 0x0A74; 7552 t['ekorean'] = 0x3154; 7553 t['elcyrillic'] = 0x043B; 7554 t['element'] = 0x2208; 7555 t['elevencircle'] = 0x246A; 7556 t['elevenparen'] = 0x247E; 7557 t['elevenperiod'] = 0x2492; 7558 t['elevenroman'] = 0x217A; 7559 t['ellipsis'] = 0x2026; 7560 t['ellipsisvertical'] = 0x22EE; 7561 t['emacron'] = 0x0113; 7562 t['emacronacute'] = 0x1E17; 7563 t['emacrongrave'] = 0x1E15; 7564 t['emcyrillic'] = 0x043C; 7565 t['emdash'] = 0x2014; 7566 t['emdashvertical'] = 0xFE31; 7567 t['emonospace'] = 0xFF45; 7568 t['emphasismarkarmenian'] = 0x055B; 7569 t['emptyset'] = 0x2205; 7570 t['enbopomofo'] = 0x3123; 7571 t['encyrillic'] = 0x043D; 7572 t['endash'] = 0x2013; 7573 t['endashvertical'] = 0xFE32; 7574 t['endescendercyrillic'] = 0x04A3; 7575 t['eng'] = 0x014B; 7576 t['engbopomofo'] = 0x3125; 7577 t['enghecyrillic'] = 0x04A5; 7578 t['enhookcyrillic'] = 0x04C8; 7579 t['enspace'] = 0x2002; 7580 t['eogonek'] = 0x0119; 7581 t['eokorean'] = 0x3153; 7582 t['eopen'] = 0x025B; 7583 t['eopenclosed'] = 0x029A; 7584 t['eopenreversed'] = 0x025C; 7585 t['eopenreversedclosed'] = 0x025E; 7586 t['eopenreversedhook'] = 0x025D; 7587 t['eparen'] = 0x24A0; 7588 t['epsilon'] = 0x03B5; 7589 t['epsilontonos'] = 0x03AD; 7590 t['equal'] = 0x003D; 7591 t['equalmonospace'] = 0xFF1D; 7592 t['equalsmall'] = 0xFE66; 7593 t['equalsuperior'] = 0x207C; 7594 t['equivalence'] = 0x2261; 7595 t['erbopomofo'] = 0x3126; 7596 t['ercyrillic'] = 0x0440; 7597 t['ereversed'] = 0x0258; 7598 t['ereversedcyrillic'] = 0x044D; 7599 t['escyrillic'] = 0x0441; 7600 t['esdescendercyrillic'] = 0x04AB; 7601 t['esh'] = 0x0283; 7602 t['eshcurl'] = 0x0286; 7603 t['eshortdeva'] = 0x090E; 7604 t['eshortvowelsigndeva'] = 0x0946; 7605 t['eshreversedloop'] = 0x01AA; 7606 t['eshsquatreversed'] = 0x0285; 7607 t['esmallhiragana'] = 0x3047; 7608 t['esmallkatakana'] = 0x30A7; 7609 t['esmallkatakanahalfwidth'] = 0xFF6A;
7610 t['estimated'] = 0x212E; 7611 t['esuperior'] = 0xF6EC; 7612 t['eta'] = 0x03B7; 7613 t['etarmenian'] = 0x0568; 7614 t['etatonos'] = 0x03AE; 7615 t['eth'] = 0x00F0; 7616 t['etilde'] = 0x1EBD; 7617 t['etildebelow'] = 0x1E1B; 7618 t['etnahtafoukhhebrew'] = 0x0591; 7619 t['etnahtafoukhlefthebrew'] = 0x0591; 7620 t['etnahtahebrew'] = 0x0591; 7621 t['etnahtalefthebrew'] = 0x0591; 7622 t['eturned'] = 0x01DD; 7623 t['eukorean'] = 0x3161; 7624 t['euro'] = 0x20AC; 7625 t['evowelsignbengali'] = 0x09C7; 7626 t['evowelsigndeva'] = 0x0947; 7627 t['evowelsigngujarati'] = 0x0AC7; 7628 t['exclam'] = 0x0021; 7629 t['exclamarmenian'] = 0x055C; 7630 t['exclamdbl'] = 0x203C; 7631 t['exclamdown'] = 0x00A1; 7632 t['exclamdownsmall'] = 0xF7A1; 7633 t['exclammonospace'] = 0xFF01; 7634 t['exclamsmall'] = 0xF721; 7635 t['existential'] = 0x2203; 7636 t['ezh'] = 0x0292; 7637 t['ezhcaron'] = 0x01EF; 7638 t['ezhcurl'] = 0x0293; 7639 t['ezhreversed'] = 0x01B9; 7640 t['ezhtail'] = 0x01BA; 7641 t['f'] = 0x0066; 7642 t['fadeva'] = 0x095E; 7643 t['fagurmukhi'] = 0x0A5E; 7644 t['fahrenheit'] = 0x2109; 7645 t['fathaarabic'] = 0x064E; 7646 t['fathalowarabic'] = 0x064E; 7647 t['fathatanarabic'] = 0x064B; 7648 t['fbopomofo'] = 0x3108; 7649 t['fcircle'] = 0x24D5; 7650 t['fdotaccent'] = 0x1E1F; 7651 t['feharabic'] = 0x0641; 7652 t['feharmenian'] = 0x0586; 7653 t['fehfinalarabic'] = 0xFED2; 7654 t['fehinitialarabic'] = 0xFED3; 7655 t['fehmedialarabic'] = 0xFED4; 7656 t['feicoptic'] = 0x03E5; 7657 t['female'] = 0x2640; 7658 t['ff'] = 0xFB00; 7659 t['ffi'] = 0xFB03; 7660 t['ffl'] = 0xFB04; 7661 t['fi'] = 0xFB01; 7662 t['fifteencircle'] = 0x246E; 7663 t['fifteenparen'] = 0x2482; 7664 t['fifteenperiod'] = 0x2496; 7665 t['figuredash'] = 0x2012; 7666 t['filledbox'] = 0x25A0; 7667 t['filledrect'] = 0x25AC; 7668 t['finalkaf'] = 0x05DA; 7669 t['finalkafdagesh'] = 0xFB3A; 7670 t['finalkafdageshhebrew'] = 0xFB3A; 7671 t['finalkafhebrew'] = 0x05DA; 7672 t['finalmem'] = 0x05DD; 7673 t['finalmemhebrew'] = 0x05DD; 7674 t['finalnun'] = 0x05DF; 7675 t['finalnunhebrew'] = 0x05DF; 7676 t['finalpe'] = 0x05E3; 7677 t['finalpehebrew'] = 0x05E3; 7678 t['finaltsadi'] = 0x05E5; 7679 t['finaltsadihebrew'] = 0x05E5; 7680 t['firsttonechinese'] = 0x02C9; 7681 t['fisheye'] = 0x25C9; 7682 t['fitacyrillic'] = 0x0473; 7683 t['five'] = 0x0035; 7684 t['fivearabic'] = 0x0665; 7685 t['fivebengali'] = 0x09EB; 7686 t['fivecircle'] = 0x2464; 7687 t['fivecircleinversesansserif'] = 0x278E; 7688 t['fivedeva'] = 0x096B; 7689 t['fiveeighths'] = 0x215D; 7690 t['fivegujarati'] = 0x0AEB; 7691 t['fivegurmukhi'] = 0x0A6B; 7692 t['fivehackarabic'] = 0x0665; 7693 t['fivehangzhou'] = 0x3025; 7694 t['fiveideographicparen'] = 0x3224; 7695 t['fiveinferior'] = 0x2085; 7696 t['fivemonospace'] = 0xFF15; 7697 t['fiveoldstyle'] = 0xF735; 7698 t['fiveparen'] = 0x2478; 7699 t['fiveperiod'] = 0x248C; 7700 t['fivepersian'] = 0x06F5; 7701 t['fiveroman'] = 0x2174; 7702 t['fivesuperior'] = 0x2075; 7703 t['fivethai'] = 0x0E55; 7704 t['fl'] = 0xFB02; 7705 t['florin'] = 0x0192; 7706 t['fmonospace'] = 0xFF46; 7707 t['fmsquare'] = 0x3399; 7708 t['fofanthai'] = 0x0E1F; 7709 t['fofathai'] = 0x0E1D; 7710 t['fongmanthai'] = 0x0E4F; 7711 t['forall'] = 0x2200; 7712 t['four'] = 0x0034; 7713 t['fourarabic'] = 0x0664; 7714 t['fourbengali'] = 0x09EA; 7715 t['fourcircle'] = 0x2463; 7716 t['fourcircleinversesansserif'] = 0x278D; 7717 t['fourdeva'] = 0x096A; 7718 t['fourgujarati'] = 0x0AEA; 7719 t['fourgurmukhi'] = 0x0A6A; 7720 t['fourhackarabic'] = 0x0664; 7721 t['fourhangzhou'] = 0x3024; 7722 t['fourideographicparen'] = 0x3223; 7723 t['fourinferior'] = 0x2084; 7724 t['fourmonospace'] = 0xFF14; 7725 t['fournumeratorbengali'] = 0x09F7; 7726 t['fouroldstyle'] = 0xF734; 7727 t['fourparen'] = 0x2477; 7728 t['fourperiod'] = 0x248B; 7729 t['fourpersian'] = 0x06F4; 7730 t['fourroman'] = 0x2173; 7731 t['foursuperior'] = 0x2074; 7732 t['fourteencircle'] = 0x246D; 7733 t['fourteenparen'] = 0x2481; 7734 t['fourteenperiod'] = 0x2495;
7735 t['fourthai'] = 0x0E54; 7736 t['fourthtonechinese'] = 0x02CB; 7737 t['fparen'] = 0x24A1; 7738 t['fraction'] = 0x2044; 7739 t['franc'] = 0x20A3; 7740 t['g'] = 0x0067; 7741 t['gabengali'] = 0x0997; 7742 t['gacute'] = 0x01F5; 7743 t['gadeva'] = 0x0917; 7744 t['gafarabic'] = 0x06AF; 7745 t['gaffinalarabic'] = 0xFB93; 7746 t['gafinitialarabic'] = 0xFB94; 7747 t['gafmedialarabic'] = 0xFB95; 7748 t['gagujarati'] = 0x0A97; 7749 t['gagurmukhi'] = 0x0A17; 7750 t['gahiragana'] = 0x304C; 7751 t['gakatakana'] = 0x30AC; 7752 t['gamma'] = 0x03B3; 7753 t['gammalatinsmall'] = 0x0263; 7754 t['gammasuperior'] = 0x02E0; 7755 t['gangiacoptic'] = 0x03EB; 7756 t['gbopomofo'] = 0x310D; 7757 t['gbreve'] = 0x011F; 7758 t['gcaron'] = 0x01E7; 7759 t['gcedilla'] = 0x0123; 7760 t['gcircle'] = 0x24D6; 7761 t['gcircumflex'] = 0x011D; 7762 t['gcommaaccent'] = 0x0123; 7763 t['gdot'] = 0x0121; 7764 t['gdotaccent'] = 0x0121; 7765 t['gecyrillic'] = 0x0433; 7766 t['gehiragana'] = 0x3052; 7767 t['gekatakana'] = 0x30B2; 7768 t['geometricallyequal'] = 0x2251; 7769 t['gereshaccenthebrew'] = 0x059C; 7770 t['gereshhebrew'] = 0x05F3; 7771 t['gereshmuqdamhebrew'] = 0x059D; 7772 t['germandbls'] = 0x00DF; 7773 t['gershayimaccenthebrew'] = 0x059E; 7774 t['gershayimhebrew'] = 0x05F4; 7775 t['getamark'] = 0x3013; 7776 t['ghabengali'] = 0x0998; 7777 t['ghadarmenian'] = 0x0572; 7778 t['ghadeva'] = 0x0918; 7779 t['ghagujarati'] = 0x0A98; 7780 t['ghagurmukhi'] = 0x0A18; 7781 t['ghainarabic'] = 0x063A; 7782 t['ghainfinalarabic'] = 0xFECE; 7783 t['ghaininitialarabic'] = 0xFECF; 7784 t['ghainmedialarabic'] = 0xFED0; 7785 t['ghemiddlehookcyrillic'] = 0x0495; 7786 t['ghestrokecyrillic'] = 0x0493; 7787 t['gheupturncyrillic'] = 0x0491; 7788 t['ghhadeva'] = 0x095A; 7789 t['ghhagurmukhi'] = 0x0A5A; 7790 t['ghook'] = 0x0260; 7791 t['ghzsquare'] = 0x3393; 7792 t['gihiragana'] = 0x304E; 7793 t['gikatakana'] = 0x30AE; 7794 t['gimarmenian'] = 0x0563; 7795 t['gimel'] = 0x05D2; 7796 t['gimeldagesh'] = 0xFB32; 7797 t['gimeldageshhebrew'] = 0xFB32; 7798 t['gimelhebrew'] = 0x05D2; 7799 t['gjecyrillic'] = 0x0453; 7800 t['glottalinvertedstroke'] = 0x01BE; 7801 t['glottalstop'] = 0x0294; 7802 t['glottalstopinverted'] = 0x0296; 7803 t['glottalstopmod'] = 0x02C0; 7804 t['glottalstopreversed'] = 0x0295; 7805 t['glottalstopreversedmod'] = 0x02C1; 7806 t['glottalstopreversedsuperior'] = 0x02E4; 7807 t['glottalstopstroke'] = 0x02A1; 7808 t['glottalstopstrokereversed'] = 0x02A2; 7809 t['gmacron'] = 0x1E21; 7810 t['gmonospace'] = 0xFF47; 7811 t['gohiragana'] = 0x3054; 7812 t['gokatakana'] = 0x30B4; 7813 t['gparen'] = 0x24A2; 7814 t['gpasquare'] = 0x33AC; 7815 t['gradient'] = 0x2207; 7816 t['grave'] = 0x0060; 7817 t['gravebelowcmb'] = 0x0316; 7818 t['gravecmb'] = 0x0300; 7819 t['gravecomb'] = 0x0300; 7820 t['gravedeva'] = 0x0953; 7821 t['gravelowmod'] = 0x02CE; 7822 t['gravemonospace'] = 0xFF40; 7823 t['gravetonecmb'] = 0x0340; 7824 t['greater'] = 0x003E; 7825 t['greaterequal'] = 0x2265; 7826 t['greaterequalorless'] = 0x22DB; 7827 t['greatermonospace'] = 0xFF1E; 7828 t['greaterorequivalent'] = 0x2273; 7829 t['greaterorless'] = 0x2277; 7830 t['greateroverequal'] = 0x2267; 7831 t['greatersmall'] = 0xFE65; 7832 t['gscript'] = 0x0261; 7833 t['gstroke'] = 0x01E5; 7834 t['guhiragana'] = 0x3050; 7835 t['guillemotleft'] = 0x00AB; 7836 t['guillemotright'] = 0x00BB; 7837 t['guilsinglleft'] = 0x2039; 7838 t['guilsinglright'] = 0x203A; 7839 t['gukatakana'] = 0x30B0; 7840 t['guramusquare'] = 0x3318; 7841 t['gysquare'] = 0x33C9; 7842 t['h'] = 0x0068; 7843 t['haabkhasiancyrillic'] = 0x04A9; 7844 t['haaltonearabic'] = 0x06C1; 7845 t['habengali'] = 0x09B9; 7846 t['hadescendercyrillic'] = 0x04B3; 7847 t['hadeva'] = 0x0939; 7848 t['hagujarati'] = 0x0AB9; 7849 t['hagurmukhi'] = 0x0A39; 7850 t['haharabic'] = 0x062D; 7851 t['hahfinalarabic'] = 0xFEA2; 7852 t['hahinitialarabic'] = 0xFEA3; 7853 t['hahiragana'] = 0x306F; 7854 t['hahmedialarabic'] = 0xFEA4; 7855 t['haitusquare'] = 0x332A; 7856 t['hakatakana'] = 0x30CF; 7857 t['hakatakanahalfwidth'] = 0xFF8A; 7858 t['halantgurmukhi'] = 0x0A4D; 7859 t['hamzaarabic'] = 0x0621; 7860 t['hamzalowarabic'] = 0x0621; 7861 t['hangulfiller'] = 0x3164; 7862 t['hardsigncyrillic'] = 0x044A; 7863 t['harpoonleftbarbup'] = 0x21BC; 7864 t['harpoonrightbarbup'] = 0x21C0; 7865 t['hasquare'] = 0x33CA; 7866 t['hatafpatah'] = 0x05B2; 7867 t['hatafpatah16'] = 0x05B2; 7868 t['hatafpatah23'] = 0x05B2; 7869 t['hatafpatah2f'] = 0x05B2; 7870 t['hatafpatahhebrew'] = 0x05B2; 7871 t['hatafpatahnarrowhebrew'] = 0x05B2; 7872 t['hatafpatahquarterhebrew'] = 0x05B2; 7873 t['hatafpatahwidehebrew'] = 0x05B2; 7874 t['hatafqamats'] = 0x05B3; 7875 t['hatafqamats1b'] = 0x05B3; 7876 t['hatafqamats28'] = 0x05B3; 7877 t['hatafqamats34'] = 0x05B3; 7878 t['hatafqamatshebrew'] = 0x05B3; 7879 t['hatafqamatsnarrowhebrew'] = 0x05B3; 7880 t['hatafqamatsquarterhebrew'] = 0x05B3; 7881 t['hatafqamatswidehebrew'] = 0x05B3; 7882 t['hatafsegol'] = 0x05B1; 7883 t['hatafsegol17'] = 0x05B1; 7884 t['hatafsegol24'] = 0x05B1; 7885 t['hatafsegol30'] = 0x05B1; 7886 t['hatafsegolhebrew'] = 0x05B1; 7887 t['hatafsegolnarrowhebrew'] = 0x05B1; 7888 t['hatafsegolquarterhebrew'] = 0x05B1; 7889 t['hatafsegolwidehebrew'] = 0x05B1; 7890 t['hbar'] = 0x0127; 7891 t['hbopomofo'] = 0x310F; 7892 t['hbrevebelow'] = 0x1E2B; 7893 t['hcedilla'] = 0x1E29; 7894 t['hcircle'] = 0x24D7; 7895 t['hcircumflex'] = 0x0125; 7896 t['hdieresis'] = 0x1E27; 7897 t['hdotaccent'] = 0x1E23; 7898 t['hdotbelow'] = 0x1E25; 7899 t['he'] = 0x05D4; 7900 t['heart'] = 0x2665; 7901 t['heartsuitblack'] = 0x2665; 7902 t['heartsuitwhite'] = 0x2661; 7903 t['hedagesh'] = 0xFB34; 7904 t['hedageshhebrew'] = 0xFB34; 7905 t['hehaltonearabic'] = 0x06C1; 7906 t['heharabic'] = 0x0647; 7907 t['hehebrew'] = 0x05D4; 7908 t['hehfinalaltonearabic'] = 0xFBA7; 7909 t['hehfinalalttwoarabic'] = 0xFEEA; 7910 t['hehfinalarabic'] = 0xFEEA; 7911 t['hehhamzaabovefinalarabic'] = 0xFBA5; 7912 t['hehhamzaaboveisolatedarabic'] = 0xFBA4; 7913 t['hehinitialaltonearabic'] = 0xFBA8; 7914 t['hehinitialarabic'] = 0xFEEB; 7915 t['hehiragana'] = 0x3078; 7916 t['hehmedialaltonearabic'] = 0xFBA9; 7917 t['hehmedialarabic'] = 0xFEEC; 7918 t['heiseierasquare'] = 0x337B; 7919 t['hekatakana'] = 0x30D8; 7920 t['hekatakanahalfwidth'] = 0xFF8D; 7921 t['hekutaarusquare'] = 0x3336; 7922 t['henghook'] = 0x0267; 7923 t['herutusquare'] = 0x3339; 7924 t['het'] = 0x05D7; 7925 t['hethebrew'] = 0x05D7; 7926 t['hhook'] = 0x0266; 7927 t['hhooksuperior'] = 0x02B1; 7928 t['hieuhacirclekorean'] = 0x327B; 7929 t['hieuhaparenkorean'] = 0x321B; 7930 t['hieuhcirclekorean'] = 0x326D; 7931 t['hieuhkorean'] = 0x314E; 7932 t['hieuhparenkorean'] = 0x320D; 7933 t['hihiragana'] = 0x3072; 7934 t['hikatakana'] = 0x30D2; 7935 t['hikatakanahalfwidth'] = 0xFF8B; 7936 t['hiriq'] = 0x05B4; 7937 t['hiriq14'] = 0x05B4; 7938 t['hiriq21'] = 0x05B4; 7939 t['hiriq2d'] = 0x05B4; 7940 t['hiriqhebrew'] = 0x05B4; 7941 t['hiriqnarrowhebrew'] = 0x05B4; 7942 t['hiriqquarterhebrew'] = 0x05B4; 7943 t['hiriqwidehebrew'] = 0x05B4; 7944 t['hlinebelow'] = 0x1E96; 7945 t['hmonospace'] = 0xFF48; 7946 t['hoarmenian'] = 0x0570; 7947 t['hohipthai'] = 0x0E2B; 7948 t['hohiragana'] = 0x307B; 7949 t['hokatakana'] = 0x30DB; 7950 t['hokatakanahalfwidth'] = 0xFF8E; 7951 t['holam'] = 0x05B9; 7952 t['holam19'] = 0x05B9; 7953 t['holam26'] = 0x05B9; 7954 t['holam32'] = 0x05B9; 7955 t['holamhebrew'] = 0x05B9; 7956 t['holamnarrowhebrew'] = 0x05B9; 7957 t['holamquarterhebrew'] = 0x05B9; 7958 t['holamwidehebrew'] = 0x05B9; 7959 t['honokhukthai'] = 0x0E2E;
7960 t['hookabovecomb'] = 0x0309; 7961 t['hookcmb'] = 0x0309; 7962 t['hookpalatalizedbelowcmb'] = 0x0321; 7963 t['hookretroflexbelowcmb'] = 0x0322; 7964 t['hoonsquare'] = 0x3342; 7965 t['horicoptic'] = 0x03E9; 7966 t['horizontalbar'] = 0x2015; 7967 t['horncmb'] = 0x031B; 7968 t['hotsprings'] = 0x2668; 7969 t['house'] = 0x2302; 7970 t['hparen'] = 0x24A3; 7971 t['hsuperior'] = 0x02B0; 7972 t['hturned'] = 0x0265; 7973 t['huhiragana'] = 0x3075; 7974 t['huiitosquare'] = 0x3333; 7975 t['hukatakana'] = 0x30D5; 7976 t['hukatakanahalfwidth'] = 0xFF8C; 7977 t['hungarumlaut'] = 0x02DD; 7978 t['hungarumlautcmb'] = 0x030B; 7979 t['hv'] = 0x0195; 7980 t['hyphen'] = 0x002D; 7981 t['hypheninferior'] = 0xF6E5; 7982 t['hyphenmonospace'] = 0xFF0D; 7983 t['hyphensmall'] = 0xFE63; 7984 t['hyphensuperior'] = 0xF6E6; 7985 t['hyphentwo'] = 0x2010; 7986 t['i'] = 0x0069; 7987 t['iacute'] = 0x00ED; 7988 t['iacyrillic'] = 0x044F; 7989 t['ibengali'] = 0x0987; 7990 t['ibopomofo'] = 0x3127; 7991 t['ibreve'] = 0x012D; 7992 t['icaron'] = 0x01D0; 7993 t['icircle'] = 0x24D8; 7994 t['icircumflex'] = 0x00EE; 7995 t['icyrillic'] = 0x0456; 7996 t['idblgrave'] = 0x0209; 7997 t['ideographearthcircle'] = 0x328F; 7998 t['ideographfirecircle'] = 0x328B; 7999 t['ideographicallianceparen'] = 0x323F; 8000 t['ideographiccallparen'] = 0x323A; 8001 t['ideographiccentrecircle'] = 0x32A5; 8002 t['ideographicclose'] = 0x3006; 8003 t['ideographiccomma'] = 0x3001; 8004 t['ideographiccommaleft'] = 0xFF64; 8005 t['ideographiccongratulationparen'] = 0x3237; 8006 t['ideographiccorrectcircle'] = 0x32A3; 8007 t['ideographicearthparen'] = 0x322F; 8008 t['ideographicenterpriseparen'] = 0x323D; 8009 t['ideographicexcellentcircle'] = 0x329D; 8010 t['ideographicfestivalparen'] = 0x3240; 8011 t['ideographicfinancialcircle'] = 0x3296; 8012 t['ideographicfinancialparen'] = 0x3236; 8013 t['ideographicfireparen'] = 0x322B; 8014 t['ideographichaveparen'] = 0x3232; 8015 t['ideographichighcircle'] = 0x32A4; 8016 t['ideographiciterationmark'] = 0x3005; 8017 t['ideographiclaborcircle'] = 0x3298; 8018 t['ideographiclaborparen'] = 0x3238; 8019 t['ideographicleftcircle'] = 0x32A7; 8020 t['ideographiclowcircle'] = 0x32A6; 8021 t['ideographicmedicinecircle'] = 0x32A9; 8022 t['ideographicmetalparen'] = 0x322E; 8023 t['ideographicmoonparen'] = 0x322A; 8024 t['ideographicnameparen'] = 0x3234; 8025 t['ideographicperiod'] = 0x3002; 8026 t['ideographicprintcircle'] = 0x329E; 8027 t['ideographicreachparen'] = 0x3243; 8028 t['ideographicrepresentparen'] = 0x3239; 8029 t['ideographicresourceparen'] = 0x323E; 8030 t['ideographicrightcircle'] = 0x32A8; 8031 t['ideographicsecretcircle'] = 0x3299; 8032 t['ideographicselfparen'] = 0x3242; 8033 t['ideographicsocietyparen'] = 0x3233; 8034 t['ideographicspace'] = 0x3000; 8035 t['ideographicspecialparen'] = 0x3235; 8036 t['ideographicstockparen'] = 0x3231; 8037 t['ideographicstudyparen'] = 0x323B; 8038 t['ideographicsunparen'] = 0x3230; 8039 t['ideographicsuperviseparen'] = 0x323C; 8040 t['ideographicwaterparen'] = 0x322C; 8041 t['ideographicwoodparen'] = 0x322D; 8042 t['ideographiczero'] = 0x3007; 8043 t['ideographmetalcircle'] = 0x328E; 8044 t['ideographmooncircle'] = 0x328A; 8045 t['ideographnamecircle'] = 0x3294; 8046 t['ideographsuncircle'] = 0x3290; 8047 t['ideographwatercircle'] = 0x328C; 8048 t['ideographwoodcircle'] = 0x328D; 8049 t['ideva'] = 0x0907; 8050 t['idieresis'] = 0x00EF; 8051 t['idieresisacute'] = 0x1E2F; 8052 t['idieresiscyrillic'] = 0x04E5; 8053 t['idotbelow'] = 0x1ECB; 8054 t['iebrevecyrillic'] = 0x04D7; 8055 t['iecyrillic'] = 0x0435; 8056 t['ieungacirclekorean'] = 0x3275; 8057 t['ieungaparenkorean'] = 0x3215; 8058 t['ieungcirclekorean'] = 0x3267; 8059 t['ieungkorean'] = 0x3147; 8060 t['ieungparenkorean'] = 0x3207; 8061 t['igrave'] = 0x00EC; 8062 t['igujarati'] = 0x0A87; 8063 t['igurmukhi'] = 0x0A07; 8064 t['ihiragana'] = 0x3044; 8065 t['ihookabove'] = 0x1EC9; 8066 t['iibengali'] = 0x0988; 8067 t['iicyrillic'] = 0x0438; 8068 t['iideva'] = 0x0908; 8069 t['iigujarati'] = 0x0A88; 8070 t['iigurmukhi'] = 0x0A08; 8071 t['iimatragurmukhi'] = 0x0A40; 8072 t['iinvertedbreve'] = 0x020B; 8073 t['iishortcyrillic'] = 0x0439; 8074 t['iivowelsignbengali'] = 0x09C0; 8075 t['iivowelsigndeva'] = 0x0940; 8076 t['iivowelsigngujarati'] = 0x0AC0; 8077 t['ij'] = 0x0133; 8078 t['ikatakana'] = 0x30A4; 8079 t['ikatakanahalfwidth'] = 0xFF72; 8080 t['ikorean'] = 0x3163; 8081 t['ilde'] = 0x02DC; 8082 t['iluyhebrew'] = 0x05AC; 8083 t['imacron'] = 0x012B; 8084 t['imacroncyrillic'] = 0x04E3; 8085 t['imageorapproximatelyequal'] = 0x2253; 8086 t['imatragurmukhi'] = 0x0A3F; 8087 t['imonospace'] = 0xFF49; 8088 t['increment'] = 0x2206; 8089 t['infinity'] = 0x221E; 8090 t['iniarmenian'] = 0x056B; 8091 t['integral'] = 0x222B; 8092 t['integralbottom'] = 0x2321; 8093 t['integralbt'] = 0x2321; 8094 t['integralex'] = 0xF8F5; 8095 t['integraltop'] = 0x2320; 8096 t['integraltp'] = 0x2320; 8097 t['intersection'] = 0x2229; 8098 t['intisquare'] = 0x3305; 8099 t['invbullet'] = 0x25D8; 8100 t['invcircle'] = 0x25D9; 8101 t['invsmileface'] = 0x263B; 8102 t['iocyrillic'] = 0x0451; 8103 t['iogonek'] = 0x012F; 8104 t['iota'] = 0x03B9; 8105 t['iotadieresis'] = 0x03CA;
8106 t['iotadieresistonos'] = 0x0390; 8107 t['iotalatin'] = 0x0269; 8108 t['iotatonos'] = 0x03AF; 8109 t['iparen'] = 0x24A4; 8110 t['irigurmukhi'] = 0x0A72; 8111 t['ismallhiragana'] = 0x3043; 8112 t['ismallkatakana'] = 0x30A3; 8113 t['ismallkatakanahalfwidth'] = 0xFF68; 8114 t['issharbengali'] = 0x09FA; 8115 t['istroke'] = 0x0268; 8116 t['isuperior'] = 0xF6ED; 8117 t['iterationhiragana'] = 0x309D; 8118 t['iterationkatakana'] = 0x30FD; 8119 t['itilde'] = 0x0129; 8120 t['itildebelow'] = 0x1E2D; 8121 t['iubopomofo'] = 0x3129; 8122 t['iucyrillic'] = 0x044E; 8123 t['ivowelsignbengali'] = 0x09BF; 8124 t['ivowelsigndeva'] = 0x093F; 8125 t['ivowelsigngujarati'] = 0x0ABF; 8126 t['izhitsacyrillic'] = 0x0475; 8127 t['izhitsadblgravecyrillic'] = 0x0477; 8128 t['j'] = 0x006A; 8129 t['jaarmenian'] = 0x0571; 8130 t['jabengali'] = 0x099C; 8131 t['jadeva'] = 0x091C; 8132 t['jagujarati'] = 0x0A9C; 8133 t['jagurmukhi'] = 0x0A1C; 8134 t['jbopomofo'] = 0x3110; 8135 t['jcaron'] = 0x01F0; 8136 t['jcircle'] = 0x24D9; 8137 t['jcircumflex'] = 0x0135; 8138 t['jcrossedtail'] = 0x029D; 8139 t['jdotlessstroke'] = 0x025F; 8140 t['jecyrillic'] = 0x0458; 8141 t['jeemarabic'] = 0x062C; 8142 t['jeemfinalarabic'] = 0xFE9E; 8143 t['jeeminitialarabic'] = 0xFE9F; 8144 t['jeemmedialarabic'] = 0xFEA0; 8145 t['jeharabic'] = 0x0698; 8146 t['jehfinalarabic'] = 0xFB8B; 8147 t['jhabengali'] = 0x099D; 8148 t['jhadeva'] = 0x091D; 8149 t['jhagujarati'] = 0x0A9D; 8150 t['jhagurmukhi'] = 0x0A1D; 8151 t['jheharmenian'] = 0x057B; 8152 t['jis'] = 0x3004; 8153 t['jmonospace'] = 0xFF4A; 8154 t['jparen'] = 0x24A5; 8155 t['jsuperior'] = 0x02B2; 8156 t['k'] = 0x006B; 8157 t['kabashkircyrillic'] = 0x04A1; 8158 t['kabengali'] = 0x0995; 8159 t['kacute'] = 0x1E31; 8160 t['kacyrillic'] = 0x043A; 8161 t['kadescendercyrillic'] = 0x049B; 8162 t['kadeva'] = 0x0915; 8163 t['kaf'] = 0x05DB; 8164 t['kafarabic'] = 0x0643; 8165 t['kafdagesh'] = 0xFB3B; 8166 t['kafdageshhebrew'] = 0xFB3B; 8167 t['kaffinalarabic'] = 0xFEDA; 8168 t['kafhebrew'] = 0x05DB; 8169 t['kafinitialarabic'] = 0xFEDB; 8170 t['kafmedialarabic'] = 0xFEDC; 8171 t['kafrafehebrew'] = 0xFB4D; 8172 t['kagujarati'] = 0x0A95; 8173 t['kagurmukhi'] = 0x0A15; 8174 t['kahiragana'] = 0x304B; 8175 t['kahookcyrillic'] = 0x04C4; 8176 t['kakatakana'] = 0x30AB; 8177 t['kakatakanahalfwidth'] = 0xFF76; 8178 t['kappa'] = 0x03BA; 8179 t['kappasymbolgreek'] = 0x03F0; 8180 t['kapyeounmieumkorean'] = 0x3171; 8181 t['kapyeounphieuphkorean'] = 0x3184; 8182 t['kapyeounpieupkorean'] = 0x3178; 8183 t['kapyeounssangpieupkorean'] = 0x3179; 8184 t['karoriisquare'] = 0x330D; 8185 t['kashidaautoarabic'] = 0x0640; 8186 t['kashidaautonosidebearingarabic'] = 0x0640; 8187 t['kasmallkatakana'] = 0x30F5; 8188 t['kasquare'] = 0x3384; 8189 t['kasraarabic'] = 0x0650; 8190 t['kasratanarabic'] = 0x064D; 8191 t['kastrokecyrillic'] = 0x049F; 8192 t['katahiraprolongmarkhalfwidth'] = 0xFF70; 8193 t['kaverticalstrokecyrillic'] = 0x049D; 8194 t['kbopomofo'] = 0x310E; 8195 t['kcalsquare'] = 0x3389; 8196 t['kcaron'] = 0x01E9; 8197 t['kcedilla'] = 0x0137; 8198 t['kcircle'] = 0x24DA; 8199 t['kcommaaccent'] = 0x0137; 8200 t['kdotbelow'] = 0x1E33; 8201 t['keharmenian'] = 0x0584; 8202 t['kehiragana'] = 0x3051; 8203 t['kekatakana'] = 0x30B1; 8204 t['kekatakanahalfwidth'] = 0xFF79; 8205 t['kenarmenian'] = 0x056F; 8206 t['kesmallkatakana'] = 0x30F6; 8207 t['kgreenlandic'] = 0x0138; 8208 t['khabengali'] = 0x0996; 8209 t['khacyrillic'] = 0x0445; 8210 t['khadeva'] = 0x0916; 8211 t['khagujarati'] = 0x0A96; 8212 t['khagurmukhi'] = 0x0A16; 8213 t['khaharabic'] = 0x062E; 8214 t['khahfinalarabic'] = 0xFEA6; 8215 t['khahinitialarabic'] = 0xFEA7; 8216 t['khahmedialarabic'] = 0xFEA8; 8217 t['kheicoptic'] = 0x03E7; 8218 t['khhadeva'] = 0x0959; 8219 t['khhagurmukhi'] = 0x0A59; 8220 t['khieukhacirclekorean'] = 0x3278; 8221 t['khieukhaparenkorean'] = 0x3218; 8222 t['khieukhcirclekorean'] = 0x326A; 8223 t['khieukhkorean'] = 0x314B; 8224 t['khieukhparenkorean'] = 0x320A; 8225 t['khokhaithai'] = 0x0E02; 8226 t['khokhonthai'] = 0x0E05; 8227 t['khokhuatthai'] = 0x0E03; 8228 t['khokhwaithai'] = 0x0E04; 8229 t['khomutthai'] = 0x0E5B; 8230 t['khook'] = 0x0199; 8231 t['khorakhangthai'] = 0x0E06; 8232 t['khzsquare'] = 0x3391; 8233 t['kihiragana'] = 0x304D; 8234 t['kikatakana'] = 0x30AD; 8235 t['kikatakanahalfwidth'] = 0xFF77; 8236 t['kiroguramusquare'] = 0x3315; 8237 t['kiromeetorusquare'] = 0x3316; 8238 t['kirosquare'] = 0x3314; 8239 t['kiyeokacirclekorean'] = 0x326E; 8240 t['kiyeokaparenkorean'] = 0x320E; 8241 t['kiyeokcirclekorean'] = 0x3260; 8242 t['kiyeokkorean'] = 0x3131; 8243 t['kiyeokparenkorean'] = 0x3200; 8244 t['kiyeoksioskorean'] = 0x3133; 8245 t['kjecyrillic'] = 0x045C; 8246 t['klinebelow'] = 0x1E35; 8247 t['klsquare'] = 0x3398; 8248 t['kmcubedsquare'] = 0x33A6; 8249 t['kmonospace'] = 0xFF4B; 8250 t['kmsquaredsquare'] = 0x33A2; 8251 t['kohiragana'] = 0x3053; 8252 t['kohmsquare'] = 0x33C0; 8253 t['kokaithai'] = 0x0E01; 8254 t['kokatakana'] = 0x30B3; 8255 t['kokatakanahalfwidth'] = 0xFF7A; 8256 t['kooposquare'] = 0x331E; 8257 t['koppacyrillic'] = 0x0481; 8258 t['koreanstandardsymbol'] = 0x327F; 8259 t['koroniscmb'] = 0x0343; 8260 t['kparen'] = 0x24A6; 8261 t['kpasquare'] = 0x33AA; 8262 t['ksicyrillic'] = 0x046F; 8263 t['ktsquare'] = 0x33CF; 8264 t['kturned'] = 0x029E; 8265 t['kuhiragana'] = 0x304F; 8266 t['kukatakana'] = 0x30AF; 8267 t['kukatakanahalfwidth'] = 0xFF78; 8268 t['kvsquare'] = 0x33B8; 8269 t['kwsquare'] = 0x33BE; 8270 t['l'] = 0x006C; 8271 t['labengali'] = 0x09B2; 8272 t['lacute'] = 0x013A; 8273 t['ladeva'] = 0x0932; 8274 t['lagujarati'] = 0x0AB2; 8275 t['lagurmukhi'] = 0x0A32; 8276 t['lakkhangyaothai'] = 0x0E45; 8277 t['lamaleffinalarabic'] = 0xFEFC; 8278 t['lamalefhamzaabovefinalarabic'] = 0xFEF8; 8279 t['lamalefhamzaaboveisolatedarabic'] = 0xFEF7; 8280 t['lamalefhamzabelowfinalarabic'] = 0xFEFA; 8281 t['lamalefhamzabelowisolatedarabic'] = 0xFEF9; 8282 t['lamalefisolatedarabic'] = 0xFEFB; 8283 t['lamalefmaddaabovefinalarabic'] = 0xFEF6; 8284 t['lamalefmaddaaboveisolatedarabic'] = 0xFEF5; 8285 t['lamarabic'] = 0x0644; 8286 t['lambda'] = 0x03BB; 8287 t['lambdastroke'] = 0x019B; 8288 t['lamed'] = 0x05DC; 8289 t['lameddagesh'] = 0xFB3C;
8290 t['lameddageshhebrew'] = 0xFB3C; 8291 t['lamedhebrew'] = 0x05DC; 8292 t['lamfinalarabic'] = 0xFEDE; 8293 t['lamhahinitialarabic'] = 0xFCCA; 8294 t['laminitialarabic'] = 0xFEDF; 8295 t['lamjeeminitialarabic'] = 0xFCC9; 8296 t['lamkhahinitialarabic'] = 0xFCCB; 8297 t['lamlamhehisolatedarabic'] = 0xFDF2; 8298 t['lammedialarabic'] = 0xFEE0; 8299 t['lammeemhahinitialarabic'] = 0xFD88; 8300 t['lammeeminitialarabic'] = 0xFCCC; 8301 t['largecircle'] = 0x25EF; 8302 t['lbar'] = 0x019A; 8303 t['lbelt'] = 0x026C; 8304 t['lbopomofo'] = 0x310C; 8305 t['lcaron'] = 0x013E; 8306 t['lcedilla'] = 0x013C; 8307 t['lcircle'] = 0x24DB; 8308 t['lcircumflexbelow'] = 0x1E3D; 8309 t['lcommaaccent'] = 0x013C; 8310 t['ldot'] = 0x0140; 8311 t['ldotaccent'] = 0x0140; 8312 t['ldotbelow'] = 0x1E37; 8313 t['ldotbelowmacron'] = 0x1E39; 8314 t['leftangleabovecmb'] = 0x031A; 8315 t['lefttackbelowcmb'] = 0x0318; 8316 t['less'] = 0x003C; 8317 t['lessequal'] = 0x2264; 8318 t['lessequalorgreater'] = 0x22DA; 8319 t['lessmonospace'] = 0xFF1C; 8320 t['lessorequivalent'] = 0x2272; 8321 t['lessorgreater'] = 0x2276; 8322 t['lessoverequal'] = 0x2266; 8323 t['lesssmall'] = 0xFE64; 8324 t['lezh'] = 0x026E; 8325 t['lfblock'] = 0x258C; 8326 t['lhookretroflex'] = 0x026D; 8327 t['lira'] = 0x20A4; 8328 t['liwnarmenian'] = 0x056C; 8329 t['lj'] = 0x01C9; 8330 t['ljecyrillic'] = 0x0459; 8331 t['ll'] = 0xF6C0; 8332 t['lladeva'] = 0x0933; 8333 t['llagujarati'] = 0x0AB3; 8334 t['llinebelow'] = 0x1E3B; 8335 t['llladeva'] = 0x0934; 8336 t['llvocalicbengali'] = 0x09E1; 8337 t['llvocalicdeva'] = 0x0961; 8338 t['llvocalicvowelsignbengali'] = 0x09E3; 8339 t['llvocalicvowelsigndeva'] = 0x0963; 8340 t['lmiddletilde'] = 0x026B; 8341 t['lmonospace'] = 0xFF4C; 8342 t['lmsquare'] = 0x33D0; 8343 t['lochulathai'] = 0x0E2C; 8344 t['logicaland'] = 0x2227; 8345 t['logicalnot'] = 0x00AC; 8346 t['logicalnotreversed'] = 0x2310; 8347 t['logicalor'] = 0x2228; 8348 t['lolingthai'] = 0x0E25; 8349 t['longs'] = 0x017F; 8350 t['lowlinecenterline'] = 0xFE4E; 8351 t['lowlinecmb'] = 0x0332; 8352 t['lowlinedashed'] = 0xFE4D; 8353 t['lozenge'] = 0x25CA; 8354 t['lparen'] = 0x24A7; 8355 t['lslash'] = 0x0142; 8356 t['lsquare'] = 0x2113; 8357 t['lsuperior'] = 0xF6EE; 8358 t['ltshade'] = 0x2591; 8359 t['luthai'] = 0x0E26; 8360 t['lvocalicbengali'] = 0x098C; 8361 t['lvocalicdeva'] = 0x090C; 8362 t['lvocalicvowelsignbengali'] = 0x09E2; 8363 t['lvocalicvowelsigndeva'] = 0x0962; 8364 t['lxsquare'] = 0x33D3; 8365 t['m'] = 0x006D; 8366 t['mabengali'] = 0x09AE; 8367 t['macron'] = 0x00AF; 8368 t['macronbelowcmb'] = 0x0331; 8369 t['macroncmb'] = 0x0304; 8370 t['macronlowmod'] = 0x02CD; 8371 t['macronmonospace'] = 0xFFE3; 8372 t['macute'] = 0x1E3F; 8373 t['madeva'] = 0x092E; 8374 t['magujarati'] = 0x0AAE; 8375 t['magurmukhi'] = 0x0A2E; 8376 t['mahapakhhebrew'] = 0x05A4; 8377 t['mahapakhlefthebrew'] = 0x05A4; 8378 t['mahiragana'] = 0x307E; 8379 t['maichattawalowleftthai'] = 0xF895; 8380 t['maichattawalowrightthai'] = 0xF894; 8381 t['maichattawathai'] = 0x0E4B; 8382 t['maichattawaupperleftthai'] = 0xF893; 8383 t['maieklowleftthai'] = 0xF88C; 8384 t['maieklowrightthai'] = 0xF88B; 8385 t['maiekthai'] = 0x0E48; 8386 t['maiekupperleftthai'] = 0xF88A; 8387 t['maihanakatleftthai'] = 0xF884; 8388 t['maihanakatthai'] = 0x0E31; 8389 t['maitaikhuleftthai'] = 0xF889; 8390 t['maitaikhuthai'] = 0x0E47; 8391 t['maitholowleftthai'] = 0xF88F; 8392 t['maitholowrightthai'] = 0xF88E; 8393 t['maithothai'] = 0x0E49; 8394 t['maithoupperleftthai'] = 0xF88D; 8395 t['maitrilowleftthai'] = 0xF892; 8396 t['maitrilowrightthai'] = 0xF891; 8397 t['maitrithai'] = 0x0E4A; 8398 t['maitriupperleftthai'] = 0xF890; 8399 t['maiyamokthai'] = 0x0E46; 8400 t['makatakana'] = 0x30DE; 8401 t['makatakanahalfwidth'] = 0xFF8F; 8402 t['male'] = 0x2642; 8403 t['mansyonsquare'] = 0x3347; 8404 t['maqafhebrew'] = 0x05BE; 8405 t['mars'] = 0x2642; 8406 t['masoracirclehebrew'] = 0x05AF; 8407 t['masquare'] = 0x3383; 8408 t['mbopomofo'] = 0x3107; 8409 t['mbsquare'] = 0x33D4; 8410 t['mcircle'] = 0x24DC; 8411 t['mcubedsquare'] = 0x33A5; 8412 t['mdotaccent'] = 0x1E41; 8413 t['mdotbelow'] = 0x1E43; 8414 t['meemarabic'] = 0x0645; 8415 t['meemfinalarabic'] = 0xFEE2; 8416 t['meeminitialarabic'] = 0xFEE3; 8417 t['meemmedialarabic'] = 0xFEE4; 8418 t['meemmeeminitialarabic'] = 0xFCD1; 8419 t['meemmeemisolatedarabic'] = 0xFC48; 8420 t['meetorusquare'] = 0x334D; 8421 t['mehiragana'] = 0x3081; 8422 t['meizierasquare'] = 0x337E; 8423 t['mekatakana'] = 0x30E1; 8424 t['mekatakanahalfwidth'] = 0xFF92; 8425 t['mem'] = 0x05DE; 8426 t['memdagesh'] = 0xFB3E; 8427 t['memdageshhebrew'] = 0xFB3E; 8428 t['memhebrew'] = 0x05DE; 8429 t['menarmenian'] = 0x0574; 8430 t['merkhahebrew'] = 0x05A5; 8431 t['merkhakefulahebrew'] = 0x05A6; 8432 t['merkhakefulalefthebrew'] = 0x05A6; 8433 t['merkhalefthebrew'] = 0x05A5; 8434 t['mhook'] = 0x0271; 8435 t['mhzsquare'] = 0x3392; 8436 t['middledotkatakanahalfwidth'] = 0xFF65; 8437 t['middot'] = 0x00B7; 8438 t['mieumacirclekorean'] = 0x3272; 8439 t['mieumaparenkorean'] = 0x3212; 8440 t['mieumcirclekorean'] = 0x3264; 8441 t['mieumkorean'] = 0x3141; 8442 t['mieumpansioskorean'] = 0x3170; 8443 t['mieumparenkorean'] = 0x3204; 8444 t['mieumpieupkorean'] = 0x316E; 8445 t['mieumsioskorean'] = 0x316F; 8446 t['mihiragana'] = 0x307F; 8447 t['mikatakana'] = 0x30DF; 8448 t['mikatakanahalfwidth'] = 0xFF90; 8449 t['minus'] = 0x2212; 8450 t['minusbelowcmb'] = 0x0320; 8451 t['minuscircle'] = 0x2296; 8452 t['minusmod'] = 0x02D7; 8453 t['minusplus'] = 0x2213; 8454 t['minute'] = 0x2032; 8455 t['miribaarusquare'] = 0x334A; 8456 t['mirisquare'] = 0x3349; 8457 t['mlonglegturned'] = 0x0270; 8458 t['mlsquare'] = 0x3396; 8459 t['mmcubedsquare'] = 0x33A3; 8460 t['mmonospace'] = 0xFF4D; 8461 t['mmsquaredsquare'] = 0x339F; 8462 t['mohiragana'] = 0x3082; 8463 t['mohmsquare'] = 0x33C1; 8464 t['mokatakana'] = 0x30E2; 8465 t['mokatakanahalfwidth'] = 0xFF93; 8466 t['molsquare'] = 0x33D6; 8467 t['momathai'] = 0x0E21; 8468 t['moverssquare'] = 0x33A7; 8469 t['moverssquaredsquare'] = 0x33A8; 8470 t['mparen'] = 0x24A8; 8471 t['mpasquare'] = 0x33AB; 8472 t['mssquare'] = 0x33B3; 8473 t['msuperior'] = 0xF6EF; 8474 t['mturned'] = 0x026F; 8475 t['mu'] = 0x00B5; 8476 t['mu1'] = 0x00B5; 8477 t['muasquare'] = 0x3382; 8478 t['muchgreater'] = 0x226B; 8479 t['muchless'] = 0x226A; 8480 t['mufsquare'] = 0x338C; 8481 t['mugreek'] = 0x03BC; 8482 t['mugsquare'] = 0x338D; 8483 t['muhiragana'] = 0x3080; 8484 t['mukatakana'] = 0x30E0; 8485 t['mukatakanahalfwidth'] = 0xFF91; 8486 t['mulsquare'] = 0x3395; 8487 t['multiply'] = 0x00D7;
8488 t['mumsquare'] = 0x339B; 8489 t['munahhebrew'] = 0x05A3; 8490 t['munahlefthebrew'] = 0x05A3; 8491 t['musicalnote'] = 0x266A; 8492 t['musicalnotedbl'] = 0x266B; 8493 t['musicflatsign'] = 0x266D; 8494 t['musicsharpsign'] = 0x266F; 8495 t['mussquare'] = 0x33B2; 8496 t['muvsquare'] = 0x33B6; 8497 t['muwsquare'] = 0x33BC; 8498 t['mvmegasquare'] = 0x33B9; 8499 t['mvsquare'] = 0x33B7; 8500 t['mwmegasquare'] = 0x33BF; 8501 t['mwsquare'] = 0x33BD; 8502 t['n'] = 0x006E; 8503 t['nabengali'] = 0x09A8; 8504 t['nabla'] = 0x2207; 8505 t['nacute'] = 0x0144; 8506 t['nadeva'] = 0x0928; 8507 t['nagujarati'] = 0x0AA8; 8508 t['nagurmukhi'] = 0x0A28; 8509 t['nahiragana'] = 0x306A; 8510 t['nakatakana'] = 0x30CA; 8511 t['nakatakanahalfwidth'] = 0xFF85; 8512 t['napostrophe'] = 0x0149; 8513 t['nasquare'] = 0x3381; 8514 t['nbopomofo'] = 0x310B; 8515 t['nbspace'] = 0x00A0; 8516 t['ncaron'] = 0x0148; 8517 t['ncedilla'] = 0x0146; 8518 t['ncircle'] = 0x24DD; 8519 t['ncircumflexbelow'] = 0x1E4B; 8520 t['ncommaaccent'] = 0x0146; 8521 t['ndotaccent'] = 0x1E45; 8522 t['ndotbelow'] = 0x1E47; 8523 t['nehiragana'] = 0x306D; 8524 t['nekatakana'] = 0x30CD; 8525 t['nekatakanahalfwidth'] = 0xFF88; 8526 t['newsheqelsign'] = 0x20AA; 8527 t['nfsquare'] = 0x338B; 8528 t['ngabengali'] = 0x0999; 8529 t['ngadeva'] = 0x0919; 8530 t['ngagujarati'] = 0x0A99; 8531 t['ngagurmukhi'] = 0x0A19; 8532 t['ngonguthai'] = 0x0E07; 8533 t['nhiragana'] = 0x3093; 8534 t['nhookleft'] = 0x0272; 8535 t['nhookretroflex'] = 0x0273; 8536 t['nieunacirclekorean'] = 0x326F; 8537 t['nieunaparenkorean'] = 0x320F; 8538 t['nieuncieuckorean'] = 0x3135; 8539 t['nieuncirclekorean'] = 0x3261; 8540 t['nieunhieuhkorean'] = 0x3136; 8541 t['nieunkorean'] = 0x3134; 8542 t['nieunpansioskorean'] = 0x3168; 8543 t['nieunparenkorean'] = 0x3201; 8544 t['nieunsioskorean'] = 0x3167; 8545 t['nieuntikeutkorean'] = 0x3166; 8546 t['nihiragana'] = 0x306B; 8547 t['nikatakana'] = 0x30CB; 8548 t['nikatakanahalfwidth'] = 0xFF86; 8549 t['nikhahitleftthai'] = 0xF899; 8550 t['nikhahitthai'] = 0x0E4D; 8551 t['nine'] = 0x0039; 8552 t['ninearabic'] = 0x0669; 8553 t['ninebengali'] = 0x09EF; 8554 t['ninecircle'] = 0x2468; 8555 t['ninecircleinversesansserif'] = 0x2792; 8556 t['ninedeva'] = 0x096F; 8557 t['ninegujarati'] = 0x0AEF; 8558 t['ninegurmukhi'] = 0x0A6F; 8559 t['ninehackarabic'] = 0x0669; 8560 t['ninehangzhou'] = 0x3029; 8561 t['nineideographicparen'] = 0x3228; 8562 t['nineinferior'] = 0x2089; 8563 t['ninemonospace'] = 0xFF19; 8564 t['nineoldstyle'] = 0xF739; 8565 t['nineparen'] = 0x247C; 8566 t['nineperiod'] = 0x2490; 8567 t['ninepersian'] = 0x06F9; 8568 t['nineroman'] = 0x2178; 8569 t['ninesuperior'] = 0x2079; 8570 t['nineteencircle'] = 0x2472; 8571 t['nineteenparen'] = 0x2486; 8572 t['nineteenperiod'] = 0x249A; 8573 t['ninethai'] = 0x0E59; 8574 t['nj'] = 0x01CC; 8575 t['njecyrillic'] = 0x045A; 8576 t['nkatakana'] = 0x30F3; 8577 t['nkatakanahalfwidth'] = 0xFF9D; 8578 t['nlegrightlong'] = 0x019E; 8579 t['nlinebelow'] = 0x1E49; 8580 t['nmonospace'] = 0xFF4E; 8581 t['nmsquare'] = 0x339A; 8582 t['nnabengali'] = 0x09A3; 8583 t['nnadeva'] = 0x0923; 8584 t['nnagujarati'] = 0x0AA3; 8585 t['nnagurmukhi'] = 0x0A23; 8586 t['nnnadeva'] = 0x0929; 8587 t['nohiragana'] = 0x306E; 8588 t['nokatakana'] = 0x30CE; 8589 t['nokatakanahalfwidth'] = 0xFF89; 8590 t['nonbreakingspace'] = 0x00A0; 8591 t['nonenthai'] = 0x0E13; 8592 t['nonuthai'] = 0x0E19; 8593 t['noonarabic'] = 0x0646; 8594 t['noonfinalarabic'] = 0xFEE6; 8595 t['noonghunnaarabic'] = 0x06BA; 8596 t['noonghunnafinalarabic'] = 0xFB9F; 8597 t['nooninitialarabic'] = 0xFEE7; 8598 t['noonjeeminitialarabic'] = 0xFCD2; 8599 t['noonjeemisolatedarabic'] = 0xFC4B; 8600 t['noonmedialarabic'] = 0xFEE8; 8601 t['noonmeeminitialarabic'] = 0xFCD5; 8602 t['noonmeemisolatedarabic'] = 0xFC4E; 8603 t['noonnoonfinalarabic'] = 0xFC8D; 8604 t['notcontains'] = 0x220C; 8605 t['notelement'] = 0x2209; 8606 t['notelementof'] = 0x2209; 8607 t['notequal'] = 0x2260; 8608 t['notgreater'] = 0x226F; 8609 t['notgreaternorequal'] = 0x2271; 8610 t['notgreaternorless'] = 0x2279; 8611 t['notidentical'] = 0x2262; 8612 t['notless'] = 0x226E; 8613 t['notlessnorequal'] = 0x2270; 8614 t['notparallel'] = 0x2226; 8615 t['notprecedes'] = 0x2280; 8616 t['notsubset'] = 0x2284; 8617 t['notsucceeds'] = 0x2281; 8618 t['notsuperset'] = 0x2285; 8619 t['nowarmenian'] = 0x0576; 8620 t['nparen'] = 0x24A9; 8621 t['nssquare'] = 0x33B1; 8622 t['nsuperior'] = 0x207F; 8623 t['ntilde'] = 0x00F1; 8624 t['nu'] = 0x03BD; 8625 t['nuhiragana'] = 0x306C; 8626 t['nukatakana'] = 0x30CC; 8627 t['nukatakanahalfwidth'] = 0xFF87; 8628 t['nuktabengali'] = 0x09BC; 8629 t['nuktadeva'] = 0x093C; 8630 t['nuktagujarati'] = 0x0ABC; 8631 t['nuktagurmukhi'] = 0x0A3C; 8632 t['numbersign'] = 0x0023; 8633 t['numbersignmonospace'] = 0xFF03; 8634 t['numbersignsmall'] = 0xFE5F; 8635 t['numeralsigngreek'] = 0x0374; 8636 t['numeralsignlowergreek'] = 0x0375; 8637 t['numero'] = 0x2116; 8638 t['nun'] = 0x05E0; 8639 t['nundagesh'] = 0xFB40; 8640 t['nundageshhebrew'] = 0xFB40; 8641 t['nunhebrew'] = 0x05E0; 8642 t['nvsquare'] = 0x33B5; 8643 t['nwsquare'] = 0x33BB; 8644 t['nyabengali'] = 0x099E; 8645 t['nyadeva'] = 0x091E; 8646 t['nyagujarati'] = 0x0A9E; 8647 t['nyagurmukhi'] = 0x0A1E; 8648 t['o'] = 0x006F; 8649 t['oacute'] = 0x00F3; 8650 t['oangthai'] = 0x0E2D; 8651 t['obarred'] = 0x0275; 8652 t['obarredcyrillic'] = 0x04E9; 8653 t['obarreddieresiscyrillic'] = 0x04EB; 8654 t['obengali'] = 0x0993; 8655 t['obopomofo'] = 0x311B; 8656 t['obreve'] = 0x014F; 8657 t['ocandradeva'] = 0x0911; 8658 t['ocandragujarati'] = 0x0A91; 8659 t['ocandravowelsigndeva'] = 0x0949; 8660 t['ocandravowelsigngujarati'] = 0x0AC9; 8661 t['ocaron'] = 0x01D2; 8662 t['ocircle'] = 0x24DE; 8663 t['ocircumflex'] = 0x00F4; 8664 t['ocircumflexacute'] = 0x1ED1; 8665 t['ocircumflexdotbelow'] = 0x1ED9; 8666 t['ocircumflexgrave'] = 0x1ED3; 8667 t['ocircumflexhookabove'] = 0x1ED5; 8668 t['ocircumflextilde'] = 0x1ED7; 8669 t['ocyrillic'] = 0x043E; 8670 t['odblacute'] = 0x0151; 8671 t['odblgrave'] = 0x020D; 8672 t['odeva'] = 0x0913; 8673 t['odieresis'] = 0x00F6; 8674 t['odieresiscyrillic'] = 0x04E7; 8675 t['odotbelow'] = 0x1ECD; 8676 t['oe'] = 0x0153; 8677 t['oekorean'] = 0x315A; 8678 t['ogonek'] = 0x02DB; 8679 t['ogonekcmb'] = 0x0328; 8680 t['ograve'] = 0x00F2; 8681 t['ogujarati'] = 0x0A93; 8682 t['oharmenian'] = 0x0585; 8683 t['ohiragana'] = 0x304A; 8684 t['ohookabove'] = 0x1ECF; 8685 t['ohorn'] = 0x01A1; 8686 t['ohornacute'] = 0x1EDB; 8687 t['ohorndotbelow'] = 0x1EE3; 8688 t['ohorngrave'] = 0x1EDD; 8689 t['ohornhookabove'] = 0x1EDF; 8690 t['ohorntilde'] = 0x1EE1; 8691 t['ohungarumlaut'] = 0x0151; 8692 t['oi'] = 0x01A3; 8693 t['oinvertedbreve'] = 0x020F; 8694 t['okatakana'] = 0x30AA; 8695 t['okatakanahalfwidth'] = 0xFF75; 8696 t['okorean'] = 0x3157; 8697 t['olehebrew'] = 0x05AB; 8698 t['omacron'] = 0x014D; 8699 t['omacronacute'] = 0x1E53; 8700 t['omacrongrave'] = 0x1E51; 8701 t['omdeva'] = 0x0950; 8702 t['omega'] = 0x03C9; 8703 t['omega1'] = 0x03D6; 8704 t['omegacyrillic'] = 0x0461; 8705 t['omegalatinclosed'] = 0x0277; 8706 t['omegaroundcyrillic'] = 0x047B; 8707 t['omegatitlocyrillic'] = 0x047D;
8708 t['omegatonos'] = 0x03CE; 8709 t['omgujarati'] = 0x0AD0; 8710 t['omicron'] = 0x03BF; 8711 t['omicrontonos'] = 0x03CC; 8712 t['omonospace'] = 0xFF4F; 8713 t['one'] = 0x0031; 8714 t['onearabic'] = 0x0661; 8715 t['onebengali'] = 0x09E7; 8716 t['onecircle'] = 0x2460; 8717 t['onecircleinversesansserif'] = 0x278A; 8718 t['onedeva'] = 0x0967; 8719 t['onedotenleader'] = 0x2024; 8720 t['oneeighth'] = 0x215B; 8721 t['onefitted'] = 0xF6DC; 8722 t['onegujarati'] = 0x0AE7; 8723 t['onegurmukhi'] = 0x0A67; 8724 t['onehackarabic'] = 0x0661; 8725 t['onehalf'] = 0x00BD; 8726 t['onehangzhou'] = 0x3021; 8727 t['oneideographicparen'] = 0x3220; 8728 t['oneinferior'] = 0x2081; 8729 t['onemonospace'] = 0xFF11; 8730 t['onenumeratorbengali'] = 0x09F4; 8731 t['oneoldstyle'] = 0xF731; 8732 t['oneparen'] = 0x2474; 8733 t['oneperiod'] = 0x2488; 8734 t['onepersian'] = 0x06F1; 8735 t['onequarter'] = 0x00BC; 8736 t['oneroman'] = 0x2170; 8737 t['onesuperior'] = 0x00B9; 8738 t['onethai'] = 0x0E51; 8739 t['onethird'] = 0x2153; 8740 t['oogonek'] = 0x01EB; 8741 t['oogonekmacron'] = 0x01ED; 8742 t['oogurmukhi'] = 0x0A13; 8743 t['oomatragurmukhi'] = 0x0A4B; 8744 t['oopen'] = 0x0254; 8745 t['oparen'] = 0x24AA; 8746 t['openbullet'] = 0x25E6; 8747 t['option'] = 0x2325; 8748 t['ordfeminine'] = 0x00AA; 8749 t['ordmasculine'] = 0x00BA; 8750 t['orthogonal'] = 0x221F; 8751 t['oshortdeva'] = 0x0912; 8752 t['oshortvowelsigndeva'] = 0x094A; 8753 t['oslash'] = 0x00F8; 8754 t['oslashacute'] = 0x01FF; 8755 t['osmallhiragana'] = 0x3049; 8756 t['osmallkatakana'] = 0x30A9; 8757 t['osmallkatakanahalfwidth'] = 0xFF6B; 8758 t['ostrokeacute'] = 0x01FF; 8759 t['osuperior'] = 0xF6F0; 8760 t['otcyrillic'] = 0x047F; 8761 t['otilde'] = 0x00F5; 8762 t['otildeacute'] = 0x1E4D; 8763 t['otildedieresis'] = 0x1E4F; 8764 t['oubopomofo'] = 0x3121; 8765 t['overline'] = 0x203E; 8766 t['overlinecenterline'] = 0xFE4A; 8767 t['overlinecmb'] = 0x0305; 8768 t['overlinedashed'] = 0xFE49; 8769 t['overlinedblwavy'] = 0xFE4C; 8770 t['overlinewavy'] = 0xFE4B; 8771 t['overscore'] = 0x00AF; 8772 t['ovowelsignbengali'] = 0x09CB; 8773 t['ovowelsigndeva'] = 0x094B; 8774 t['ovowelsigngujarati'] = 0x0ACB; 8775 t['p'] = 0x0070; 8776 t['paampssquare'] = 0x3380; 8777 t['paasentosquare'] = 0x332B; 8778 t['pabengali'] = 0x09AA; 8779 t['pacute'] = 0x1E55;
8780 t['padeva'] = 0x092A; 8781 t['pagedown'] = 0x21DF; 8782 t['pageup'] = 0x21DE; 8783 t['pagujarati'] = 0x0AAA; 8784 t['pagurmukhi'] = 0x0A2A; 8785 t['pahiragana'] = 0x3071; 8786 t['paiyannoithai'] = 0x0E2F; 8787 t['pakatakana'] = 0x30D1; 8788 t['palatalizationcyrilliccmb'] = 0x0484; 8789 t['palochkacyrillic'] = 0x04C0; 8790 t['pansioskorean'] = 0x317F; 8791 t['paragraph'] = 0x00B6; 8792 t['parallel'] = 0x2225; 8793 t['parenleft'] = 0x0028; 8794 t['parenleftaltonearabic'] = 0xFD3E; 8795 t['parenleftbt'] = 0xF8ED; 8796 t['parenleftex'] = 0xF8EC; 8797 t['parenleftinferior'] = 0x208D; 8798 t['parenleftmonospace'] = 0xFF08; 8799 t['parenleftsmall'] = 0xFE59; 8800 t['parenleftsuperior'] = 0x207D; 8801 t['parenlefttp'] = 0xF8EB; 8802 t['parenleftvertical'] = 0xFE35; 8803 t['parenright'] = 0x0029; 8804 t['parenrightaltonearabic'] = 0xFD3F; 8805 t['parenrightbt'] = 0xF8F8; 8806 t['parenrightex'] = 0xF8F7; 8807 t['parenrightinferior'] = 0x208E; 8808 t['parenrightmonospace'] = 0xFF09; 8809 t['parenrightsmall'] = 0xFE5A; 8810 t['parenrightsuperior'] = 0x207E; 8811 t['parenrighttp'] = 0xF8F6; 8812 t['parenrightvertical'] = 0xFE36; 8813 t['partialdiff'] = 0x2202; 8814 t['paseqhebrew'] = 0x05C0; 8815 t['pashtahebrew'] = 0x0599; 8816 t['pasquare'] = 0x33A9; 8817 t['patah'] = 0x05B7; 8818 t['patah11'] = 0x05B7; 8819 t['patah1d'] = 0x05B7; 8820 t['patah2a'] = 0x05B7; 8821 t['patahhebrew'] = 0x05B7; 8822 t['patahnarrowhebrew'] = 0x05B7; 8823 t['patahquarterhebrew'] = 0x05B7; 8824 t['patahwidehebrew'] = 0x05B7; 8825 t['pazerhebrew'] = 0x05A1; 8826 t['pbopomofo'] = 0x3106; 8827 t['pcircle'] = 0x24DF; 8828 t['pdotaccent'] = 0x1E57; 8829 t['pe'] = 0x05E4; 8830 t['pecyrillic'] = 0x043F; 8831 t['pedagesh'] = 0xFB44; 8832 t['pedageshhebrew'] = 0xFB44; 8833 t['peezisquare'] = 0x333B; 8834 t['pefinaldageshhebrew'] = 0xFB43; 8835 t['peharabic'] = 0x067E; 8836 t['peharmenian'] = 0x057A; 8837 t['pehebrew'] = 0x05E4; 8838 t['pehfinalarabic'] = 0xFB57; 8839 t['pehinitialarabic'] = 0xFB58; 8840 t['pehiragana'] = 0x307A; 8841 t['pehmedialarabic'] = 0xFB59; 8842 t['pekatakana'] = 0x30DA; 8843 t['pemiddlehookcyrillic'] = 0x04A7; 8844 t['perafehebrew'] = 0xFB4E; 8845 t['percent'] = 0x0025; 8846 t['percentarabic'] = 0x066A; 8847 t['percentmonospace'] = 0xFF05; 8848 t['percentsmall'] = 0xFE6A; 8849 t['period'] = 0x002E; 8850 t['periodarmenian'] = 0x0589; 8851 t['periodcentered'] = 0x00B7; 8852 t['periodhalfwidth'] = 0xFF61; 8853 t['periodinferior'] = 0xF6E7; 8854 t['periodmonospace'] = 0xFF0E; 8855 t['periodsmall'] = 0xFE52; 8856 t['periodsuperior'] = 0xF6E8; 8857 t['perispomenigreekcmb'] = 0x0342; 8858 t['perpendicular'] = 0x22A5; 8859 t['perthousand'] = 0x2030; 8860 t['peseta'] = 0x20A7; 8861 t['pfsquare'] = 0x338A; 8862 t['phabengali'] = 0x09AB; 8863 t['phadeva'] = 0x092B; 8864 t['phagujarati'] = 0x0AAB; 8865 t['phagurmukhi'] = 0x0A2B; 8866 t['phi'] = 0x03C6; 8867 t['phi1'] = 0x03D5; 8868 t['phieuphacirclekorean'] = 0x327A; 8869 t['phieuphaparenkorean'] = 0x321A; 8870 t['phieuphcirclekorean'] = 0x326C; 8871 t['phieuphkorean'] = 0x314D; 8872 t['phieuphparenkorean'] = 0x320C; 8873 t['philatin'] = 0x0278; 8874 t['phinthuthai'] = 0x0E3A; 8875 t['phisymbolgreek'] = 0x03D5; 8876 t['phook'] = 0x01A5; 8877 t['phophanthai'] = 0x0E1E; 8878 t['phophungthai'] = 0x0E1C; 8879 t['phosamphaothai'] = 0x0E20; 8880 t['pi'] = 0x03C0; 8881 t['pieupacirclekorean'] = 0x3273; 8882 t['pieupaparenkorean'] = 0x3213; 8883 t['pieupcieuckorean'] = 0x3176; 8884 t['pieupcirclekorean'] = 0x3265; 8885 t['pieupkiyeokkorean'] = 0x3172; 8886 t['pieupkorean'] = 0x3142; 8887 t['pieupparenkorean'] = 0x3205; 8888 t['pieupsioskiyeokkorean'] = 0x3174; 8889 t['pieupsioskorean'] = 0x3144; 8890 t['pieupsiostikeutkorean'] = 0x3175; 8891 t['pieupthieuthkorean'] = 0x3177; 8892 t['pieuptikeutkorean'] = 0x3173; 8893 t['pihiragana'] = 0x3074; 8894 t['pikatakana'] = 0x30D4; 8895 t['pisymbolgreek'] = 0x03D6; 8896 t['piwrarmenian'] = 0x0583; 8897 t['plus'] = 0x002B; 8898 t['plusbelowcmb'] = 0x031F; 8899 t['pluscircle'] = 0x2295; 8900 t['plusminus'] = 0x00B1; 8901 t['plusmod'] = 0x02D6; 8902 t['plusmonospace'] = 0xFF0B; 8903 t['plussmall'] = 0xFE62; 8904 t['plussuperior'] = 0x207A; 8905 t['pmonospace'] = 0xFF50; 8906 t['pmsquare'] = 0x33D8; 8907 t['pohiragana'] = 0x307D; 8908 t['pointingindexdownwhite'] = 0x261F; 8909 t['pointingindexleftwhite'] = 0x261C; 8910 t['pointingindexrightwhite'] = 0x261E; 8911 t['pointingindexupwhite'] = 0x261D; 8912 t['pokatakana'] = 0x30DD; 8913 t['poplathai'] = 0x0E1B; 8914 t['postalmark'] = 0x3012; 8915 t['postalmarkface'] = 0x3020; 8916 t['pparen'] = 0x24AB; 8917 t['precedes'] = 0x227A; 8918 t['prescription'] = 0x211E; 8919 t['primemod'] = 0x02B9; 8920 t['primereversed'] = 0x2035; 8921 t['product'] = 0x220F; 8922 t['projective'] = 0x2305; 8923 t['prolongedkana'] = 0x30FC; 8924 t['propellor'] = 0x2318; 8925 t['propersubset'] = 0x2282; 8926 t['propersuperset'] = 0x2283; 8927 t['proportion'] = 0x2237; 8928 t['proportional'] = 0x221D; 8929 t['psi'] = 0x03C8; 8930 t['psicyrillic'] = 0x0471; 8931 t['psilipneumatacyrilliccmb'] = 0x0486; 8932 t['pssquare'] = 0x33B0; 8933 t['puhiragana'] = 0x3077;
8934 t['pukatakana'] = 0x30D7; 8935 t['pvsquare'] = 0x33B4; 8936 t['pwsquare'] = 0x33BA; 8937 t['q'] = 0x0071; 8938 t['qadeva'] = 0x0958; 8939 t['qadmahebrew'] = 0x05A8; 8940 t['qafarabic'] = 0x0642; 8941 t['qaffinalarabic'] = 0xFED6; 8942 t['qafinitialarabic'] = 0xFED7; 8943 t['qafmedialarabic'] = 0xFED8; 8944 t['qamats'] = 0x05B8; 8945 t['qamats10'] = 0x05B8; 8946 t['qamats1a'] = 0x05B8; 8947 t['qamats1c'] = 0x05B8; 8948 t['qamats27'] = 0x05B8; 8949 t['qamats29'] = 0x05B8; 8950 t['qamats33'] = 0x05B8; 8951 t['qamatsde'] = 0x05B8; 8952 t['qamatshebrew'] = 0x05B8; 8953 t['qamatsnarrowhebrew'] = 0x05B8; 8954 t['qamatsqatanhebrew'] = 0x05B8; 8955 t['qamatsqatannarrowhebrew'] = 0x05B8; 8956 t['qamatsqatanquarterhebrew'] = 0x05B8; 8957 t['qamatsqatanwidehebrew'] = 0x05B8; 8958 t['qamatsquarterhebrew'] = 0x05B8; 8959 t['qamatswidehebrew'] = 0x05B8; 8960 t['qarneyparahebrew'] = 0x059F; 8961 t['qbopomofo'] = 0x3111; 8962 t['qcircle'] = 0x24E0; 8963 t['qhook'] = 0x02A0; 8964 t['qmonospace'] = 0xFF51; 8965 t['qof'] = 0x05E7; 8966 t['qofdagesh'] = 0xFB47; 8967 t['qofdageshhebrew'] = 0xFB47; 8968 t['qofhebrew'] = 0x05E7; 8969 t['qparen'] = 0x24AC; 8970 t['quarternote'] = 0x2669; 8971 t['qubuts'] = 0x05BB; 8972 t['qubuts18'] = 0x05BB; 8973 t['qubuts25'] = 0x05BB; 8974 t['qubuts31'] = 0x05BB; 8975 t['qubutshebrew'] = 0x05BB; 8976 t['qubutsnarrowhebrew'] = 0x05BB; 8977 t['qubutsquarterhebrew'] = 0x05BB; 8978 t['qubutswidehebrew'] = 0x05BB; 8979 t['question'] = 0x003F; 8980 t['questionarabic'] = 0x061F; 8981 t['questionarmenian'] = 0x055E; 8982 t['questiondown'] = 0x00BF; 8983 t['questiondownsmall'] = 0xF7BF; 8984 t['questiongreek'] = 0x037E; 8985 t['questionmonospace'] = 0xFF1F; 8986 t['questionsmall'] = 0xF73F; 8987 t['quotedbl'] = 0x0022; 8988 t['quotedblbase'] = 0x201E; 8989 t['quotedblleft'] = 0x201C; 8990 t['quotedblmonospace'] = 0xFF02; 8991 t['quotedblprime'] = 0x301E; 8992 t['quotedblprimereversed'] = 0x301D; 8993 t['quotedblright'] = 0x201D; 8994 t['quoteleft'] = 0x2018; 8995 t['quoteleftreversed'] = 0x201B; 8996 t['quotereversed'] = 0x201B; 8997 t['quoteright'] = 0x2019; 8998 t['quoterightn'] = 0x0149; 8999 t['quotesinglbase'] = 0x201A; 9000 t['quotesingle'] = 0x0027; 9001 t['quotesinglemonospace'] = 0xFF07; 9002 t['r'] = 0x0072; 9003 t['raarmenian'] = 0x057C; 9004 t['rabengali'] = 0x09B0; 9005 t['racute'] = 0x0155; 9006 t['radeva'] = 0x0930; 9007 t['radical'] = 0x221A; 9008 t['radicalex'] = 0xF8E5; 9009 t['radoverssquare'] = 0x33AE; 9010 t['radoverssquaredsquare'] = 0x33AF; 9011 t['radsquare'] = 0x33AD; 9012 t['rafe'] = 0x05BF; 9013 t['rafehebrew'] = 0x05BF; 9014 t['ragujarati'] = 0x0AB0; 9015 t['ragurmukhi'] = 0x0A30; 9016 t['rahiragana'] = 0x3089; 9017 t['rakatakana'] = 0x30E9; 9018 t['rakatakanahalfwidth'] = 0xFF97; 9019 t['ralowerdiagonalbengali'] = 0x09F1; 9020 t['ramiddlediagonalbengali'] = 0x09F0; 9021 t['ramshorn'] = 0x0264; 9022 t['ratio'] = 0x2236; 9023 t['rbopomofo'] = 0x3116; 9024 t['rcaron'] = 0x0159; 9025 t['rcedilla'] = 0x0157; 9026 t['rcircle'] = 0x24E1; 9027 t['rcommaaccent'] = 0x0157; 9028 t['rdblgrave'] = 0x0211; 9029 t['rdotaccent'] = 0x1E59; 9030 t['rdotbelow'] = 0x1E5B; 9031 t['rdotbelowmacron'] = 0x1E5D; 9032 t['referencemark'] = 0x203B; 9033 t['reflexsubset'] = 0x2286; 9034 t['reflexsuperset'] = 0x2287; 9035 t['registered'] = 0x00AE; 9036 t['registersans'] = 0xF8E8; 9037 t['registerserif'] = 0xF6DA; 9038 t['reharabic'] = 0x0631; 9039 t['reharmenian'] = 0x0580; 9040 t['rehfinalarabic'] = 0xFEAE; 9041 t['rehiragana'] = 0x308C; 9042 t['rekatakana'] = 0x30EC; 9043 t['rekatakanahalfwidth'] = 0xFF9A; 9044 t['resh'] = 0x05E8; 9045 t['reshdageshhebrew'] = 0xFB48; 9046 t['reshhebrew'] = 0x05E8; 9047 t['reversedtilde'] = 0x223D; 9048 t['reviahebrew'] = 0x0597; 9049 t['reviamugrashhebrew'] = 0x0597; 9050 t['revlogicalnot'] = 0x2310; 9051 t['rfishhook'] = 0x027E; 9052 t['rfishhookreversed'] = 0x027F; 9053 t['rhabengali'] = 0x09DD; 9054 t['rhadeva'] = 0x095D; 9055 t['rho'] = 0x03C1; 9056 t['rhook'] = 0x027D; 9057 t['rhookturned'] = 0x027B; 9058 t['rhookturnedsuperior'] = 0x02B5; 9059 t['rhosymbolgreek'] = 0x03F1; 9060 t['rhotichookmod'] = 0x02DE; 9061 t['rieulacirclekorean'] = 0x3271; 9062 t['rieulaparenkorean'] = 0x3211; 9063 t['rieulcirclekorean'] = 0x3263; 9064 t['rieulhieuhkorean'] = 0x3140; 9065 t['rieulkiyeokkorean'] = 0x313A; 9066 t['rieulkiyeoksioskorean'] = 0x3169; 9067 t['rieulkorean'] = 0x3139; 9068 t['rieulmieumkorean'] = 0x313B; 9069 t['rieulpansioskorean'] = 0x316C; 9070 t['rieulparenkorean'] = 0x3203; 9071 t['rieulphieuphkorean'] = 0x313F; 9072 t['rieulpieupkorean'] = 0x313C; 9073 t['rieulpieupsioskorean'] = 0x316B; 9074 t['rieulsioskorean'] = 0x313D; 9075 t['rieulthieuthkorean'] = 0x313E; 9076 t['rieultikeutkorean'] = 0x316A; 9077 t['rieulyeorinhieuhkorean'] = 0x316D; 9078 t['rightangle'] = 0x221F; 9079 t['righttackbelowcmb'] = 0x0319; 9080 t['righttriangle'] = 0x22BF; 9081 t['rihiragana'] = 0x308A; 9082 t['rikatakana'] = 0x30EA; 9083 t['rikatakanahalfwidth'] = 0xFF98; 9084 t['ring'] = 0x02DA; 9085 t['ringbelowcmb'] = 0x0325; 9086 t['ringcmb'] = 0x030A; 9087 t['ringhalfleft'] = 0x02BF; 9088 t['ringhalfleftarmenian'] = 0x0559; 9089 t['ringhalfleftbelowcmb'] = 0x031C; 9090 t['ringhalfleftcentered'] = 0x02D3; 9091 t['ringhalfright'] = 0x02BE; 9092 t['ringhalfrightbelowcmb'] = 0x0339; 9093 t['ringhalfrightcentered'] = 0x02D2; 9094 t['rinvertedbreve'] = 0x0213; 9095 t['rittorusquare'] = 0x3351; 9096 t['rlinebelow'] = 0x1E5F; 9097 t['rlongleg'] = 0x027C; 9098 t['rlonglegturned'] = 0x027A; 9099 t['rmonospace'] = 0xFF52; 9100 t['rohiragana'] = 0x308D; 9101 t['rokatakana'] = 0x30ED; 9102 t['rokatakanahalfwidth'] = 0xFF9B; 9103 t['roruathai'] = 0x0E23; 9104 t['rparen'] = 0x24AD; 9105 t['rrabengali'] = 0x09DC; 9106 t['rradeva'] = 0x0931; 9107 t['rragurmukhi'] = 0x0A5C; 9108 t['rreharabic'] = 0x0691; 9109 t['rrehfinalarabic'] = 0xFB8D; 9110 t['rrvocalicbengali'] = 0x09E0; 9111 t['rrvocalicdeva'] = 0x0960;
9112 t['rrvocalicgujarati'] = 0x0AE0; 9113 t['rrvocalicvowelsignbengali'] = 0x09C4; 9114 t['rrvocalicvowelsigndeva'] = 0x0944; 9115 t['rrvocalicvowelsigngujarati'] = 0x0AC4; 9116 t['rsuperior'] = 0xF6F1; 9117 t['rtblock'] = 0x2590; 9118 t['rturned'] = 0x0279; 9119 t['rturnedsuperior'] = 0x02B4; 9120 t['ruhiragana'] = 0x308B; 9121 t['rukatakana'] = 0x30EB; 9122 t['rukatakanahalfwidth'] = 0xFF99; 9123 t['rupeemarkbengali'] = 0x09F2; 9124 t['rupeesignbengali'] = 0x09F3; 9125 t['rupiah'] = 0xF6DD; 9126 t['ruthai'] = 0x0E24; 9127 t['rvocalicbengali'] = 0x098B; 9128 t['rvocalicdeva'] = 0x090B; 9129 t['rvocalicgujarati'] = 0x0A8B; 9130 t['rvocalicvowelsignbengali'] = 0x09C3; 9131 t['rvocalicvowelsigndeva'] = 0x0943; 9132 t['rvocalicvowelsigngujarati'] = 0x0AC3; 9133 t['s'] = 0x0073; 9134 t['sabengali'] = 0x09B8; 9135 t['sacute'] = 0x015B; 9136 t['sacutedotaccent'] = 0x1E65; 9137 t['sadarabic'] = 0x0635; 9138 t['sadeva'] = 0x0938; 9139 t['sadfinalarabic'] = 0xFEBA; 9140 t['sadinitialarabic'] = 0xFEBB; 9141 t['sadmedialarabic'] = 0xFEBC; 9142 t['sagujarati'] = 0x0AB8; 9143 t['sagurmukhi'] = 0x0A38; 9144 t['sahiragana'] = 0x3055; 9145 t['sakatakana'] = 0x30B5; 9146 t['sakatakanahalfwidth'] = 0xFF7B; 9147 t['sallallahoualayhewasallamarabic'] = 0xFDFA; 9148 t['samekh'] = 0x05E1; 9149 t['samekhdagesh'] = 0xFB41; 9150 t['samekhdageshhebrew'] = 0xFB41; 9151 t['samekhhebrew'] = 0x05E1; 9152 t['saraaathai'] = 0x0E32; 9153 t['saraaethai'] = 0x0E41; 9154 t['saraaimaimalaithai'] = 0x0E44; 9155 t['saraaimaimuanthai'] = 0x0E43; 9156 t['saraamthai'] = 0x0E33; 9157 t['saraathai'] = 0x0E30; 9158 t['saraethai'] = 0x0E40; 9159 t['saraiileftthai'] = 0xF886; 9160 t['saraiithai'] = 0x0E35; 9161 t['saraileftthai'] = 0xF885; 9162 t['saraithai'] = 0x0E34; 9163 t['saraothai'] = 0x0E42; 9164 t['saraueeleftthai'] = 0xF888; 9165 t['saraueethai'] = 0x0E37; 9166 t['saraueleftthai'] = 0xF887; 9167 t['sarauethai'] = 0x0E36; 9168 t['sarauthai'] = 0x0E38; 9169 t['sarauuthai'] = 0x0E39; 9170 t['sbopomofo'] = 0x3119; 9171 t['scaron'] = 0x0161; 9172 t['scarondotaccent'] = 0x1E67; 9173 t['scedilla'] = 0x015F; 9174 t['schwa'] = 0x0259; 9175 t['schwacyrillic'] = 0x04D9; 9176 t['schwadieresiscyrillic'] = 0x04DB; 9177 t['schwahook'] = 0x025A; 9178 t['scircle'] = 0x24E2; 9179 t['scircumflex'] = 0x015D; 9180 t['scommaaccent'] = 0x0219; 9181 t['sdotaccent'] = 0x1E61; 9182 t['sdotbelow'] = 0x1E63; 9183 t['sdotbelowdotaccent'] = 0x1E69; 9184 t['seagullbelowcmb'] = 0x033C; 9185 t['second'] = 0x2033; 9186 t['secondtonechinese'] = 0x02CA; 9187 t['section'] = 0x00A7; 9188 t['seenarabic'] = 0x0633; 9189 t['seenfinalarabic'] = 0xFEB2; 9190 t['seeninitialarabic'] = 0xFEB3; 9191 t['seenmedialarabic'] = 0xFEB4; 9192 t['segol'] = 0x05B6; 9193 t['segol13'] = 0x05B6; 9194 t['segol1f'] = 0x05B6; 9195 t['segol2c'] = 0x05B6; 9196 t['segolhebrew'] = 0x05B6; 9197 t['segolnarrowhebrew'] = 0x05B6; 9198 t['segolquarterhebrew'] = 0x05B6; 9199 t['segoltahebrew'] = 0x0592; 9200 t['segolwidehebrew'] = 0x05B6; 9201 t['seharmenian'] = 0x057D; 9202 t['sehiragana'] = 0x305B; 9203 t['sekatakana'] = 0x30BB; 9204 t['sekatakanahalfwidth'] = 0xFF7E; 9205 t['semicolon'] = 0x003B; 9206 t['semicolonarabic'] = 0x061B; 9207 t['semicolonmonospace'] = 0xFF1B; 9208 t['semicolonsmall'] = 0xFE54; 9209 t['semivoicedmarkkana'] = 0x309C; 9210 t['semivoicedmarkkanahalfwidth'] = 0xFF9F; 9211 t['sentisquare'] = 0x3322; 9212 t['sentosquare'] = 0x3323; 9213 t['seven'] = 0x0037; 9214 t['sevenarabic'] = 0x0667; 9215 t['sevenbengali'] = 0x09ED; 9216 t['sevencircle'] = 0x2466; 9217 t['sevencircleinversesansserif'] = 0x2790; 9218 t['sevendeva'] = 0x096D; 9219 t['seveneighths'] = 0x215E; 9220 t['sevengujarati'] = 0x0AED; 9221 t['sevengurmukhi'] = 0x0A6D; 9222 t['sevenhackarabic'] = 0x0667; 9223 t['sevenhangzhou'] = 0x3027; 9224 t['sevenideographicparen'] = 0x3226; 9225 t['seveninferior'] = 0x2087; 9226 t['sevenmonospace'] = 0xFF17; 9227 t['sevenoldstyle'] = 0xF737; 9228 t['sevenparen'] = 0x247A; 9229 t['sevenperiod'] = 0x248E; 9230 t['sevenpersian'] = 0x06F7; 9231 t['sevenroman'] = 0x2176; 9232 t['sevensuperior'] = 0x2077; 9233 t['seventeencircle'] = 0x2470; 9234 t['seventeenparen'] = 0x2484; 9235 t['seventeenperiod'] = 0x2498; 9236 t['seventhai'] = 0x0E57; 9237 t['sfthyphen'] = 0x00AD; 9238 t['shaarmenian'] = 0x0577; 9239 t['shabengali'] = 0x09B6; 9240 t['shacyrillic'] = 0x0448; 9241 t['shaddaarabic'] = 0x0651; 9242 t['shaddadammaarabic'] = 0xFC61; 9243 t['shaddadammatanarabic'] = 0xFC5E; 9244 t['shaddafathaarabic'] = 0xFC60; 9245 t['shaddakasraarabic'] = 0xFC62; 9246 t['shaddakasratanarabic'] = 0xFC5F; 9247 t['shade'] = 0x2592; 9248 t['shadedark'] = 0x2593; 9249 t['shadelight'] = 0x2591; 9250 t['shademedium'] = 0x2592; 9251 t['shadeva'] = 0x0936; 9252 t['shagujarati'] = 0x0AB6; 9253 t['shagurmukhi'] = 0x0A36; 9254 t['shalshelethebrew'] = 0x0593; 9255 t['shbopomofo'] = 0x3115; 9256 t['shchacyrillic'] = 0x0449; 9257 t['sheenarabic'] = 0x0634; 9258 t['sheenfinalarabic'] = 0xFEB6; 9259 t['sheeninitialarabic'] = 0xFEB7; 9260 t['sheenmedialarabic'] = 0xFEB8; 9261 t['sheicoptic'] = 0x03E3; 9262 t['sheqel'] = 0x20AA; 9263 t['sheqelhebrew'] = 0x20AA; 9264 t['sheva'] = 0x05B0; 9265 t['sheva115'] = 0x05B0; 9266 t['sheva15'] = 0x05B0; 9267 t['sheva22'] = 0x05B0; 9268 t['sheva2e'] = 0x05B0; 9269 t['shevahebrew'] = 0x05B0; 9270 t['shevanarrowhebrew'] = 0x05B0; 9271 t['shevaquarterhebrew'] = 0x05B0; 9272 t['shevawidehebrew'] = 0x05B0; 9273 t['shhacyrillic'] = 0x04BB; 9274 t['shimacoptic'] = 0x03ED; 9275 t['shin'] = 0x05E9; 9276 t['shindagesh'] = 0xFB49; 9277 t['shindageshhebrew'] = 0xFB49; 9278 t['shindageshshindot'] = 0xFB2C; 9279 t['shindageshshindothebrew'] = 0xFB2C; 9280 t['shindageshsindot'] = 0xFB2D; 9281 t['shindageshsindothebrew'] = 0xFB2D; 9282 t['shindothebrew'] = 0x05C1; 9283 t['shinhebrew'] = 0x05E9; 9284 t['shinshindot'] = 0xFB2A; 9285 t['shinshindothebrew'] = 0xFB2A; 9286 t['shinsindot'] = 0xFB2B; 9287 t['shinsindothebrew'] = 0xFB2B; 9288 t['shook'] = 0x0282;
9289 t['sigma'] = 0x03C3; 9290 t['sigma1'] = 0x03C2; 9291 t['sigmafinal'] = 0x03C2; 9292 t['sigmalunatesymbolgreek'] = 0x03F2; 9293 t['sihiragana'] = 0x3057; 9294 t['sikatakana'] = 0x30B7; 9295 t['sikatakanahalfwidth'] = 0xFF7C; 9296 t['siluqhebrew'] = 0x05BD; 9297 t['siluqlefthebrew'] = 0x05BD; 9298 t['similar'] = 0x223C; 9299 t['sindothebrew'] = 0x05C2; 9300 t['siosacirclekorean'] = 0x3274; 9301 t['siosaparenkorean'] = 0x3214; 9302 t['sioscieuckorean'] = 0x317E; 9303 t['sioscirclekorean'] = 0x3266; 9304 t['sioskiyeokkorean'] = 0x317A; 9305 t['sioskorean'] = 0x3145; 9306 t['siosnieunkorean'] = 0x317B; 9307 t['siosparenkorean'] = 0x3206; 9308 t['siospieupkorean'] = 0x317D; 9309 t['siostikeutkorean'] = 0x317C; 9310 t['six'] = 0x0036; 9311 t['sixarabic'] = 0x0666; 9312 t['sixbengali'] = 0x09EC; 9313 t['sixcircle'] = 0x2465; 9314 t['sixcircleinversesansserif'] = 0x278F; 9315 t['sixdeva'] = 0x096C; 9316 t['sixgujarati'] = 0x0AEC; 9317 t['sixgurmukhi'] = 0x0A6C; 9318 t['sixhackarabic'] = 0x0666; 9319 t['sixhangzhou'] = 0x3026; 9320 t['sixideographicparen'] = 0x3225; 9321 t['sixinferior'] = 0x2086; 9322 t['sixmonospace'] = 0xFF16; 9323 t['sixoldstyle'] = 0xF736; 9324 t['sixparen'] = 0x2479; 9325 t['sixperiod'] = 0x248D; 9326 t['sixpersian'] = 0x06F6; 9327 t['sixroman'] = 0x2175; 9328 t['sixsuperior'] = 0x2076; 9329 t['sixteencircle'] = 0x246F; 9330 t['sixteencurrencydenominatorbengali'] = 0x09F9; 9331 t['sixteenparen'] = 0x2483; 9332 t['sixteenperiod'] = 0x2497; 9333 t['sixthai'] = 0x0E56; 9334 t['slash'] = 0x002F; 9335 t['slashmonospace'] = 0xFF0F; 9336 t['slong'] = 0x017F; 9337 t['slongdotaccent'] = 0x1E9B; 9338 t['smileface'] = 0x263A; 9339 t['smonospace'] = 0xFF53; 9340 t['sofpasuqhebrew'] = 0x05C3; 9341 t['softhyphen'] = 0x00AD; 9342 t['softsigncyrillic'] = 0x044C; 9343 t['sohiragana'] = 0x305D; 9344 t['sokatakana'] = 0x30BD; 9345 t['sokatakanahalfwidth'] = 0xFF7F; 9346 t['soliduslongoverlaycmb'] = 0x0338; 9347 t['solidusshortoverlaycmb'] = 0x0337; 9348 t['sorusithai'] = 0x0E29; 9349 t['sosalathai'] = 0x0E28; 9350 t['sosothai'] = 0x0E0B; 9351 t['sosuathai'] = 0x0E2A; 9352 t['space'] = 0x0020; 9353 t['spacehackarabic'] = 0x0020; 9354 t['spade'] = 0x2660; 9355 t['spadesuitblack'] = 0x2660; 9356 t['spadesuitwhite'] = 0x2664; 9357 t['sparen'] = 0x24AE; 9358 t['squarebelowcmb'] = 0x033B; 9359 t['squarecc'] = 0x33C4; 9360 t['squarecm'] = 0x339D; 9361 t['squarediagonalcrosshatchfill'] = 0x25A9; 9362 t['squarehorizontalfill'] = 0x25A4; 9363 t['squarekg'] = 0x338F; 9364 t['squarekm'] = 0x339E; 9365 t['squarekmcapital'] = 0x33CE; 9366 t['squareln'] = 0x33D1; 9367 t['squarelog'] = 0x33D2; 9368 t['squaremg'] = 0x338E; 9369 t['squaremil'] = 0x33D5; 9370 t['squaremm'] = 0x339C; 9371 t['squaremsquared'] = 0x33A1; 9372 t['squareorthogonalcrosshatchfill'] = 0x25A6; 9373 t['squareupperlefttolowerrightfill'] = 0x25A7; 9374 t['squareupperrighttolowerleftfill'] = 0x25A8; 9375 t['squareverticalfill'] = 0x25A5; 9376 t['squarewhitewithsmallblack'] = 0x25A3; 9377 t['srsquare'] = 0x33DB; 9378 t['ssabengali'] = 0x09B7; 9379 t['ssadeva'] = 0x0937; 9380 t['ssagujarati'] = 0x0AB7; 9381 t['ssangcieuckorean'] = 0x3149; 9382 t['ssanghieuhkorean'] = 0x3185; 9383 t['ssangieungkorean'] = 0x3180; 9384 t['ssangkiyeokkorean'] = 0x3132; 9385 t['ssangnieunkorean'] = 0x3165; 9386 t['ssangpieupkorean'] = 0x3143; 9387 t['ssangsioskorean'] = 0x3146; 9388 t['ssangtikeutkorean'] = 0x3138; 9389 t['ssuperior'] = 0xF6F2; 9390 t['sterling'] = 0x00A3; 9391 t['sterlingmonospace'] = 0xFFE1; 9392 t['strokelongoverlaycmb'] = 0x0336; 9393 t['strokeshortoverlaycmb'] = 0x0335; 9394 t['subset'] = 0x2282; 9395 t['subsetnotequal'] = 0x228A; 9396 t['subsetorequal'] = 0x2286; 9397 t['succeeds'] = 0x227B; 9398 t['suchthat'] = 0x220B; 9399 t['suhiragana'] = 0x3059; 9400 t['sukatakana'] = 0x30B9; 9401 t['sukatakanahalfwidth'] = 0xFF7D; 9402 t['sukunarabic'] = 0x0652; 9403 t['summation'] = 0x2211; 9404 t['sun'] = 0x263C; 9405 t['superset'] = 0x2283; 9406 t['supersetnotequal'] = 0x228B; 9407 t['supersetorequal'] = 0x2287; 9408 t['svsquare'] = 0x33DC; 9409 t['syouwaerasquare'] = 0x337C; 9410 t['t'] = 0x0074; 9411 t['tabengali'] = 0x09A4; 9412 t['tackdown'] = 0x22A4; 9413 t['tackleft'] = 0x22A3; 9414 t['tadeva'] = 0x0924; 9415 t['tagujarati'] = 0x0AA4; 9416 t['tagurmukhi'] = 0x0A24; 9417 t['taharabic'] = 0x0637; 9418 t['tahfinalarabic'] = 0xFEC2; 9419 t['tahinitialarabic'] = 0xFEC3; 9420 t['tahiragana'] = 0x305F; 9421 t['tahmedialarabic'] = 0xFEC4; 9422 t['taisyouerasquare'] = 0x337D; 9423 t['takatakana'] = 0x30BF;
9424 t['takatakanahalfwidth'] = 0xFF80; 9425 t['tatweelarabic'] = 0x0640; 9426 t['tau'] = 0x03C4; 9427 t['tav'] = 0x05EA; 9428 t['tavdages'] = 0xFB4A; 9429 t['tavdagesh'] = 0xFB4A; 9430 t['tavdageshhebrew'] = 0xFB4A; 9431 t['tavhebrew'] = 0x05EA; 9432 t['tbar'] = 0x0167; 9433 t['tbopomofo'] = 0x310A; 9434 t['tcaron'] = 0x0165; 9435 t['tccurl'] = 0x02A8; 9436 t['tcedilla'] = 0x0163; 9437 t['tcheharabic'] = 0x0686; 9438 t['tchehfinalarabic'] = 0xFB7B; 9439 t['tchehinitialarabic'] = 0xFB7C; 9440 t['tchehmedialarabic'] = 0xFB7D; 9441 t['tcircle'] = 0x24E3; 9442 t['tcircumflexbelow'] = 0x1E71; 9443 t['tcommaaccent'] = 0x0163; 9444 t['tdieresis'] = 0x1E97; 9445 t['tdotaccent'] = 0x1E6B; 9446 t['tdotbelow'] = 0x1E6D; 9447 t['tecyrillic'] = 0x0442; 9448 t['tedescendercyrillic'] = 0x04AD; 9449 t['teharabic'] = 0x062A; 9450 t['tehfinalarabic'] = 0xFE96; 9451 t['tehhahinitialarabic'] = 0xFCA2; 9452 t['tehhahisolatedarabic'] = 0xFC0C; 9453 t['tehinitialarabic'] = 0xFE97; 9454 t['tehiragana'] = 0x3066; 9455 t['tehjeeminitialarabic'] = 0xFCA1; 9456 t['tehjeemisolatedarabic'] = 0xFC0B; 9457 t['tehmarbutaarabic'] = 0x0629; 9458 t['tehmarbutafinalarabic'] = 0xFE94; 9459 t['tehmedialarabic'] = 0xFE98; 9460 t['tehmeeminitialarabic'] = 0xFCA4; 9461 t['tehmeemisolatedarabic'] = 0xFC0E; 9462 t['tehnoonfinalarabic'] = 0xFC73; 9463 t['tekatakana'] = 0x30C6; 9464 t['tekatakanahalfwidth'] = 0xFF83; 9465 t['telephone'] = 0x2121; 9466 t['telephoneblack'] = 0x260E; 9467 t['telishagedolahebrew'] = 0x05A0; 9468 t['telishaqetanahebrew'] = 0x05A9; 9469 t['tencircle'] = 0x2469; 9470 t['tenideographicparen'] = 0x3229; 9471 t['tenparen'] = 0x247D; 9472 t['tenperiod'] = 0x2491; 9473 t['tenroman'] = 0x2179; 9474 t['tesh'] = 0x02A7; 9475 t['tet'] = 0x05D8; 9476 t['tetdagesh'] = 0xFB38; 9477 t['tetdageshhebrew'] = 0xFB38; 9478 t['tethebrew'] = 0x05D8; 9479 t['tetsecyrillic'] = 0x04B5; 9480 t['tevirhebrew'] = 0x059B; 9481 t['tevirlefthebrew'] = 0x059B; 9482 t['thabengali'] = 0x09A5; 9483 t['thadeva'] = 0x0925; 9484 t['thagujarati'] = 0x0AA5; 9485 t['thagurmukhi'] = 0x0A25; 9486 t['thalarabic'] = 0x0630; 9487 t['thalfinalarabic'] = 0xFEAC; 9488 t['thanthakhatlowleftthai'] = 0xF898; 9489 t['thanthakhatlowrightthai'] = 0xF897; 9490 t['thanthakhatthai'] = 0x0E4C; 9491 t['thanthakhatupperleftthai'] = 0xF896; 9492 t['theharabic'] = 0x062B; 9493 t['thehfinalarabic'] = 0xFE9A; 9494 t['thehinitialarabic'] = 0xFE9B; 9495 t['thehmedialarabic'] = 0xFE9C; 9496 t['thereexists'] = 0x2203; 9497 t['therefore'] = 0x2234; 9498 t['theta'] = 0x03B8; 9499 t['theta1'] = 0x03D1; 9500 t['thetasymbolgreek'] = 0x03D1; 9501 t['thieuthacirclekorean'] = 0x3279; 9502 t['thieuthaparenkorean'] = 0x3219; 9503 t['thieuthcirclekorean'] = 0x326B; 9504 t['thieuthkorean'] = 0x314C; 9505 t['thieuthparenkorean'] = 0x320B; 9506 t['thirteencircle'] = 0x246C; 9507 t['thirteenparen'] = 0x2480; 9508 t['thirteenperiod'] = 0x2494; 9509 t['thonangmonthothai'] = 0x0E11; 9510 t['thook'] = 0x01AD; 9511 t['thophuthaothai'] = 0x0E12; 9512 t['thorn'] = 0x00FE; 9513 t['thothahanthai'] = 0x0E17; 9514 t['thothanthai'] = 0x0E10; 9515 t['thothongthai'] = 0x0E18; 9516 t['thothungthai'] = 0x0E16; 9517 t['thousandcyrillic'] = 0x0482; 9518 t['thousandsseparatorarabic'] = 0x066C; 9519 t['thousandsseparatorpersian'] = 0x066C; 9520 t['three'] = 0x0033; 9521 t['threearabic'] = 0x0663; 9522 t['threebengali'] = 0x09E9; 9523 t['threecircle'] = 0x2462; 9524 t['threecircleinversesansserif'] = 0x278C; 9525 t['threedeva'] = 0x0969; 9526 t['threeeighths'] = 0x215C; 9527 t['threegujarati'] = 0x0AE9; 9528 t['threegurmukhi'] = 0x0A69; 9529 t['threehackarabic'] = 0x0663; 9530 t['threehangzhou'] = 0x3023; 9531 t['threeideographicparen'] = 0x3222; 9532 t['threeinferior'] = 0x2083; 9533 t['threemonospace'] = 0xFF13; 9534 t['threenumeratorbengali'] = 0x09F6; 9535 t['threeoldstyle'] = 0xF733; 9536 t['threeparen'] = 0x2476; 9537 t['threeperiod'] = 0x248A; 9538 t['threepersian'] = 0x06F3; 9539 t['threequarters'] = 0x00BE; 9540 t['threequartersemdash'] = 0xF6DE; 9541 t['threeroman'] = 0x2172; 9542 t['threesuperior'] = 0x00B3; 9543 t['threethai'] = 0x0E53; 9544 t['thzsquare'] = 0x3394; 9545 t['tihiragana'] = 0x3061; 9546 t['tikatakana'] = 0x30C1; 9547 t['tikatakanahalfwidth'] = 0xFF81; 9548 t['tikeutacirclekorean'] = 0x3270; 9549 t['tikeutaparenkorean'] = 0x3210; 9550 t['tikeutcirclekorean'] = 0x3262; 9551 t['tikeutkorean'] = 0x3137; 9552 t['tikeutparenkorean'] = 0x3202; 9553 t['tilde'] = 0x02DC; 9554 t['tildebelowcmb'] = 0x0330; 9555 t['tildecmb'] = 0x0303; 9556 t['tildecomb'] = 0x0303; 9557 t['tildedoublecmb'] = 0x0360; 9558 t['tildeoperator'] = 0x223C; 9559 t['tildeoverlaycmb'] = 0x0334; 9560 t['tildeverticalcmb'] = 0x033E; 9561 t['timescircle'] = 0x2297; 9562 t['tipehahebrew'] = 0x0596; 9563 t['tipehalefthebrew'] = 0x0596; 9564 t['tippigurmukhi'] = 0x0A70; 9565 t['titlocyrilliccmb'] = 0x0483; 9566 t['tiwnarmenian'] = 0x057F; 9567 t['tlinebelow'] = 0x1E6F; 9568 t['tmonospace'] = 0xFF54; 9569 t['toarmenian'] = 0x0569; 9570 t['tohiragana'] = 0x3068; 9571 t['tokatakana'] = 0x30C8; 9572 t['tokatakanahalfwidth'] = 0xFF84; 9573 t['tonebarextrahighmod'] = 0x02E5; 9574 t['tonebarextralowmod'] = 0x02E9; 9575 t['tonebarhighmod'] = 0x02E6; 9576 t['tonebarlowmod'] = 0x02E8; 9577 t['tonebarmidmod'] = 0x02E7; 9578 t['tonefive'] = 0x01BD; 9579 t['tonesix'] = 0x0185; 9580 t['tonetwo'] = 0x01A8; 9581 t['tonos'] = 0x0384; 9582 t['tonsquare'] = 0x3327; 9583 t['topatakthai'] = 0x0E0F; 9584 t['tortoiseshellbracketleft'] = 0x3014; 9585 t['tortoiseshellbracketleftsmall'] = 0xFE5D; 9586 t['tortoiseshellbracketleftvertical'] = 0xFE39; 9587 t['tortoiseshellbracketright'] = 0x3015; 9588 t['tortoiseshellbracketrightsmall'] = 0xFE5E; 9589 t['tortoiseshellbracketrightvertical'] = 0xFE3A; 9590 t['totaothai'] = 0x0E15; 9591 t['tpalatalhook'] = 0x01AB; 9592 t['tparen'] = 0x24AF; 9593 t['trademark'] = 0x2122; 9594 t['trademarksans'] = 0xF8EA; 9595 t['trademarkserif'] = 0xF6DB; 9596 t['tretroflexhook'] = 0x0288; 9597 t['triagdn'] = 0x25BC; 9598 t['triaglf'] = 0x25C4; 9599 t['triagrt'] = 0x25BA; 9600 t['triagup'] = 0x25B2; 9601 t['ts'] = 0x02A6; 9602 t['tsadi'] = 0x05E6; 9603 t['tsadidagesh'] = 0xFB46; 9604 t['tsadidageshhebrew'] = 0xFB46; 9605 t['tsadihebrew'] = 0x05E6; 9606 t['tsecyrillic'] = 0x0446;
9607 t['tsere'] = 0x05B5; 9608 t['tsere12'] = 0x05B5; 9609 t['tsere1e'] = 0x05B5; 9610 t['tsere2b'] = 0x05B5; 9611 t['tserehebrew'] = 0x05B5; 9612 t['tserenarrowhebrew'] = 0x05B5; 9613 t['tserequarterhebrew'] = 0x05B5; 9614 t['tserewidehebrew'] = 0x05B5; 9615 t['tshecyrillic'] = 0x045B; 9616 t['tsuperior'] = 0xF6F3; 9617 t['ttabengali'] = 0x099F; 9618 t['ttadeva'] = 0x091F; 9619 t['ttagujarati'] = 0x0A9F; 9620 t['ttagurmukhi'] = 0x0A1F; 9621 t['tteharabic'] = 0x0679; 9622 t['ttehfinalarabic'] = 0xFB67; 9623 t['ttehinitialarabic'] = 0xFB68; 9624 t['ttehmedialarabic'] = 0xFB69; 9625 t['tthabengali'] = 0x09A0; 9626 t['tthadeva'] = 0x0920; 9627 t['tthagujarati'] = 0x0AA0; 9628 t['tthagurmukhi'] = 0x0A20; 9629 t['tturned'] = 0x0287; 9630 t['tuhiragana'] = 0x3064; 9631 t['tukatakana'] = 0x30C4; 9632 t['tukatakanahalfwidth'] = 0xFF82; 9633 t['tusmallhiragana'] = 0x3063; 9634 t['tusmallkatakana'] = 0x30C3; 9635 t['tusmallkatakanahalfwidth'] = 0xFF6F; 9636 t['twelvecircle'] = 0x246B; 9637 t['twelveparen'] = 0x247F; 9638 t['twelveperiod'] = 0x2493; 9639 t['twelveroman'] = 0x217B; 9640 t['twentycircle'] = 0x2473; 9641 t['twentyhangzhou'] = 0x5344; 9642 t['twentyparen'] = 0x2487; 9643 t['twentyperiod'] = 0x249B; 9644 t['two'] = 0x0032; 9645 t['twoarabic'] = 0x0662; 9646 t['twobengali'] = 0x09E8; 9647 t['twocircle'] = 0x2461; 9648 t['twocircleinversesansserif'] = 0x278B; 9649 t['twodeva'] = 0x0968; 9650 t['twodotenleader'] = 0x2025; 9651 t['twodotleader'] = 0x2025; 9652 t['twodotleadervertical'] = 0xFE30; 9653 t['twogujarati'] = 0x0AE8; 9654 t['twogurmukhi'] = 0x0A68; 9655 t['twohackarabic'] = 0x0662; 9656 t['twohangzhou'] = 0x3022; 9657 t['twoideographicparen'] = 0x3221; 9658 t['twoinferior'] = 0x2082; 9659 t['twomonospace'] = 0xFF12; 9660 t['twonumeratorbengali'] = 0x09F5; 9661 t['twooldstyle'] = 0xF732; 9662 t['twoparen'] = 0x2475; 9663 t['twoperiod'] = 0x2489; 9664 t['twopersian'] = 0x06F2; 9665 t['tworoman'] = 0x2171; 9666 t['twostroke'] = 0x01BB; 9667 t['twosuperior'] = 0x00B2; 9668 t['twothai'] = 0x0E52; 9669 t['twothirds'] = 0x2154; 9670 t['u'] = 0x0075; 9671 t['uacute'] = 0x00FA; 9672 t['ubar'] = 0x0289; 9673 t['ubengali'] = 0x0989; 9674 t['ubopomofo'] = 0x3128; 9675 t['ubreve'] = 0x016D; 9676 t['ucaron'] = 0x01D4; 9677 t['ucircle'] = 0x24E4; 9678 t['ucircumflex'] = 0x00FB; 9679 t['ucircumflexbelow'] = 0x1E77; 9680 t['ucyrillic'] = 0x0443; 9681 t['udattadeva'] = 0x0951; 9682 t['udblacute'] = 0x0171; 9683 t['udblgrave'] = 0x0215; 9684 t['udeva'] = 0x0909; 9685 t['udieresis'] = 0x00FC; 9686 t['udieresisacute'] = 0x01D8; 9687 t['udieresisbelow'] = 0x1E73; 9688 t['udieresiscaron'] = 0x01DA; 9689 t['udieresiscyrillic'] = 0x04F1; 9690 t['udieresisgrave'] = 0x01DC; 9691 t['udieresismacron'] = 0x01D6; 9692 t['udotbelow'] = 0x1EE5; 9693 t['ugrave'] = 0x00F9; 9694 t['ugujarati'] = 0x0A89; 9695 t['ugurmukhi'] = 0x0A09; 9696 t['uhiragana'] = 0x3046; 9697 t['uhookabove'] = 0x1EE7; 9698 t['uhorn'] = 0x01B0; 9699 t['uhornacute'] = 0x1EE9; 9700 t['uhorndotbelow'] = 0x1EF1; 9701 t['uhorngrave'] = 0x1EEB; 9702 t['uhornhookabove'] = 0x1EED; 9703 t['uhorntilde'] = 0x1EEF; 9704 t['uhungarumlaut'] = 0x0171; 9705 t['uhungarumlautcyrillic'] = 0x04F3; 9706 t['uinvertedbreve'] = 0x0217; 9707 t['ukatakana'] = 0x30A6; 9708 t['ukatakanahalfwidth'] = 0xFF73; 9709 t['ukcyrillic'] = 0x0479; 9710 t['ukorean'] = 0x315C; 9711 t['umacron'] = 0x016B; 9712 t['umacroncyrillic'] = 0x04EF; 9713 t['umacrondieresis'] = 0x1E7B; 9714 t['umatragurmukhi'] = 0x0A41; 9715 t['umonospace'] = 0xFF55; 9716 t['underscore'] = 0x005F; 9717 t['underscoredbl'] = 0x2017; 9718 t['underscoremonospace'] = 0xFF3F; 9719 t['underscorevertical'] = 0xFE33; 9720 t['underscorewavy'] = 0xFE4F; 9721 t['union'] = 0x222A; 9722 t['universal'] = 0x2200; 9723 t['uogonek'] = 0x0173; 9724 t['uparen'] = 0x24B0; 9725 t['upblock'] = 0x2580; 9726 t['upperdothebrew'] = 0x05C4; 9727 t['upsilon'] = 0x03C5; 9728 t['upsilondieresis'] = 0x03CB; 9729 t['upsilondieresistonos'] = 0x03B0; 9730 t['upsilonlatin'] = 0x028A; 9731 t['upsilontonos'] = 0x03CD; 9732 t['uptackbelowcmb'] = 0x031D; 9733 t['uptackmod'] = 0x02D4; 9734 t['uragurmukhi'] = 0x0A73; 9735 t['uring'] = 0x016F; 9736 t['ushortcyrillic'] = 0x045E; 9737 t['usmallhiragana'] = 0x3045; 9738 t['usmallkatakana'] = 0x30A5; 9739 t['usmallkatakanahalfwidth'] = 0xFF69; 9740 t['ustraightcyrillic'] = 0x04AF; 9741 t['ustraightstrokecyrillic'] = 0x04B1; 9742 t['utilde'] = 0x0169; 9743 t['utildeacute'] = 0x1E79; 9744 t['utildebelow'] = 0x1E75; 9745 t['uubengali'] = 0x098A; 9746 t['uudeva'] = 0x090A; 9747 t['uugujarati'] = 0x0A8A; 9748 t['uugurmukhi'] = 0x0A0A; 9749 t['uumatragurmukhi'] = 0x0A42; 9750 t['uuvowelsignbengali'] = 0x09C2; 9751 t['uuvowelsigndeva'] = 0x0942; 9752 t['uuvowelsigngujarati'] = 0x0AC2; 9753 t['uvowelsignbengali'] = 0x09C1; 9754 t['uvowelsigndeva'] = 0x0941; 9755 t['uvowelsigngujarati'] = 0x0AC1; 9756 t['v'] = 0x0076; 9757 t['vadeva'] = 0x0935; 9758 t['vagujarati'] = 0x0AB5; 9759 t['vagurmukhi'] = 0x0A35; 9760 t['vakatakana'] = 0x30F7; 9761 t['vav'] = 0x05D5;
9762 t['vavdagesh'] = 0xFB35; 9763 t['vavdagesh65'] = 0xFB35; 9764 t['vavdageshhebrew'] = 0xFB35; 9765 t['vavhebrew'] = 0x05D5; 9766 t['vavholam'] = 0xFB4B; 9767 t['vavholamhebrew'] = 0xFB4B; 9768 t['vavvavhebrew'] = 0x05F0; 9769 t['vavyodhebrew'] = 0x05F1; 9770 t['vcircle'] = 0x24E5; 9771 t['vdotbelow'] = 0x1E7F; 9772 t['vecyrillic'] = 0x0432; 9773 t['veharabic'] = 0x06A4; 9774 t['vehfinalarabic'] = 0xFB6B; 9775 t['vehinitialarabic'] = 0xFB6C; 9776 t['vehmedialarabic'] = 0xFB6D; 9777 t['vekatakana'] = 0x30F9; 9778 t['venus'] = 0x2640; 9779 t['verticalbar'] = 0x007C; 9780 t['verticallineabovecmb'] = 0x030D; 9781 t['verticallinebelowcmb'] = 0x0329; 9782 t['verticallinelowmod'] = 0x02CC; 9783 t['verticallinemod'] = 0x02C8; 9784 t['vewarmenian'] = 0x057E; 9785 t['vhook'] = 0x028B; 9786 t['vikatakana'] = 0x30F8; 9787 t['viramabengali'] = 0x09CD; 9788 t['viramadeva'] = 0x094D; 9789 t['viramagujarati'] = 0x0ACD; 9790 t['visargabengali'] = 0x0983; 9791 t['visargadeva'] = 0x0903; 9792 t['visargagujarati'] = 0x0A83; 9793 t['vmonospace'] = 0xFF56; 9794 t['voarmenian'] = 0x0578; 9795 t['voicediterationhiragana'] = 0x309E; 9796 t['voicediterationkatakana'] = 0x30FE; 9797 t['voicedmarkkana'] = 0x309B; 9798 t['voicedmarkkanahalfwidth'] = 0xFF9E; 9799 t['vokatakana'] = 0x30FA; 9800 t['vparen'] = 0x24B1; 9801 t['vtilde'] = 0x1E7D; 9802 t['vturned'] = 0x028C; 9803 t['vuhiragana'] = 0x3094; 9804 t['vukatakana'] = 0x30F4; 9805 t['w'] = 0x0077; 9806 t['wacute'] = 0x1E83; 9807 t['waekorean'] = 0x3159; 9808 t['wahiragana'] = 0x308F; 9809 t['wakatakana'] = 0x30EF; 9810 t['wakatakanahalfwidth'] = 0xFF9C; 9811 t['wakorean'] = 0x3158; 9812 t['wasmallhiragana'] = 0x308E; 9813 t['wasmallkatakana'] = 0x30EE; 9814 t['wattosquare'] = 0x3357; 9815 t['wavedash'] = 0x301C; 9816 t['wavyunderscorevertical'] = 0xFE34; 9817 t['wawarabic'] = 0x0648; 9818 t['wawfinalarabic'] = 0xFEEE; 9819 t['wawhamzaabovearabic'] = 0x0624; 9820 t['wawhamzaabovefinalarabic'] = 0xFE86; 9821 t['wbsquare'] = 0x33DD; 9822 t['wcircle'] = 0x24E6; 9823 t['wcircumflex'] = 0x0175; 9824 t['wdieresis'] = 0x1E85; 9825 t['wdotaccent'] = 0x1E87; 9826 t['wdotbelow'] = 0x1E89; 9827 t['wehiragana'] = 0x3091; 9828 t['weierstrass'] = 0x2118; 9829 t['wekatakana'] = 0x30F1; 9830 t['wekorean'] = 0x315E; 9831 t['weokorean'] = 0x315D; 9832 t['wgrave'] = 0x1E81; 9833 t['whitebullet'] = 0x25E6; 9834 t['whitecircle'] = 0x25CB; 9835 t['whitecircleinverse'] = 0x25D9; 9836 t['whitecornerbracketleft'] = 0x300E; 9837 t['whitecornerbracketleftvertical'] = 0xFE43; 9838 t['whitecornerbracketright'] = 0x300F; 9839 t['whitecornerbracketrightvertical'] = 0xFE44; 9840 t['whitediamond'] = 0x25C7; 9841 t['whitediamondcontainingblacksmalldiamond'] = 0x25C8; 9842 t['whitedownpointingsmalltriangle'] = 0x25BF; 9843 t['whitedownpointingtriangle'] = 0x25BD; 9844 t['whiteleftpointingsmalltriangle'] = 0x25C3; 9845 t['whiteleftpointingtriangle'] = 0x25C1; 9846 t['whitelenticularbracketleft'] = 0x3016; 9847 t['whitelenticularbracketright'] = 0x3017; 9848 t['whiterightpointingsmalltriangle'] = 0x25B9; 9849 t['whiterightpointingtriangle'] = 0x25B7; 9850 t['whitesmallsquare'] = 0x25AB; 9851 t['whitesmilingface'] = 0x263A; 9852 t['whitesquare'] = 0x25A1; 9853 t['whitestar'] = 0x2606; 9854 t['whitetelephone'] = 0x260F; 9855 t['whitetortoiseshellbracketleft'] = 0x3018; 9856 t['whitetortoiseshellbracketright'] = 0x3019; 9857 t['whiteuppointingsmalltriangle'] = 0x25B5; 9858 t['whiteuppointingtriangle'] = 0x25B3; 9859 t['wihiragana'] = 0x3090; 9860 t['wikatakana'] = 0x30F0; 9861 t['wikorean'] = 0x315F; 9862 t['wmonospace'] = 0xFF57; 9863 t['wohiragana'] = 0x3092; 9864 t['wokatakana'] = 0x30F2; 9865 t['wokatakanahalfwidth'] = 0xFF66; 9866 t['won'] = 0x20A9; 9867 t['wonmonospace'] = 0xFFE6; 9868 t['wowaenthai'] = 0x0E27; 9869 t['wparen'] = 0x24B2; 9870 t['wring'] = 0x1E98; 9871 t['wsuperior'] = 0x02B7; 9872 t['wturned'] = 0x028D; 9873 t['wynn'] = 0x01BF; 9874 t['x'] = 0x0078; 9875 t['xabovecmb'] = 0x033D; 9876 t['xbopomofo'] = 0x3112; 9877 t['xcircle'] = 0x24E7; 9878 t['xdieresis'] = 0x1E8D; 9879 t['xdotaccent'] = 0x1E8B; 9880 t['xeharmenian'] = 0x056D; 9881 t['xi'] = 0x03BE; 9882 t['xmonospace'] = 0xFF58; 9883 t['xparen'] = 0x24B3; 9884 t['xsuperior'] = 0x02E3; 9885 t['y'] = 0x0079; 9886 t['yaadosquare'] = 0x334E; 9887 t['yabengali'] = 0x09AF; 9888 t['yacute'] = 0x00FD; 9889 t['yadeva'] = 0x092F; 9890 t['yaekorean'] = 0x3152; 9891 t['yagujarati'] = 0x0AAF; 9892 t['yagurmukhi'] = 0x0A2F; 9893 t['yahiragana'] = 0x3084; 9894 t['yakatakana'] = 0x30E4; 9895 t['yakatakanahalfwidth'] = 0xFF94; 9896 t['yakorean'] = 0x3151; 9897 t['yamakkanthai'] = 0x0E4E; 9898 t['yasmallhiragana'] = 0x3083; 9899 t['yasmallkatakana'] = 0x30E3; 9900 t['yasmallkatakanahalfwidth'] = 0xFF6C; 9901 t['yatcyrillic'] = 0x0463; 9902 t['ycircle'] = 0x24E8; 9903 t['ycircumflex'] = 0x0177; 9904 t['ydieresis'] = 0x00FF;
9905 t['ydotaccent'] = 0x1E8F; 9906 t['ydotbelow'] = 0x1EF5; 9907 t['yeharabic'] = 0x064A; 9908 t['yehbarreearabic'] = 0x06D2; 9909 t['yehbarreefinalarabic'] = 0xFBAF; 9910 t['yehfinalarabic'] = 0xFEF2; 9911 t['yehhamzaabovearabic'] = 0x0626; 9912 t['yehhamzaabovefinalarabic'] = 0xFE8A; 9913 t['yehhamzaaboveinitialarabic'] = 0xFE8B; 9914 t['yehhamzaabovemedialarabic'] = 0xFE8C; 9915 t['yehinitialarabic'] = 0xFEF3; 9916 t['yehmedialarabic'] = 0xFEF4; 9917 t['yehmeeminitialarabic'] = 0xFCDD; 9918 t['yehmeemisolatedarabic'] = 0xFC58; 9919 t['yehnoonfinalarabic'] = 0xFC94; 9920 t['yehthreedotsbelowarabic'] = 0x06D1; 9921 t['yekorean'] = 0x3156; 9922 t['yen'] = 0x00A5; 9923 t['yenmonospace'] = 0xFFE5; 9924 t['yeokorean'] = 0x3155; 9925 t['yeorinhieuhkorean'] = 0x3186; 9926 t['yerahbenyomohebrew'] = 0x05AA; 9927 t['yerahbenyomolefthebrew'] = 0x05AA; 9928 t['yericyrillic'] = 0x044B; 9929 t['yerudieresiscyrillic'] = 0x04F9; 9930 t['yesieungkorean'] = 0x3181; 9931 t['yesieungpansioskorean'] = 0x3183; 9932 t['yesieungsioskorean'] = 0x3182; 9933 t['yetivhebrew'] = 0x059A; 9934 t['ygrave'] = 0x1EF3; 9935 t['yhook'] = 0x01B4; 9936 t['yhookabove'] = 0x1EF7; 9937 t['yiarmenian'] = 0x0575; 9938 t['yicyrillic'] = 0x0457; 9939 t['yikorean'] = 0x3162; 9940 t['yinyang'] = 0x262F; 9941 t['yiwnarmenian'] = 0x0582; 9942 t['ymonospace'] = 0xFF59; 9943 t['yod'] = 0x05D9; 9944 t['yoddagesh'] = 0xFB39; 9945 t['yoddageshhebrew'] = 0xFB39; 9946 t['yodhebrew'] = 0x05D9; 9947 t['yodyodhebrew'] = 0x05F2; 9948 t['yodyodpatahhebrew'] = 0xFB1F; 9949 t['yohiragana'] = 0x3088; 9950 t['yoikorean'] = 0x3189; 9951 t['yokatakana'] = 0x30E8; 9952 t['yokatakanahalfwidth'] = 0xFF96; 9953 t['yokorean'] = 0x315B; 9954 t['yosmallhiragana'] = 0x3087; 9955 t['yosmallkatakana'] = 0x30E7; 9956 t['yosmallkatakanahalfwidth'] = 0xFF6E; 9957 t['yotgreek'] = 0x03F3; 9958 t['yoyaekorean'] = 0x3188; 9959 t['yoyakorean'] = 0x3187; 9960 t['yoyakthai'] = 0x0E22; 9961 t['yoyingthai'] = 0x0E0D; 9962 t['yparen'] = 0x24B4; 9963 t['ypogegrammeni'] = 0x037A; 9964 t['ypogegrammenigreekcmb'] = 0x0345; 9965 t['yr'] = 0x01A6; 9966 t['yring'] = 0x1E99; 9967 t['ysuperior'] = 0x02B8; 9968 t['ytilde'] = 0x1EF9; 9969 t['yturned'] = 0x028E; 9970 t['yuhiragana'] = 0x3086; 9971 t['yuikorean'] = 0x318C; 9972 t['yukatakana'] = 0x30E6; 9973 t['yukatakanahalfwidth'] = 0xFF95; 9974 t['yukorean'] = 0x3160; 9975 t['yusbigcyrillic'] = 0x046B; 9976 t['yusbigiotifiedcyrillic'] = 0x046D; 9977 t['yuslittlecyrillic'] = 0x0467; 9978 t['yuslittleiotifiedcyrillic'] = 0x0469; 9979 t['yusmallhiragana'] = 0x3085; 9980 t['yusmallkatakana'] = 0x30E5; 9981 t['yusmallkatakanahalfwidth'] = 0xFF6D; 9982 t['yuyekorean'] = 0x318B; 9983 t['yuyeokorean'] = 0x318A; 9984 t['yyabengali'] = 0x09DF; 9985 t['yyadeva'] = 0x095F; 9986 t['z'] = 0x007A; 9987 t['zaarmenian'] = 0x0566; 9988 t['zacute'] = 0x017A; 9989 t['zadeva'] = 0x095B; 9990 t['zagurmukhi'] = 0x0A5B; 9991 t['zaharabic'] = 0x0638; 9992 t['zahfinalarabic'] = 0xFEC6; 9993 t['zahinitialarabic'] = 0xFEC7; 9994 t['zahiragana'] = 0x3056; 9995 t['zahmedialarabic'] = 0xFEC8; 9996 t['zainarabic'] = 0x0632; 9997 t['zainfinalarabic'] = 0xFEB0; 9998 t['zakatakana'] = 0x30B6; 9999 t['zaqefgadolhebrew'] = 0x0595; 10000 t['zaqefqatanhebrew'] = 0x0594; 10001 t['zarqahebrew'] = 0x0598; 10002 t['zayin'] = 0x05D6; 10003 t['zayindagesh'] = 0xFB36; 10004 t['zayindageshhebrew'] = 0xFB36; 10005 t['zayinhebrew'] = 0x05D6; 10006 t['zbopomofo'] = 0x3117; 10007 t['zcaron'] = 0x017E; 10008 t['zcircle'] = 0x24E9; 10009 t['zcircumflex'] = 0x1E91; 10010 t['zcurl'] = 0x0291; 10011 t['zdot'] = 0x017C; 10012 t['zdotaccent'] = 0x017C; 10013 t['zdotbelow'] = 0x1E93; 10014 t['zecyrillic'] = 0x0437; 10015 t['zedescendercyrillic'] = 0x0499; 10016 t['zedieresiscyrillic'] = 0x04DF; 10017 t['zehiragana'] = 0x305C; 10018 t['zekatakana'] = 0x30BC; 10019 t['zero'] = 0x0030; 10020 t['zeroarabic'] = 0x0660; 10021 t['zerobengali'] = 0x09E6; 10022 t['zerodeva'] = 0x0966; 10023 t['zerogujarati'] = 0x0AE6; 10024 t['zerogurmukhi'] = 0x0A66; 10025 t['zerohackarabic'] = 0x0660; 10026 t['zeroinferior'] = 0x2080; 10027 t['zeromonospace'] = 0xFF10; 10028 t['zerooldstyle'] = 0xF730; 10029 t['zeropersian'] = 0x06F0; 10030 t['zerosuperior'] = 0x2070; 10031 t['zerothai'] = 0x0E50; 10032 t['zerowidthjoiner'] = 0xFEFF; 10033 t['zerowidthnonjoiner'] = 0x200C; 10034 t['zerowidthspace'] = 0x200B; 10035 t['zeta'] = 0x03B6; 10036 t['zhbopomofo'] = 0x3113; 10037 t['zhearmenian'] = 0x056A; 10038 t['zhebrevecyrillic'] = 0x04C2; 10039 t['zhecyrillic'] = 0x0436; 10040 t['zhedescendercyrillic'] = 0x0497; 10041 t['zhedieresiscyrillic'] = 0x04DD; 10042 t['zihiragana'] = 0x3058; 10043 t['zikatakana'] = 0x30B8; 10044 t['zinorhebrew'] = 0x05AE; 10045 t['zlinebelow'] = 0x1E95; 10046 t['zmonospace'] = 0xFF5A; 10047 t['zohiragana'] = 0x305E; 10048 t['zokatakana'] = 0x30BE; 10049 t['zparen'] = 0x24B5; 10050 t['zretroflexhook'] = 0x0290; 10051 t['zstroke'] = 0x01B6; 10052 t['zuhiragana'] = 0x305A; 10053 t['zukatakana'] = 0x30BA; 10054 t['.notdef'] = 0x0000; 10055 t['angbracketleftbig'] = 0x2329; 10056 t['angbracketleftBig'] = 0x2329; 10057 t['angbracketleftbigg'] = 0x2329; 10058 t['angbracketleftBigg'] = 0x2329; 10059 t['angbracketrightBig'] = 0x232A; 10060 t['angbracketrightbig'] = 0x232A; 10061 t['angbracketrightBigg'] = 0x232A; 10062 t['angbracketrightbigg'] = 0x232A; 10063 t['arrowhookleft'] = 0x21AA; 10064 t['arrowhookright'] = 0x21A9; 10065 t['arrowlefttophalf'] = 0x21BC; 10066 t['arrowleftbothalf'] = 0x21BD; 10067 t['arrownortheast'] = 0x2197; 10068 t['arrownorthwest'] = 0x2196; 10069 t['arrowrighttophalf'] = 0x21C0; 10070 t['arrowrightbothalf'] = 0x21C1; 10071 t['arrowsoutheast'] = 0x2198; 10072 t['arrowsouthwest'] = 0x2199; 10073 t['backslashbig'] = 0x2216; 10074 t['backslashBig'] = 0x2216; 10075 t['backslashBigg'] = 0x2216; 10076 t['backslashbigg'] = 0x2216; 10077 t['bardbl'] = 0x2016; 10078 t['bracehtipdownleft'] = 0xFE37; 10079 t['bracehtipdownright'] = 0xFE37; 10080 t['bracehtipupleft'] = 0xFE38; 10081 t['bracehtipupright'] = 0xFE38; 10082 t['braceleftBig'] = 0x007B; 10083 t['braceleftbig'] = 0x007B; 10084 t['braceleftbigg'] = 0x007B; 10085 t['braceleftBigg'] = 0x007B; 10086 t['bracerightBig'] = 0x007D; 10087 t['bracerightbig'] = 0x007D; 10088 t['bracerightbigg'] = 0x007D; 10089 t['bracerightBigg'] = 0x007D; 10090 t['bracketleftbig'] = 0x005B; 10091 t['bracketleftBig'] = 0x005B; 10092 t['bracketleftbigg'] = 0x005B; 10093 t['bracketleftBigg'] = 0x005B; 10094 t['bracketrightBig'] = 0x005D; 10095 t['bracketrightbig'] = 0x005D; 10096 t['bracketrightbigg'] = 0x005D; 10097 t['bracketrightBigg'] = 0x005D; 10098 t['ceilingleftbig'] = 0x2308; 10099 t['ceilingleftBig'] = 0x2308; 10100 t['ceilingleftBigg'] = 0x2308; 10101 t['ceilingleftbigg'] = 0x2308; 10102 t['ceilingrightbig'] = 0x2309; 10103 t['ceilingrightBig'] = 0x2309; 10104 t['ceilingrightbigg'] = 0x2309; 10105 t['ceilingrightBigg'] = 0x2309; 10106 t['circledotdisplay'] = 0x2299; 10107 t['circledottext'] = 0x2299; 10108 t['circlemultiplydisplay'] = 0x2297; 10109 t['circlemultiplytext'] = 0x2297; 10110 t['circleplusdisplay'] = 0x2295; 10111 t['circleplustext'] = 0x2295; 10112 t['contintegraldisplay'] = 0x222E; 10113 t['contintegraltext'] = 0x222E; 10114 t['coproductdisplay'] = 0x2210; 10115 t['coproducttext'] = 0x2210; 10116 t['floorleftBig'] = 0x230A; 10117 t['floorleftbig'] = 0x230A; 10118 t['floorleftbigg'] = 0x230A; 10119 t['floorleftBigg'] = 0x230A; 10120 t['floorrightbig'] = 0x230B; 10121 t['floorrightBig'] = 0x230B; 10122 t['floorrightBigg'] = 0x230B; 10123 t['floorrightbigg'] = 0x230B; 10124 t['hatwide'] = 0x0302; 10125 t['hatwider'] = 0x0302; 10126 t['hatwidest'] = 0x0302; 10127 t['intercal'] = 0x1D40; 10128 t['integraldisplay'] = 0x222B; 10129 t['integraltext'] = 0x222B; 10130 t['intersectiondisplay'] = 0x22C2; 10131 t['intersectiontext'] = 0x22C2; 10132 t['logicalanddisplay'] = 0x2227; 10133 t['logicalandtext'] = 0x2227; 10134 t['logicalordisplay'] = 0x2228; 10135 t['logicalortext'] = 0x2228; 10136 t['parenleftBig'] = 0x0028; 10137 t['parenleftbig'] = 0x0028; 10138 t['parenleftBigg'] = 0x0028; 10139 t['parenleftbigg'] = 0x0028; 10140 t['parenrightBig'] = 0x0029; 10141 t['parenrightbig'] = 0x0029; 10142 t['parenrightBigg'] = 0x0029; 10143 t['parenrightbigg'] = 0x0029; 10144 t['prime'] = 0x2032; 10145 t['productdisplay'] = 0x220F; 10146 t['producttext'] = 0x220F; 10147 t['radicalbig'] = 0x221A; 10148 t['radicalBig'] = 0x221A; 10149 t['radicalBigg'] = 0x221A; 10150 t['radicalbigg'] = 0x221A; 10151 t['radicalbt'] = 0x221A; 10152 t['radicaltp'] = 0x221A; 10153 t['radicalvertex'] = 0x221A; 10154 t['slashbig'] = 0x002F; 10155 t['slashBig'] = 0x002F; 10156 t['slashBigg'] = 0x002F; 10157 t['slashbigg'] = 0x002F; 10158 t['summationdisplay'] = 0x2211; 10159 t['summationtext'] = 0x2211; 10160 t['tildewide'] = 0x02DC; 10161 t['tildewider'] = 0x02DC; 10162 t['tildewidest'] = 0x02DC; 10163 t['uniondisplay'] = 0x22C3; 10164 t['unionmultidisplay'] = 0x228E; 10165 t['unionmultitext'] = 0x228E; 10166 t['unionsqdisplay'] = 0x2294; 10167 t['unionsqtext'] = 0x2294; 10168 t['uniontext'] = 0x22C3; 10169 t['vextenddouble'] = 0x2225; 10170 t['vextendsingle'] = 0x2223; 10171}); 10172var getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) { 10173 t['space'] = 0x0020; 10174 t['a1'] = 0x2701; 10175 t['a2'] = 0x2702; 10176 t['a202'] = 0x2703; 10177 t['a3'] = 0x2704; 10178 t['a4'] = 0x260E; 10179 t['a5'] = 0x2706; 10180 t['a119'] = 0x2707; 10181 t['a118'] = 0x2708; 10182 t['a117'] = 0x2709; 10183 t['a11'] = 0x261B; 10184 t['a12'] = 0x261E; 10185 t['a13'] = 0x270C; 10186 t['a14'] = 0x270D; 10187 t['a15'] = 0x270E; 10188 t['a16'] = 0x270F; 10189 t['a105'] = 0x2710; 10190 t['a17'] = 0x2711; 10191 t['a18'] = 0x2712; 10192 t['a19'] = 0x2713; 10193 t['a20'] = 0x2714; 10194 t['a21'] = 0x2715; 10195 t['a22'] = 0x2716; 10196 t['a23'] = 0x2717; 10197 t['a24'] = 0x2718; 10198 t['a25'] = 0x2719; 10199 t['a26'] = 0x271A; 10200 t['a27'] = 0x271B;
vendor: 5,340 bytes, lines 10201-10423
10201 t['a28'] = 0x271C; 10202 t['a6'] = 0x271D; 10203 t['a7'] = 0x271E; 10204 t['a8'] = 0x271F; 10205 t['a9'] = 0x2720; 10206 t['a10'] = 0x2721; 10207 t['a29'] = 0x2722; 10208 t['a30'] = 0x2723; 10209 t['a31'] = 0x2724; 10210 t['a32'] = 0x2725; 10211 t['a33'] = 0x2726; 10212 t['a34'] = 0x2727; 10213 t['a35'] = 0x2605; 10214 t['a36'] = 0x2729; 10215 t['a37'] = 0x272A; 10216 t['a38'] = 0x272B; 10217 t['a39'] = 0x272C; 10218 t['a40'] = 0x272D; 10219 t['a41'] = 0x272E; 10220 t['a42'] = 0x272F; 10221 t['a43'] = 0x2730; 10222 t['a44'] = 0x2731; 10223 t['a45'] = 0x2732; 10224 t['a46'] = 0x2733; 10225 t['a47'] = 0x2734; 10226 t['a48'] = 0x2735; 10227 t['a49'] = 0x2736; 10228 t['a50'] = 0x2737; 10229 t['a51'] = 0x2738; 10230 t['a52'] = 0x2739; 10231 t['a53'] = 0x273A; 10232 t['a54'] = 0x273B; 10233 t['a55'] = 0x273C; 10234 t['a56'] = 0x273D; 10235 t['a57'] = 0x273E; 10236 t['a58'] = 0x273F; 10237 t['a59'] = 0x2740; 10238 t['a60'] = 0x2741; 10239 t['a61'] = 0x2742; 10240 t['a62'] = 0x2743; 10241 t['a63'] = 0x2744; 10242 t['a64'] = 0x2745; 10243 t['a65'] = 0x2746; 10244 t['a66'] = 0x2747; 10245 t['a67'] = 0x2748; 10246 t['a68'] = 0x2749; 10247 t['a69'] = 0x274A; 10248 t['a70'] = 0x274B; 10249 t['a71'] = 0x25CF; 10250 t['a72'] = 0x274D; 10251 t['a73'] = 0x25A0; 10252 t['a74'] = 0x274F; 10253 t['a203'] = 0x2750; 10254 t['a75'] = 0x2751; 10255 t['a204'] = 0x2752; 10256 t['a76'] = 0x25B2; 10257 t['a77'] = 0x25BC; 10258 t['a78'] = 0x25C6; 10259 t['a79'] = 0x2756; 10260 t['a81'] = 0x25D7; 10261 t['a82'] = 0x2758; 10262 t['a83'] = 0x2759; 10263 t['a84'] = 0x275A; 10264 t['a97'] = 0x275B; 10265 t['a98'] = 0x275C; 10266 t['a99'] = 0x275D; 10267 t['a100'] = 0x275E; 10268 t['a101'] = 0x2761; 10269 t['a102'] = 0x2762; 10270 t['a103'] = 0x2763; 10271 t['a104'] = 0x2764; 10272 t['a106'] = 0x2765; 10273 t['a107'] = 0x2766; 10274 t['a108'] = 0x2767; 10275 t['a112'] = 0x2663; 10276 t['a111'] = 0x2666; 10277 t['a110'] = 0x2665; 10278 t['a109'] = 0x2660; 10279 t['a120'] = 0x2460; 10280 t['a121'] = 0x2461; 10281 t['a122'] = 0x2462; 10282 t['a123'] = 0x2463; 10283 t['a124'] = 0x2464; 10284 t['a125'] = 0x2465; 10285 t['a126'] = 0x2466; 10286 t['a127'] = 0x2467; 10287 t['a128'] = 0x2468; 10288 t['a129'] = 0x2469; 10289 t['a130'] = 0x2776; 10290 t['a131'] = 0x2777; 10291 t['a132'] = 0x2778; 10292 t['a133'] = 0x2779; 10293 t['a134'] = 0x277A; 10294 t['a135'] = 0x277B; 10295 t['a136'] = 0x277C; 10296 t['a137'] = 0x277D; 10297 t['a138'] = 0x277E; 10298 t['a139'] = 0x277F; 10299 t['a140'] = 0x2780; 10300 t['a141'] = 0x2781; 10301 t['a142'] = 0x2782; 10302 t['a143'] = 0x2783; 10303 t['a144'] = 0x2784; 10304 t['a145'] = 0x2785; 10305 t['a146'] = 0x2786; 10306 t['a147'] = 0x2787; 10307 t['a148'] = 0x2788; 10308 t['a149'] = 0x2789; 10309 t['a150'] = 0x278A; 10310 t['a151'] = 0x278B; 10311 t['a152'] = 0x278C; 10312 t['a153'] = 0x278D; 10313 t['a154'] = 0x278E; 10314 t['a155'] = 0x278F; 10315 t['a156'] = 0x2790; 10316 t['a157'] = 0x2791; 10317 t['a158'] = 0x2792; 10318 t['a159'] = 0x2793; 10319 t['a160'] = 0x2794; 10320 t['a161'] = 0x2192; 10321 t['a163'] = 0x2194; 10322 t['a164'] = 0x2195; 10323 t['a196'] = 0x2798; 10324 t['a165'] = 0x2799; 10325 t['a192'] = 0x279A; 10326 t['a166'] = 0x279B; 10327 t['a167'] = 0x279C; 10328 t['a168'] = 0x279D; 10329 t['a169'] = 0x279E; 10330 t['a170'] = 0x279F; 10331 t['a171'] = 0x27A0; 10332 t['a172'] = 0x27A1; 10333 t['a173'] = 0x27A2; 10334 t['a162'] = 0x27A3; 10335 t['a174'] = 0x27A4; 10336 t['a175'] = 0x27A5; 10337 t['a176'] = 0x27A6; 10338 t['a177'] = 0x27A7; 10339 t['a178'] = 0x27A8; 10340 t['a179'] = 0x27A9; 10341 t['a193'] = 0x27AA; 10342 t['a180'] = 0x27AB; 10343 t['a199'] = 0x27AC; 10344 t['a181'] = 0x27AD; 10345 t['a200'] = 0x27AE; 10346 t['a182'] = 0x27AF; 10347 t['a201'] = 0x27B1; 10348 t['a183'] = 0x27B2; 10349 t['a184'] = 0x27B3; 10350 t['a197'] = 0x27B4; 10351 t['a185'] = 0x27B5; 10352 t['a194'] = 0x27B6; 10353 t['a198'] = 0x27B7; 10354 t['a186'] = 0x27B8; 10355 t['a195'] = 0x27B9; 10356 t['a187'] = 0x27BA; 10357 t['a188'] = 0x27BB; 10358 t['a189'] = 0x27BC; 10359 t['a190'] = 0x27BD; 10360 t['a191'] = 0x27BE; 10361 t['a89'] = 0x2768; 10362 t['a90'] = 0x2769; 10363 t['a93'] = 0x276A; 10364 t['a94'] = 0x276B; 10365 t['a91'] = 0x276C; 10366 t['a92'] = 0x276D; 10367 t['a205'] = 0x276E; 10368 t['a85'] = 0x276F; 10369 t['a206'] = 0x2770; 10370 t['a86'] = 0x2771; 10371 t['a87'] = 0x2772; 10372 t['a88'] = 0x2773; 10373 t['a95'] = 0x2774; 10374 t['a96'] = 0x2775; 10375 t['.notdef'] = 0x0000; 10376}); 10377exports.getGlyphsUnicode = getGlyphsUnicode; 10378exports.getDingbatsGlyphsUnicode = getDingbatsGlyphsUnicode; 10379 10380/***/ }), 10381/* 44 */ 10382/***/ (function(module, exports, __w_pdfjs_require__) { 10383 10384"use strict"; 10385 10386 10387var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 10388 10389module.exports = function isNodeJS() { 10390 return (typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process + '' === '[object process]'; 10391}; 10392 10393/***/ }), 10394/* 45 */ 10395/***/ (function(module, exports, __w_pdfjs_require__) { 10396 10397"use strict"; 10398 10399 10400module.exports = !__w_pdfjs_require__(13) && !__w_pdfjs_require__(14)(function () { 10401 return Object.defineProperty(__w_pdfjs_require__(27)('div'), 'a', { 10402 get: function get() { 10403 return 7; 10404 } 10405 }).a != 7; 10406}); 10407 10408/***/ }), 10409/* 46 */ 10410/***/ (function(module, exports, __w_pdfjs_require__) { 10411 10412"use strict"; 10413 10414 10415var isObject = __w_pdfjs_require__(3); 10416module.exports = function (it, S) { 10417 if (!isObject(it)) return it; 10418 var fn, val; 10419 if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; 10420 if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; 10421 if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; 10422 throw TypeError("Can't convert object to primitive value"); 10423};
vendor: 4,654 bytes, lines 10424-10577
10424 10425/***/ }), 10426/* 47 */ 10427/***/ (function(module, exports, __w_pdfjs_require__) { 10428 10429"use strict"; 10430 10431 10432var toIObject = __w_pdfjs_require__(17); 10433var toLength = __w_pdfjs_require__(31); 10434var toAbsoluteIndex = __w_pdfjs_require__(80); 10435module.exports = function (IS_INCLUDES) { 10436 return function ($this, el, fromIndex) { 10437 var O = toIObject($this); 10438 var length = toLength(O.length); 10439 var index = toAbsoluteIndex(fromIndex, length); 10440 var value; 10441 if (IS_INCLUDES && el != el) while (length > index) { 10442 value = O[index++]; 10443 if (value != value) return true; 10444 } else for (; length > index; index++) { 10445 if (IS_INCLUDES || index in O) { 10446 if (O[index] === el) return IS_INCLUDES || index || 0; 10447 } 10448 }return !IS_INCLUDES && -1; 10449 }; 10450}; 10451 10452/***/ }), 10453/* 48 */ 10454/***/ (function(module, exports, __w_pdfjs_require__) { 10455 10456"use strict"; 10457 10458 10459var global = __w_pdfjs_require__(5); 10460var SHARED = '__core-js_shared__'; 10461var store = global[SHARED] || (global[SHARED] = {}); 10462module.exports = function (key) { 10463 return store[key] || (store[key] = {}); 10464}; 10465 10466/***/ }), 10467/* 49 */ 10468/***/ (function(module, exports, __w_pdfjs_require__) { 10469 10470"use strict"; 10471 10472 10473module.exports = 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'.split(','); 10474 10475/***/ }), 10476/* 50 */ 10477/***/ (function(module, exports, __w_pdfjs_require__) { 10478 10479"use strict"; 10480 10481 10482var UNSCOPABLES = __w_pdfjs_require__(4)('unscopables'); 10483var ArrayProto = Array.prototype; 10484if (ArrayProto[UNSCOPABLES] == undefined) __w_pdfjs_require__(12)(ArrayProto, UNSCOPABLES, {}); 10485module.exports = function (key) { 10486 ArrayProto[UNSCOPABLES][key] = true; 10487}; 10488 10489/***/ }), 10490/* 51 */ 10491/***/ (function(module, exports, __w_pdfjs_require__) { 10492 10493"use strict"; 10494 10495 10496var classof = __w_pdfjs_require__(35); 10497var test = {}; 10498test[__w_pdfjs_require__(4)('toStringTag')] = 'z'; 10499if (test + '' != '[object z]') { 10500 __w_pdfjs_require__(10)(Object.prototype, 'toString', function toString() { 10501 return '[object ' + classof(this) + ']'; 10502 }, true); 10503} 10504 10505/***/ }), 10506/* 52 */ 10507/***/ (function(module, exports, __w_pdfjs_require__) { 10508 10509"use strict"; 10510 10511 10512var LIBRARY = __w_pdfjs_require__(53); 10513var $export = __w_pdfjs_require__(6); 10514var redefine = __w_pdfjs_require__(10); 10515var hide = __w_pdfjs_require__(12); 10516var has = __w_pdfjs_require__(9); 10517var Iterators = __w_pdfjs_require__(19); 10518var $iterCreate = __w_pdfjs_require__(93); 10519var setToStringTag = __w_pdfjs_require__(24); 10520var getPrototypeOf = __w_pdfjs_require__(96); 10521var ITERATOR = __w_pdfjs_require__(4)('iterator'); 10522var BUGGY = !([].keys && 'next' in [].keys()); 10523var FF_ITERATOR = '@@iterator'; 10524var KEYS = 'keys'; 10525var VALUES = 'values'; 10526var returnThis = function returnThis() { 10527 return this; 10528}; 10529module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { 10530 $iterCreate(Constructor, NAME, next); 10531 var getMethod = function getMethod(kind) { 10532 if (!BUGGY && kind in proto) return proto[kind]; 10533 switch (kind) { 10534 case KEYS: 10535 return function keys() { 10536 return new Constructor(this, kind); 10537 }; 10538 case VALUES: 10539 return function values() { 10540 return new Constructor(this, kind); 10541 }; 10542 } 10543 return function entries() { 10544 return new Constructor(this, kind); 10545 }; 10546 }; 10547 var TAG = NAME + ' Iterator'; 10548 var DEF_VALUES = DEFAULT == VALUES; 10549 var VALUES_BUG = false; 10550 var proto = Base.prototype; 10551 var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; 10552 var $default = $native || getMethod(DEFAULT); 10553 var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; 10554 var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; 10555 var methods, key, IteratorPrototype; 10556 if ($anyNative) { 10557 IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); 10558 if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { 10559 setToStringTag(IteratorPrototype, TAG, true); 10560 if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); 10561 } 10562 } 10563 if (DEF_VALUES && $native && $native.name !== VALUES) { 10564 VALUES_BUG = true; 10565 $default = function values() { 10566 return $native.call(this); 10567 }; 10568 } 10569 if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { 10570 hide(proto, ITERATOR, $default); 10571 } 10572 Iterators[NAME] = $default; 10573 Iterators[TAG] = returnThis; 10574 if (DEFAULT) { 10575 methods = { 10576 values: DEF_VALUES ? $default : getMethod(VALUES), 10577 keys: IS_SET ? $default : getMethod(KEYS),
vendor: 5,701 bytes, lines 10578-10803
10578 entries: $entries 10579 }; 10580 if (FORCED) for (key in methods) { 10581 if (!(key in proto)) redefine(proto, key, methods[key]); 10582 } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); 10583 } 10584 return methods; 10585}; 10586 10587/***/ }), 10588/* 53 */ 10589/***/ (function(module, exports, __w_pdfjs_require__) { 10590 10591"use strict"; 10592 10593 10594module.exports = false; 10595 10596/***/ }), 10597/* 54 */ 10598/***/ (function(module, exports, __w_pdfjs_require__) { 10599 10600"use strict"; 10601 10602 10603var document = __w_pdfjs_require__(5).document; 10604module.exports = document && document.documentElement; 10605 10606/***/ }), 10607/* 55 */ 10608/***/ (function(module, exports, __w_pdfjs_require__) { 10609 10610"use strict"; 10611 10612 10613var $iterators = __w_pdfjs_require__(97); 10614var getKeys = __w_pdfjs_require__(23); 10615var redefine = __w_pdfjs_require__(10); 10616var global = __w_pdfjs_require__(5); 10617var hide = __w_pdfjs_require__(12); 10618var Iterators = __w_pdfjs_require__(19); 10619var wks = __w_pdfjs_require__(4); 10620var ITERATOR = wks('iterator'); 10621var TO_STRING_TAG = wks('toStringTag'); 10622var ArrayValues = Iterators.Array; 10623var DOMIterables = { 10624 CSSRuleList: true, 10625 CSSStyleDeclaration: false, 10626 CSSValueList: false, 10627 ClientRectList: false, 10628 DOMRectList: false, 10629 DOMStringList: false, 10630 DOMTokenList: true, 10631 DataTransferItemList: false, 10632 FileList: false, 10633 HTMLAllCollection: false, 10634 HTMLCollection: false, 10635 HTMLFormElement: false, 10636 HTMLSelectElement: false, 10637 MediaList: true, 10638 MimeTypeArray: false, 10639 NamedNodeMap: false, 10640 NodeList: true, 10641 PaintRequestList: false, 10642 Plugin: false, 10643 PluginArray: false, 10644 SVGLengthList: false, 10645 SVGNumberList: false, 10646 SVGPathSegList: false, 10647 SVGPointList: false, 10648 SVGStringList: false, 10649 SVGTransformList: false, 10650 SourceBufferList: false, 10651 StyleSheetList: true, 10652 TextTrackCueList: false, 10653 TextTrackList: false, 10654 TouchList: false 10655}; 10656for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { 10657 var NAME = collections[i]; 10658 var explicit = DOMIterables[NAME]; 10659 var Collection = global[NAME]; 10660 var proto = Collection && Collection.prototype; 10661 var key; 10662 if (proto) { 10663 if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); 10664 if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); 10665 Iterators[NAME] = ArrayValues; 10666 if (explicit) for (key in $iterators) { 10667 if (!proto[key]) redefine(proto, key, $iterators[key], true); 10668 } 10669 } 10670} 10671 10672/***/ }), 10673/* 56 */ 10674/***/ (function(module, exports, __w_pdfjs_require__) { 10675 10676"use strict"; 10677 10678 10679var anObject = __w_pdfjs_require__(8); 10680var aFunction = __w_pdfjs_require__(16); 10681var SPECIES = __w_pdfjs_require__(4)('species'); 10682module.exports = function (O, D) { 10683 var C = anObject(O).constructor; 10684 var S; 10685 return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); 10686}; 10687 10688/***/ }), 10689/* 57 */ 10690/***/ (function(module, exports, __w_pdfjs_require__) { 10691 10692"use strict"; 10693 10694 10695var ctx = __w_pdfjs_require__(11); 10696var invoke = __w_pdfjs_require__(103); 10697var html = __w_pdfjs_require__(54); 10698var cel = __w_pdfjs_require__(27); 10699var global = __w_pdfjs_require__(5); 10700var process = global.process; 10701var setTask = global.setImmediate; 10702var clearTask = global.clearImmediate; 10703var MessageChannel = global.MessageChannel; 10704var Dispatch = global.Dispatch; 10705var counter = 0; 10706var queue = {}; 10707var ONREADYSTATECHANGE = 'onreadystatechange'; 10708var defer, channel, port; 10709var run = function run() { 10710 var id = +this; 10711 if (queue.hasOwnProperty(id)) { 10712 var fn = queue[id]; 10713 delete queue[id]; 10714 fn(); 10715 } 10716}; 10717var listener = function listener(event) { 10718 run.call(event.data); 10719}; 10720if (!setTask || !clearTask) { 10721 setTask = function setImmediate(fn) { 10722 var args = []; 10723 var i = 1; 10724 while (arguments.length > i) { 10725 args.push(arguments[i++]); 10726 }queue[++counter] = function () { 10727 invoke(typeof fn == 'function' ? fn : Function(fn), args); 10728 }; 10729 defer(counter); 10730 return counter; 10731 }; 10732 clearTask = function clearImmediate(id) { 10733 delete queue[id]; 10734 }; 10735 if (__w_pdfjs_require__(18)(process) == 'process') { 10736 defer = function defer(id) { 10737 process.nextTick(ctx(run, id, 1)); 10738 }; 10739 } else if (Dispatch && Dispatch.now) { 10740 defer = function defer(id) { 10741 Dispatch.now(ctx(run, id, 1)); 10742 }; 10743 } else if (MessageChannel) { 10744 channel = new MessageChannel(); 10745 port = channel.port2; 10746 channel.port1.onmessage = listener; 10747 defer = ctx(port.postMessage, port, 1); 10748 } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { 10749 defer = function defer(id) { 10750 global.postMessage(id + '', '*'); 10751 }; 10752 global.addEventListener('message', listener, false); 10753 } else if (ONREADYSTATECHANGE in cel('script')) { 10754 defer = function defer(id) { 10755 html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { 10756 html.removeChild(this); 10757 run.call(id); 10758 }; 10759 }; 10760 } else { 10761 defer = function defer(id) { 10762 setTimeout(ctx(run, id, 1), 0); 10763 }; 10764 } 10765} 10766module.exports = { 10767 set: setTask, 10768 clear: clearTask 10769}; 10770 10771/***/ }), 10772/* 58 */ 10773/***/ (function(module, exports, __w_pdfjs_require__) { 10774 10775"use strict"; 10776 10777 10778module.exports = function (exec) { 10779 try { 10780 return { 10781 e: false, 10782 v: exec() 10783 }; 10784 } catch (e) { 10785 return { 10786 e: true, 10787 v: e 10788 }; 10789 } 10790}; 10791 10792/***/ }), 10793/* 59 */ 10794/***/ (function(module, exports, __w_pdfjs_require__) { 10795 10796"use strict"; 10797 10798 10799var anObject = __w_pdfjs_require__(8); 10800var isObject = __w_pdfjs_require__(3); 10801var newPromiseCapability = __w_pdfjs_require__(38); 10802module.exports = function (C, x) { 10803 anObject(C);
10804 if (isObject(x) && x.constructor === C) return x; 10805 var promiseCapability = newPromiseCapability.f(C); 10806 var resolve = promiseCapability.resolve; 10807 resolve(x); 10808 return promiseCapability.promise; 10809}; 10810 10811/***/ }), 10812/* 60 */ 10813/***/ (function(module, exports, __w_pdfjs_require__) { 10814 10815"use strict"; 10816 10817 10818var ITERATOR = __w_pdfjs_require__(4)('iterator'); 10819var SAFE_CLOSING = false; 10820try { 10821 var riter = [7][ITERATOR](); 10822 riter['return'] = function () { 10823 SAFE_CLOSING = true; 10824 }; 10825 Array.from(riter, function () { 10826 throw 2; 10827 }); 10828} catch (e) {} 10829module.exports = function (exec, skipClosing) { 10830 if (!skipClosing && !SAFE_CLOSING) return false; 10831 var safe = false; 10832 try { 10833 var arr = [7]; 10834 var iter = arr[ITERATOR](); 10835 iter.next = function () { 10836 return { done: safe = true }; 10837 }; 10838 arr[ITERATOR] = function () { 10839 return iter; 10840 }; 10841 exec(arr); 10842 } catch (e) {} 10843 return safe; 10844}; 10845 10846/***/ }), 10847/* 61 */ 10848/***/ (function(module, exports, __w_pdfjs_require__) { 10849 10850"use strict"; 10851 10852 10853var ctx = __w_pdfjs_require__(11); 10854var IObject = __w_pdfjs_require__(29); 10855var toObject = __w_pdfjs_require__(36); 10856var toLength = __w_pdfjs_require__(31); 10857var asc = __w_pdfjs_require__(110); 10858module.exports = function (TYPE, $create) { 10859 var IS_MAP = TYPE == 1; 10860 var IS_FILTER = TYPE == 2; 10861 var IS_SOME = TYPE == 3; 10862 var IS_EVERY = TYPE == 4; 10863 var IS_FIND_INDEX = TYPE == 6; 10864 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; 10865 var create = $create || asc; 10866 return function ($this, callbackfn, that) { 10867 var O = toObject($this); 10868 var self = IObject(O); 10869 var f = ctx(callbackfn, that, 3); 10870 var length = toLength(self.length); 10871 var index = 0; 10872 var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; 10873 var val, res; 10874 for (; length > index; index++) { 10875 if (NO_HOLES || index in self) { 10876 val = self[index]; 10877 res = f(val, index, O); 10878 if (TYPE) { 10879 if (IS_MAP) result[index] = res;else if (res) switch (TYPE) { 10880 case 3: 10881 return true; 10882 case 5: 10883 return val; 10884 case 6: 10885 return index; 10886 case 2: 10887 result.push(val); 10888 } else if (IS_EVERY) return false; 10889 } 10890 } 10891 }return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; 10892 }; 10893}; 10894 10895/***/ }), 10896/* 62 */ 10897/***/ (function(module, exports, __w_pdfjs_require__) { 10898 10899"use strict"; 10900 10901 10902var isObject = __w_pdfjs_require__(3); 10903module.exports = function (it, TYPE) { 10904 if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); 10905 return it; 10906}; 10907 10908/***/ }), 10909/* 63 */ 10910/***/ (function(module, exports, __w_pdfjs_require__) { 10911 10912"use strict"; 10913 10914 10915Object.defineProperty(exports, "__esModule", { 10916 value: true 10917}); 10918exports.ChunkedStreamManager = exports.ChunkedStream = undefined; 10919 10920var _util = __w_pdfjs_require__(0); 10921 10922var ChunkedStream = function ChunkedStreamClosure() { 10923 function ChunkedStream(length, chunkSize, manager) { 10924 this.bytes = new Uint8Array(length); 10925 this.start = 0; 10926 this.pos = 0; 10927 this.end = length; 10928 this.chunkSize = chunkSize; 10929 this.loadedChunks = []; 10930 this.numChunksLoaded = 0; 10931 this.numChunks = Math.ceil(length / chunkSize); 10932 this.manager = manager; 10933 this.progressiveDataLength = 0; 10934 this.lastSuccessfulEnsureByteChunk = -1; 10935 } 10936 ChunkedStream.prototype = { 10937 getMissingChunks: function ChunkedStream_getMissingChunks() { 10938 var chunks = []; 10939 for (var chunk = 0, n = this.numChunks; chunk < n; ++chunk) { 10940 if (!this.loadedChunks[chunk]) { 10941 chunks.push(chunk); 10942 } 10943 } 10944 return chunks; 10945 }, 10946 getBaseStreams: function ChunkedStream_getBaseStreams() { 10947 return [this]; 10948 }, 10949 allChunksLoaded: function ChunkedStream_allChunksLoaded() { 10950 return this.numChunksLoaded === this.numChunks; 10951 }, 10952 onReceiveData: function ChunkedStream_onReceiveData(begin, chunk) { 10953 var end = begin + chunk.byteLength; 10954 if (begin % this.chunkSize !== 0) { 10955 throw new Error('Bad begin offset: ' + begin); 10956 } 10957 var length = this.bytes.length; 10958 if (end % this.chunkSize !== 0 && end !== length) { 10959 throw new Error('Bad end offset: ' + end); 10960 } 10961 this.bytes.set(new Uint8Array(chunk), begin); 10962 var chunkSize = this.chunkSize; 10963 var beginChunk = Math.floor(begin / chunkSize); 10964 var endChunk = Math.floor((end - 1) / chunkSize) + 1; 10965 var curChunk; 10966 for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { 10967 if (!this.loadedChunks[curChunk]) { 10968 this.loadedChunks[curChunk] = true; 10969 ++this.numChunksLoaded; 10970 } 10971 } 10972 }, 10973 onReceiveProgressiveData: function ChunkedStream_onReceiveProgressiveData(data) { 10974 var position = this.progressiveDataLength; 10975 var beginChunk = Math.floor(position / this.chunkSize); 10976 this.bytes.set(new Uint8Array(data), position); 10977 position += data.byteLength; 10978 this.progressiveDataLength = position; 10979 var endChunk = position >= this.end ? this.numChunks : Math.floor(position / this.chunkSize); 10980 var curChunk; 10981 for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { 10982 if (!this.loadedChunks[curChunk]) { 10983 this.loadedChunks[curChunk] = true; 10984 ++this.numChunksLoaded; 10985 } 10986 } 10987 }, 10988 ensureByte: function ChunkedStream_ensureByte(pos) { 10989 var chunk = Math.floor(pos / this.chunkSize); 10990 if (chunk === this.lastSuccessfulEnsureByteChunk) { 10991 return; 10992 } 10993 if (!this.loadedChunks[chunk]) { 10994 throw new _util.MissingDataException(pos, pos + 1); 10995 } 10996 this.lastSuccessfulEnsureByteChunk = chunk; 10997 }, 10998 ensureRange: function ChunkedStream_ensureRange(begin, end) { 10999 if (begin >= end) { 11000 return; 11001 } 11002 if (end <= this.progressiveDataLength) { 11003 return; 11004 } 11005 var chunkSize = this.chunkSize; 11006 var beginChunk = Math.floor(begin / chunkSize); 11007 var endChunk = Math.floor((end - 1) / chunkSize) + 1; 11008 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 11009 if (!this.loadedChunks[chunk]) { 11010 throw new _util.MissingDataException(begin, end); 11011 } 11012 } 11013 }, 11014 nextEmptyChunk: function ChunkedStream_nextEmptyChunk(beginChunk) { 11015 var chunk, 11016 numChunks = this.numChunks; 11017 for (var i = 0; i < numChunks; ++i) { 11018 chunk = (beginChunk + i) % numChunks; 11019 if (!this.loadedChunks[chunk]) { 11020 return chunk; 11021 } 11022 } 11023 return null; 11024 }, 11025 hasChunk: function ChunkedStream_hasChunk(chunk) { 11026 return !!this.loadedChunks[chunk]; 11027 }, 11028 get length() {
vendor: 3,825 bytes, lines 11029-11143
11029 return this.end - this.start; 11030 }, 11031 get isEmpty() { 11032 return this.length === 0; 11033 }, 11034 getByte: function ChunkedStream_getByte() { 11035 var pos = this.pos; 11036 if (pos >= this.end) { 11037 return -1; 11038 } 11039 this.ensureByte(pos); 11040 return this.bytes[this.pos++]; 11041 }, 11042 getUint16: function ChunkedStream_getUint16() { 11043 var b0 = this.getByte(); 11044 var b1 = this.getByte(); 11045 if (b0 === -1 || b1 === -1) { 11046 return -1; 11047 } 11048 return (b0 << 8) + b1; 11049 }, 11050 getInt32: function ChunkedStream_getInt32() { 11051 var b0 = this.getByte(); 11052 var b1 = this.getByte(); 11053 var b2 = this.getByte(); 11054 var b3 = this.getByte(); 11055 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 11056 }, 11057 getBytes: function ChunkedStream_getBytes(length) { 11058 var bytes = this.bytes; 11059 var pos = this.pos; 11060 var strEnd = this.end; 11061 if (!length) { 11062 this.ensureRange(pos, strEnd); 11063 return bytes.subarray(pos, strEnd); 11064 } 11065 var end = pos + length; 11066 if (end > strEnd) { 11067 end = strEnd; 11068 } 11069 this.ensureRange(pos, end); 11070 this.pos = end; 11071 return bytes.subarray(pos, end); 11072 }, 11073 peekByte: function ChunkedStream_peekByte() { 11074 var peekedByte = this.getByte(); 11075 this.pos--; 11076 return peekedByte; 11077 }, 11078 peekBytes: function ChunkedStream_peekBytes(length) { 11079 var bytes = this.getBytes(length); 11080 this.pos -= bytes.length; 11081 return bytes; 11082 }, 11083 getByteRange: function ChunkedStream_getBytes(begin, end) { 11084 this.ensureRange(begin, end); 11085 return this.bytes.subarray(begin, end); 11086 }, 11087 skip: function ChunkedStream_skip(n) { 11088 if (!n) { 11089 n = 1; 11090 } 11091 this.pos += n; 11092 }, 11093 reset: function ChunkedStream_reset() { 11094 this.pos = this.start; 11095 }, 11096 moveStart: function ChunkedStream_moveStart() { 11097 this.start = this.pos; 11098 }, 11099 makeSubStream: function ChunkedStream_makeSubStream(start, length, dict) { 11100 this.ensureRange(start, start + length); 11101 function ChunkedStreamSubstream() {} 11102 ChunkedStreamSubstream.prototype = Object.create(this); 11103 ChunkedStreamSubstream.prototype.getMissingChunks = function () { 11104 var chunkSize = this.chunkSize; 11105 var beginChunk = Math.floor(this.start / chunkSize); 11106 var endChunk = Math.floor((this.end - 1) / chunkSize) + 1; 11107 var missingChunks = []; 11108 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 11109 if (!this.loadedChunks[chunk]) { 11110 missingChunks.push(chunk); 11111 } 11112 } 11113 return missingChunks; 11114 }; 11115 var subStream = new ChunkedStreamSubstream(); 11116 subStream.pos = subStream.start = start; 11117 subStream.end = start + length || this.end; 11118 subStream.dict = dict; 11119 return subStream; 11120 } 11121 }; 11122 return ChunkedStream; 11123}(); 11124var ChunkedStreamManager = function ChunkedStreamManagerClosure() { 11125 function ChunkedStreamManager(pdfNetworkStream, args) { 11126 var chunkSize = args.rangeChunkSize; 11127 var length = args.length; 11128 this.stream = new ChunkedStream(length, chunkSize, this); 11129 this.length = length; 11130 this.chunkSize = chunkSize; 11131 this.pdfNetworkStream = pdfNetworkStream; 11132 this.url = args.url; 11133 this.disableAutoFetch = args.disableAutoFetch; 11134 this.msgHandler = args.msgHandler; 11135 this.currRequestId = 0; 11136 this.chunksNeededByRequest = Object.create(null); 11137 this.requestsByChunk = Object.create(null); 11138 this.promisesByRequest = Object.create(null); 11139 this.progressiveDataLength = 0; 11140 this.aborted = false; 11141 this._loadedStreamCapability = (0, _util.createPromiseCapability)(); 11142 } 11143 ChunkedStreamManager.prototype = {
11144 onLoadedStream: function ChunkedStreamManager_getLoadedStream() { 11145 return this._loadedStreamCapability.promise; 11146 }, 11147 sendRequest: function ChunkedStreamManager_sendRequest(begin, end) { 11148 var _this = this; 11149 11150 var rangeReader = this.pdfNetworkStream.getRangeReader(begin, end); 11151 if (!rangeReader.isStreamingSupported) { 11152 rangeReader.onProgress = this.onProgress.bind(this); 11153 } 11154 var chunks = [], 11155 loaded = 0; 11156 var manager = this; 11157 var promise = new Promise(function (resolve, reject) { 11158 var readChunk = function readChunk(chunk) { 11159 try { 11160 if (!chunk.done) { 11161 var data = chunk.value; 11162 chunks.push(data); 11163 loaded += (0, _util.arrayByteLength)(data); 11164 if (rangeReader.isStreamingSupported) { 11165 manager.onProgress({ loaded: loaded }); 11166 } 11167 rangeReader.read().then(readChunk, reject); 11168 return; 11169 } 11170 var chunkData = (0, _util.arraysToBytes)(chunks); 11171 chunks = null; 11172 resolve(chunkData); 11173 } catch (e) { 11174 reject(e); 11175 } 11176 }; 11177 rangeReader.read().then(readChunk, reject); 11178 }); 11179 promise.then(function (data) { 11180 if (_this.aborted) { 11181 return; 11182 } 11183 _this.onReceiveData({ 11184 chunk: data, 11185 begin: begin 11186 }); 11187 }); 11188 }, 11189 requestAllChunks: function ChunkedStreamManager_requestAllChunks() { 11190 var missingChunks = this.stream.getMissingChunks(); 11191 this._requestChunks(missingChunks); 11192 return this._loadedStreamCapability.promise; 11193 }, 11194 _requestChunks: function ChunkedStreamManager_requestChunks(chunks) { 11195 var requestId = this.currRequestId++; 11196 var i, ii; 11197 var chunksNeeded = Object.create(null); 11198 this.chunksNeededByRequest[requestId] = chunksNeeded; 11199 for (i = 0, ii = chunks.length; i < ii; i++) { 11200 if (!this.stream.hasChunk(chunks[i])) { 11201 chunksNeeded[chunks[i]] = true; 11202 } 11203 } 11204 if ((0, _util.isEmptyObj)(chunksNeeded)) { 11205 return Promise.resolve(); 11206 } 11207 var capability = (0, _util.createPromiseCapability)(); 11208 this.promisesByRequest[requestId] = capability; 11209 var chunksToRequest = []; 11210 for (var chunk in chunksNeeded) { 11211 chunk = chunk | 0; 11212 if (!(chunk in this.requestsByChunk)) { 11213 this.requestsByChunk[chunk] = []; 11214 chunksToRequest.push(chunk); 11215 } 11216 this.requestsByChunk[chunk].push(requestId); 11217 } 11218 if (!chunksToRequest.length) { 11219 return capability.promise; 11220 } 11221 var groupedChunksToRequest = this.groupChunks(chunksToRequest); 11222 for (i = 0; i < groupedChunksToRequest.length; ++i) { 11223 var groupedChunk = groupedChunksToRequest[i]; 11224 var begin = groupedChunk.beginChunk * this.chunkSize; 11225 var end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); 11226 this.sendRequest(begin, end); 11227 } 11228 return capability.promise; 11229 }, 11230 getStream: function ChunkedStreamManager_getStream() { 11231 return this.stream; 11232 }, 11233 requestRange: function ChunkedStreamManager_requestRange(begin, end) { 11234 end = Math.min(end, this.length); 11235 var beginChunk = this.getBeginChunk(begin); 11236 var endChunk = this.getEndChunk(end); 11237 var chunks = []; 11238 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 11239 chunks.push(chunk); 11240 } 11241 return this._requestChunks(chunks); 11242 }, 11243 requestRanges: function ChunkedStreamManager_requestRanges(ranges) { 11244 ranges = ranges || []; 11245 var chunksToRequest = []; 11246 for (var i = 0; i < ranges.length; i++) { 11247 var beginChunk = this.getBeginChunk(ranges[i].begin); 11248 var endChunk = this.getEndChunk(ranges[i].end); 11249 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 11250 if (chunksToRequest.indexOf(chunk) < 0) { 11251 chunksToRequest.push(chunk);
vendor: 3,013 bytes, lines 11252-11334
11252 } 11253 } 11254 } 11255 chunksToRequest.sort(function (a, b) { 11256 return a - b; 11257 }); 11258 return this._requestChunks(chunksToRequest); 11259 }, 11260 groupChunks: function ChunkedStreamManager_groupChunks(chunks) { 11261 var groupedChunks = []; 11262 var beginChunk = -1; 11263 var prevChunk = -1; 11264 for (var i = 0; i < chunks.length; ++i) { 11265 var chunk = chunks[i]; 11266 if (beginChunk < 0) { 11267 beginChunk = chunk; 11268 } 11269 if (prevChunk >= 0 && prevChunk + 1 !== chunk) { 11270 groupedChunks.push({ 11271 beginChunk: beginChunk, 11272 endChunk: prevChunk + 1 11273 }); 11274 beginChunk = chunk; 11275 } 11276 if (i + 1 === chunks.length) { 11277 groupedChunks.push({ 11278 beginChunk: beginChunk, 11279 endChunk: chunk + 1 11280 }); 11281 } 11282 prevChunk = chunk; 11283 } 11284 return groupedChunks; 11285 }, 11286 onProgress: function ChunkedStreamManager_onProgress(args) { 11287 var bytesLoaded = this.stream.numChunksLoaded * this.chunkSize + args.loaded; 11288 this.msgHandler.send('DocProgress', { 11289 loaded: bytesLoaded, 11290 total: this.length 11291 }); 11292 }, 11293 onReceiveData: function ChunkedStreamManager_onReceiveData(args) { 11294 var chunk = args.chunk; 11295 var isProgressive = args.begin === undefined; 11296 var begin = isProgressive ? this.progressiveDataLength : args.begin; 11297 var end = begin + chunk.byteLength; 11298 var beginChunk = Math.floor(begin / this.chunkSize); 11299 var endChunk = end < this.length ? Math.floor(end / this.chunkSize) : Math.ceil(end / this.chunkSize); 11300 if (isProgressive) { 11301 this.stream.onReceiveProgressiveData(chunk); 11302 this.progressiveDataLength = end; 11303 } else { 11304 this.stream.onReceiveData(begin, chunk); 11305 } 11306 if (this.stream.allChunksLoaded()) { 11307 this._loadedStreamCapability.resolve(this.stream); 11308 } 11309 var loadedRequests = []; 11310 var i, requestId; 11311 for (chunk = beginChunk; chunk < endChunk; ++chunk) { 11312 var requestIds = this.requestsByChunk[chunk] || []; 11313 delete this.requestsByChunk[chunk]; 11314 for (i = 0; i < requestIds.length; ++i) { 11315 requestId = requestIds[i]; 11316 var chunksNeeded = this.chunksNeededByRequest[requestId]; 11317 if (chunk in chunksNeeded) { 11318 delete chunksNeeded[chunk]; 11319 } 11320 if (!(0, _util.isEmptyObj)(chunksNeeded)) { 11321 continue; 11322 } 11323 loadedRequests.push(requestId); 11324 } 11325 } 11326 if (!this.disableAutoFetch && (0, _util.isEmptyObj)(this.requestsByChunk)) { 11327 var nextEmptyChunk; 11328 if (this.stream.numChunksLoaded === 1) { 11329 var lastChunk = this.stream.numChunks - 1; 11330 if (!this.stream.hasChunk(lastChunk)) { 11331 nextEmptyChunk = lastChunk; 11332 } 11333 } else { 11334 nextEmptyChunk = this.stream.nextEmptyChunk(endChunk);
11335 } 11336 if (Number.isInteger(nextEmptyChunk)) { 11337 this._requestChunks([nextEmptyChunk]); 11338 } 11339 } 11340 for (i = 0; i < loadedRequests.length; ++i) { 11341 requestId = loadedRequests[i]; 11342 var capability = this.promisesByRequest[requestId]; 11343 delete this.promisesByRequest[requestId]; 11344 capability.resolve(); 11345 } 11346 this.msgHandler.send('DocProgress', { 11347 loaded: this.stream.numChunksLoaded * this.chunkSize, 11348 total: this.length 11349 }); 11350 }, 11351 onError: function ChunkedStreamManager_onError(err) { 11352 this._loadedStreamCapability.reject(err); 11353 }, 11354 getBeginChunk: function ChunkedStreamManager_getBeginChunk(begin) { 11355 var chunk = Math.floor(begin / this.chunkSize); 11356 return chunk; 11357 }, 11358 getEndChunk: function ChunkedStreamManager_getEndChunk(end) { 11359 var chunk = Math.floor((end - 1) / this.chunkSize) + 1; 11360 return chunk; 11361 }, 11362 abort: function ChunkedStreamManager_abort() { 11363 this.aborted = true; 11364 if (this.pdfNetworkStream) { 11365 this.pdfNetworkStream.cancelAllRequests('abort'); 11366 } 11367 for (var requestId in this.promisesByRequest) { 11368 var capability = this.promisesByRequest[requestId]; 11369 capability.reject(new Error('Request was aborted')); 11370 } 11371 } 11372 }; 11373 return ChunkedStreamManager; 11374}(); 11375exports.ChunkedStream = ChunkedStream; 11376exports.ChunkedStreamManager = ChunkedStreamManager; 11377 11378/***/ }), 11379/* 64 */ 11380/***/ (function(module, exports, __w_pdfjs_require__) { 11381 11382"use strict"; 11383 11384 11385Object.defineProperty(exports, "__esModule", { 11386 value: true 11387}); 11388exports.FileSpec = exports.XRef = exports.ObjectLoader = exports.Catalog = undefined; 11389 11390var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 11391 11392var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 11393 11394var _util = __w_pdfjs_require__(0); 11395 11396var _primitives = __w_pdfjs_require__(1); 11397 11398var _parser = __w_pdfjs_require__(26); 11399 11400var _chunked_stream = __w_pdfjs_require__(63); 11401 11402var _crypto = __w_pdfjs_require__(67); 11403 11404var _colorspace = __w_pdfjs_require__(20); 11405 11406var Catalog = function CatalogClosure() { 11407 function Catalog(pdfManager, xref, pageFactory) { 11408 this.pdfManager = pdfManager; 11409 this.xref = xref; 11410 this.catDict = xref.getCatalogObj(); 11411 if (!(0, _primitives.isDict)(this.catDict)) { 11412 throw new _util.FormatError('catalog object is not a dictionary'); 11413 } 11414 this.fontCache = new _primitives.RefSetCache(); 11415 this.builtInCMapCache = Object.create(null); 11416 this.pageKidsCountCache = new _primitives.RefSetCache(); 11417 this.pageFactory = pageFactory; 11418 this.pagePromises = []; 11419 } 11420 Catalog.prototype = { 11421 get metadata() { 11422 var streamRef = this.catDict.getRaw('Metadata'); 11423 if (!(0, _primitives.isRef)(streamRef)) { 11424 return (0, _util.shadow)(this, 'metadata', null); 11425 } 11426 var encryptMetadata = !this.xref.encrypt ? false : this.xref.encrypt.encryptMetadata; 11427 var stream = this.xref.fetch(streamRef, !encryptMetadata); 11428 var metadata; 11429 if (stream && (0, _primitives.isDict)(stream.dict)) { 11430 var type = stream.dict.get('Type'); 11431 var subtype = stream.dict.get('Subtype'); 11432 if ((0, _primitives.isName)(type, 'Metadata') && (0, _primitives.isName)(subtype, 'XML')) { 11433 try { 11434 metadata = (0, _util.stringToUTF8String)((0, _util.bytesToString)(stream.getBytes())); 11435 } catch (e) { 11436 if (e instanceof _util.MissingDataException) { 11437 throw e; 11438 } 11439 (0, _util.info)('Skipping invalid metadata.'); 11440 } 11441 } 11442 } 11443 return (0, _util.shadow)(this, 'metadata', metadata); 11444 }, 11445 get toplevelPagesDict() { 11446 var pagesObj = this.catDict.get('Pages'); 11447 if (!(0, _primitives.isDict)(pagesObj)) { 11448 throw new _util.FormatError('invalid top-level pages dictionary'); 11449 } 11450 return (0, _util.shadow)(this, 'toplevelPagesDict', pagesObj); 11451 }, 11452 get documentOutline() { 11453 var obj = null;
11454 try { 11455 obj = this.readDocumentOutline(); 11456 } catch (ex) { 11457 if (ex instanceof _util.MissingDataException) { 11458 throw ex; 11459 } 11460 (0, _util.warn)('Unable to read document outline'); 11461 } 11462 return (0, _util.shadow)(this, 'documentOutline', obj); 11463 }, 11464 readDocumentOutline: function Catalog_readDocumentOutline() { 11465 var obj = this.catDict.get('Outlines'); 11466 if (!(0, _primitives.isDict)(obj)) { 11467 return null; 11468 } 11469 obj = obj.getRaw('First'); 11470 if (!(0, _primitives.isRef)(obj)) { 11471 return null; 11472 } 11473 var root = { items: [] }; 11474 var queue = [{ 11475 obj: obj, 11476 parent: root 11477 }]; 11478 var processed = new _primitives.RefSet(); 11479 processed.put(obj); 11480 var xref = this.xref, 11481 blackColor = new Uint8Array(3); 11482 while (queue.length > 0) { 11483 var i = queue.shift(); 11484 var outlineDict = xref.fetchIfRef(i.obj); 11485 if (outlineDict === null) { 11486 continue; 11487 } 11488 if (!outlineDict.has('Title')) { 11489 throw new _util.FormatError('Invalid outline item'); 11490 } 11491 var data = { 11492 url: null, 11493 dest: null 11494 }; 11495 Catalog.parseDestDictionary({ 11496 destDict: outlineDict, 11497 resultObj: data, 11498 docBaseUrl: this.pdfManager.docBaseUrl 11499 }); 11500 var title = outlineDict.get('Title'); 11501 var flags = outlineDict.get('F') || 0; 11502 var color = outlineDict.getArray('C'), 11503 rgbColor = blackColor; 11504 if (Array.isArray(color) && color.length === 3 && (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) { 11505 rgbColor = _colorspace.ColorSpace.singletons.rgb.getRgb(color, 0); 11506 } 11507 var outlineItem = { 11508 dest: data.dest, 11509 url: data.url, 11510 unsafeUrl: data.unsafeUrl, 11511 newWindow: data.newWindow, 11512 title: (0, _util.stringToPDFString)(title), 11513 color: rgbColor, 11514 count: outlineDict.get('Count'), 11515 bold: !!(flags & 2), 11516 italic: !!(flags & 1), 11517 items: [] 11518 }; 11519 i.parent.items.push(outlineItem); 11520 obj = outlineDict.getRaw('First'); 11521 if ((0, _primitives.isRef)(obj) && !processed.has(obj)) { 11522 queue.push({ 11523 obj: obj, 11524 parent: outlineItem 11525 }); 11526 processed.put(obj); 11527 } 11528 obj = outlineDict.getRaw('Next'); 11529 if ((0, _primitives.isRef)(obj) && !processed.has(obj)) { 11530 queue.push({ 11531 obj: obj, 11532 parent: i.parent 11533 }); 11534 processed.put(obj); 11535 } 11536 } 11537 return root.items.length > 0 ? root.items : null; 11538 }, 11539 get numPages() { 11540 var obj = this.toplevelPagesDict.get('Count'); 11541 if (!Number.isInteger(obj)) { 11542 throw new _util.FormatError('page count in top level pages object is not an integer'); 11543 } 11544 return (0, _util.shadow)(this, 'numPages', obj); 11545 }, 11546 get destinations() { 11547 function fetchDestination(dest) { 11548 return (0, _primitives.isDict)(dest) ? dest.get('D') : dest; 11549 } 11550 var xref = this.xref; 11551 var dests = {}, 11552 nameTreeRef, 11553 nameDictionaryRef; 11554 var obj = this.catDict.get('Names'); 11555 if (obj && obj.has('Dests')) { 11556 nameTreeRef = obj.getRaw('Dests'); 11557 } else if (this.catDict.has('Dests')) { 11558 nameDictionaryRef = this.catDict.get('Dests'); 11559 } 11560 if (nameDictionaryRef) { 11561 obj = nameDictionaryRef; 11562 obj.forEach(function catalogForEach(key, value) { 11563 if (!value) { 11564 return; 11565 } 11566 dests[key] = fetchDestination(value); 11567 }); 11568 } 11569 if (nameTreeRef) { 11570 var nameTree = new NameTree(nameTreeRef, xref); 11571 var names = nameTree.getAll(); 11572 for (var name in names) { 11573 dests[name] = fetchDestination(names[name]); 11574 } 11575 } 11576 return (0, _util.shadow)(this, 'destinations', dests); 11577 }, 11578 getDestination: function Catalog_getDestination(destinationId) { 11579 function fetchDestination(dest) { 11580 return (0, _primitives.isDict)(dest) ? dest.get('D') : dest; 11581 } 11582 var xref = this.xref; 11583 var dest = null, 11584 nameTreeRef, 11585 nameDictionaryRef; 11586 var obj = this.catDict.get('Names'); 11587 if (obj && obj.has('Dests')) { 11588 nameTreeRef = obj.getRaw('Dests'); 11589 } else if (this.catDict.has('Dests')) { 11590 nameDictionaryRef = this.catDict.get('Dests'); 11591 } 11592 if (nameDictionaryRef) { 11593 var value = nameDictionaryRef.get(destinationId); 11594 if (value) { 11595 dest = fetchDestination(value); 11596 } 11597 } 11598 if (nameTreeRef) {
11599 var nameTree = new NameTree(nameTreeRef, xref); 11600 dest = fetchDestination(nameTree.get(destinationId)); 11601 } 11602 return dest; 11603 }, 11604 get pageLabels() { 11605 var obj = null; 11606 try { 11607 obj = this.readPageLabels(); 11608 } catch (ex) { 11609 if (ex instanceof _util.MissingDataException) { 11610 throw ex; 11611 } 11612 (0, _util.warn)('Unable to read page labels.'); 11613 } 11614 return (0, _util.shadow)(this, 'pageLabels', obj); 11615 }, 11616 readPageLabels: function Catalog_readPageLabels() { 11617 var obj = this.catDict.getRaw('PageLabels'); 11618 if (!obj) { 11619 return null; 11620 } 11621 var pageLabels = new Array(this.numPages); 11622 var style = null; 11623 var prefix = ''; 11624 var numberTree = new NumberTree(obj, this.xref); 11625 var nums = numberTree.getAll(); 11626 var currentLabel = '', 11627 currentIndex = 1; 11628 for (var i = 0, ii = this.numPages; i < ii; i++) { 11629 if (i in nums) { 11630 var labelDict = nums[i]; 11631 if (!(0, _primitives.isDict)(labelDict)) { 11632 throw new _util.FormatError('The PageLabel is not a dictionary.'); 11633 } 11634 var type = labelDict.get('Type'); 11635 if (type && !(0, _primitives.isName)(type, 'PageLabel')) { 11636 throw new _util.FormatError('Invalid type in PageLabel dictionary.'); 11637 } 11638 var s = labelDict.get('S'); 11639 if (s && !(0, _primitives.isName)(s)) { 11640 throw new _util.FormatError('Invalid style in PageLabel dictionary.'); 11641 } 11642 style = s ? s.name : null; 11643 var p = labelDict.get('P'); 11644 if (p && !(0, _util.isString)(p)) { 11645 throw new _util.FormatError('Invalid prefix in PageLabel dictionary.'); 11646 } 11647 prefix = p ? (0, _util.stringToPDFString)(p) : ''; 11648 var st = labelDict.get('St'); 11649 if (st && !(Number.isInteger(st) && st >= 1)) { 11650 throw new _util.FormatError('Invalid start in PageLabel dictionary.'); 11651 } 11652 currentIndex = st || 1; 11653 } 11654 switch (style) { 11655 case 'D': 11656 currentLabel = currentIndex; 11657 break; 11658 case 'R': 11659 case 'r': 11660 currentLabel = _util.Util.toRoman(currentIndex, style === 'r'); 11661 break; 11662 case 'A': 11663 case 'a': 11664 var LIMIT = 26; 11665 var A_UPPER_CASE = 0x41, 11666 A_LOWER_CASE = 0x61; 11667 var baseCharCode = style === 'a' ? A_LOWER_CASE : A_UPPER_CASE; 11668 var letterIndex = currentIndex - 1; 11669 var character = String.fromCharCode(baseCharCode + letterIndex % LIMIT); 11670 var charBuf = []; 11671 for (var j = 0, jj = letterIndex / LIMIT | 0; j <= jj; j++) { 11672 charBuf.push(character); 11673 } 11674 currentLabel = charBuf.join(''); 11675 break; 11676 default: 11677 if (style) { 11678 throw new _util.FormatError('Invalid style "' + style + '" in PageLabel dictionary.'); 11679 } 11680 } 11681 pageLabels[i] = prefix + currentLabel; 11682 currentLabel = ''; 11683 currentIndex++; 11684 } 11685 return pageLabels; 11686 }, 11687 get pageMode() { 11688 var obj = this.catDict.get('PageMode'); 11689 var pageMode = 'UseNone'; 11690 if ((0, _primitives.isName)(obj)) { 11691 switch (obj.name) { 11692 case 'UseNone': 11693 case 'UseOutlines': 11694 case 'UseThumbs': 11695 case 'FullScreen': 11696 case 'UseOC': 11697 case 'UseAttachments': 11698 pageMode = obj.name; 11699 } 11700 } 11701 return (0, _util.shadow)(this, 'pageMode', pageMode); 11702 }, 11703 get attachments() { 11704 var xref = this.xref; 11705 var attachments = null, 11706 nameTreeRef; 11707 var obj = this.catDict.get('Names'); 11708 if (obj) { 11709 nameTreeRef = obj.getRaw('EmbeddedFiles'); 11710 } 11711 if (nameTreeRef) { 11712 var nameTree = new NameTree(nameTreeRef, xref); 11713 var names = nameTree.getAll(); 11714 for (var name in names) { 11715 var fs = new FileSpec(names[name], xref); 11716 if (!attachments) { 11717 attachments = Object.create(null); 11718 } 11719 attachments[(0, _util.stringToPDFString)(name)] = fs.serializable; 11720 } 11721 } 11722 return (0, _util.shadow)(this, 'attachments', attachments); 11723 }, 11724 get javaScript() { 11725 var xref = this.xref; 11726 var obj = this.catDict.get('Names'); 11727 var javaScript = null; 11728 function appendIfJavaScriptDict(jsDict) { 11729 var type = jsDict.get('S'); 11730 if (!(0, _primitives.isName)(type, 'JavaScript')) { 11731 return; 11732 } 11733 var js = jsDict.get('JS'); 11734 if ((0, _primitives.isStream)(js)) { 11735 js = (0, _util.bytesToString)(js.getBytes()); 11736 } else if (!(0, _util.isString)(js)) { 11737 return; 11738 } 11739 if (!javaScript) { 11740 javaScript = []; 11741 } 11742 javaScript.push((0, _util.stringToPDFString)(js)); 11743 } 11744 if (obj && obj.has('JavaScript')) {
11745 var nameTree = new NameTree(obj.getRaw('JavaScript'), xref); 11746 var names = nameTree.getAll(); 11747 for (var name in names) { 11748 var jsDict = names[name]; 11749 if ((0, _primitives.isDict)(jsDict)) { 11750 appendIfJavaScriptDict(jsDict); 11751 } 11752 } 11753 } 11754 var openactionDict = this.catDict.get('OpenAction'); 11755 if ((0, _primitives.isDict)(openactionDict, 'Action')) { 11756 var actionType = openactionDict.get('S'); 11757 if ((0, _primitives.isName)(actionType, 'Named')) { 11758 var action = openactionDict.get('N'); 11759 if ((0, _primitives.isName)(action, 'Print')) { 11760 if (!javaScript) { 11761 javaScript = []; 11762 } 11763 javaScript.push('print({});'); 11764 } 11765 } else { 11766 appendIfJavaScriptDict(openactionDict); 11767 } 11768 } 11769 return (0, _util.shadow)(this, 'javaScript', javaScript); 11770 }, 11771 cleanup: function Catalog_cleanup() { 11772 var _this = this; 11773 11774 this.pageKidsCountCache.clear(); 11775 var promises = []; 11776 this.fontCache.forEach(function (promise) { 11777 promises.push(promise); 11778 }); 11779 return Promise.all(promises).then(function (translatedFonts) { 11780 for (var i = 0, ii = translatedFonts.length; i < ii; i++) { 11781 var font = translatedFonts[i].dict; 11782 delete font.translated; 11783 } 11784 _this.fontCache.clear(); 11785 _this.builtInCMapCache = Object.create(null); 11786 }); 11787 }, 11788 getPage: function Catalog_getPage(pageIndex) { 11789 var _this2 = this; 11790 11791 if (!(pageIndex in this.pagePromises)) { 11792 this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then(function (_ref) { 11793 var _ref2 = _slicedToArray(_ref, 2), 11794 dict = _ref2[0], 11795 ref = _ref2[1]; 11796 11797 return _this2.pageFactory.createPage(pageIndex, dict, ref, _this2.fontCache, _this2.builtInCMapCache); 11798 }); 11799 } 11800 return this.pagePromises[pageIndex]; 11801 }, 11802 getPageDict: function Catalog_getPageDict(pageIndex) { 11803 var capability = (0, _util.createPromiseCapability)(); 11804 var nodesToVisit = [this.catDict.getRaw('Pages')]; 11805 var count, 11806 currentPageIndex = 0; 11807 var xref = this.xref, 11808 pageKidsCountCache = this.pageKidsCountCache; 11809 function next() { 11810 while (nodesToVisit.length) { 11811 var currentNode = nodesToVisit.pop(); 11812 if ((0, _primitives.isRef)(currentNode)) { 11813 count = pageKidsCountCache.get(currentNode); 11814 if (count > 0 && currentPageIndex + count < pageIndex) { 11815 currentPageIndex += count; 11816 continue; 11817 } 11818 xref.fetchAsync(currentNode).then(function (obj) { 11819 if ((0, _primitives.isDict)(obj, 'Page') || (0, _primitives.isDict)(obj) && !obj.has('Kids')) { 11820 if (pageIndex === currentPageIndex) { 11821 if (currentNode && !pageKidsCountCache.has(currentNode)) { 11822 pageKidsCountCache.put(currentNode, 1); 11823 } 11824 capability.resolve([obj, currentNode]); 11825 } else { 11826 currentPageIndex++; 11827 next(); 11828 } 11829 return; 11830 } 11831 nodesToVisit.push(obj); 11832 next(); 11833 }, capability.reject); 11834 return; 11835 } 11836 if (!(0, _primitives.isDict)(currentNode)) { 11837 capability.reject(new _util.FormatError('page dictionary kid reference points to wrong type of object')); 11838 return; 11839 } 11840 count = currentNode.get('Count'); 11841 var objId = currentNode.objId; 11842 if (objId && !pageKidsCountCache.has(objId)) { 11843 pageKidsCountCache.put(objId, count); 11844 } 11845 if (currentPageIndex + count <= pageIndex) { 11846 currentPageIndex += count; 11847 continue; 11848 } 11849 var kids = currentNode.get('Kids'); 11850 if (!Array.isArray(kids)) { 11851 capability.reject(new _util.FormatError('page dictionary kids object is not an array')); 11852 return; 11853 } 11854 for (var last = kids.length - 1; last >= 0; last--) { 11855 nodesToVisit.push(kids[last]); 11856 } 11857 } 11858 capability.reject(new Error('Page index ' + pageIndex + ' not found.'));
11859 } 11860 next(); 11861 return capability.promise; 11862 }, 11863 getPageIndex: function Catalog_getPageIndex(pageRef) { 11864 var xref = this.xref; 11865 function pagesBeforeRef(kidRef) { 11866 var total = 0; 11867 var parentRef; 11868 return xref.fetchAsync(kidRef).then(function (node) { 11869 if ((0, _primitives.isRefsEqual)(kidRef, pageRef) && !(0, _primitives.isDict)(node, 'Page') && !((0, _primitives.isDict)(node) && !node.has('Type') && node.has('Contents'))) { 11870 throw new _util.FormatError('The reference does not point to a /Page Dict.'); 11871 } 11872 if (!node) { 11873 return null; 11874 } 11875 if (!(0, _primitives.isDict)(node)) { 11876 throw new _util.FormatError('node must be a Dict.'); 11877 } 11878 parentRef = node.getRaw('Parent'); 11879 return node.getAsync('Parent'); 11880 }).then(function (parent) { 11881 if (!parent) { 11882 return null; 11883 } 11884 if (!(0, _primitives.isDict)(parent)) { 11885 throw new _util.FormatError('parent must be a Dict.'); 11886 } 11887 return parent.getAsync('Kids'); 11888 }).then(function (kids) { 11889 if (!kids) { 11890 return null; 11891 } 11892 var kidPromises = []; 11893 var found = false; 11894 for (var i = 0; i < kids.length; i++) { 11895 var kid = kids[i]; 11896 if (!(0, _primitives.isRef)(kid)) { 11897 throw new _util.FormatError('kid must be a Ref.'); 11898 } 11899 if (kid.num === kidRef.num) { 11900 found = true; 11901 break; 11902 } 11903 kidPromises.push(xref.fetchAsync(kid).then(function (kid) { 11904 if (kid.has('Count')) { 11905 var count = kid.get('Count'); 11906 total += count; 11907 } else { 11908 total++; 11909 } 11910 })); 11911 } 11912 if (!found) { 11913 throw new _util.FormatError('kid ref not found in parents kids'); 11914 } 11915 return Promise.all(kidPromises).then(function () { 11916 return [total, parentRef]; 11917 }); 11918 }); 11919 } 11920 var total = 0; 11921 function next(ref) { 11922 return pagesBeforeRef(ref).then(function (args) { 11923 if (!args) { 11924 return total; 11925 } 11926 var count = args[0]; 11927 var parentRef = args[1]; 11928 total += count; 11929 return next(parentRef); 11930 }); 11931 } 11932 return next(pageRef); 11933 } 11934 }; 11935 Catalog.parseDestDictionary = function Catalog_parseDestDictionary(params) { 11936 function addDefaultProtocolToUrl(url) { 11937 if (url.indexOf('www.') === 0) { 11938 return 'http://' + url; 11939 } 11940 return url; 11941 } 11942 function tryConvertUrlEncoding(url) { 11943 try { 11944 return (0, _util.stringToUTF8String)(url); 11945 } catch (e) { 11946 return url; 11947 } 11948 } 11949 var destDict = params.destDict; 11950 if (!(0, _primitives.isDict)(destDict)) { 11951 (0, _util.warn)('parseDestDictionary: "destDict" must be a dictionary.'); 11952 return; 11953 } 11954 var resultObj = params.resultObj; 11955 if ((typeof resultObj === 'undefined' ? 'undefined' : _typeof(resultObj)) !== 'object') { 11956 (0, _util.warn)('parseDestDictionary: "resultObj" must be an object.'); 11957 return; 11958 } 11959 var docBaseUrl = params.docBaseUrl || null; 11960 var action = destDict.get('A'), 11961 url, 11962 dest; 11963 if (!(0, _primitives.isDict)(action) && destDict.has('Dest')) { 11964 action = destDict.get('Dest'); 11965 } 11966 if ((0, _primitives.isDict)(action)) { 11967 var actionType = action.get('S'); 11968 if (!(0, _primitives.isName)(actionType)) { 11969 (0, _util.warn)('parseDestDictionary: Invalid type in Action dictionary.'); 11970 return; 11971 } 11972 var actionName = actionType.name; 11973 switch (actionName) { 11974 case 'URI': 11975 url = action.get('URI'); 11976 if ((0, _primitives.isName)(url)) { 11977 url = '/' + url.name; 11978 } else if ((0, _util.isString)(url)) { 11979 url = addDefaultProtocolToUrl(url); 11980 } 11981 break; 11982 case 'GoTo': 11983 dest = action.get('D'); 11984 break; 11985 case 'Launch': 11986 case 'GoToR': 11987 var urlDict = action.get('F'); 11988 if ((0, _primitives.isDict)(urlDict)) { 11989 url = urlDict.get('F') || null; 11990 } else if ((0, _util.isString)(urlDict)) { 11991 url = urlDict; 11992 } 11993 var remoteDest = action.get('D'); 11994 if (remoteDest) { 11995 if ((0, _primitives.isName)(remoteDest)) { 11996 remoteDest = remoteDest.name; 11997 } 11998 if ((0, _util.isString)(url)) { 11999 var baseUrl = url.split('#')[0]; 12000 if ((0, _util.isString)(remoteDest)) { 12001 url = baseUrl + '#' + remoteDest; 12002 } else if (Array.isArray(remoteDest)) { 12003 url = baseUrl + '#' + JSON.stringify(remoteDest); 12004 } 12005 } 12006 } 12007 var newWindow = action.get('NewWindow'); 12008 if ((0, _util.isBool)(newWindow)) { 12009 resultObj.newWindow = newWindow; 12010 } 12011 break; 12012 case 'Named': 12013 var namedAction = action.get('N'); 12014 if ((0, _primitives.isName)(namedAction)) { 12015 resultObj.action = namedAction.name; 12016 } 12017 break; 12018 case 'JavaScript': 12019 var jsAction = action.get('JS'), 12020 js; 12021 if ((0, _primitives.isStream)(jsAction)) { 12022 js = (0, _util.bytesToString)(jsAction.getBytes()); 12023 } else if ((0, _util.isString)(jsAction)) { 12024 js = jsAction; 12025 } 12026 if (js) { 12027 var URL_OPEN_METHODS = ['app.launchURL', 'window.open']; 12028 var regex = new RegExp('^\\s*(' + URL_OPEN_METHODS.join('|').split('.').join('\\.') + ')\\((?:\'|\")([^\'\"]*)(?:\'|\")(?:,\\s*(\\w+)\\)|\\))', 'i'); 12029 var jsUrl = regex.exec((0, _util.stringToPDFString)(js)); 12030 if (jsUrl && jsUrl[2]) { 12031 url = jsUrl[2]; 12032 if (jsUrl[3] === 'true' && jsUrl[1] === 'app.launchURL') { 12033 resultObj.newWindow = true; 12034 } 12035 break; 12036 } 12037 } 12038 default: 12039 (0, _util.warn)('parseDestDictionary: Unsupported Action type "' + actionName + '".'); 12040 break; 12041 } 12042 } else if (destDict.has('Dest')) { 12043 dest = destDict.get('Dest'); 12044 } 12045 if ((0, _util.isString)(url)) { 12046 url = tryConvertUrlEncoding(url); 12047 var absoluteUrl = (0, _util.createValidAbsoluteUrl)(url, docBaseUrl); 12048 if (absoluteUrl) { 12049 resultObj.url = absoluteUrl.href; 12050 } 12051 resultObj.unsafeUrl = url; 12052 } 12053 if (dest) { 12054 if ((0, _primitives.isName)(dest)) { 12055 dest = dest.name; 12056 } 12057 if ((0, _util.isString)(dest) || Array.isArray(dest)) { 12058 resultObj.dest = dest; 12059 } 12060 } 12061 }; 12062 return Catalog; 12063}();
12064var XRef = function XRefClosure() { 12065 function XRef(stream, pdfManager) { 12066 this.stream = stream; 12067 this.pdfManager = pdfManager; 12068 this.entries = []; 12069 this.xrefstms = Object.create(null); 12070 this.cache = []; 12071 this.stats = { 12072 streamTypes: [], 12073 fontTypes: [] 12074 }; 12075 } 12076 XRef.prototype = { 12077 setStartXRef: function XRef_setStartXRef(startXRef) { 12078 this.startXRefQueue = [startXRef]; 12079 }, 12080 parse: function XRef_parse(recoveryMode) { 12081 var trailerDict; 12082 if (!recoveryMode) { 12083 trailerDict = this.readXRef(); 12084 } else { 12085 (0, _util.warn)('Indexing all PDF objects'); 12086 trailerDict = this.indexObjects(); 12087 } 12088 trailerDict.assignXref(this); 12089 this.trailer = trailerDict; 12090 var encrypt = trailerDict.get('Encrypt'); 12091 if ((0, _primitives.isDict)(encrypt)) { 12092 var ids = trailerDict.get('ID'); 12093 var fileId = ids && ids.length ? ids[0] : ''; 12094 encrypt.suppressEncryption = true; 12095 this.encrypt = new _crypto.CipherTransformFactory(encrypt, fileId, this.pdfManager.password); 12096 } 12097 if (!(this.root = trailerDict.get('Root'))) { 12098 throw new _util.FormatError('Invalid root reference'); 12099 } 12100 }, 12101 processXRefTable: function XRef_processXRefTable(parser) { 12102 if (!('tableState' in this)) { 12103 this.tableState = { 12104 entryNum: 0, 12105 streamPos: parser.lexer.stream.pos, 12106 parserBuf1: parser.buf1, 12107 parserBuf2: parser.buf2 12108 }; 12109 } 12110 var obj = this.readXRefTable(parser); 12111 if (!(0, _primitives.isCmd)(obj, 'trailer')) { 12112 throw new _util.FormatError('Invalid XRef table: could not find trailer dictionary'); 12113 } 12114 var dict = parser.getObj(); 12115 if (!(0, _primitives.isDict)(dict) && dict.dict) { 12116 dict = dict.dict; 12117 } 12118 if (!(0, _primitives.isDict)(dict)) { 12119 throw new _util.FormatError('Invalid XRef table: could not parse trailer dictionary'); 12120 } 12121 delete this.tableState; 12122 return dict; 12123 }, 12124 readXRefTable: function XRef_readXRefTable(parser) { 12125 var stream = parser.lexer.stream; 12126 var tableState = this.tableState; 12127 stream.pos = tableState.streamPos; 12128 parser.buf1 = tableState.parserBuf1; 12129 parser.buf2 = tableState.parserBuf2; 12130 var obj; 12131 while (true) { 12132 if (!('firstEntryNum' in tableState) || !('entryCount' in tableState)) { 12133 if ((0, _primitives.isCmd)(obj = parser.getObj(), 'trailer')) { 12134 break; 12135 } 12136 tableState.firstEntryNum = obj; 12137 tableState.entryCount = parser.getObj(); 12138 } 12139 var first = tableState.firstEntryNum; 12140 var count = tableState.entryCount; 12141 if (!Number.isInteger(first) || !Number.isInteger(count)) { 12142 throw new _util.FormatError('Invalid XRef table: wrong types in subsection header'); 12143 } 12144 for (var i = tableState.entryNum; i < count; i++) { 12145 tableState.streamPos = stream.pos; 12146 tableState.entryNum = i; 12147 tableState.parserBuf1 = parser.buf1; 12148 tableState.parserBuf2 = parser.buf2; 12149 var entry = {}; 12150 entry.offset = parser.getObj(); 12151 entry.gen = parser.getObj(); 12152 var type = parser.getObj(); 12153 if ((0, _primitives.isCmd)(type, 'f')) { 12154 entry.free = true; 12155 } else if ((0, _primitives.isCmd)(type, 'n')) { 12156 entry.uncompressed = true; 12157 } 12158 if (!Number.isInteger(entry.offset) || !Number.isInteger(entry.gen) || !(entry.free || entry.uncompressed)) { 12159 throw new _util.FormatError('Invalid entry in XRef subsection: ' + first + ', ' + count); 12160 } 12161 if (i === 0 && entry.free && first === 1) { 12162 first = 0; 12163 } 12164 if (!this.entries[i + first]) { 12165 this.entries[i + first] = entry; 12166 } 12167 } 12168 tableState.entryNum = 0; 12169 tableState.streamPos = stream.pos; 12170 tableState.parserBuf1 = parser.buf1; 12171 tableState.parserBuf2 = parser.buf2; 12172 delete tableState.firstEntryNum; 12173 delete tableState.entryCount; 12174 } 12175 if (this.entries[0] && !this.entries[0].free) { 12176 throw new _util.FormatError('Invalid XRef table: unexpected first object'); 12177 } 12178 return obj;
vendor: 4,239 bytes, lines 12179-12300
12179 }, 12180 processXRefStream: function XRef_processXRefStream(stream) { 12181 if (!('streamState' in this)) { 12182 var streamParameters = stream.dict; 12183 var byteWidths = streamParameters.get('W'); 12184 var range = streamParameters.get('Index'); 12185 if (!range) { 12186 range = [0, streamParameters.get('Size')]; 12187 } 12188 this.streamState = { 12189 entryRanges: range, 12190 byteWidths: byteWidths, 12191 entryNum: 0, 12192 streamPos: stream.pos 12193 }; 12194 } 12195 this.readXRefStream(stream); 12196 delete this.streamState; 12197 return stream.dict; 12198 }, 12199 readXRefStream: function XRef_readXRefStream(stream) { 12200 var i, j; 12201 var streamState = this.streamState; 12202 stream.pos = streamState.streamPos; 12203 var byteWidths = streamState.byteWidths; 12204 var typeFieldWidth = byteWidths[0]; 12205 var offsetFieldWidth = byteWidths[1]; 12206 var generationFieldWidth = byteWidths[2]; 12207 var entryRanges = streamState.entryRanges; 12208 while (entryRanges.length > 0) { 12209 var first = entryRanges[0]; 12210 var n = entryRanges[1]; 12211 if (!Number.isInteger(first) || !Number.isInteger(n)) { 12212 throw new _util.FormatError('Invalid XRef range fields: ' + first + ', ' + n); 12213 } 12214 if (!Number.isInteger(typeFieldWidth) || !Number.isInteger(offsetFieldWidth) || !Number.isInteger(generationFieldWidth)) { 12215 throw new _util.FormatError('Invalid XRef entry fields length: ' + first + ', ' + n); 12216 } 12217 for (i = streamState.entryNum; i < n; ++i) { 12218 streamState.entryNum = i; 12219 streamState.streamPos = stream.pos; 12220 var type = 0, 12221 offset = 0, 12222 generation = 0; 12223 for (j = 0; j < typeFieldWidth; ++j) { 12224 type = type << 8 | stream.getByte(); 12225 } 12226 if (typeFieldWidth === 0) { 12227 type = 1; 12228 } 12229 for (j = 0; j < offsetFieldWidth; ++j) { 12230 offset = offset << 8 | stream.getByte(); 12231 } 12232 for (j = 0; j < generationFieldWidth; ++j) { 12233 generation = generation << 8 | stream.getByte(); 12234 } 12235 var entry = {}; 12236 entry.offset = offset; 12237 entry.gen = generation; 12238 switch (type) { 12239 case 0: 12240 entry.free = true; 12241 break; 12242 case 1: 12243 entry.uncompressed = true; 12244 break; 12245 case 2: 12246 break; 12247 default: 12248 throw new _util.FormatError('Invalid XRef entry type: ' + type); 12249 } 12250 if (!this.entries[first + i]) { 12251 this.entries[first + i] = entry; 12252 } 12253 } 12254 streamState.entryNum = 0; 12255 streamState.streamPos = stream.pos; 12256 entryRanges.splice(0, 2); 12257 } 12258 }, 12259 indexObjects: function XRef_indexObjects() { 12260 var TAB = 0x9, 12261 LF = 0xA, 12262 CR = 0xD, 12263 SPACE = 0x20; 12264 var PERCENT = 0x25, 12265 LT = 0x3C; 12266 function readToken(data, offset) { 12267 var token = '', 12268 ch = data[offset]; 12269 while (ch !== LF && ch !== CR && ch !== LT) { 12270 if (++offset >= data.length) { 12271 break; 12272 } 12273 token += String.fromCharCode(ch); 12274 ch = data[offset]; 12275 } 12276 return token; 12277 } 12278 function skipUntil(data, offset, what) { 12279 var length = what.length, 12280 dataLength = data.length; 12281 var skipped = 0; 12282 while (offset < dataLength) { 12283 var i = 0; 12284 while (i < length && data[offset + i] === what[i]) { 12285 ++i; 12286 } 12287 if (i >= length) { 12288 break; 12289 } 12290 offset++; 12291 skipped++; 12292 } 12293 return skipped; 12294 } 12295 var objRegExp = /^(\d+)\s+(\d+)\s+obj\b/; 12296 var endobjRegExp = /\bendobj[\b\s]$/; 12297 var nestedObjRegExp = /\s+(\d+\s+\d+\s+obj[\b\s])$/; 12298 var CHECK_CONTENT_LENGTH = 25; 12299 var trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]); 12300 var startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]);
12301 var objBytes = new Uint8Array([111, 98, 106]); 12302 var xrefBytes = new Uint8Array([47, 88, 82, 101, 102]); 12303 this.entries.length = 0; 12304 var stream = this.stream; 12305 stream.pos = 0; 12306 var buffer = stream.getBytes(); 12307 var position = stream.start, 12308 length = buffer.length; 12309 var trailers = [], 12310 xrefStms = []; 12311 while (position < length) { 12312 var ch = buffer[position]; 12313 if (ch === TAB || ch === LF || ch === CR || ch === SPACE) { 12314 ++position; 12315 continue; 12316 } 12317 if (ch === PERCENT) { 12318 do { 12319 ++position; 12320 if (position >= length) { 12321 break; 12322 } 12323 ch = buffer[position]; 12324 } while (ch !== LF && ch !== CR); 12325 continue; 12326 } 12327 var token = readToken(buffer, position); 12328 var m; 12329 if (token.indexOf('xref') === 0 && (token.length === 4 || /\s/.test(token[4]))) { 12330 position += skipUntil(buffer, position, trailerBytes); 12331 trailers.push(position); 12332 position += skipUntil(buffer, position, startxrefBytes); 12333 } else if (m = objRegExp.exec(token)) { 12334 if (typeof this.entries[m[1]] === 'undefined') { 12335 this.entries[m[1]] = { 12336 offset: position - stream.start, 12337 gen: m[2] | 0, 12338 uncompressed: true 12339 }; 12340 } 12341 var contentLength = void 0, 12342 startPos = position + token.length; 12343 while (startPos < buffer.length) { 12344 var endPos = startPos + skipUntil(buffer, startPos, objBytes) + 4; 12345 contentLength = endPos - position; 12346 var checkPos = Math.max(endPos - CHECK_CONTENT_LENGTH, startPos); 12347 var tokenStr = (0, _util.bytesToString)(buffer.subarray(checkPos, endPos)); 12348 if (endobjRegExp.test(tokenStr)) { 12349 break; 12350 } else { 12351 var objToken = nestedObjRegExp.exec(tokenStr); 12352 if (objToken && objToken[1]) { 12353 (0, _util.warn)('indexObjects: Found new "obj" inside of another "obj", ' + 'caused by missing "endobj" -- trying to recover.'); 12354 contentLength -= objToken[1].length; 12355 break; 12356 } 12357 } 12358 startPos += contentLength; 12359 } 12360 var content = buffer.subarray(position, position + contentLength); 12361 var xrefTagOffset = skipUntil(content, 0, xrefBytes); 12362 if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) { 12363 xrefStms.push(position - stream.start); 12364 this.xrefstms[position - stream.start] = 1; 12365 } 12366 position += contentLength; 12367 } else if (token.indexOf('trailer') === 0 && (token.length === 7 || /\s/.test(token[7]))) { 12368 trailers.push(position); 12369 position += skipUntil(buffer, position, startxrefBytes); 12370 } else { 12371 position += token.length + 1; 12372 } 12373 } 12374 var i, ii; 12375 for (i = 0, ii = xrefStms.length; i < ii; ++i) { 12376 this.startXRefQueue.push(xrefStms[i]); 12377 this.readXRef(true); 12378 } 12379 var dict; 12380 for (i = 0, ii = trailers.length; i < ii; ++i) { 12381 stream.pos = trailers[i]; 12382 var parser = new _parser.Parser(new _parser.Lexer(stream), true, this, true); 12383 var obj = parser.getObj(); 12384 if (!(0, _primitives.isCmd)(obj, 'trailer')) { 12385 continue; 12386 } 12387 dict = parser.getObj(); 12388 if (!(0, _primitives.isDict)(dict)) { 12389 continue; 12390 } 12391 if (dict.has('ID')) { 12392 return dict; 12393 } 12394 } 12395 if (dict) { 12396 return dict; 12397 } 12398 throw new _util.InvalidPDFException('Invalid PDF structure'); 12399 }, 12400 readXRef: function XRef_readXRef(recoveryMode) { 12401 var stream = this.stream; 12402 var startXRefParsedCache = Object.create(null); 12403 try { 12404 while (this.startXRefQueue.length) { 12405 var startXRef = this.startXRefQueue[0]; 12406 if (startXRefParsedCache[startXRef]) { 12407 (0, _util.warn)('readXRef - skipping XRef table since it was already parsed.'); 12408 this.startXRefQueue.shift(); 12409 continue; 12410 } 12411 startXRefParsedCache[startXRef] = true; 12412 stream.pos = startXRef + stream.start; 12413 var parser = new _parser.Parser(new _parser.Lexer(stream), true, this); 12414 var obj = parser.getObj(); 12415 var dict; 12416 if ((0, _primitives.isCmd)(obj, 'xref')) { 12417 dict = this.processXRefTable(parser); 12418 if (!this.topDict) { 12419 this.topDict = dict; 12420 } 12421 obj = dict.get('XRefStm'); 12422 if (Number.isInteger(obj)) { 12423 var pos = obj;
12424 if (!(pos in this.xrefstms)) { 12425 this.xrefstms[pos] = 1; 12426 this.startXRefQueue.push(pos); 12427 } 12428 } 12429 } else if (Number.isInteger(obj)) { 12430 if (!Number.isInteger(parser.getObj()) || !(0, _primitives.isCmd)(parser.getObj(), 'obj') || !(0, _primitives.isStream)(obj = parser.getObj())) { 12431 throw new _util.FormatError('Invalid XRef stream'); 12432 } 12433 dict = this.processXRefStream(obj); 12434 if (!this.topDict) { 12435 this.topDict = dict; 12436 } 12437 if (!dict) { 12438 throw new _util.FormatError('Failed to read XRef stream'); 12439 } 12440 } else { 12441 throw new _util.FormatError('Invalid XRef stream header'); 12442 } 12443 obj = dict.get('Prev'); 12444 if (Number.isInteger(obj)) { 12445 this.startXRefQueue.push(obj); 12446 } else if ((0, _primitives.isRef)(obj)) { 12447 this.startXRefQueue.push(obj.num); 12448 } 12449 this.startXRefQueue.shift(); 12450 } 12451 return this.topDict; 12452 } catch (e) { 12453 if (e instanceof _util.MissingDataException) { 12454 throw e; 12455 } 12456 (0, _util.info)('(while reading XRef): ' + e); 12457 } 12458 if (recoveryMode) { 12459 return; 12460 } 12461 throw new _util.XRefParseException(); 12462 }, 12463 getEntry: function XRef_getEntry(i) { 12464 var xrefEntry = this.entries[i]; 12465 if (xrefEntry && !xrefEntry.free && xrefEntry.offset) { 12466 return xrefEntry; 12467 } 12468 return null; 12469 }, 12470 fetchIfRef: function XRef_fetchIfRef(obj, suppressEncryption) { 12471 if (!(0, _primitives.isRef)(obj)) { 12472 return obj; 12473 } 12474 return this.fetch(obj, suppressEncryption); 12475 }, 12476 fetch: function XRef_fetch(ref, suppressEncryption) { 12477 if (!(0, _primitives.isRef)(ref)) { 12478 throw new Error('ref object is not a reference'); 12479 } 12480 var num = ref.num; 12481 if (num in this.cache) { 12482 var cacheEntry = this.cache[num]; 12483 if (cacheEntry instanceof _primitives.Dict && !cacheEntry.objId) { 12484 cacheEntry.objId = ref.toString(); 12485 } 12486 return cacheEntry; 12487 } 12488 var xrefEntry = this.getEntry(num); 12489 if (xrefEntry === null) { 12490 return this.cache[num] = null; 12491 } 12492 if (xrefEntry.uncompressed) { 12493 xrefEntry = this.fetchUncompressed(ref, xrefEntry, suppressEncryption); 12494 } else { 12495 xrefEntry = this.fetchCompressed(xrefEntry, suppressEncryption); 12496 } 12497 if ((0, _primitives.isDict)(xrefEntry)) { 12498 xrefEntry.objId = ref.toString(); 12499 } else if ((0, _primitives.isStream)(xrefEntry)) { 12500 xrefEntry.dict.objId = ref.toString(); 12501 } 12502 return xrefEntry; 12503 }, 12504 fetchUncompressed: function XRef_fetchUncompressed(ref, xrefEntry, suppressEncryption) { 12505 var gen = ref.gen; 12506 var num = ref.num; 12507 if (xrefEntry.gen !== gen) { 12508 throw new _util.FormatError('inconsistent generation in XRef'); 12509 } 12510 var stream = this.stream.makeSubStream(xrefEntry.offset + this.stream.start); 12511 var parser = new _parser.Parser(new _parser.Lexer(stream), true, this); 12512 var obj1 = parser.getObj(); 12513 var obj2 = parser.getObj(); 12514 var obj3 = parser.getObj(); 12515 if (!Number.isInteger(obj1)) { 12516 obj1 = parseInt(obj1, 10); 12517 } 12518 if (!Number.isInteger(obj2)) { 12519 obj2 = parseInt(obj2, 10); 12520 } 12521 if (obj1 !== num || obj2 !== gen || !(0, _primitives.isCmd)(obj3)) { 12522 throw new _util.FormatError('bad XRef entry'); 12523 } 12524 if (obj3.cmd !== 'obj') { 12525 if (obj3.cmd.indexOf('obj') === 0) { 12526 num = parseInt(obj3.cmd.substring(3), 10); 12527 if (!Number.isNaN(num)) { 12528 return num; 12529 } 12530 } 12531 throw new _util.FormatError('bad XRef entry'); 12532 } 12533 if (this.encrypt && !suppressEncryption) { 12534 xrefEntry = parser.getObj(this.encrypt.createCipherTransform(num, gen)); 12535 } else { 12536 xrefEntry = parser.getObj(); 12537 } 12538 if (!(0, _primitives.isStream)(xrefEntry)) { 12539 this.cache[num] = xrefEntry; 12540 } 12541 return xrefEntry; 12542 }, 12543 fetchCompressed: function XRef_fetchCompressed(xrefEntry, suppressEncryption) { 12544 var tableOffset = xrefEntry.offset; 12545 var stream = this.fetch(new _primitives.Ref(tableOffset, 0)); 12546 if (!(0, _primitives.isStream)(stream)) { 12547 throw new _util.FormatError('bad ObjStm stream'); 12548 } 12549 var first = stream.dict.get('First'); 12550 var n = stream.dict.get('N'); 12551 if (!Number.isInteger(first) || !Number.isInteger(n)) { 12552 throw new _util.FormatError('invalid first and n parameters for ObjStm stream'); 12553 } 12554 var parser = new _parser.Parser(new _parser.Lexer(stream), false, this); 12555 parser.allowStreams = true; 12556 var i,
12557 entries = [], 12558 num, 12559 nums = []; 12560 for (i = 0; i < n; ++i) { 12561 num = parser.getObj(); 12562 if (!Number.isInteger(num)) { 12563 throw new _util.FormatError('invalid object number in the ObjStm stream: ' + num); 12564 } 12565 nums.push(num); 12566 var offset = parser.getObj(); 12567 if (!Number.isInteger(offset)) { 12568 throw new _util.FormatError('invalid object offset in the ObjStm stream: ' + offset); 12569 } 12570 } 12571 for (i = 0; i < n; ++i) { 12572 entries.push(parser.getObj()); 12573 if ((0, _primitives.isCmd)(parser.buf1, 'endobj')) { 12574 parser.shift(); 12575 } 12576 num = nums[i]; 12577 var entry = this.entries[num]; 12578 if (entry && entry.offset === tableOffset && entry.gen === i) { 12579 this.cache[num] = entries[i]; 12580 } 12581 } 12582 xrefEntry = entries[xrefEntry.gen]; 12583 if (xrefEntry === undefined) { 12584 throw new _util.FormatError('bad XRef entry for compressed object'); 12585 } 12586 return xrefEntry; 12587 }, 12588 fetchIfRefAsync: function XRef_fetchIfRefAsync(obj, suppressEncryption) { 12589 if (!(0, _primitives.isRef)(obj)) { 12590 return Promise.resolve(obj); 12591 } 12592 return this.fetchAsync(obj, suppressEncryption); 12593 }, 12594 fetchAsync: function XRef_fetchAsync(ref, suppressEncryption) { 12595 var streamManager = this.stream.manager; 12596 var xref = this; 12597 return new Promise(function tryFetch(resolve, reject) { 12598 try { 12599 resolve(xref.fetch(ref, suppressEncryption)); 12600 } catch (e) { 12601 if (e instanceof _util.MissingDataException) { 12602 streamManager.requestRange(e.begin, e.end).then(function () { 12603 tryFetch(resolve, reject); 12604 }, reject); 12605 return; 12606 } 12607 reject(e); 12608 } 12609 }); 12610 }, 12611 getCatalogObj: function XRef_getCatalogObj() { 12612 return this.root; 12613 } 12614 }; 12615 return XRef; 12616}(); 12617var NameOrNumberTree = function NameOrNumberTreeClosure() { 12618 function NameOrNumberTree(root, xref) { 12619 (0, _util.unreachable)('Cannot initialize NameOrNumberTree.'); 12620 } 12621 NameOrNumberTree.prototype = { 12622 getAll: function NameOrNumberTree_getAll() { 12623 var dict = Object.create(null); 12624 if (!this.root) { 12625 return dict; 12626 } 12627 var xref = this.xref; 12628 var processed = new _primitives.RefSet(); 12629 processed.put(this.root); 12630 var queue = [this.root]; 12631 while (queue.length > 0) { 12632 var i, n; 12633 var obj = xref.fetchIfRef(queue.shift()); 12634 if (!(0, _primitives.isDict)(obj)) { 12635 continue; 12636 } 12637 if (obj.has('Kids')) { 12638 var kids = obj.get('Kids'); 12639 for (i = 0, n = kids.length; i < n; i++) { 12640 var kid = kids[i]; 12641 if (processed.has(kid)) { 12642 throw new _util.FormatError('Duplicate entry in "' + this._type + '" tree.'); 12643 } 12644 queue.push(kid); 12645 processed.put(kid); 12646 } 12647 continue; 12648 } 12649 var entries = obj.get(this._type); 12650 if (Array.isArray(entries)) { 12651 for (i = 0, n = entries.length; i < n; i += 2) { 12652 dict[xref.fetchIfRef(entries[i])] = xref.fetchIfRef(entries[i + 1]); 12653 } 12654 } 12655 } 12656 return dict; 12657 }, 12658 get: function NameOrNumberTree_get(key) { 12659 if (!this.root) { 12660 return null; 12661 } 12662 var xref = this.xref; 12663 var kidsOrEntries = xref.fetchIfRef(this.root); 12664 var loopCount = 0; 12665 var MAX_LEVELS = 10; 12666 var l, r, m; 12667 while (kidsOrEntries.has('Kids')) { 12668 if (++loopCount > MAX_LEVELS) { 12669 (0, _util.warn)('Search depth limit reached for "' + this._type + '" tree.'); 12670 return null; 12671 } 12672 var kids = kidsOrEntries.get('Kids'); 12673 if (!Array.isArray(kids)) { 12674 return null; 12675 } 12676 l = 0; 12677 r = kids.length - 1; 12678 while (l <= r) { 12679 m = l + r >> 1; 12680 var kid = xref.fetchIfRef(kids[m]); 12681 var limits = kid.get('Limits'); 12682 if (key < xref.fetchIfRef(limits[0])) { 12683 r = m - 1; 12684 } else if (key > xref.fetchIfRef(limits[1])) { 12685 l = m + 1; 12686 } else { 12687 kidsOrEntries = xref.fetchIfRef(kids[m]); 12688 break; 12689 } 12690 } 12691 if (l > r) { 12692 return null; 12693 } 12694 } 12695 var entries = kidsOrEntries.get(this._type); 12696 if (Array.isArray(entries)) { 12697 l = 0; 12698 r = entries.length - 2; 12699 while (l <= r) { 12700 m = l + r & ~1; 12701 var currentKey = xref.fetchIfRef(entries[m]); 12702 if (key < currentKey) { 12703 r = m - 2; 12704 } else if (key > currentKey) { 12705 l = m + 2; 12706 } else { 12707 return xref.fetchIfRef(entries[m + 1]); 12708 } 12709 } 12710 } 12711 return null; 12712 } 12713 }; 12714 return NameOrNumberTree; 12715}();
12716var NameTree = function NameTreeClosure() { 12717 function NameTree(root, xref) { 12718 this.root = root; 12719 this.xref = xref; 12720 this._type = 'Names'; 12721 } 12722 _util.Util.inherit(NameTree, NameOrNumberTree, {}); 12723 return NameTree; 12724}(); 12725var NumberTree = function NumberTreeClosure() { 12726 function NumberTree(root, xref) { 12727 this.root = root; 12728 this.xref = xref; 12729 this._type = 'Nums'; 12730 } 12731 _util.Util.inherit(NumberTree, NameOrNumberTree, {}); 12732 return NumberTree; 12733}(); 12734var FileSpec = function FileSpecClosure() { 12735 function FileSpec(root, xref) { 12736 if (!root || !(0, _primitives.isDict)(root)) { 12737 return; 12738 } 12739 this.xref = xref; 12740 this.root = root; 12741 if (root.has('FS')) { 12742 this.fs = root.get('FS'); 12743 } 12744 this.description = root.has('Desc') ? (0, _util.stringToPDFString)(root.get('Desc')) : ''; 12745 if (root.has('RF')) { 12746 (0, _util.warn)('Related file specifications are not supported'); 12747 } 12748 this.contentAvailable = true; 12749 if (!root.has('EF')) { 12750 this.contentAvailable = false; 12751 (0, _util.warn)('Non-embedded file specifications are not supported'); 12752 } 12753 } 12754 function pickPlatformItem(dict) { 12755 if (dict.has('UF')) { 12756 return dict.get('UF'); 12757 } else if (dict.has('F')) { 12758 return dict.get('F'); 12759 } else if (dict.has('Unix')) { 12760 return dict.get('Unix'); 12761 } else if (dict.has('Mac')) { 12762 return dict.get('Mac'); 12763 } else if (dict.has('DOS')) { 12764 return dict.get('DOS'); 12765 } 12766 return null; 12767 } 12768 FileSpec.prototype = { 12769 get filename() { 12770 if (!this._filename && this.root) { 12771 var filename = pickPlatformItem(this.root) || 'unnamed'; 12772 this._filename = (0, _util.stringToPDFString)(filename).replace(/\\\\/g, '\\').replace(/\\\//g, '/').replace(/\\/g, '/'); 12773 } 12774 return this._filename; 12775 }, 12776 get content() { 12777 if (!this.contentAvailable) { 12778 return null; 12779 } 12780 if (!this.contentRef && this.root) { 12781 this.contentRef = pickPlatformItem(this.root.get('EF')); 12782 } 12783 var content = null; 12784 if (this.contentRef) { 12785 var xref = this.xref; 12786 var fileObj = xref.fetchIfRef(this.contentRef); 12787 if (fileObj && (0, _primitives.isStream)(fileObj)) { 12788 content = fileObj.getBytes(); 12789 } else { 12790 (0, _util.warn)('Embedded file specification points to non-existing/invalid ' + 'content'); 12791 } 12792 } else { 12793 (0, _util.warn)('Embedded file specification does not have a content'); 12794 } 12795 return content; 12796 }, 12797 get serializable() { 12798 return { 12799 filename: this.filename, 12800 content: this.content 12801 }; 12802 } 12803 }; 12804 return FileSpec; 12805}(); 12806var ObjectLoader = function () { 12807 function mayHaveChildren(value) { 12808 return (0, _primitives.isRef)(value) || (0, _primitives.isDict)(value) || Array.isArray(value) || (0, _primitives.isStream)(value); 12809 } 12810 function addChildren(node, nodesToVisit) { 12811 if ((0, _primitives.isDict)(node) || (0, _primitives.isStream)(node)) { 12812 var dict = (0, _primitives.isDict)(node) ? node : node.dict; 12813 var dictKeys = dict.getKeys(); 12814 for (var i = 0, ii = dictKeys.length; i < ii; i++) { 12815 var rawValue = dict.getRaw(dictKeys[i]); 12816 if (mayHaveChildren(rawValue)) { 12817 nodesToVisit.push(rawValue); 12818 } 12819 } 12820 } else if (Array.isArray(node)) { 12821 for (var _i = 0, _ii = node.length; _i < _ii; _i++) { 12822 var value = node[_i]; 12823 if (mayHaveChildren(value)) { 12824 nodesToVisit.push(value); 12825 } 12826 } 12827 } 12828 } 12829 function ObjectLoader(dict, keys, xref) { 12830 this.dict = dict; 12831 this.keys = keys; 12832 this.xref = xref; 12833 this.refSet = null; 12834 this.capability = null; 12835 } 12836 ObjectLoader.prototype = { 12837 load: function load() { 12838 this.capability = (0, _util.createPromiseCapability)(); 12839 if (!(this.xref.stream instanceof _chunked_stream.ChunkedStream) || this.xref.stream.getMissingChunks().length === 0) { 12840 this.capability.resolve(); 12841 return this.capability.promise; 12842 } 12843 var keys = this.keys, 12844 dict = this.dict; 12845 12846 this.refSet = new _primitives.RefSet(); 12847 var nodesToVisit = []; 12848 for (var i = 0, ii = keys.length; i < ii; i++) { 12849 var rawValue = dict.getRaw(keys[i]); 12850 if (rawValue !== undefined) { 12851 nodesToVisit.push(rawValue); 12852 } 12853 } 12854 this._walk(nodesToVisit); 12855 return this.capability.promise; 12856 }, 12857 _walk: function _walk(nodesToVisit) { 12858 var _this3 = this; 12859 12860 var nodesToRevisit = []; 12861 var pendingRequests = []; 12862 while (nodesToVisit.length) { 12863 var currentNode = nodesToVisit.pop();
12864 if ((0, _primitives.isRef)(currentNode)) { 12865 if (this.refSet.has(currentNode)) { 12866 continue; 12867 } 12868 try { 12869 this.refSet.put(currentNode); 12870 currentNode = this.xref.fetch(currentNode); 12871 } catch (ex) { 12872 if (!(ex instanceof _util.MissingDataException)) { 12873 throw ex; 12874 } 12875 nodesToRevisit.push(currentNode); 12876 pendingRequests.push({ 12877 begin: ex.begin, 12878 end: ex.end 12879 }); 12880 } 12881 } 12882 if (currentNode && currentNode.getBaseStreams) { 12883 var baseStreams = currentNode.getBaseStreams(); 12884 var foundMissingData = false; 12885 for (var i = 0, ii = baseStreams.length; i < ii; i++) { 12886 var stream = baseStreams[i]; 12887 if (stream.getMissingChunks && stream.getMissingChunks().length) { 12888 foundMissingData = true; 12889 pendingRequests.push({ 12890 begin: stream.start, 12891 end: stream.end 12892 }); 12893 } 12894 } 12895 if (foundMissingData) { 12896 nodesToRevisit.push(currentNode); 12897 } 12898 } 12899 addChildren(currentNode, nodesToVisit); 12900 } 12901 if (pendingRequests.length) { 12902 this.xref.stream.manager.requestRanges(pendingRequests).then(function () { 12903 for (var _i2 = 0, _ii2 = nodesToRevisit.length; _i2 < _ii2; _i2++) { 12904 var node = nodesToRevisit[_i2]; 12905 if ((0, _primitives.isRef)(node)) { 12906 _this3.refSet.remove(node); 12907 } 12908 } 12909 _this3._walk(nodesToRevisit); 12910 }, this.capability.reject); 12911 return; 12912 } 12913 this.refSet = null; 12914 this.capability.resolve(); 12915 } 12916 }; 12917 return ObjectLoader; 12918}(); 12919exports.Catalog = Catalog; 12920exports.ObjectLoader = ObjectLoader; 12921exports.XRef = XRef; 12922exports.FileSpec = FileSpec; 12923 12924/***/ }), 12925/* 65 */ 12926/***/ (function(module, exports, __w_pdfjs_require__) { 12927 12928"use strict"; 12929 12930 12931Object.defineProperty(exports, "__esModule", { 12932 value: true 12933}); 12934var ArithmeticDecoder = function ArithmeticDecoderClosure() { 12935 var QeTable = [{ 12936 qe: 0x5601, 12937 nmps: 1, 12938 nlps: 1, 12939 switchFlag: 1 12940 }, { 12941 qe: 0x3401, 12942 nmps: 2, 12943 nlps: 6, 12944 switchFlag: 0 12945 }, { 12946 qe: 0x1801, 12947 nmps: 3, 12948 nlps: 9, 12949 switchFlag: 0 12950 }, { 12951 qe: 0x0AC1, 12952 nmps: 4, 12953 nlps: 12, 12954 switchFlag: 0 12955 }, { 12956 qe: 0x0521, 12957 nmps: 5, 12958 nlps: 29, 12959 switchFlag: 0 12960 }, { 12961 qe: 0x0221, 12962 nmps: 38, 12963 nlps: 33, 12964 switchFlag: 0 12965 }, { 12966 qe: 0x5601, 12967 nmps: 7, 12968 nlps: 6, 12969 switchFlag: 1 12970 }, { 12971 qe: 0x5401, 12972 nmps: 8, 12973 nlps: 14, 12974 switchFlag: 0 12975 }, { 12976 qe: 0x4801, 12977 nmps: 9, 12978 nlps: 14, 12979 switchFlag: 0 12980 }, { 12981 qe: 0x3801, 12982 nmps: 10, 12983 nlps: 14, 12984 switchFlag: 0 12985 }, { 12986 qe: 0x3001, 12987 nmps: 11, 12988 nlps: 17, 12989 switchFlag: 0 12990 }, { 12991 qe: 0x2401, 12992 nmps: 12, 12993 nlps: 18, 12994 switchFlag: 0 12995 }, { 12996 qe: 0x1C01, 12997 nmps: 13, 12998 nlps: 20, 12999 switchFlag: 0 13000 }, { 13001 qe: 0x1601, 13002 nmps: 29, 13003 nlps: 21, 13004 switchFlag: 0 13005 }, { 13006 qe: 0x5601, 13007 nmps: 15, 13008 nlps: 14, 13009 switchFlag: 1 13010 }, { 13011 qe: 0x5401, 13012 nmps: 16, 13013 nlps: 14, 13014 switchFlag: 0 13015 }, { 13016 qe: 0x5101, 13017 nmps: 17, 13018 nlps: 15, 13019 switchFlag: 0 13020 }, { 13021 qe: 0x4801, 13022 nmps: 18, 13023 nlps: 16, 13024 switchFlag: 0 13025 }, { 13026 qe: 0x3801, 13027 nmps: 19, 13028 nlps: 17, 13029 switchFlag: 0 13030 }, { 13031 qe: 0x3401, 13032 nmps: 20, 13033 nlps: 18, 13034 switchFlag: 0 13035 }, { 13036 qe: 0x3001, 13037 nmps: 21, 13038 nlps: 19, 13039 switchFlag: 0 13040 }, { 13041 qe: 0x2801, 13042 nmps: 22, 13043 nlps: 19, 13044 switchFlag: 0 13045 }, { 13046 qe: 0x2401, 13047 nmps: 23, 13048 nlps: 20, 13049 switchFlag: 0 13050 }, { 13051 qe: 0x2201, 13052 nmps: 24, 13053 nlps: 21, 13054 switchFlag: 0 13055 }, { 13056 qe: 0x1C01, 13057 nmps: 25, 13058 nlps: 22, 13059 switchFlag: 0 13060 }, { 13061 qe: 0x1801, 13062 nmps: 26, 13063 nlps: 23, 13064 switchFlag: 0 13065 }, { 13066 qe: 0x1601, 13067 nmps: 27, 13068 nlps: 24, 13069 switchFlag: 0 13070 }, { 13071 qe: 0x1401, 13072 nmps: 28, 13073 nlps: 25, 13074 switchFlag: 0 13075 }, { 13076 qe: 0x1201, 13077 nmps: 29, 13078 nlps: 26, 13079 switchFlag: 0 13080 }, { 13081 qe: 0x1101, 13082 nmps: 30, 13083 nlps: 27, 13084 switchFlag: 0 13085 }, { 13086 qe: 0x0AC1, 13087 nmps: 31, 13088 nlps: 28, 13089 switchFlag: 0 13090 }, { 13091 qe: 0x09C1, 13092 nmps: 32, 13093 nlps: 29, 13094 switchFlag: 0 13095 }, { 13096 qe: 0x08A1, 13097 nmps: 33, 13098 nlps: 30, 13099 switchFlag: 0 13100 }, { 13101 qe: 0x0521, 13102 nmps: 34, 13103 nlps: 31, 13104 switchFlag: 0 13105 }, { 13106 qe: 0x0441, 13107 nmps: 35, 13108 nlps: 32, 13109 switchFlag: 0 13110 }, { 13111 qe: 0x02A1, 13112 nmps: 36, 13113 nlps: 33, 13114 switchFlag: 0 13115 }, { 13116 qe: 0x0221, 13117 nmps: 37, 13118 nlps: 34, 13119 switchFlag: 0 13120 }, { 13121 qe: 0x0141, 13122 nmps: 38, 13123 nlps: 35, 13124 switchFlag: 0 13125 }, { 13126 qe: 0x0111, 13127 nmps: 39, 13128 nlps: 36, 13129 switchFlag: 0 13130 }, { 13131 qe: 0x0085, 13132 nmps: 40, 13133 nlps: 37, 13134 switchFlag: 0 13135 }, { 13136 qe: 0x0049, 13137 nmps: 41, 13138 nlps: 38, 13139 switchFlag: 0 13140 }, { 13141 qe: 0x0025, 13142 nmps: 42, 13143 nlps: 39, 13144 switchFlag: 0 13145 }, { 13146 qe: 0x0015, 13147 nmps: 43, 13148 nlps: 40, 13149 switchFlag: 0 13150 }, { 13151 qe: 0x0009, 13152 nmps: 44, 13153 nlps: 41, 13154 switchFlag: 0 13155 }, { 13156 qe: 0x0005, 13157 nmps: 45, 13158 nlps: 42, 13159 switchFlag: 0 13160 }, { 13161 qe: 0x0001, 13162 nmps: 45, 13163 nlps: 43, 13164 switchFlag: 0 13165 }, { 13166 qe: 0x5601, 13167 nmps: 46, 13168 nlps: 46, 13169 switchFlag: 0 13170 }]; 13171 function ArithmeticDecoder(data, start, end) { 13172 this.data = data; 13173 this.bp = start; 13174 this.dataEnd = end;
13175 this.chigh = data[start]; 13176 this.clow = 0; 13177 this.byteIn(); 13178 this.chigh = this.chigh << 7 & 0xFFFF | this.clow >> 9 & 0x7F; 13179 this.clow = this.clow << 7 & 0xFFFF; 13180 this.ct -= 7; 13181 this.a = 0x8000; 13182 } 13183 ArithmeticDecoder.prototype = { 13184 byteIn: function ArithmeticDecoder_byteIn() { 13185 var data = this.data; 13186 var bp = this.bp; 13187 if (data[bp] === 0xFF) { 13188 var b1 = data[bp + 1]; 13189 if (b1 > 0x8F) { 13190 this.clow += 0xFF00; 13191 this.ct = 8; 13192 } else { 13193 bp++; 13194 this.clow += data[bp] << 9; 13195 this.ct = 7; 13196 this.bp = bp; 13197 } 13198 } else { 13199 bp++; 13200 this.clow += bp < this.dataEnd ? data[bp] << 8 : 0xFF00; 13201 this.ct = 8; 13202 this.bp = bp; 13203 } 13204 if (this.clow > 0xFFFF) { 13205 this.chigh += this.clow >> 16; 13206 this.clow &= 0xFFFF; 13207 } 13208 }, 13209 readBit: function ArithmeticDecoder_readBit(contexts, pos) { 13210 var cx_index = contexts[pos] >> 1, 13211 cx_mps = contexts[pos] & 1; 13212 var qeTableIcx = QeTable[cx_index]; 13213 var qeIcx = qeTableIcx.qe; 13214 var d; 13215 var a = this.a - qeIcx; 13216 if (this.chigh < qeIcx) { 13217 if (a < qeIcx) { 13218 a = qeIcx; 13219 d = cx_mps; 13220 cx_index = qeTableIcx.nmps; 13221 } else { 13222 a = qeIcx; 13223 d = 1 ^ cx_mps; 13224 if (qeTableIcx.switchFlag === 1) { 13225 cx_mps = d; 13226 } 13227 cx_index = qeTableIcx.nlps; 13228 } 13229 } else { 13230 this.chigh -= qeIcx; 13231 if ((a & 0x8000) !== 0) { 13232 this.a = a; 13233 return cx_mps; 13234 } 13235 if (a < qeIcx) { 13236 d = 1 ^ cx_mps; 13237 if (qeTableIcx.switchFlag === 1) { 13238 cx_mps = d; 13239 } 13240 cx_index = qeTableIcx.nlps; 13241 } else { 13242 d = cx_mps; 13243 cx_index = qeTableIcx.nmps; 13244 } 13245 } 13246 do { 13247 if (this.ct === 0) { 13248 this.byteIn(); 13249 } 13250 a <<= 1; 13251 this.chigh = this.chigh << 1 & 0xFFFF | this.clow >> 15 & 1; 13252 this.clow = this.clow << 1 & 0xFFFF; 13253 this.ct--; 13254 } while ((a & 0x8000) === 0); 13255 this.a = a; 13256 contexts[pos] = cx_index << 1 | cx_mps; 13257 return d; 13258 } 13259 }; 13260 return ArithmeticDecoder; 13261}(); 13262exports.ArithmeticDecoder = ArithmeticDecoder; 13263 13264/***/ }), 13265/* 66 */ 13266/***/ (function(module, exports, __w_pdfjs_require__) { 13267 13268"use strict"; 13269 13270 13271Object.defineProperty(exports, "__esModule", { 13272 value: true 13273}); 13274exports.JpxImage = undefined; 13275 13276var _util = __w_pdfjs_require__(0); 13277 13278var _arithmetic_decoder = __w_pdfjs_require__(65); 13279 13280var JpxError = function JpxErrorClosure() { 13281 function JpxError(msg) { 13282 this.message = 'JPX error: ' + msg; 13283 } 13284 JpxError.prototype = new Error(); 13285 JpxError.prototype.name = 'JpxError'; 13286 JpxError.constructor = JpxError; 13287 return JpxError; 13288}(); 13289var JpxImage = function JpxImageClosure() { 13290 var SubbandsGainLog2 = { 13291 'LL': 0, 13292 'LH': 1, 13293 'HL': 1, 13294 'HH': 2 13295 }; 13296 function JpxImage() { 13297 this.failOnCorruptedImage = false; 13298 } 13299 JpxImage.prototype = { 13300 parse: function JpxImage_parse(data) { 13301 var head = (0, _util.readUint16)(data, 0); 13302 if (head === 0xFF4F) { 13303 this.parseCodestream(data, 0, data.length); 13304 return; 13305 } 13306 var position = 0, 13307 length = data.length; 13308 while (position < length) { 13309 var headerSize = 8; 13310 var lbox = (0, _util.readUint32)(data, position); 13311 var tbox = (0, _util.readUint32)(data, position + 4); 13312 position += headerSize; 13313 if (lbox === 1) { 13314 lbox = (0, _util.readUint32)(data, position) * 4294967296 + (0, _util.readUint32)(data, position + 4); 13315 position += 8; 13316 headerSize += 8; 13317 } 13318 if (lbox === 0) { 13319 lbox = length - position + headerSize; 13320 } 13321 if (lbox < headerSize) { 13322 throw new JpxError('Invalid box field size'); 13323 } 13324 var dataLength = lbox - headerSize; 13325 var jumpDataLength = true; 13326 switch (tbox) { 13327 case 0x6A703268: 13328 jumpDataLength = false; 13329 break; 13330 case 0x636F6C72: 13331 var method = data[position]; 13332 if (method === 1) { 13333 var colorspace = (0, _util.readUint32)(data, position + 3); 13334 switch (colorspace) { 13335 case 16: 13336 case 17: 13337 case 18: 13338 break; 13339 default: 13340 (0, _util.warn)('Unknown colorspace ' + colorspace); 13341 break; 13342 } 13343 } else if (method === 2) { 13344 (0, _util.info)('ICC profile not supported'); 13345 } 13346 break; 13347 case 0x6A703263: 13348 this.parseCodestream(data, position, position + dataLength); 13349 break; 13350 case 0x6A502020: 13351 if ((0, _util.readUint32)(data, position) !== 0x0d0a870a) { 13352 (0, _util.warn)('Invalid JP2 signature'); 13353 } 13354 break; 13355 case 0x6A501A1A: 13356 case 0x66747970: 13357 case 0x72726571: 13358 case 0x72657320: 13359 case 0x69686472: 13360 break; 13361 default: 13362 var headerType = String.fromCharCode(tbox >> 24 & 0xFF, tbox >> 16 & 0xFF, tbox >> 8 & 0xFF, tbox & 0xFF); 13363 (0, _util.warn)('Unsupported header type ' + tbox + ' (' + headerType + ')'); 13364 break; 13365 } 13366 if (jumpDataLength) { 13367 position += dataLength; 13368 } 13369 } 13370 }, 13371 parseImageProperties: function JpxImage_parseImageProperties(stream) { 13372 var newByte = stream.getByte(); 13373 while (newByte >= 0) { 13374 var oldByte = newByte; 13375 newByte = stream.getByte(); 13376 var code = oldByte << 8 | newByte; 13377 if (code === 0xFF51) { 13378 stream.skip(4); 13379 var Xsiz = stream.getInt32() >>> 0; 13380 var Ysiz = stream.getInt32() >>> 0; 13381 var XOsiz = stream.getInt32() >>> 0; 13382 var YOsiz = stream.getInt32() >>> 0; 13383 stream.skip(16); 13384 var Csiz = stream.getUint16(); 13385 this.width = Xsiz - XOsiz; 13386 this.height = Ysiz - YOsiz; 13387 this.componentsCount = Csiz; 13388 this.bitsPerComponent = 8; 13389 return; 13390 } 13391 } 13392 throw new JpxError('No size marker found in JPX stream'); 13393 }, 13394 parseCodestream: function JpxImage_parseCodestream(data, start, end) { 13395 var context = {}; 13396 var doNotRecover = false;
vendor: 5,122 bytes, lines 13397-13531
13397 try { 13398 var position = start; 13399 while (position + 1 < end) { 13400 var code = (0, _util.readUint16)(data, position); 13401 position += 2; 13402 var length = 0, 13403 j, 13404 sqcd, 13405 spqcds, 13406 spqcdSize, 13407 scalarExpounded, 13408 tile; 13409 switch (code) { 13410 case 0xFF4F: 13411 context.mainHeader = true; 13412 break; 13413 case 0xFFD9: 13414 break; 13415 case 0xFF51: 13416 length = (0, _util.readUint16)(data, position); 13417 var siz = {}; 13418 siz.Xsiz = (0, _util.readUint32)(data, position + 4); 13419 siz.Ysiz = (0, _util.readUint32)(data, position + 8); 13420 siz.XOsiz = (0, _util.readUint32)(data, position + 12); 13421 siz.YOsiz = (0, _util.readUint32)(data, position + 16); 13422 siz.XTsiz = (0, _util.readUint32)(data, position + 20); 13423 siz.YTsiz = (0, _util.readUint32)(data, position + 24); 13424 siz.XTOsiz = (0, _util.readUint32)(data, position + 28); 13425 siz.YTOsiz = (0, _util.readUint32)(data, position + 32); 13426 var componentsCount = (0, _util.readUint16)(data, position + 36); 13427 siz.Csiz = componentsCount; 13428 var components = []; 13429 j = position + 38; 13430 for (var i = 0; i < componentsCount; i++) { 13431 var component = { 13432 precision: (data[j] & 0x7F) + 1, 13433 isSigned: !!(data[j] & 0x80), 13434 XRsiz: data[j + 1], 13435 YRsiz: data[j + 2] 13436 }; 13437 j += 3; 13438 calculateComponentDimensions(component, siz); 13439 components.push(component); 13440 } 13441 context.SIZ = siz; 13442 context.components = components; 13443 calculateTileGrids(context, components); 13444 context.QCC = []; 13445 context.COC = []; 13446 break; 13447 case 0xFF5C: 13448 length = (0, _util.readUint16)(data, position); 13449 var qcd = {}; 13450 j = position + 2; 13451 sqcd = data[j++]; 13452 switch (sqcd & 0x1F) { 13453 case 0: 13454 spqcdSize = 8; 13455 scalarExpounded = true; 13456 break; 13457 case 1: 13458 spqcdSize = 16; 13459 scalarExpounded = false; 13460 break; 13461 case 2: 13462 spqcdSize = 16; 13463 scalarExpounded = true; 13464 break; 13465 default: 13466 throw new Error('Invalid SQcd value ' + sqcd); 13467 } 13468 qcd.noQuantization = spqcdSize === 8; 13469 qcd.scalarExpounded = scalarExpounded; 13470 qcd.guardBits = sqcd >> 5; 13471 spqcds = []; 13472 while (j < length + position) { 13473 var spqcd = {}; 13474 if (spqcdSize === 8) { 13475 spqcd.epsilon = data[j++] >> 3; 13476 spqcd.mu = 0; 13477 } else { 13478 spqcd.epsilon = data[j] >> 3; 13479 spqcd.mu = (data[j] & 0x7) << 8 | data[j + 1]; 13480 j += 2; 13481 } 13482 spqcds.push(spqcd); 13483 } 13484 qcd.SPqcds = spqcds; 13485 if (context.mainHeader) { 13486 context.QCD = qcd; 13487 } else { 13488 context.currentTile.QCD = qcd; 13489 context.currentTile.QCC = []; 13490 } 13491 break; 13492 case 0xFF5D: 13493 length = (0, _util.readUint16)(data, position); 13494 var qcc = {}; 13495 j = position + 2; 13496 var cqcc; 13497 if (context.SIZ.Csiz < 257) { 13498 cqcc = data[j++]; 13499 } else { 13500 cqcc = (0, _util.readUint16)(data, j); 13501 j += 2; 13502 } 13503 sqcd = data[j++]; 13504 switch (sqcd & 0x1F) { 13505 case 0: 13506 spqcdSize = 8; 13507 scalarExpounded = true; 13508 break; 13509 case 1: 13510 spqcdSize = 16; 13511 scalarExpounded = false; 13512 break; 13513 case 2: 13514 spqcdSize = 16; 13515 scalarExpounded = true; 13516 break; 13517 default: 13518 throw new Error('Invalid SQcd value ' + sqcd); 13519 } 13520 qcc.noQuantization = spqcdSize === 8; 13521 qcc.scalarExpounded = scalarExpounded; 13522 qcc.guardBits = sqcd >> 5; 13523 spqcds = []; 13524 while (j < length + position) { 13525 spqcd = {}; 13526 if (spqcdSize === 8) { 13527 spqcd.epsilon = data[j++] >> 3; 13528 spqcd.mu = 0; 13529 } else { 13530 spqcd.epsilon = data[j] >> 3; 13531 spqcd.mu = (data[j] & 0x7) << 8 | data[j + 1];
vendor: 4,831 bytes, lines 13532-13646
13532 j += 2; 13533 } 13534 spqcds.push(spqcd); 13535 } 13536 qcc.SPqcds = spqcds; 13537 if (context.mainHeader) { 13538 context.QCC[cqcc] = qcc; 13539 } else { 13540 context.currentTile.QCC[cqcc] = qcc; 13541 } 13542 break; 13543 case 0xFF52: 13544 length = (0, _util.readUint16)(data, position); 13545 var cod = {}; 13546 j = position + 2; 13547 var scod = data[j++]; 13548 cod.entropyCoderWithCustomPrecincts = !!(scod & 1); 13549 cod.sopMarkerUsed = !!(scod & 2); 13550 cod.ephMarkerUsed = !!(scod & 4); 13551 cod.progressionOrder = data[j++]; 13552 cod.layersCount = (0, _util.readUint16)(data, j); 13553 j += 2; 13554 cod.multipleComponentTransform = data[j++]; 13555 cod.decompositionLevelsCount = data[j++]; 13556 cod.xcb = (data[j++] & 0xF) + 2; 13557 cod.ycb = (data[j++] & 0xF) + 2; 13558 var blockStyle = data[j++]; 13559 cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1); 13560 cod.resetContextProbabilities = !!(blockStyle & 2); 13561 cod.terminationOnEachCodingPass = !!(blockStyle & 4); 13562 cod.verticalyStripe = !!(blockStyle & 8); 13563 cod.predictableTermination = !!(blockStyle & 16); 13564 cod.segmentationSymbolUsed = !!(blockStyle & 32); 13565 cod.reversibleTransformation = data[j++]; 13566 if (cod.entropyCoderWithCustomPrecincts) { 13567 var precinctsSizes = []; 13568 while (j < length + position) { 13569 var precinctsSize = data[j++]; 13570 precinctsSizes.push({ 13571 PPx: precinctsSize & 0xF, 13572 PPy: precinctsSize >> 4 13573 }); 13574 } 13575 cod.precinctsSizes = precinctsSizes; 13576 } 13577 var unsupported = []; 13578 if (cod.selectiveArithmeticCodingBypass) { 13579 unsupported.push('selectiveArithmeticCodingBypass'); 13580 } 13581 if (cod.resetContextProbabilities) { 13582 unsupported.push('resetContextProbabilities'); 13583 } 13584 if (cod.terminationOnEachCodingPass) { 13585 unsupported.push('terminationOnEachCodingPass'); 13586 } 13587 if (cod.verticalyStripe) { 13588 unsupported.push('verticalyStripe'); 13589 } 13590 if (cod.predictableTermination) { 13591 unsupported.push('predictableTermination'); 13592 } 13593 if (unsupported.length > 0) { 13594 doNotRecover = true; 13595 throw new Error('Unsupported COD options (' + unsupported.join(', ') + ')'); 13596 } 13597 if (context.mainHeader) { 13598 context.COD = cod; 13599 } else { 13600 context.currentTile.COD = cod; 13601 context.currentTile.COC = []; 13602 } 13603 break; 13604 case 0xFF90: 13605 length = (0, _util.readUint16)(data, position); 13606 tile = {}; 13607 tile.index = (0, _util.readUint16)(data, position + 2); 13608 tile.length = (0, _util.readUint32)(data, position + 4); 13609 tile.dataEnd = tile.length + position - 2; 13610 tile.partIndex = data[position + 8]; 13611 tile.partsCount = data[position + 9]; 13612 context.mainHeader = false; 13613 if (tile.partIndex === 0) { 13614 tile.COD = context.COD; 13615 tile.COC = context.COC.slice(0); 13616 tile.QCD = context.QCD; 13617 tile.QCC = context.QCC.slice(0); 13618 } 13619 context.currentTile = tile; 13620 break; 13621 case 0xFF93: 13622 tile = context.currentTile; 13623 if (tile.partIndex === 0) { 13624 initializeTile(context, tile.index); 13625 buildPackets(context); 13626 } 13627 length = tile.dataEnd - position; 13628 parseTilePackets(context, data, position, length); 13629 break; 13630 case 0xFF55: 13631 case 0xFF57: 13632 case 0xFF58: 13633 case 0xFF64: 13634 length = (0, _util.readUint16)(data, position); 13635 break; 13636 case 0xFF53: 13637 throw new Error('Codestream code 0xFF53 (COC) is ' + 'not implemented'); 13638 default: 13639 throw new Error('Unknown codestream code: ' + code.toString(16)); 13640 } 13641 position += length; 13642 } 13643 } catch (e) { 13644 if (doNotRecover || this.failOnCorruptedImage) { 13645 throw new JpxError(e.message); 13646 } else {
vendor: 6,058 bytes, lines 13647-13779
13647 (0, _util.warn)('JPX: Trying to recover from: ' + e.message); 13648 } 13649 } 13650 this.tiles = transformComponents(context); 13651 this.width = context.SIZ.Xsiz - context.SIZ.XOsiz; 13652 this.height = context.SIZ.Ysiz - context.SIZ.YOsiz; 13653 this.componentsCount = context.SIZ.Csiz; 13654 } 13655 }; 13656 function calculateComponentDimensions(component, siz) { 13657 component.x0 = Math.ceil(siz.XOsiz / component.XRsiz); 13658 component.x1 = Math.ceil(siz.Xsiz / component.XRsiz); 13659 component.y0 = Math.ceil(siz.YOsiz / component.YRsiz); 13660 component.y1 = Math.ceil(siz.Ysiz / component.YRsiz); 13661 component.width = component.x1 - component.x0; 13662 component.height = component.y1 - component.y0; 13663 } 13664 function calculateTileGrids(context, components) { 13665 var siz = context.SIZ; 13666 var tile, 13667 tiles = []; 13668 var numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz); 13669 var numYtiles = Math.ceil((siz.Ysiz - siz.YTOsiz) / siz.YTsiz); 13670 for (var q = 0; q < numYtiles; q++) { 13671 for (var p = 0; p < numXtiles; p++) { 13672 tile = {}; 13673 tile.tx0 = Math.max(siz.XTOsiz + p * siz.XTsiz, siz.XOsiz); 13674 tile.ty0 = Math.max(siz.YTOsiz + q * siz.YTsiz, siz.YOsiz); 13675 tile.tx1 = Math.min(siz.XTOsiz + (p + 1) * siz.XTsiz, siz.Xsiz); 13676 tile.ty1 = Math.min(siz.YTOsiz + (q + 1) * siz.YTsiz, siz.Ysiz); 13677 tile.width = tile.tx1 - tile.tx0; 13678 tile.height = tile.ty1 - tile.ty0; 13679 tile.components = []; 13680 tiles.push(tile); 13681 } 13682 } 13683 context.tiles = tiles; 13684 var componentsCount = siz.Csiz; 13685 for (var i = 0, ii = componentsCount; i < ii; i++) { 13686 var component = components[i]; 13687 for (var j = 0, jj = tiles.length; j < jj; j++) { 13688 var tileComponent = {}; 13689 tile = tiles[j]; 13690 tileComponent.tcx0 = Math.ceil(tile.tx0 / component.XRsiz); 13691 tileComponent.tcy0 = Math.ceil(tile.ty0 / component.YRsiz); 13692 tileComponent.tcx1 = Math.ceil(tile.tx1 / component.XRsiz); 13693 tileComponent.tcy1 = Math.ceil(tile.ty1 / component.YRsiz); 13694 tileComponent.width = tileComponent.tcx1 - tileComponent.tcx0; 13695 tileComponent.height = tileComponent.tcy1 - tileComponent.tcy0; 13696 tile.components[i] = tileComponent; 13697 } 13698 } 13699 } 13700 function getBlocksDimensions(context, component, r) { 13701 var codOrCoc = component.codingStyleParameters; 13702 var result = {}; 13703 if (!codOrCoc.entropyCoderWithCustomPrecincts) { 13704 result.PPx = 15; 13705 result.PPy = 15; 13706 } else { 13707 result.PPx = codOrCoc.precinctsSizes[r].PPx; 13708 result.PPy = codOrCoc.precinctsSizes[r].PPy; 13709 } 13710 result.xcb_ = r > 0 ? Math.min(codOrCoc.xcb, result.PPx - 1) : Math.min(codOrCoc.xcb, result.PPx); 13711 result.ycb_ = r > 0 ? Math.min(codOrCoc.ycb, result.PPy - 1) : Math.min(codOrCoc.ycb, result.PPy); 13712 return result; 13713 } 13714 function buildPrecincts(context, resolution, dimensions) { 13715 var precinctWidth = 1 << dimensions.PPx; 13716 var precinctHeight = 1 << dimensions.PPy; 13717 var isZeroRes = resolution.resLevel === 0; 13718 var precinctWidthInSubband = 1 << dimensions.PPx + (isZeroRes ? 0 : -1); 13719 var precinctHeightInSubband = 1 << dimensions.PPy + (isZeroRes ? 0 : -1); 13720 var numprecinctswide = resolution.trx1 > resolution.trx0 ? Math.ceil(resolution.trx1 / precinctWidth) - Math.floor(resolution.trx0 / precinctWidth) : 0; 13721 var numprecinctshigh = resolution.try1 > resolution.try0 ? Math.ceil(resolution.try1 / precinctHeight) - Math.floor(resolution.try0 / precinctHeight) : 0; 13722 var numprecincts = numprecinctswide * numprecinctshigh; 13723 resolution.precinctParameters = { 13724 precinctWidth: precinctWidth, 13725 precinctHeight: precinctHeight, 13726 numprecinctswide: numprecinctswide, 13727 numprecinctshigh: numprecinctshigh, 13728 numprecincts: numprecincts, 13729 precinctWidthInSubband: precinctWidthInSubband, 13730 precinctHeightInSubband: precinctHeightInSubband 13731 }; 13732 } 13733 function buildCodeblocks(context, subband, dimensions) { 13734 var xcb_ = dimensions.xcb_; 13735 var ycb_ = dimensions.ycb_; 13736 var codeblockWidth = 1 << xcb_; 13737 var codeblockHeight = 1 << ycb_; 13738 var cbx0 = subband.tbx0 >> xcb_; 13739 var cby0 = subband.tby0 >> ycb_; 13740 var cbx1 = subband.tbx1 + codeblockWidth - 1 >> xcb_; 13741 var cby1 = subband.tby1 + codeblockHeight - 1 >> ycb_; 13742 var precinctParameters = subband.resolution.precinctParameters; 13743 var codeblocks = []; 13744 var precincts = []; 13745 var i, j, codeblock, precinctNumber; 13746 for (j = cby0; j < cby1; j++) { 13747 for (i = cbx0; i < cbx1; i++) { 13748 codeblock = { 13749 cbx: i, 13750 cby: j, 13751 tbx0: codeblockWidth * i, 13752 tby0: codeblockHeight * j, 13753 tbx1: codeblockWidth * (i + 1), 13754 tby1: codeblockHeight * (j + 1) 13755 }; 13756 codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0); 13757 codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0); 13758 codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1); 13759 codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1); 13760 var pi = Math.floor((codeblock.tbx0_ - subband.tbx0) / precinctParameters.precinctWidthInSubband); 13761 var pj = Math.floor((codeblock.tby0_ - subband.tby0) / precinctParameters.precinctHeightInSubband); 13762 precinctNumber = pi + pj * precinctParameters.numprecinctswide; 13763 codeblock.precinctNumber = precinctNumber; 13764 codeblock.subbandType = subband.type; 13765 codeblock.Lblock = 3; 13766 if (codeblock.tbx1_ <= codeblock.tbx0_ || codeblock.tby1_ <= codeblock.tby0_) { 13767 continue; 13768 } 13769 codeblocks.push(codeblock); 13770 var precinct = precincts[precinctNumber]; 13771 if (precinct !== undefined) { 13772 if (i < precinct.cbxMin) { 13773 precinct.cbxMin = i; 13774 } else if (i > precinct.cbxMax) { 13775 precinct.cbxMax = i; 13776 } 13777 if (j < precinct.cbyMin) { 13778 precinct.cbxMin = j; 13779 } else if (j >
vendor: 25,917 bytes, lines 13779-14453
13779 precinct.cbyMax) { 13780 precinct.cbyMax = j; 13781 } 13782 } else { 13783 precincts[precinctNumber] = precinct = { 13784 cbxMin: i, 13785 cbyMin: j, 13786 cbxMax: i, 13787 cbyMax: j 13788 }; 13789 } 13790 codeblock.precinct = precinct; 13791 } 13792 } 13793 subband.codeblockParameters = { 13794 codeblockWidth: xcb_, 13795 codeblockHeight: ycb_, 13796 numcodeblockwide: cbx1 - cbx0 + 1, 13797 numcodeblockhigh: cby1 - cby0 + 1 13798 }; 13799 subband.codeblocks = codeblocks; 13800 subband.precincts = precincts; 13801 } 13802 function createPacket(resolution, precinctNumber, layerNumber) { 13803 var precinctCodeblocks = []; 13804 var subbands = resolution.subbands; 13805 for (var i = 0, ii = subbands.length; i < ii; i++) { 13806 var subband = subbands[i]; 13807 var codeblocks = subband.codeblocks; 13808 for (var j = 0, jj = codeblocks.length; j < jj; j++) { 13809 var codeblock = codeblocks[j]; 13810 if (codeblock.precinctNumber !== precinctNumber) { 13811 continue; 13812 } 13813 precinctCodeblocks.push(codeblock); 13814 } 13815 } 13816 return { 13817 layerNumber: layerNumber, 13818 codeblocks: precinctCodeblocks 13819 }; 13820 } 13821 function LayerResolutionComponentPositionIterator(context) { 13822 var siz = context.SIZ; 13823 var tileIndex = context.currentTile.index; 13824 var tile = context.tiles[tileIndex]; 13825 var layersCount = tile.codingStyleDefaultParameters.layersCount; 13826 var componentsCount = siz.Csiz; 13827 var maxDecompositionLevelsCount = 0; 13828 for (var q = 0; q < componentsCount; q++) { 13829 maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, tile.components[q].codingStyleParameters.decompositionLevelsCount); 13830 } 13831 var l = 0, 13832 r = 0, 13833 i = 0, 13834 k = 0; 13835 this.nextPacket = function JpxImage_nextPacket() { 13836 for (; l < layersCount; l++) { 13837 for (; r <= maxDecompositionLevelsCount; r++) { 13838 for (; i < componentsCount; i++) { 13839 var component = tile.components[i]; 13840 if (r > component.codingStyleParameters.decompositionLevelsCount) { 13841 continue; 13842 } 13843 var resolution = component.resolutions[r]; 13844 var numprecincts = resolution.precinctParameters.numprecincts; 13845 for (; k < numprecincts;) { 13846 var packet = createPacket(resolution, k, l); 13847 k++; 13848 return packet; 13849 } 13850 k = 0; 13851 } 13852 i = 0; 13853 } 13854 r = 0; 13855 } 13856 throw new JpxError('Out of packets'); 13857 }; 13858 } 13859 function ResolutionLayerComponentPositionIterator(context) { 13860 var siz = context.SIZ; 13861 var tileIndex = context.currentTile.index; 13862 var tile = context.tiles[tileIndex]; 13863 var layersCount = tile.codingStyleDefaultParameters.layersCount; 13864 var componentsCount = siz.Csiz; 13865 var maxDecompositionLevelsCount = 0; 13866 for (var q = 0; q < componentsCount; q++) { 13867 maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, tile.components[q].codingStyleParameters.decompositionLevelsCount); 13868 } 13869 var r = 0, 13870 l = 0, 13871 i = 0, 13872 k = 0; 13873 this.nextPacket = function JpxImage_nextPacket() { 13874 for (; r <= maxDecompositionLevelsCount; r++) { 13875 for (; l < layersCount; l++) { 13876 for (; i < componentsCount; i++) { 13877 var component = tile.components[i]; 13878 if (r > component.codingStyleParameters.decompositionLevelsCount) { 13879 continue; 13880 } 13881 var resolution = component.resolutions[r]; 13882 var numprecincts = resolution.precinctParameters.numprecincts; 13883 for (; k < numprecincts;) { 13884 var packet = createPacket(resolution, k, l); 13885 k++; 13886 return packet; 13887 } 13888 k = 0; 13889 } 13890 i = 0; 13891 } 13892 l = 0; 13893 } 13894 throw new JpxError('Out of packets'); 13895 }; 13896 } 13897 function ResolutionPositionComponentLayerIterator(context) { 13898 var siz = context.SIZ; 13899 var tileIndex = context.currentTile.index; 13900 var tile = context.tiles[tileIndex]; 13901 var layersCount = tile.codingStyleDefaultParameters.layersCount; 13902 var componentsCount = siz.Csiz; 13903 var l, r, c, p; 13904 var maxDecompositionLevelsCount = 0; 13905 for (c = 0; c < componentsCount; c++) { 13906 var component = tile.components[c]; 13907 maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, component.codingStyleParameters.decompositionLevelsCount); 13908 } 13909 var maxNumPrecinctsInLevel = new Int32Array(maxDecompositionLevelsCount + 1); 13910 for (r = 0; r <= maxDecompositionLevelsCount; ++r) { 13911 var maxNumPrecincts = 0; 13912 for (c = 0; c < componentsCount; ++c) { 13913 var resolutions = tile.components[c].resolutions; 13914 if (r < resolutions.length) { 13915 maxNumPrecincts = Math.max(maxNumPrecincts, resolutions[r].precinctParameters.numprecincts); 13916 } 13917 } 13918 maxNumPrecinctsInLevel[r] = maxNumPrecincts; 13919 } 13920 l = 0; 13921 r = 0; 13922 c = 0; 13923 p = 0; 13924 this.nextPacket = function JpxImage_nextPacket() { 13925 for (; r <= maxDecompositionLevelsCount; r++) { 13926 for (; p < maxNumPrecinctsInLevel[r]; p++) { 13927 for (; c < componentsCount; c++) { 13928 var component = tile.components[c]; 13929 if (r > component.codingStyleParameters.decompositionLevelsCount) { 13930 continue; 13931 } 13932 var resolution = component.resolutions[r]; 13933 var numprecincts = resolution.precinctParameters.numprecincts; 13934 if (p >= numprecincts) { 13935 continue; 13936 } 13937 for (; l < layersCount;) { 13938 var packet = createPacket(resolution, p, l); 13939 l++; 13940 return packet; 13941 } 13942 l = 0; 13943 } 13944 c = 0; 13945 } 13946 p = 0; 13947 } 13948 throw new JpxError('Out of packets'); 13949 }; 13950 } 13951 function PositionComponentResolutionLayerIterator(context) { 13952 var siz = context.SIZ; 13953 var tileIndex = context.currentTile.index; 13954 var tile = context.tiles[tileIndex]; 13955 var layersCount = tile.codingStyleDefaultParameters.layersCount; 13956 var componentsCount = siz.Csiz; 13957 var precinctsSizes = getPrecinctSizesInImageScale(tile); 13958 var precinctsIterationSizes = precinctsSizes; 13959 var l = 0, 13960 r = 0, 13961 c = 0, 13962 px = 0, 13963 py = 0; 13964 this.nextPacket = function JpxImage_nextPacket() { 13965 for (; py < precinctsIterationSizes.maxNumHigh; py++) { 13966 for (; px < precinctsIterationSizes.maxNumWide; px++) { 13967 for (; c < componentsCount; c++) { 13968 var component = tile.components[c]; 13969 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 13970 for (; r <= decompositionLevelsCount; r++) { 13971 var resolution = component.resolutions[r]; 13972 var sizeInImageScale = precinctsSizes.components[c].resolutions[r]; 13973 var k = getPrecinctIndexIfExist(px, py, sizeInImageScale, precinctsIterationSizes, resolution); 13974 if (k === null) { 13975 continue; 13976 } 13977 for (; l < layersCount;) { 13978 var packet = createPacket(resolution, k, l); 13979 l++; 13980 return packet; 13981 } 13982 l = 0; 13983 } 13984 r = 0; 13985 } 13986 c = 0; 13987 } 13988 px = 0; 13989 } 13990 throw new JpxError('Out of packets'); 13991 }; 13992 } 13993 function ComponentPositionResolutionLayerIterator(context) { 13994 var siz = context.SIZ; 13995 var tileIndex = context.currentTile.index; 13996 var tile = context.tiles[tileIndex]; 13997 var layersCount = tile.codingStyleDefaultParameters.layersCount; 13998 var componentsCount = siz.Csiz; 13999 var precinctsSizes = getPrecinctSizesInImageScale(tile); 14000 var l = 0, 14001 r = 0, 14002 c = 0, 14003 px = 0, 14004 py = 0; 14005 this.nextPacket = function JpxImage_nextPacket() { 14006 for (; c < componentsCount; ++c) { 14007 var component = tile.components[c]; 14008 var precinctsIterationSizes = precinctsSizes.components[c]; 14009 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 14010 for (; py < precinctsIterationSizes.maxNumHigh; py++) { 14011 for (; px < precinctsIterationSizes.maxNumWide; px++) { 14012 for (; r <= decompositionLevelsCount; r++) { 14013 var resolution = component.resolutions[r]; 14014 var sizeInImageScale = precinctsIterationSizes.resolutions[r]; 14015 var k = getPrecinctIndexIfExist(px, py, sizeInImageScale, precinctsIterationSizes, resolution); 14016 if (k === null) { 14017 continue; 14018 } 14019 for (; l < layersCount;) { 14020 var packet = createPacket(resolution, k, l); 14021 l++; 14022 return packet; 14023 } 14024 l = 0; 14025 } 14026 r = 0; 14027 } 14028 px = 0; 14029 } 14030 py = 0; 14031 } 14032 throw new JpxError('Out of packets'); 14033 }; 14034 } 14035 function getPrecinctIndexIfExist(pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) { 14036 var posX = pxIndex * precinctIterationSizes.minWidth; 14037 var posY = pyIndex * precinctIterationSizes.minHeight; 14038 if (posX % sizeInImageScale.width !== 0 || posY % sizeInImageScale.height !== 0) { 14039 return null; 14040 } 14041 var startPrecinctRowIndex = posY / sizeInImageScale.width * resolution.precinctParameters.numprecinctswide; 14042 return posX / sizeInImageScale.height + startPrecinctRowIndex; 14043 } 14044 function getPrecinctSizesInImageScale(tile) { 14045 var componentsCount = tile.components.length; 14046 var minWidth = Number.MAX_VALUE; 14047 var minHeight = Number.MAX_VALUE; 14048 var maxNumWide = 0; 14049 var maxNumHigh = 0; 14050 var sizePerComponent = new Array(componentsCount); 14051 for (var c = 0; c < componentsCount; c++) { 14052 var component = tile.components[c]; 14053 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 14054 var sizePerResolution = new Array(decompositionLevelsCount + 1); 14055 var minWidthCurrentComponent = Number.MAX_VALUE; 14056 var minHeightCurrentComponent = Number.MAX_VALUE; 14057 var maxNumWideCurrentComponent = 0; 14058 var maxNumHighCurrentComponent = 0; 14059 var scale = 1; 14060 for (var r = decompositionLevelsCount; r >= 0; --r) { 14061 var resolution = component.resolutions[r]; 14062 var widthCurrentResolution = scale * resolution.precinctParameters.precinctWidth; 14063 var heightCurrentResolution = scale * resolution.precinctParameters.precinctHeight; 14064 minWidthCurrentComponent = Math.min(minWidthCurrentComponent, widthCurrentResolution); 14065 minHeightCurrentComponent = Math.min(minHeightCurrentComponent, heightCurrentResolution); 14066 maxNumWideCurrentComponent = Math.max(maxNumWideCurrentComponent, resolution.precinctParameters.numprecinctswide); 14067 maxNumHighCurrentComponent = Math.max(maxNumHighCurrentComponent, resolution.precinctParameters.numprecinctshigh); 14068 sizePerResolution[r] = { 14069 width: widthCurrentResolution, 14070 height: heightCurrentResolution 14071 }; 14072 scale <<= 1; 14073 } 14074 minWidth = Math.min(minWidth, minWidthCurrentComponent); 14075 minHeight = Math.min(minHeight, minHeightCurrentComponent); 14076 maxNumWide = Math.max(maxNumWide, maxNumWideCurrentComponent); 14077 maxNumHigh = Math.max(maxNumHigh, maxNumHighCurrentComponent); 14078 sizePerComponent[c] = { 14079 resolutions: sizePerResolution, 14080 minWidth: minWidthCurrentComponent, 14081 minHeight: minHeightCurrentComponent, 14082 maxNumWide: maxNumWideCurrentComponent, 14083 maxNumHigh: maxNumHighCurrentComponent 14084 }; 14085 } 14086 return { 14087 components: sizePerComponent, 14088 minWidth: minWidth, 14089 minHeight: minHeight, 14090 maxNumWide: maxNumWide, 14091 maxNumHigh: maxNumHigh 14092 }; 14093 } 14094 function buildPackets(context) { 14095 var siz = context.SIZ; 14096 var tileIndex = context.currentTile.index; 14097 var tile = context.tiles[tileIndex]; 14098 var componentsCount = siz.Csiz; 14099 for (var c = 0; c < componentsCount; c++) { 14100 var component = tile.components[c]; 14101 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 14102 var resolutions = []; 14103 var subbands = []; 14104 for (var r = 0; r <= decompositionLevelsCount; r++) { 14105 var blocksDimensions = getBlocksDimensions(context, component, r); 14106 var resolution = {}; 14107 var scale = 1 << decompositionLevelsCount - r; 14108 resolution.trx0 = Math.ceil(component.tcx0 / scale); 14109 resolution.try0 = Math.ceil(component.tcy0 / scale); 14110 resolution.trx1 = Math.ceil(component.tcx1 / scale); 14111 resolution.try1 = Math.ceil(component.tcy1 / scale); 14112 resolution.resLevel = r; 14113 buildPrecincts(context, resolution, blocksDimensions); 14114 resolutions.push(resolution); 14115 var subband; 14116 if (r === 0) { 14117 subband = {}; 14118 subband.type = 'LL'; 14119 subband.tbx0 = Math.ceil(component.tcx0 / scale); 14120 subband.tby0 = Math.ceil(component.tcy0 / scale); 14121 subband.tbx1 = Math.ceil(component.tcx1 / scale); 14122 subband.tby1 = Math.ceil(component.tcy1 / scale); 14123 subband.resolution = resolution; 14124 buildCodeblocks(context, subband, blocksDimensions); 14125 subbands.push(subband); 14126 resolution.subbands = [subband]; 14127 } else { 14128 var bscale = 1 << decompositionLevelsCount - r + 1; 14129 var resolutionSubbands = []; 14130 subband = {}; 14131 subband.type = 'HL'; 14132 subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); 14133 subband.tby0 = Math.ceil(component.tcy0 / bscale); 14134 subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); 14135 subband.tby1 = Math.ceil(component.tcy1 / bscale); 14136 subband.resolution = resolution; 14137 buildCodeblocks(context, subband, blocksDimensions); 14138 subbands.push(subband); 14139 resolutionSubbands.push(subband); 14140 subband = {}; 14141 subband.type = 'LH'; 14142 subband.tbx0 = Math.ceil(component.tcx0 / bscale); 14143 subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); 14144 subband.tbx1 = Math.ceil(component.tcx1 / bscale); 14145 subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); 14146 subband.resolution = resolution; 14147 buildCodeblocks(context, subband, blocksDimensions); 14148 subbands.push(subband); 14149 resolutionSubbands.push(subband); 14150 subband = {}; 14151 subband.type = 'HH'; 14152 subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); 14153 subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); 14154 subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); 14155 subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); 14156 subband.resolution = resolution; 14157 buildCodeblocks(context, subband, blocksDimensions); 14158 subbands.push(subband); 14159 resolutionSubbands.push(subband); 14160 resolution.subbands = resolutionSubbands; 14161 } 14162 } 14163 component.resolutions = resolutions; 14164 component.subbands = subbands; 14165 } 14166 var progressionOrder = tile.codingStyleDefaultParameters.progressionOrder; 14167 switch (progressionOrder) { 14168 case 0: 14169 tile.packetsIterator = new LayerResolutionComponentPositionIterator(context); 14170 break; 14171 case 1: 14172 tile.packetsIterator = new ResolutionLayerComponentPositionIterator(context); 14173 break; 14174 case 2: 14175 tile.packetsIterator = new ResolutionPositionComponentLayerIterator(context); 14176 break; 14177 case 3: 14178 tile.packetsIterator = new PositionComponentResolutionLayerIterator(context); 14179 break; 14180 case 4: 14181 tile.packetsIterator = new ComponentPositionResolutionLayerIterator(context); 14182 break; 14183 default: 14184 throw new JpxError('Unsupported progression order ' + progressionOrder); 14185 } 14186 } 14187 function parseTilePackets(context, data, offset, dataLength) { 14188 var position = 0; 14189 var buffer, 14190 bufferSize = 0, 14191 skipNextBit = false; 14192 function readBits(count) { 14193 while (bufferSize < count) { 14194 var b = data[offset + position]; 14195 position++; 14196 if (skipNextBit) { 14197 buffer = buffer << 7 | b; 14198 bufferSize += 7; 14199 skipNextBit = false; 14200 } else { 14201 buffer = buffer << 8 | b; 14202 bufferSize += 8; 14203 } 14204 if (b === 0xFF) { 14205 skipNextBit = true; 14206 } 14207 } 14208 bufferSize -= count; 14209 return buffer >>> bufferSize & (1 << count) - 1; 14210 } 14211 function skipMarkerIfEqual(value) { 14212 if (data[offset + position - 1] === 0xFF && data[offset + position] === value) { 14213 skipBytes(1); 14214 return true; 14215 } else if (data[offset + position] === 0xFF && data[offset + position + 1] === value) { 14216 skipBytes(2); 14217 return true; 14218 } 14219 return false; 14220 } 14221 function skipBytes(count) { 14222 position += count; 14223 } 14224 function alignToByte() { 14225 bufferSize = 0; 14226 if (skipNextBit) { 14227 position++; 14228 skipNextBit = false; 14229 } 14230 } 14231 function readCodingpasses() { 14232 if (readBits(1) === 0) { 14233 return 1; 14234 } 14235 if (readBits(1) === 0) { 14236 return 2; 14237 } 14238 var value = readBits(2); 14239 if (value < 3) { 14240 return value + 3; 14241 } 14242 value = readBits(5); 14243 if (value < 31) { 14244 return value + 6; 14245 } 14246 value = readBits(7); 14247 return value + 37; 14248 } 14249 var tileIndex = context.currentTile.index; 14250 var tile = context.tiles[tileIndex]; 14251 var sopMarkerUsed = context.COD.sopMarkerUsed; 14252 var ephMarkerUsed = context.COD.ephMarkerUsed; 14253 var packetsIterator = tile.packetsIterator; 14254 while (position < dataLength) { 14255 alignToByte(); 14256 if (sopMarkerUsed && skipMarkerIfEqual(0x91)) { 14257 skipBytes(4); 14258 } 14259 var packet = packetsIterator.nextPacket(); 14260 if (!readBits(1)) { 14261 continue; 14262 } 14263 var layerNumber = packet.layerNumber; 14264 var queue = [], 14265 codeblock; 14266 for (var i = 0, ii = packet.codeblocks.length; i < ii; i++) { 14267 codeblock = packet.codeblocks[i]; 14268 var precinct = codeblock.precinct; 14269 var codeblockColumn = codeblock.cbx - precinct.cbxMin; 14270 var codeblockRow = codeblock.cby - precinct.cbyMin; 14271 var codeblockIncluded = false; 14272 var firstTimeInclusion = false; 14273 var valueReady; 14274 if (codeblock['included'] !== undefined) { 14275 codeblockIncluded = !!readBits(1); 14276 } else { 14277 precinct = codeblock.precinct; 14278 var inclusionTree, zeroBitPlanesTree; 14279 if (precinct['inclusionTree'] !== undefined) { 14280 inclusionTree = precinct.inclusionTree; 14281 } else { 14282 var width = precinct.cbxMax - precinct.cbxMin + 1; 14283 var height = precinct.cbyMax - precinct.cbyMin + 1; 14284 inclusionTree = new InclusionTree(width, height, layerNumber); 14285 zeroBitPlanesTree = new TagTree(width, height); 14286 precinct.inclusionTree = inclusionTree; 14287 precinct.zeroBitPlanesTree = zeroBitPlanesTree; 14288 } 14289 if (inclusionTree.reset(codeblockColumn, codeblockRow, layerNumber)) { 14290 while (true) { 14291 if (readBits(1)) { 14292 valueReady = !inclusionTree.nextLevel(); 14293 if (valueReady) { 14294 codeblock.included = true; 14295 codeblockIncluded = firstTimeInclusion = true; 14296 break; 14297 } 14298 } else { 14299 inclusionTree.incrementValue(layerNumber); 14300 break; 14301 } 14302 } 14303 } 14304 } 14305 if (!codeblockIncluded) { 14306 continue; 14307 } 14308 if (firstTimeInclusion) { 14309 zeroBitPlanesTree = precinct.zeroBitPlanesTree; 14310 zeroBitPlanesTree.reset(codeblockColumn, codeblockRow); 14311 while (true) { 14312 if (readBits(1)) { 14313 valueReady = !zeroBitPlanesTree.nextLevel(); 14314 if (valueReady) { 14315 break; 14316 } 14317 } else { 14318 zeroBitPlanesTree.incrementValue(); 14319 } 14320 } 14321 codeblock.zeroBitPlanes = zeroBitPlanesTree.value; 14322 } 14323 var codingpasses = readCodingpasses(); 14324 while (readBits(1)) { 14325 codeblock.Lblock++; 14326 } 14327 var codingpassesLog2 = (0, _util.log2)(codingpasses); 14328 var bits = (codingpasses < 1 << codingpassesLog2 ? codingpassesLog2 - 1 : codingpassesLog2) + codeblock.Lblock; 14329 var codedDataLength = readBits(bits); 14330 queue.push({ 14331 codeblock: codeblock, 14332 codingpasses: codingpasses, 14333 dataLength: codedDataLength 14334 }); 14335 } 14336 alignToByte(); 14337 if (ephMarkerUsed) { 14338 skipMarkerIfEqual(0x92); 14339 } 14340 while (queue.length > 0) { 14341 var packetItem = queue.shift(); 14342 codeblock = packetItem.codeblock; 14343 if (codeblock['data'] === undefined) { 14344 codeblock.data = []; 14345 } 14346 codeblock.data.push({ 14347 data: data, 14348 start: offset + position, 14349 end: offset + position + packetItem.dataLength, 14350 codingpasses: packetItem.codingpasses 14351 }); 14352 position += packetItem.dataLength; 14353 } 14354 } 14355 return position; 14356 } 14357 function copyCoefficients(coefficients, levelWidth, levelHeight, subband, delta, mb, reversible, segmentationSymbolUsed) { 14358 var x0 = subband.tbx0; 14359 var y0 = subband.tby0; 14360 var width = subband.tbx1 - subband.tbx0; 14361 var codeblocks = subband.codeblocks; 14362 var right = subband.type.charAt(0) === 'H' ? 1 : 0; 14363 var bottom = subband.type.charAt(1) === 'H' ? levelWidth : 0; 14364 for (var i = 0, ii = codeblocks.length; i < ii; ++i) { 14365 var codeblock = codeblocks[i]; 14366 var blockWidth = codeblock.tbx1_ - codeblock.tbx0_; 14367 var blockHeight = codeblock.tby1_ - codeblock.tby0_; 14368 if (blockWidth === 0 || blockHeight === 0) { 14369 continue; 14370 } 14371 if (codeblock['data'] === undefined) { 14372 continue; 14373 } 14374 var bitModel, currentCodingpassType; 14375 bitModel = new BitModel(blockWidth, blockHeight, codeblock.subbandType, codeblock.zeroBitPlanes, mb); 14376 currentCodingpassType = 2; 14377 var data = codeblock.data, 14378 totalLength = 0, 14379 codingpasses = 0; 14380 var j, jj, dataItem; 14381 for (j = 0, jj = data.length; j < jj; j++) { 14382 dataItem = data[j]; 14383 totalLength += dataItem.end - dataItem.start; 14384 codingpasses += dataItem.codingpasses; 14385 } 14386 var encodedData = new Uint8Array(totalLength); 14387 var position = 0; 14388 for (j = 0, jj = data.length; j < jj; j++) { 14389 dataItem = data[j]; 14390 var chunk = dataItem.data.subarray(dataItem.start, dataItem.end); 14391 encodedData.set(chunk, position); 14392 position += chunk.length; 14393 } 14394 var decoder = new _arithmetic_decoder.ArithmeticDecoder(encodedData, 0, totalLength); 14395 bitModel.setDecoder(decoder); 14396 for (j = 0; j < codingpasses; j++) { 14397 switch (currentCodingpassType) { 14398 case 0: 14399 bitModel.runSignificancePropagationPass(); 14400 break; 14401 case 1: 14402 bitModel.runMagnitudeRefinementPass(); 14403 break; 14404 case 2: 14405 bitModel.runCleanupPass(); 14406 if (segmentationSymbolUsed) { 14407 bitModel.checkSegmentationSymbol(); 14408 } 14409 break; 14410 } 14411 currentCodingpassType = (currentCodingpassType + 1) % 3; 14412 } 14413 var offset = codeblock.tbx0_ - x0 + (codeblock.tby0_ - y0) * width; 14414 var sign = bitModel.coefficentsSign; 14415 var magnitude = bitModel.coefficentsMagnitude; 14416 var bitsDecoded = bitModel.bitsDecoded; 14417 var magnitudeCorrection = reversible ? 0 : 0.5; 14418 var k, n, nb; 14419 position = 0; 14420 var interleave = subband.type !== 'LL'; 14421 for (j = 0; j < blockHeight; j++) { 14422 var row = offset / width | 0; 14423 var levelOffset = 2 * row * (levelWidth - width) + right + bottom; 14424 for (k = 0; k < blockWidth; k++) { 14425 n = magnitude[position]; 14426 if (n !== 0) { 14427 n = (n + magnitudeCorrection) * delta; 14428 if (sign[position] !== 0) { 14429 n = -n; 14430 } 14431 nb = bitsDecoded[position]; 14432 var pos = interleave ? levelOffset + (offset << 1) : offset; 14433 if (reversible && nb >= mb) { 14434 coefficients[pos] = n; 14435 } else { 14436 coefficients[pos] = n * (1 << mb - nb); 14437 } 14438 } 14439 offset++; 14440 position++; 14441 } 14442 offset += width - blockWidth; 14443 } 14444 } 14445 } 14446 function transformTile(context, tile, c) { 14447 var component = tile.components[c]; 14448 var codingStyleParameters = component.codingStyleParameters; 14449 var quantizationParameters = component.quantizationParameters; 14450 var decompositionLevelsCount = codingStyleParameters.decompositionLevelsCount; 14451 var spqcds = quantizationParameters.SPqcds; 14452 var scalarExpounded = quantizationParameters.scalarExpounded; 14453 var guardBits = quantizationParameters.guardBits;
vendor: 5,607 bytes, lines 14454-14599
14454 var segmentationSymbolUsed = codingStyleParameters.segmentationSymbolUsed; 14455 var precision = context.components[c].precision; 14456 var reversible = codingStyleParameters.reversibleTransformation; 14457 var transform = reversible ? new ReversibleTransform() : new IrreversibleTransform(); 14458 var subbandCoefficients = []; 14459 var b = 0; 14460 for (var i = 0; i <= decompositionLevelsCount; i++) { 14461 var resolution = component.resolutions[i]; 14462 var width = resolution.trx1 - resolution.trx0; 14463 var height = resolution.try1 - resolution.try0; 14464 var coefficients = new Float32Array(width * height); 14465 for (var j = 0, jj = resolution.subbands.length; j < jj; j++) { 14466 var mu, epsilon; 14467 if (!scalarExpounded) { 14468 mu = spqcds[0].mu; 14469 epsilon = spqcds[0].epsilon + (i > 0 ? 1 - i : 0); 14470 } else { 14471 mu = spqcds[b].mu; 14472 epsilon = spqcds[b].epsilon; 14473 b++; 14474 } 14475 var subband = resolution.subbands[j]; 14476 var gainLog2 = SubbandsGainLog2[subband.type]; 14477 var delta = reversible ? 1 : Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048); 14478 var mb = guardBits + epsilon - 1; 14479 copyCoefficients(coefficients, width, height, subband, delta, mb, reversible, segmentationSymbolUsed); 14480 } 14481 subbandCoefficients.push({ 14482 width: width, 14483 height: height, 14484 items: coefficients 14485 }); 14486 } 14487 var result = transform.calculate(subbandCoefficients, component.tcx0, component.tcy0); 14488 return { 14489 left: component.tcx0, 14490 top: component.tcy0, 14491 width: result.width, 14492 height: result.height, 14493 items: result.items 14494 }; 14495 } 14496 function transformComponents(context) { 14497 var siz = context.SIZ; 14498 var components = context.components; 14499 var componentsCount = siz.Csiz; 14500 var resultImages = []; 14501 for (var i = 0, ii = context.tiles.length; i < ii; i++) { 14502 var tile = context.tiles[i]; 14503 var transformedTiles = []; 14504 var c; 14505 for (c = 0; c < componentsCount; c++) { 14506 transformedTiles[c] = transformTile(context, tile, c); 14507 } 14508 var tile0 = transformedTiles[0]; 14509 var out = new Uint8ClampedArray(tile0.items.length * componentsCount); 14510 var result = { 14511 left: tile0.left, 14512 top: tile0.top, 14513 width: tile0.width, 14514 height: tile0.height, 14515 items: out 14516 }; 14517 var shift, offset; 14518 var pos = 0, 14519 j, 14520 jj, 14521 y0, 14522 y1, 14523 y2; 14524 if (tile.codingStyleDefaultParameters.multipleComponentTransform) { 14525 var fourComponents = componentsCount === 4; 14526 var y0items = transformedTiles[0].items; 14527 var y1items = transformedTiles[1].items; 14528 var y2items = transformedTiles[2].items; 14529 var y3items = fourComponents ? transformedTiles[3].items : null; 14530 shift = components[0].precision - 8; 14531 offset = (128 << shift) + 0.5; 14532 var component0 = tile.components[0]; 14533 var alpha01 = componentsCount - 3; 14534 jj = y0items.length; 14535 if (!component0.codingStyleParameters.reversibleTransformation) { 14536 for (j = 0; j < jj; j++, pos += alpha01) { 14537 y0 = y0items[j] + offset; 14538 y1 = y1items[j]; 14539 y2 = y2items[j]; 14540 out[pos++] = y0 + 1.402 * y2 >> shift; 14541 out[pos++] = y0 - 0.34413 * y1 - 0.71414 * y2 >> shift; 14542 out[pos++] = y0 + 1.772 * y1 >> shift; 14543 } 14544 } else { 14545 for (j = 0; j < jj; j++, pos += alpha01) { 14546 y0 = y0items[j] + offset; 14547 y1 = y1items[j]; 14548 y2 = y2items[j]; 14549 var g = y0 - (y2 + y1 >> 2); 14550 out[pos++] = g + y2 >> shift; 14551 out[pos++] = g >> shift; 14552 out[pos++] = g + y1 >> shift; 14553 } 14554 } 14555 if (fourComponents) { 14556 for (j = 0, pos = 3; j < jj; j++, pos += 4) { 14557 out[pos] = y3items[j] + offset >> shift; 14558 } 14559 } 14560 } else { 14561 for (c = 0; c < componentsCount; c++) { 14562 var items = transformedTiles[c].items; 14563 shift = components[c].precision - 8; 14564 offset = (128 << shift) + 0.5; 14565 for (pos = c, j = 0, jj = items.length; j < jj; j++) { 14566 out[pos] = items[j] + offset >> shift; 14567 pos += componentsCount; 14568 } 14569 } 14570 } 14571 resultImages.push(result); 14572 } 14573 return resultImages; 14574 } 14575 function initializeTile(context, tileIndex) { 14576 var siz = context.SIZ; 14577 var componentsCount = siz.Csiz; 14578 var tile = context.tiles[tileIndex]; 14579 for (var c = 0; c < componentsCount; c++) { 14580 var component = tile.components[c]; 14581 var qcdOrQcc = context.currentTile.QCC[c] !== undefined ? context.currentTile.QCC[c] : context.currentTile.QCD; 14582 component.quantizationParameters = qcdOrQcc; 14583 var codOrCoc = context.currentTile.COC[c] !== undefined ? context.currentTile.COC[c] : context.currentTile.COD; 14584 component.codingStyleParameters = codOrCoc; 14585 } 14586 tile.codingStyleDefaultParameters = context.currentTile.COD; 14587 } 14588 var TagTree = function TagTreeClosure() { 14589 function TagTree(width, height) { 14590 var levelsLength = (0, _util.log2)(Math.max(width, height)) + 1; 14591 this.levels = []; 14592 for (var i = 0; i < levelsLength; i++) { 14593 var level = { 14594 width: width, 14595 height: height, 14596 items: [] 14597 }; 14598 this.levels.push(level); 14599 width = Math.ceil(width / 2);
vendor: 21,005 bytes, lines 14600-15116
14600 height = Math.ceil(height / 2); 14601 } 14602 } 14603 TagTree.prototype = { 14604 reset: function TagTree_reset(i, j) { 14605 var currentLevel = 0, 14606 value = 0, 14607 level; 14608 while (currentLevel < this.levels.length) { 14609 level = this.levels[currentLevel]; 14610 var index = i + j * level.width; 14611 if (level.items[index] !== undefined) { 14612 value = level.items[index]; 14613 break; 14614 } 14615 level.index = index; 14616 i >>= 1; 14617 j >>= 1; 14618 currentLevel++; 14619 } 14620 currentLevel--; 14621 level = this.levels[currentLevel]; 14622 level.items[level.index] = value; 14623 this.currentLevel = currentLevel; 14624 delete this.value; 14625 }, 14626 incrementValue: function TagTree_incrementValue() { 14627 var level = this.levels[this.currentLevel]; 14628 level.items[level.index]++; 14629 }, 14630 nextLevel: function TagTree_nextLevel() { 14631 var currentLevel = this.currentLevel; 14632 var level = this.levels[currentLevel]; 14633 var value = level.items[level.index]; 14634 currentLevel--; 14635 if (currentLevel < 0) { 14636 this.value = value; 14637 return false; 14638 } 14639 this.currentLevel = currentLevel; 14640 level = this.levels[currentLevel]; 14641 level.items[level.index] = value; 14642 return true; 14643 } 14644 }; 14645 return TagTree; 14646 }(); 14647 var InclusionTree = function InclusionTreeClosure() { 14648 function InclusionTree(width, height, defaultValue) { 14649 var levelsLength = (0, _util.log2)(Math.max(width, height)) + 1; 14650 this.levels = []; 14651 for (var i = 0; i < levelsLength; i++) { 14652 var items = new Uint8Array(width * height); 14653 for (var j = 0, jj = items.length; j < jj; j++) { 14654 items[j] = defaultValue; 14655 } 14656 var level = { 14657 width: width, 14658 height: height, 14659 items: items 14660 }; 14661 this.levels.push(level); 14662 width = Math.ceil(width / 2); 14663 height = Math.ceil(height / 2); 14664 } 14665 } 14666 InclusionTree.prototype = { 14667 reset: function InclusionTree_reset(i, j, stopValue) { 14668 var currentLevel = 0; 14669 while (currentLevel < this.levels.length) { 14670 var level = this.levels[currentLevel]; 14671 var index = i + j * level.width; 14672 level.index = index; 14673 var value = level.items[index]; 14674 if (value === 0xFF) { 14675 break; 14676 } 14677 if (value > stopValue) { 14678 this.currentLevel = currentLevel; 14679 this.propagateValues(); 14680 return false; 14681 } 14682 i >>= 1; 14683 j >>= 1; 14684 currentLevel++; 14685 } 14686 this.currentLevel = currentLevel - 1; 14687 return true; 14688 }, 14689 incrementValue: function InclusionTree_incrementValue(stopValue) { 14690 var level = this.levels[this.currentLevel]; 14691 level.items[level.index] = stopValue + 1; 14692 this.propagateValues(); 14693 }, 14694 propagateValues: function InclusionTree_propagateValues() { 14695 var levelIndex = this.currentLevel; 14696 var level = this.levels[levelIndex]; 14697 var currentValue = level.items[level.index]; 14698 while (--levelIndex >= 0) { 14699 level = this.levels[levelIndex]; 14700 level.items[level.index] = currentValue; 14701 } 14702 }, 14703 nextLevel: function InclusionTree_nextLevel() { 14704 var currentLevel = this.currentLevel; 14705 var level = this.levels[currentLevel]; 14706 var value = level.items[level.index]; 14707 level.items[level.index] = 0xFF; 14708 currentLevel--; 14709 if (currentLevel < 0) { 14710 return false; 14711 } 14712 this.currentLevel = currentLevel; 14713 level = this.levels[currentLevel]; 14714 level.items[level.index] = value; 14715 return true; 14716 } 14717 }; 14718 return InclusionTree; 14719 }(); 14720 var BitModel = function BitModelClosure() { 14721 var UNIFORM_CONTEXT = 17; 14722 var RUNLENGTH_CONTEXT = 18; 14723 var LLAndLHContextsLabel = new Uint8Array([0, 5, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 1, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8]); 14724 var HLContextLabel = new Uint8Array([0, 3, 4, 0, 5, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 1, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8]); 14725 var HHContextLabel = new Uint8Array([0, 1, 2, 0, 1, 2, 2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 3, 4, 5, 0, 4, 5, 5, 0, 5, 5, 5, 0, 0, 0, 0, 0, 6, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 0, 8, 8, 8, 0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 0, 8, 8, 8]); 14726 function BitModel(width, height, subband, zeroBitPlanes, mb) { 14727 this.width = width; 14728 this.height = height; 14729 this.contextLabelTable = subband === 'HH' ? HHContextLabel : subband === 'HL' ? HLContextLabel : LLAndLHContextsLabel; 14730 var coefficientCount = width * height; 14731 this.neighborsSignificance = new Uint8Array(coefficientCount); 14732 this.coefficentsSign = new Uint8Array(coefficientCount); 14733 this.coefficentsMagnitude = mb > 14 ? new Uint32Array(coefficientCount) : mb > 6 ? new Uint16Array(coefficientCount) : new Uint8Array(coefficientCount); 14734 this.processingFlags = new Uint8Array(coefficientCount); 14735 var bitsDecoded = new Uint8Array(coefficientCount); 14736 if (zeroBitPlanes !== 0) { 14737 for (var i = 0; i < coefficientCount; i++) { 14738 bitsDecoded[i] = zeroBitPlanes; 14739 } 14740 } 14741 this.bitsDecoded = bitsDecoded; 14742 this.reset(); 14743 } 14744 BitModel.prototype = { 14745 setDecoder: function BitModel_setDecoder(decoder) { 14746 this.decoder = decoder; 14747 }, 14748 reset: function BitModel_reset() { 14749 this.contexts = new Int8Array(19); 14750 this.contexts[0] = 4 << 1 | 0; 14751 this.contexts[UNIFORM_CONTEXT] = 46 << 1 | 0; 14752 this.contexts[RUNLENGTH_CONTEXT] = 3 << 1 | 0; 14753 }, 14754 setNeighborsSignificance: function BitModel_setNeighborsSignificance(row, column, index) { 14755 var neighborsSignificance = this.neighborsSignificance; 14756 var width = this.width, 14757 height = this.height; 14758 var left = column > 0; 14759 var right = column + 1 < width; 14760 var i; 14761 if (row > 0) { 14762 i = index - width; 14763 if (left) { 14764 neighborsSignificance[i - 1] += 0x10; 14765 } 14766 if (right) { 14767 neighborsSignificance[i + 1] += 0x10; 14768 } 14769 neighborsSignificance[i] += 0x04; 14770 } 14771 if (row + 1 < height) { 14772 i = index + width; 14773 if (left) { 14774 neighborsSignificance[i - 1] += 0x10; 14775 } 14776 if (right) { 14777 neighborsSignificance[i + 1] += 0x10; 14778 } 14779 neighborsSignificance[i] += 0x04; 14780 } 14781 if (left) { 14782 neighborsSignificance[index - 1] += 0x01; 14783 } 14784 if (right) { 14785 neighborsSignificance[index + 1] += 0x01; 14786 } 14787 neighborsSignificance[index] |= 0x80; 14788 }, 14789 runSignificancePropagationPass: function BitModel_runSignificancePropagationPass() { 14790 var decoder = this.decoder; 14791 var width = this.width, 14792 height = this.height; 14793 var coefficentsMagnitude = this.coefficentsMagnitude; 14794 var coefficentsSign = this.coefficentsSign; 14795 var neighborsSignificance = this.neighborsSignificance; 14796 var processingFlags = this.processingFlags; 14797 var contexts = this.contexts; 14798 var labels = this.contextLabelTable; 14799 var bitsDecoded = this.bitsDecoded; 14800 var processedInverseMask = ~1; 14801 var processedMask = 1; 14802 var firstMagnitudeBitMask = 2; 14803 for (var i0 = 0; i0 < height; i0 += 4) { 14804 for (var j = 0; j < width; j++) { 14805 var index = i0 * width + j; 14806 for (var i1 = 0; i1 < 4; i1++, index += width) { 14807 var i = i0 + i1; 14808 if (i >= height) { 14809 break; 14810 } 14811 processingFlags[index] &= processedInverseMask; 14812 if (coefficentsMagnitude[index] || !neighborsSignificance[index]) { 14813 continue; 14814 } 14815 var contextLabel = labels[neighborsSignificance[index]]; 14816 var decision = decoder.readBit(contexts, contextLabel); 14817 if (decision) { 14818 var sign = this.decodeSignBit(i, j, index); 14819 coefficentsSign[index] = sign; 14820 coefficentsMagnitude[index] = 1; 14821 this.setNeighborsSignificance(i, j, index); 14822 processingFlags[index] |= firstMagnitudeBitMask; 14823 } 14824 bitsDecoded[index]++; 14825 processingFlags[index] |= processedMask; 14826 } 14827 } 14828 } 14829 }, 14830 decodeSignBit: function BitModel_decodeSignBit(row, column, index) { 14831 var width = this.width, 14832 height = this.height; 14833 var coefficentsMagnitude = this.coefficentsMagnitude; 14834 var coefficentsSign = this.coefficentsSign; 14835 var contribution, sign0, sign1, significance1; 14836 var contextLabel, decoded; 14837 significance1 = column > 0 && coefficentsMagnitude[index - 1] !== 0; 14838 if (column + 1 < width && coefficentsMagnitude[index + 1] !== 0) { 14839 sign1 = coefficentsSign[index + 1]; 14840 if (significance1) { 14841 sign0 = coefficentsSign[index - 1]; 14842 contribution = 1 - sign1 - sign0; 14843 } else { 14844 contribution = 1 - sign1 - sign1; 14845 } 14846 } else if (significance1) { 14847 sign0 = coefficentsSign[index - 1]; 14848 contribution = 1 - sign0 - sign0; 14849 } else { 14850 contribution = 0; 14851 } 14852 var horizontalContribution = 3 * contribution; 14853 significance1 = row > 0 && coefficentsMagnitude[index - width] !== 0; 14854 if (row + 1 < height && coefficentsMagnitude[index + width] !== 0) { 14855 sign1 = coefficentsSign[index + width]; 14856 if (significance1) { 14857 sign0 = coefficentsSign[index - width]; 14858 contribution = 1 - sign1 - sign0 + horizontalContribution; 14859 } else { 14860 contribution = 1 - sign1 - sign1 + horizontalContribution; 14861 } 14862 } else if (significance1) { 14863 sign0 = coefficentsSign[index - width]; 14864 contribution = 1 - sign0 - sign0 + horizontalContribution; 14865 } else { 14866 contribution = horizontalContribution; 14867 } 14868 if (contribution >= 0) { 14869 contextLabel = 9 + contribution; 14870 decoded = this.decoder.readBit(this.contexts, contextLabel); 14871 } else { 14872 contextLabel = 9 - contribution; 14873 decoded = this.decoder.readBit(this.contexts, contextLabel) ^ 1; 14874 } 14875 return decoded; 14876 }, 14877 runMagnitudeRefinementPass: function BitModel_runMagnitudeRefinementPass() { 14878 var decoder = this.decoder; 14879 var width = this.width, 14880 height = this.height; 14881 var coefficentsMagnitude = this.coefficentsMagnitude; 14882 var neighborsSignificance = this.neighborsSignificance; 14883 var contexts = this.contexts; 14884 var bitsDecoded = this.bitsDecoded; 14885 var processingFlags = this.processingFlags; 14886 var processedMask = 1; 14887 var firstMagnitudeBitMask = 2; 14888 var length = width * height; 14889 var width4 = width * 4; 14890 for (var index0 = 0, indexNext; index0 < length; index0 = indexNext) { 14891 indexNext = Math.min(length, index0 + width4); 14892 for (var j = 0; j < width; j++) { 14893 for (var index = index0 + j; index < indexNext; index += width) { 14894 if (!coefficentsMagnitude[index] || (processingFlags[index] & processedMask) !== 0) { 14895 continue; 14896 } 14897 var contextLabel = 16; 14898 if ((processingFlags[index] & firstMagnitudeBitMask) !== 0) { 14899 processingFlags[index] ^= firstMagnitudeBitMask; 14900 var significance = neighborsSignificance[index] & 127; 14901 contextLabel = significance === 0 ? 15 : 14; 14902 } 14903 var bit = decoder.readBit(contexts, contextLabel); 14904 coefficentsMagnitude[index] = coefficentsMagnitude[index] << 1 | bit; 14905 bitsDecoded[index]++; 14906 processingFlags[index] |= processedMask; 14907 } 14908 } 14909 } 14910 }, 14911 runCleanupPass: function BitModel_runCleanupPass() { 14912 var decoder = this.decoder; 14913 var width = this.width, 14914 height = this.height; 14915 var neighborsSignificance = this.neighborsSignificance; 14916 var coefficentsMagnitude = this.coefficentsMagnitude; 14917 var coefficentsSign = this.coefficentsSign; 14918 var contexts = this.contexts; 14919 var labels = this.contextLabelTable; 14920 var bitsDecoded = this.bitsDecoded; 14921 var processingFlags = this.processingFlags; 14922 var processedMask = 1; 14923 var firstMagnitudeBitMask = 2; 14924 var oneRowDown = width; 14925 var twoRowsDown = width * 2; 14926 var threeRowsDown = width * 3; 14927 var iNext; 14928 for (var i0 = 0; i0 < height; i0 = iNext) { 14929 iNext = Math.min(i0 + 4, height); 14930 var indexBase = i0 * width; 14931 var checkAllEmpty = i0 + 3 < height; 14932 for (var j = 0; j < width; j++) { 14933 var index0 = indexBase + j; 14934 var allEmpty = checkAllEmpty && processingFlags[index0] === 0 && processingFlags[index0 + oneRowDown] === 0 && processingFlags[index0 + twoRowsDown] === 0 && processingFlags[index0 + threeRowsDown] === 0 && neighborsSignificance[index0] === 0 && neighborsSignificance[index0 + oneRowDown] === 0 && neighborsSignificance[index0 + twoRowsDown] === 0 && neighborsSignificance[index0 + threeRowsDown] === 0; 14935 var i1 = 0, 14936 index = index0; 14937 var i = i0, 14938 sign; 14939 if (allEmpty) { 14940 var hasSignificantCoefficent = decoder.readBit(contexts, RUNLENGTH_CONTEXT); 14941 if (!hasSignificantCoefficent) { 14942 bitsDecoded[index0]++; 14943 bitsDecoded[index0 + oneRowDown]++; 14944 bitsDecoded[index0 + twoRowsDown]++; 14945 bitsDecoded[index0 + threeRowsDown]++; 14946 continue; 14947 } 14948 i1 = decoder.readBit(contexts, UNIFORM_CONTEXT) << 1 | decoder.readBit(contexts, UNIFORM_CONTEXT); 14949 if (i1 !== 0) { 14950 i = i0 + i1; 14951 index += i1 * width; 14952 } 14953 sign = this.decodeSignBit(i, j, index); 14954 coefficentsSign[index] = sign; 14955 coefficentsMagnitude[index] = 1; 14956 this.setNeighborsSignificance(i, j, index); 14957 processingFlags[index] |= firstMagnitudeBitMask; 14958 index = index0; 14959 for (var i2 = i0; i2 <= i; i2++, index += width) { 14960 bitsDecoded[index]++; 14961 } 14962 i1++; 14963 } 14964 for (i = i0 + i1; i < iNext; i++, index += width) { 14965 if (coefficentsMagnitude[index] || (processingFlags[index] & processedMask) !== 0) { 14966 continue; 14967 } 14968 var contextLabel = labels[neighborsSignificance[index]]; 14969 var decision = decoder.readBit(contexts, contextLabel); 14970 if (decision === 1) { 14971 sign = this.decodeSignBit(i, j, index); 14972 coefficentsSign[index] = sign; 14973 coefficentsMagnitude[index] = 1; 14974 this.setNeighborsSignificance(i, j, index); 14975 processingFlags[index] |= firstMagnitudeBitMask; 14976 } 14977 bitsDecoded[index]++; 14978 } 14979 } 14980 } 14981 }, 14982 checkSegmentationSymbol: function BitModel_checkSegmentationSymbol() { 14983 var decoder = this.decoder; 14984 var contexts = this.contexts; 14985 var symbol = decoder.readBit(contexts, UNIFORM_CONTEXT) << 3 | decoder.readBit(contexts, UNIFORM_CONTEXT) << 2 | decoder.readBit(contexts, UNIFORM_CONTEXT) << 1 | decoder.readBit(contexts, UNIFORM_CONTEXT); 14986 if (symbol !== 0xA) { 14987 throw new JpxError('Invalid segmentation symbol'); 14988 } 14989 } 14990 }; 14991 return BitModel; 14992 }(); 14993 var Transform = function TransformClosure() { 14994 function Transform() {} 14995 Transform.prototype.calculate = function transformCalculate(subbands, u0, v0) { 14996 var ll = subbands[0]; 14997 for (var i = 1, ii = subbands.length; i < ii; i++) { 14998 ll = this.iterate(ll, subbands[i], u0, v0); 14999 } 15000 return ll; 15001 }; 15002 Transform.prototype.extend = function extend(buffer, offset, size) { 15003 var i1 = offset - 1, 15004 j1 = offset + 1; 15005 var i2 = offset + size - 2, 15006 j2 = offset + size; 15007 buffer[i1--] = buffer[j1++]; 15008 buffer[j2++] = buffer[i2--]; 15009 buffer[i1--] = buffer[j1++]; 15010 buffer[j2++] = buffer[i2--]; 15011 buffer[i1--] = buffer[j1++]; 15012 buffer[j2++] = buffer[i2--]; 15013 buffer[i1] = buffer[j1]; 15014 buffer[j2] = buffer[i2]; 15015 }; 15016 Transform.prototype.iterate = function Transform_iterate(ll, hl_lh_hh, u0, v0) { 15017 var llWidth = ll.width, 15018 llHeight = ll.height, 15019 llItems = ll.items; 15020 var width = hl_lh_hh.width; 15021 var height = hl_lh_hh.height; 15022 var items = hl_lh_hh.items; 15023 var i, j, k, l, u, v; 15024 for (k = 0, i = 0; i < llHeight; i++) { 15025 l = i * 2 * width; 15026 for (j = 0; j < llWidth; j++, k++, l += 2) { 15027 items[l] = llItems[k]; 15028 } 15029 } 15030 llItems = ll.items = null; 15031 var bufferPadding = 4; 15032 var rowBuffer = new Float32Array(width + 2 * bufferPadding); 15033 if (width === 1) { 15034 if ((u0 & 1) !== 0) { 15035 for (v = 0, k = 0; v < height; v++, k += width) { 15036 items[k] *= 0.5; 15037 } 15038 } 15039 } else { 15040 for (v = 0, k = 0; v < height; v++, k += width) { 15041 rowBuffer.set(items.subarray(k, k + width), bufferPadding); 15042 this.extend(rowBuffer, bufferPadding, width); 15043 this.filter(rowBuffer, bufferPadding, width); 15044 items.set(rowBuffer.subarray(bufferPadding, bufferPadding + width), k); 15045 } 15046 } 15047 var numBuffers = 16; 15048 var colBuffers = []; 15049 for (i = 0; i < numBuffers; i++) { 15050 colBuffers.push(new Float32Array(height + 2 * bufferPadding)); 15051 } 15052 var b, 15053 currentBuffer = 0; 15054 ll = bufferPadding + height; 15055 if (height === 1) { 15056 if ((v0 & 1) !== 0) { 15057 for (u = 0; u < width; u++) { 15058 items[u] *= 0.5; 15059 } 15060 } 15061 } else { 15062 for (u = 0; u < width; u++) { 15063 if (currentBuffer === 0) { 15064 numBuffers = Math.min(width - u, numBuffers); 15065 for (k = u, l = bufferPadding; l < ll; k += width, l++) { 15066 for (b = 0; b < numBuffers; b++) { 15067 colBuffers[b][l] = items[k + b]; 15068 } 15069 } 15070 currentBuffer = numBuffers; 15071 } 15072 currentBuffer--; 15073 var buffer = colBuffers[currentBuffer]; 15074 this.extend(buffer, bufferPadding, height); 15075 this.filter(buffer, bufferPadding, height); 15076 if (currentBuffer === 0) { 15077 k = u - numBuffers + 1; 15078 for (l = bufferPadding; l < ll; k += width, l++) { 15079 for (b = 0; b < numBuffers; b++) { 15080 items[k + b] = colBuffers[b][l]; 15081 } 15082 } 15083 } 15084 } 15085 } 15086 return { 15087 width: width, 15088 height: height, 15089 items: items 15090 }; 15091 }; 15092 return Transform; 15093 }(); 15094 var IrreversibleTransform = function IrreversibleTransformClosure() { 15095 function IrreversibleTransform() { 15096 Transform.call(this); 15097 } 15098 IrreversibleTransform.prototype = Object.create(Transform.prototype); 15099 IrreversibleTransform.prototype.filter = function irreversibleTransformFilter(x, offset, length) { 15100 var len = length >> 1; 15101 offset = offset | 0; 15102 var j, n, current, next; 15103 var alpha = -1.586134342059924; 15104 var beta = -0.052980118572961; 15105 var gamma = 0.882911075530934; 15106 var delta = 0.443506852043971; 15107 var K = 1.230174104914001; 15108 var K_ = 1 / K; 15109 j = offset - 3; 15110 for (n = len + 4; n--; j += 2) { 15111 x[j] *= K_; 15112 } 15113 j = offset - 2; 15114 current = delta * x[j - 1]; 15115 for (n = len + 3; n--; j += 2) { 15116 next = delta * x[j + 1];
vendor: 2,001 bytes, lines 15117-15189
15117 x[j] = K * x[j] - current - next; 15118 if (n--) { 15119 j += 2; 15120 current = delta * x[j + 1]; 15121 x[j] = K * x[j] - current - next; 15122 } else { 15123 break; 15124 } 15125 } 15126 j = offset - 1; 15127 current = gamma * x[j - 1]; 15128 for (n = len + 2; n--; j += 2) { 15129 next = gamma * x[j + 1]; 15130 x[j] -= current + next; 15131 if (n--) { 15132 j += 2; 15133 current = gamma * x[j + 1]; 15134 x[j] -= current + next; 15135 } else { 15136 break; 15137 } 15138 } 15139 j = offset; 15140 current = beta * x[j - 1]; 15141 for (n = len + 1; n--; j += 2) { 15142 next = beta * x[j + 1]; 15143 x[j] -= current + next; 15144 if (n--) { 15145 j += 2; 15146 current = beta * x[j + 1]; 15147 x[j] -= current + next; 15148 } else { 15149 break; 15150 } 15151 } 15152 if (len !== 0) { 15153 j = offset + 1; 15154 current = alpha * x[j - 1]; 15155 for (n = len; n--; j += 2) { 15156 next = alpha * x[j + 1]; 15157 x[j] -= current + next; 15158 if (n--) { 15159 j += 2; 15160 current = alpha * x[j + 1]; 15161 x[j] -= current + next; 15162 } else { 15163 break; 15164 } 15165 } 15166 } 15167 }; 15168 return IrreversibleTransform; 15169 }(); 15170 var ReversibleTransform = function ReversibleTransformClosure() { 15171 function ReversibleTransform() { 15172 Transform.call(this); 15173 } 15174 ReversibleTransform.prototype = Object.create(Transform.prototype); 15175 ReversibleTransform.prototype.filter = function reversibleTransformFilter(x, offset, length) { 15176 var len = length >> 1; 15177 offset = offset | 0; 15178 var j, n; 15179 for (j = offset, n = len + 1; n--; j += 2) { 15180 x[j] -= x[j - 1] + x[j + 1] + 2 >> 2; 15181 } 15182 for (j = offset + 1, n = len; n--; j += 2) { 15183 x[j] += x[j - 1] + x[j + 1] >> 1; 15184 } 15185 }; 15186 return ReversibleTransform; 15187 }(); 15188 return JpxImage; 15189}();
15190exports.JpxImage = JpxImage; 15191 15192/***/ }), 15193/* 67 */ 15194/***/ (function(module, exports, __w_pdfjs_require__) { 15195 15196"use strict"; 15197 15198 15199Object.defineProperty(exports, "__esModule", { 15200 value: true 15201}); 15202exports.calculateSHA512 = exports.calculateSHA384 = exports.calculateSHA256 = exports.calculateMD5 = exports.PDF20 = exports.PDF17 = exports.CipherTransformFactory = exports.ARCFourCipher = exports.AES256Cipher = exports.AES128Cipher = undefined; 15203 15204var _util = __w_pdfjs_require__(0); 15205 15206var _primitives = __w_pdfjs_require__(1); 15207 15208var _stream = __w_pdfjs_require__(2); 15209 15210var ARCFourCipher = function ARCFourCipherClosure() { 15211 function ARCFourCipher(key) { 15212 this.a = 0; 15213 this.b = 0; 15214 var s = new Uint8Array(256); 15215 var i, 15216 j = 0, 15217 tmp, 15218 keyLength = key.length; 15219 for (i = 0; i < 256; ++i) { 15220 s[i] = i; 15221 } 15222 for (i = 0; i < 256; ++i) { 15223 tmp = s[i]; 15224 j = j + tmp + key[i % keyLength] & 0xFF; 15225 s[i] = s[j]; 15226 s[j] = tmp; 15227 } 15228 this.s = s; 15229 } 15230 ARCFourCipher.prototype = { 15231 encryptBlock: function ARCFourCipher_encryptBlock(data) { 15232 var i, 15233 n = data.length, 15234 tmp, 15235 tmp2; 15236 var a = this.a, 15237 b = this.b, 15238 s = this.s; 15239 var output = new Uint8Array(n); 15240 for (i = 0; i < n; ++i) { 15241 a = a + 1 & 0xFF; 15242 tmp = s[a]; 15243 b = b + tmp & 0xFF; 15244 tmp2 = s[b]; 15245 s[a] = tmp2; 15246 s[b] = tmp; 15247 output[i] = data[i] ^ s[tmp + tmp2 & 0xFF]; 15248 } 15249 this.a = a; 15250 this.b = b; 15251 return output; 15252 } 15253 }; 15254 ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock; 15255 return ARCFourCipher; 15256}(); 15257var calculateMD5 = function calculateMD5Closure() { 15258 var r = new Uint8Array([7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]); 15259 var k = new Int32Array([-680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, -145523070, -1120210379, 718787259, -343485551]); 15260 function hash(data, offset, length) { 15261 var h0 = 1732584193, 15262 h1 = -271733879, 15263 h2 = -1732584194, 15264 h3 = 271733878; 15265 var paddedLength = length + 72 & ~63; 15266 var padded = new Uint8Array(paddedLength); 15267 var i, j, n; 15268 for (i = 0; i < length; ++i) { 15269 padded[i] = data[offset++]; 15270 } 15271 padded[i++] = 0x80; 15272 n = paddedLength - 8; 15273 while (i < n) { 15274 padded[i++] = 0; 15275 } 15276 padded[i++] = length << 3 & 0xFF; 15277 padded[i++] = length >> 5 & 0xFF; 15278 padded[i++] = length >> 13 & 0xFF; 15279 padded[i++] = length >> 21 & 0xFF; 15280 padded[i++] = length >>> 29 & 0xFF; 15281 padded[i++] = 0; 15282 padded[i++] = 0; 15283 padded[i++] = 0; 15284 var w = new Int32Array(16); 15285 for (i = 0; i < paddedLength;) { 15286 for (j = 0; j < 16; ++j, i += 4) { 15287 w[j] = padded[i] | padded[i + 1] << 8 | padded[i + 2] << 16 | padded[i + 3] << 24; 15288 } 15289 var a = h0, 15290 b = h1, 15291 c = h2, 15292 d = h3, 15293 f, 15294 g; 15295 for (j = 0; j < 64; ++j) { 15296 if (j < 16) { 15297 f = b & c | ~b & d; 15298 g = j; 15299 } else if (j < 32) { 15300 f = d & b | ~d & c; 15301 g = 5 * j + 1 & 15; 15302 } else if (j < 48) { 15303 f = b ^ c ^ d; 15304 g = 3 * j + 5 & 15; 15305 } else { 15306 f = c ^ (b | ~d); 15307 g = 7 * j & 15; 15308 } 15309 var tmp = d, 15310 rotateArg = a + f + k[j] + w[g] | 0, 15311 rotate = r[j]; 15312 d = c; 15313 c = b; 15314 b = b + (rotateArg << rotate | rotateArg >>> 32 - rotate) | 0; 15315 a = tmp; 15316 } 15317 h0 = h0 + a | 0; 15318 h1 = h1 + b | 0; 15319 h2 = h2 + c | 0; 15320 h3 = h3 + d | 0; 15321 } 15322 return new Uint8Array([h0 & 0xFF, h0 >> 8 & 0xFF, h0 >> 16 & 0xFF, h0 >>> 24 & 0xFF, h1 & 0xFF, h1 >> 8 & 0xFF, h1 >> 16 & 0xFF, h1 >>> 24 & 0xFF, h2 & 0xFF, h2 >> 8 & 0xFF, h2 >> 16 & 0xFF, h2 >>> 24 & 0xFF, h3 & 0xFF, h3 >> 8 & 0xFF, h3 >> 16 & 0xFF, h3 >>> 24 & 0xFF]); 15323 } 15324 return hash; 15325}(); 15326var Word64 = function Word64Closure() { 15327 function Word64(highInteger, lowInteger) { 15328 this.high = highInteger | 0; 15329 this.low = lowInteger | 0; 15330 } 15331 Word64.prototype = { 15332 and: function Word64_and(word) { 15333 this.high &= word.high; 15334 this.low &= word.low; 15335 }, 15336 xor: function Word64_xor(word) { 15337 this.high ^= word.high; 15338 this.low ^= word.low; 15339 }, 15340 or: function Word64_or(word) { 15341 this.high |= word.high; 15342 this.low |= word.low; 15343 }, 15344 shiftRight: function Word64_shiftRight(places) { 15345 if (places >= 32) { 15346 this.low = this.high >>> places - 32 | 0; 15347 this.high = 0; 15348 } else { 15349 this.low = this.low >>> places | this.high << 32 - places; 15350 this.high = this.high >>> places | 0; 15351 } 15352 }, 15353 shiftLeft: function Word64_shiftLeft(places) { 15354 if (places >= 32) { 15355 this.high = this.low << places - 32; 15356 this.low = 0; 15357 } else { 15358 this.high = this.high << places | this.low >>> 32 - places; 15359 this.low = this.low << places; 15360 } 15361 }, 15362 rotateRight: function Word64_rotateRight(places) { 15363 var low, high; 15364 if (places & 32) { 15365 high = this.low; 15366 low = this.high; 15367 } else { 15368 low = this.low; 15369 high = this.high; 15370 } 15371 places &= 31; 15372 this.low = low >>> places | high << 32 - places; 15373 this.high = high >>> places | low << 32 - places; 15374 }, 15375 not: function Word64_not() { 15376 this.high = ~this.high; 15377 this.low = ~this.low; 15378 }, 15379 add: function Word64_add(word) { 15380 var lowAdd = (this.low >>> 0) + (word.low >>> 0); 15381 var highAdd = (this.high >>> 0) + (word.high >>> 0); 15382 if (lowAdd > 0xFFFFFFFF) { 15383 highAdd += 1; 15384 } 15385 this.low = lowAdd | 0; 15386 this.high = highAdd | 0; 15387 }, 15388 copyTo: function Word64_copyTo(bytes, offset) { 15389 bytes[offset] = this.high >>> 24 & 0xFF; 15390 bytes[offset + 1] = this.high >> 16 & 0xFF; 15391 bytes[offset + 2] = this.high >> 8 & 0xFF; 15392 bytes[offset + 3] = this.high & 0xFF; 15393 bytes[offset + 4] = this.low >>> 24 & 0xFF; 15394 bytes[offset + 5] = this.low >> 16 & 0xFF; 15395 bytes[offset + 6] = this.low >> 8 & 0xFF; 15396 bytes[offset + 7] = this.low & 0xFF; 15397 }, 15398 assign: function Word64_assign(word) { 15399 this.high = word.high; 15400 this.low = word.low; 15401 } 15402 }; 15403 return Word64; 15404}();
vendor: 5,344 bytes, lines 15405-15559
15405var calculateSHA256 = function calculateSHA256Closure() { 15406 function rotr(x, n) { 15407 return x >>> n | x << 32 - n; 15408 } 15409 function ch(x, y, z) { 15410 return x & y ^ ~x & z; 15411 } 15412 function maj(x, y, z) { 15413 return x & y ^ x & z ^ y & z; 15414 } 15415 function sigma(x) { 15416 return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22); 15417 } 15418 function sigmaPrime(x) { 15419 return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); 15420 } 15421 function littleSigma(x) { 15422 return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3; 15423 } 15424 function littleSigmaPrime(x) { 15425 return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10; 15426 } 15427 var k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; 15428 function hash(data, offset, length) { 15429 var h0 = 0x6a09e667, 15430 h1 = 0xbb67ae85, 15431 h2 = 0x3c6ef372, 15432 h3 = 0xa54ff53a, 15433 h4 = 0x510e527f, 15434 h5 = 0x9b05688c, 15435 h6 = 0x1f83d9ab, 15436 h7 = 0x5be0cd19; 15437 var paddedLength = Math.ceil((length + 9) / 64) * 64; 15438 var padded = new Uint8Array(paddedLength); 15439 var i, j, n; 15440 for (i = 0; i < length; ++i) { 15441 padded[i] = data[offset++]; 15442 } 15443 padded[i++] = 0x80; 15444 n = paddedLength - 8; 15445 while (i < n) { 15446 padded[i++] = 0; 15447 } 15448 padded[i++] = 0; 15449 padded[i++] = 0; 15450 padded[i++] = 0; 15451 padded[i++] = length >>> 29 & 0xFF; 15452 padded[i++] = length >> 21 & 0xFF; 15453 padded[i++] = length >> 13 & 0xFF; 15454 padded[i++] = length >> 5 & 0xFF; 15455 padded[i++] = length << 3 & 0xFF; 15456 var w = new Uint32Array(64); 15457 for (i = 0; i < paddedLength;) { 15458 for (j = 0; j < 16; ++j) { 15459 w[j] = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; 15460 i += 4; 15461 } 15462 for (j = 16; j < 64; ++j) { 15463 w[j] = littleSigmaPrime(w[j - 2]) + w[j - 7] + littleSigma(w[j - 15]) + w[j - 16] | 0; 15464 } 15465 var a = h0, 15466 b = h1, 15467 c = h2, 15468 d = h3, 15469 e = h4, 15470 f = h5, 15471 g = h6, 15472 h = h7, 15473 t1, 15474 t2; 15475 for (j = 0; j < 64; ++j) { 15476 t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j]; 15477 t2 = sigma(a) + maj(a, b, c); 15478 h = g; 15479 g = f; 15480 f = e; 15481 e = d + t1 | 0; 15482 d = c; 15483 c = b; 15484 b = a; 15485 a = t1 + t2 | 0; 15486 } 15487 h0 = h0 + a | 0; 15488 h1 = h1 + b | 0; 15489 h2 = h2 + c | 0; 15490 h3 = h3 + d | 0; 15491 h4 = h4 + e | 0; 15492 h5 = h5 + f | 0; 15493 h6 = h6 + g | 0; 15494 h7 = h7 + h | 0; 15495 } 15496 return new Uint8Array([h0 >> 24 & 0xFF, h0 >> 16 & 0xFF, h0 >> 8 & 0xFF, h0 & 0xFF, h1 >> 24 & 0xFF, h1 >> 16 & 0xFF, h1 >> 8 & 0xFF, h1 & 0xFF, h2 >> 24 & 0xFF, h2 >> 16 & 0xFF, h2 >> 8 & 0xFF, h2 & 0xFF, h3 >> 24 & 0xFF, h3 >> 16 & 0xFF, h3 >> 8 & 0xFF, h3 & 0xFF, h4 >> 24 & 0xFF, h4 >> 16 & 0xFF, h4 >> 8 & 0xFF, h4 & 0xFF, h5 >> 24 & 0xFF, h5 >> 16 & 0xFF, h5 >> 8 & 0xFF, h5 & 0xFF, h6 >> 24 & 0xFF, h6 >> 16 & 0xFF, h6 >> 8 & 0xFF, h6 & 0xFF, h7 >> 24 & 0xFF, h7 >> 16 & 0xFF, h7 >> 8 & 0xFF, h7 & 0xFF]); 15497 } 15498 return hash; 15499}(); 15500var calculateSHA512 = function calculateSHA512Closure() { 15501 function ch(result, x, y, z, tmp) { 15502 result.assign(x); 15503 result.and(y); 15504 tmp.assign(x); 15505 tmp.not(); 15506 tmp.and(z); 15507 result.xor(tmp); 15508 } 15509 function maj(result, x, y, z, tmp) { 15510 result.assign(x); 15511 result.and(y); 15512 tmp.assign(x); 15513 tmp.and(z); 15514 result.xor(tmp); 15515 tmp.assign(y); 15516 tmp.and(z); 15517 result.xor(tmp); 15518 } 15519 function sigma(result, x, tmp) { 15520 result.assign(x); 15521 result.rotateRight(28); 15522 tmp.assign(x); 15523 tmp.rotateRight(34); 15524 result.xor(tmp); 15525 tmp.assign(x); 15526 tmp.rotateRight(39); 15527 result.xor(tmp); 15528 } 15529 function sigmaPrime(result, x, tmp) { 15530 result.assign(x); 15531 result.rotateRight(14); 15532 tmp.assign(x); 15533 tmp.rotateRight(18); 15534 result.xor(tmp); 15535 tmp.assign(x); 15536 tmp.rotateRight(41); 15537 result.xor(tmp); 15538 } 15539 function littleSigma(result, x, tmp) { 15540 result.assign(x); 15541 result.rotateRight(1); 15542 tmp.assign(x); 15543 tmp.rotateRight(8); 15544 result.xor(tmp); 15545 tmp.assign(x); 15546 tmp.shiftRight(7); 15547 result.xor(tmp); 15548 } 15549 function littleSigmaPrime(result, x, tmp) { 15550 result.assign(x); 15551 result.rotateRight(19); 15552 tmp.assign(x); 15553 tmp.rotateRight(61); 15554 result.xor(tmp); 15555 tmp.assign(x); 15556 tmp.shiftRight(6); 15557 result.xor(tmp); 15558 } 15559 var k = [new Word64(0x428a2f98, 0xd728ae22), new Word64(0x71374491, 0x23ef65cd), new Word64(0xb5c0fbcf, 0xec4d3b2f), new Word64(0xe9b5dba5, 0x8189dbbc), new Word64(0x3956c25b, 0xf348b538), new Word64(0x59f111f1, 0xb
vendor: 7,245 bytes, lines 15559-15719
15559605d019), new Word64(0x923f82a4, 0xaf194f9b), new Word64(0xab1c5ed5, 0xda6d8118), new Word64(0xd807aa98, 0xa3030242), new Word64(0x12835b01, 0x45706fbe), new Word64(0x243185be, 0x4ee4b28c), new Word64(0x550c7dc3, 0xd5ffb4e2), new Word64(0x72be5d74, 0xf27b896f), new Word64(0x80deb1fe, 0x3b1696b1), new Word64(0x9bdc06a7, 0x25c71235), new Word64(0xc19bf174, 0xcf692694), new Word64(0xe49b69c1, 0x9ef14ad2), new Word64(0xefbe4786, 0x384f25e3), new Word64(0x0fc19dc6, 0x8b8cd5b5), new Word64(0x240ca1cc, 0x77ac9c65), new Word64(0x2de92c6f, 0x592b0275), new Word64(0x4a7484aa, 0x6ea6e483), new Word64(0x5cb0a9dc, 0xbd41fbd4), new Word64(0x76f988da, 0x831153b5), new Word64(0x983e5152, 0xee66dfab), new Word64(0xa831c66d, 0x2db43210), new Word64(0xb00327c8, 0x98fb213f), new Word64(0xbf597fc7, 0xbeef0ee4), new Word64(0xc6e00bf3, 0x3da88fc2), new Word64(0xd5a79147, 0x930aa725), new Word64(0x06ca6351, 0xe003826f), new Word64(0x14292967, 0x0a0e6e70), new Word64(0x27b70a85, 0x46d22ffc), new Word64(0x2e1b2138, 0x5c26c926), new Word64(0x4d2c6dfc, 0x5ac42aed), new Word64(0x53380d13, 0x9d95b3df), new Word64(0x650a7354, 0x8baf63de), new Word64(0x766a0abb, 0x3c77b2a8), new Word64(0x81c2c92e, 0x47edaee6), new Word64(0x92722c85, 0x1482353b), new Word64(0xa2bfe8a1, 0x4cf10364), new Word64(0xa81a664b, 0xbc423001), new Word64(0xc24b8b70, 0xd0f89791), new Word64(0xc76c51a3, 0x0654be30), new Word64(0xd192e819, 0xd6ef5218), new Word64(0xd6990624, 0x5565a910), new Word64(0xf40e3585, 0x5771202a), new Word64(0x106aa070, 0x32bbd1b8), new Word64(0x19a4c116, 0xb8d2d0c8), new Word64(0x1e376c08, 0x5141ab53), new Word64(0x2748774c, 0xdf8eeb99), new Word64(0x34b0bcb5, 0xe19b48a8), new Word64(0x391c0cb3, 0xc5c95a63), new Word64(0x4ed8aa4a, 0xe3418acb), new Word64(0x5b9cca4f, 0x7763e373), new Word64(0x682e6ff3, 0xd6b2b8a3), new Word64(0x748f82ee, 0x5defb2fc), new Word64(0x78a5636f, 0x43172f60), new Word64(0x84c87814, 0xa1f0ab72), new Word64(0x8cc70208, 0x1a6439ec), new Word64(0x90befffa, 0x23631e28), new Word64(0xa4506ceb, 0xde82bde9), new Word64(0xbef9a3f7, 0xb2c67915), new Word64(0xc67178f2, 0xe372532b), new Word64(0xca273ece, 0xea26619c), new Word64(0xd186b8c7, 0x21c0c207), new Word64(0xeada7dd6, 0xcde0eb1e), new Word64(0xf57d4f7f, 0xee6ed178), new Word64(0x06f067aa, 0x72176fba), new Word64(0x0a637dc5, 0xa2c898a6), new Word64(0x113f9804, 0xbef90dae), new Word64(0x1b710b35, 0x131c471b), new Word64(0x28db77f5, 0x23047d84), new Word64(0x32caab7b, 0x40c72493), new Word64(0x3c9ebe0a, 0x15c9bebc), new Word64(0x431d67c4, 0x9c100d4c), new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a), new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)]; 15560 function hash(data, offset, length, mode384) { 15561 mode384 = !!mode384; 15562 var h0, h1, h2, h3, h4, h5, h6, h7; 15563 if (!mode384) { 15564 h0 = new Word64(0x6a09e667, 0xf3bcc908); 15565 h1 = new Word64(0xbb67ae85, 0x84caa73b); 15566 h2 = new Word64(0x3c6ef372, 0xfe94f82b); 15567 h3 = new Word64(0xa54ff53a, 0x5f1d36f1); 15568 h4 = new Word64(0x510e527f, 0xade682d1); 15569 h5 = new Word64(0x9b05688c, 0x2b3e6c1f); 15570 h6 = new Word64(0x1f83d9ab, 0xfb41bd6b); 15571 h7 = new Word64(0x5be0cd19, 0x137e2179); 15572 } else { 15573 h0 = new Word64(0xcbbb9d5d, 0xc1059ed8); 15574 h1 = new Word64(0x629a292a, 0x367cd507); 15575 h2 = new Word64(0x9159015a, 0x3070dd17); 15576 h3 = new Word64(0x152fecd8, 0xf70e5939); 15577 h4 = new Word64(0x67332667, 0xffc00b31); 15578 h5 = new Word64(0x8eb44a87, 0x68581511); 15579 h6 = new Word64(0xdb0c2e0d, 0x64f98fa7); 15580 h7 = new Word64(0x47b5481d, 0xbefa4fa4); 15581 } 15582 var paddedLength = Math.ceil((length + 17) / 128) * 128; 15583 var padded = new Uint8Array(paddedLength); 15584 var i, j, n; 15585 for (i = 0; i < length; ++i) { 15586 padded[i] = data[offset++]; 15587 } 15588 padded[i++] = 0x80; 15589 n = paddedLength - 16; 15590 while (i < n) { 15591 padded[i++] = 0; 15592 } 15593 padded[i++] = 0; 15594 padded[i++] = 0; 15595 padded[i++] = 0; 15596 padded[i++] = 0; 15597 padded[i++] = 0; 15598 padded[i++] = 0; 15599 padded[i++] = 0; 15600 padded[i++] = 0; 15601 padded[i++] = 0; 15602 padded[i++] = 0; 15603 padded[i++] = 0; 15604 padded[i++] = length >>> 29 & 0xFF; 15605 padded[i++] = length >> 21 & 0xFF; 15606 padded[i++] = length >> 13 & 0xFF; 15607 padded[i++] = length >> 5 & 0xFF; 15608 padded[i++] = length << 3 & 0xFF; 15609 var w = new Array(80); 15610 for (i = 0; i < 80; i++) { 15611 w[i] = new Word64(0, 0); 15612 } 15613 var a = new Word64(0, 0), 15614 b = new Word64(0, 0), 15615 c = new Word64(0, 0); 15616 var d = new Word64(0, 0), 15617 e = new Word64(0, 0), 15618 f = new Word64(0, 0); 15619 var g = new Word64(0, 0), 15620 h = new Word64(0, 0); 15621 var t1 = new Word64(0, 0), 15622 t2 = new Word64(0, 0); 15623 var tmp1 = new Word64(0, 0), 15624 tmp2 = new Word64(0, 0), 15625 tmp3; 15626 for (i = 0; i < paddedLength;) { 15627 for (j = 0; j < 16; ++j) { 15628 w[j].high = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; 15629 w[j].low = padded[i + 4] << 24 | padded[i + 5] << 16 | padded[i + 6] << 8 | padded[i + 7]; 15630 i += 8; 15631 } 15632 for (j = 16; j < 80; ++j) { 15633 tmp3 = w[j]; 15634 littleSigmaPrime(tmp3, w[j - 2], tmp2); 15635 tmp3.add(w[j - 7]); 15636 littleSigma(tmp1, w[j - 15], tmp2); 15637 tmp3.add(tmp1); 15638 tmp3.add(w[j - 16]); 15639 } 15640 a.assign(h0); 15641 b.assign(h1); 15642 c.assign(h2); 15643 d.assign(h3); 15644 e.assign(h4); 15645 f.assign(h5); 15646 g.assign(h6); 15647 h.assign(h7); 15648 for (j = 0; j < 80; ++j) { 15649 t1.assign(h); 15650 sigmaPrime(tmp1, e, tmp2); 15651 t1.add(tmp1); 15652 ch(tmp1, e, f, g, tmp2); 15653 t1.add(tmp1); 15654 t1.add(k[j]); 15655 t1.add(w[j]); 15656 sigma(t2, a, tmp2); 15657 maj(tmp1, a, b, c, tmp2); 15658 t2.add(tmp1); 15659 tmp3 = h; 15660 h = g; 15661 g = f; 15662 f = e; 15663 d.add(t1); 15664 e = d; 15665 d = c; 15666 c = b; 15667 b = a; 15668 tmp3.assign(t1); 15669 tmp3.add(t2); 15670 a = tmp3; 15671 } 15672 h0.add(a); 15673 h1.add(b); 15674 h2.add(c); 15675 h3.add(d); 15676 h4.add(e); 15677 h5.add(f); 15678 h6.add(g); 15679 h7.add(h); 15680 } 15681 var result; 15682 if (!mode384) { 15683 result = new Uint8Array(64); 15684 h0.copyTo(result, 0); 15685 h1.copyTo(result, 8); 15686 h2.copyTo(result, 16); 15687 h3.copyTo(result, 24); 15688 h4.copyTo(result, 32); 15689 h5.copyTo(result, 40); 15690 h6.copyTo(result, 48); 15691 h7.copyTo(result, 56); 15692 } else { 15693 result = new Uint8Array(48); 15694 h0.copyTo(result, 0); 15695 h1.copyTo(result, 8); 15696 h2.copyTo(result, 16); 15697 h3.copyTo(result, 24); 15698 h4.copyTo(result, 32); 15699 h5.copyTo(result, 40); 15700 } 15701 return result; 15702 } 15703 return hash; 15704}(); 15705var calculateSHA384 = function calculateSHA384Closure() { 15706 function hash(data, offset, length) { 15707 return calculateSHA512(data, offset, length, true); 15708 } 15709 return hash; 15710}(); 15711var NullCipher = function NullCipherClosure() { 15712 function NullCipher() {} 15713 NullCipher.prototype = { 15714 decryptBlock: function NullCipher_decryptBlock(data) { 15715 return data; 15716 } 15717 }; 15718 return NullCipher; 15719}();
15720var AES128Cipher = function AES128CipherClosure() { 15721 var rcon = new Uint8Array([0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d]); 15722 var s = new Uint8Array([0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16]); 15723 var inv_s = new Uint8Array([0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]); 15724 var mixCol = new Uint8Array(256); 15725 for (var i = 0; i < 256; i++) { 15726 if (i < 128) { 15727 mixCol[i] = i << 1; 15728 } else { 15729 mixCol[i] = i << 1 ^ 0x1b; 15730 } 15731 } 15732 var mix = new Uint32Array([0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c
vendor: 5,699 bytes, lines 15732-15838
1573274, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); 15733 function expandKey128(cipherKey) { 15734 var b = 176, 15735 result = new Uint8Array(b); 15736 result.set(cipherKey); 15737 for (var j = 16, i = 1; j < b; ++i) { 15738 var t1 = result[j - 3], 15739 t2 = result[j - 2], 15740 t3 = result[j - 1], 15741 t4 = result[j - 4]; 15742 t1 = s[t1]; 15743 t2 = s[t2]; 15744 t3 = s[t3]; 15745 t4 = s[t4]; 15746 t1 = t1 ^ rcon[i]; 15747 for (var n = 0; n < 4; ++n) { 15748 result[j] = t1 ^= result[j - 16]; 15749 j++; 15750 result[j] = t2 ^= result[j - 16]; 15751 j++; 15752 result[j] = t3 ^= result[j - 16]; 15753 j++; 15754 result[j] = t4 ^= result[j - 16]; 15755 j++; 15756 } 15757 } 15758 return result; 15759 } 15760 function decrypt128(input, key) { 15761 var state = new Uint8Array(16); 15762 state.set(input); 15763 var i, j, k; 15764 var t, u, v; 15765 for (j = 0, k = 160; j < 16; ++j, ++k) { 15766 state[j] ^= key[k]; 15767 } 15768 for (i = 9; i >= 1; --i) { 15769 t = state[13]; 15770 state[13] = state[9]; 15771 state[9] = state[5]; 15772 state[5] = state[1]; 15773 state[1] = t; 15774 t = state[14]; 15775 u = state[10]; 15776 state[14] = state[6]; 15777 state[10] = state[2]; 15778 state[6] = t; 15779 state[2] = u; 15780 t = state[15]; 15781 u = state[11]; 15782 v = state[7]; 15783 state[15] = state[3]; 15784 state[11] = t; 15785 state[7] = u; 15786 state[3] = v; 15787 for (j = 0; j < 16; ++j) { 15788 state[j] = inv_s[state[j]]; 15789 } 15790 for (j = 0, k = i * 16; j < 16; ++j, ++k) { 15791 state[j] ^= key[k]; 15792 } 15793 for (j = 0; j < 16; j += 4) { 15794 var s0 = mix[state[j]], 15795 s1 = mix[state[j + 1]], 15796 s2 = mix[state[j + 2]], 15797 s3 = mix[state[j + 3]]; 15798 t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8; 15799 state[j] = t >>> 24 & 0xFF; 15800 state[j + 1] = t >> 16 & 0xFF; 15801 state[j + 2] = t >> 8 & 0xFF; 15802 state[j + 3] = t & 0xFF; 15803 } 15804 } 15805 t = state[13]; 15806 state[13] = state[9]; 15807 state[9] = state[5]; 15808 state[5] = state[1]; 15809 state[1] = t; 15810 t = state[14]; 15811 u = state[10]; 15812 state[14] = state[6]; 15813 state[10] = state[2]; 15814 state[6] = t; 15815 state[2] = u; 15816 t = state[15]; 15817 u = state[11]; 15818 v = state[7]; 15819 state[15] = state[3]; 15820 state[11] = t; 15821 state[7] = u; 15822 state[3] = v; 15823 for (j = 0; j < 16; ++j) { 15824 state[j] = inv_s[state[j]]; 15825 state[j] ^= key[j]; 15826 } 15827 return state; 15828 } 15829 function encrypt128(input, key) { 15830 var t, u, v, j, k; 15831 var state = new Uint8Array(16); 15832 state.set(input); 15833 for (j = 0; j < 16; ++j) { 15834 state[j] ^= key[j]; 15835 } 15836 for (i = 1; i < 10; i++) { 15837 for (j = 0; j < 16; ++j) { 15838 state[j] = s[state[j]];
vendor: 4,944 bytes, lines 15839-16015
15839 } 15840 v = state[1]; 15841 state[1] = state[5]; 15842 state[5] = state[9]; 15843 state[9] = state[13]; 15844 state[13] = v; 15845 v = state[2]; 15846 u = state[6]; 15847 state[2] = state[10]; 15848 state[6] = state[14]; 15849 state[10] = v; 15850 state[14] = u; 15851 v = state[3]; 15852 u = state[7]; 15853 t = state[11]; 15854 state[3] = state[15]; 15855 state[7] = v; 15856 state[11] = u; 15857 state[15] = t; 15858 for (j = 0; j < 16; j += 4) { 15859 var s0 = state[j + 0], 15860 s1 = state[j + 1]; 15861 var s2 = state[j + 2], 15862 s3 = state[j + 3]; 15863 t = s0 ^ s1 ^ s2 ^ s3; 15864 state[j + 0] ^= t ^ mixCol[s0 ^ s1]; 15865 state[j + 1] ^= t ^ mixCol[s1 ^ s2]; 15866 state[j + 2] ^= t ^ mixCol[s2 ^ s3]; 15867 state[j + 3] ^= t ^ mixCol[s3 ^ s0]; 15868 } 15869 for (j = 0, k = i * 16; j < 16; ++j, ++k) { 15870 state[j] ^= key[k]; 15871 } 15872 } 15873 for (j = 0; j < 16; ++j) { 15874 state[j] = s[state[j]]; 15875 } 15876 v = state[1]; 15877 state[1] = state[5]; 15878 state[5] = state[9]; 15879 state[9] = state[13]; 15880 state[13] = v; 15881 v = state[2]; 15882 u = state[6]; 15883 state[2] = state[10]; 15884 state[6] = state[14]; 15885 state[10] = v; 15886 state[14] = u; 15887 v = state[3]; 15888 u = state[7]; 15889 t = state[11]; 15890 state[3] = state[15]; 15891 state[7] = v; 15892 state[11] = u; 15893 state[15] = t; 15894 for (j = 0, k = 160; j < 16; ++j, ++k) { 15895 state[j] ^= key[k]; 15896 } 15897 return state; 15898 } 15899 function AES128Cipher(key) { 15900 this.key = expandKey128(key); 15901 this.buffer = new Uint8Array(16); 15902 this.bufferPosition = 0; 15903 } 15904 function decryptBlock2(data, finalize) { 15905 var i, 15906 j, 15907 ii, 15908 sourceLength = data.length, 15909 buffer = this.buffer, 15910 bufferLength = this.bufferPosition, 15911 result = [], 15912 iv = this.iv; 15913 for (i = 0; i < sourceLength; ++i) { 15914 buffer[bufferLength] = data[i]; 15915 ++bufferLength; 15916 if (bufferLength < 16) { 15917 continue; 15918 } 15919 var plain = decrypt128(buffer, this.key); 15920 for (j = 0; j < 16; ++j) { 15921 plain[j] ^= iv[j]; 15922 } 15923 iv = buffer; 15924 result.push(plain); 15925 buffer = new Uint8Array(16); 15926 bufferLength = 0; 15927 } 15928 this.buffer = buffer; 15929 this.bufferLength = bufferLength; 15930 this.iv = iv; 15931 if (result.length === 0) { 15932 return new Uint8Array([]); 15933 } 15934 var outputLength = 16 * result.length; 15935 if (finalize) { 15936 var lastBlock = result[result.length - 1]; 15937 var psLen = lastBlock[15]; 15938 if (psLen <= 16) { 15939 for (i = 15, ii = 16 - psLen; i >= ii; --i) { 15940 if (lastBlock[i] !== psLen) { 15941 psLen = 0; 15942 break; 15943 } 15944 } 15945 outputLength -= psLen; 15946 result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); 15947 } 15948 } 15949 var output = new Uint8Array(outputLength); 15950 for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { 15951 output.set(result[i], j); 15952 } 15953 return output; 15954 } 15955 AES128Cipher.prototype = { 15956 decryptBlock: function AES128Cipher_decryptBlock(data, finalize) { 15957 var i, 15958 sourceLength = data.length; 15959 var buffer = this.buffer, 15960 bufferLength = this.bufferPosition; 15961 for (i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { 15962 buffer[bufferLength] = data[i]; 15963 } 15964 if (bufferLength < 16) { 15965 this.bufferLength = bufferLength; 15966 return new Uint8Array([]); 15967 } 15968 this.iv = buffer; 15969 this.buffer = new Uint8Array(16); 15970 this.bufferLength = 0; 15971 this.decryptBlock = decryptBlock2; 15972 return this.decryptBlock(data.subarray(16), finalize); 15973 }, 15974 encrypt: function AES128Cipher_encrypt(data, iv) { 15975 var i, 15976 j, 15977 ii, 15978 sourceLength = data.length, 15979 buffer = this.buffer, 15980 bufferLength = this.bufferPosition, 15981 result = []; 15982 if (!iv) { 15983 iv = new Uint8Array(16); 15984 } 15985 for (i = 0; i < sourceLength; ++i) { 15986 buffer[bufferLength] = data[i]; 15987 ++bufferLength; 15988 if (bufferLength < 16) { 15989 continue; 15990 } 15991 for (j = 0; j < 16; ++j) { 15992 buffer[j] ^= iv[j]; 15993 } 15994 var cipher = encrypt128(buffer, this.key); 15995 iv = cipher; 15996 result.push(cipher); 15997 buffer = new Uint8Array(16); 15998 bufferLength = 0; 15999 } 16000 this.buffer = buffer; 16001 this.bufferLength = bufferLength; 16002 this.iv = iv; 16003 if (result.length === 0) { 16004 return new Uint8Array([]); 16005 } 16006 var outputLength = 16 * result.length; 16007 var output = new Uint8Array(outputLength); 16008 for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { 16009 output.set(result[i], j); 16010 } 16011 return output; 16012 } 16013 }; 16014 return AES128Cipher; 16015}();
16016var AES256Cipher = function AES256CipherClosure() { 16017 var s = new Uint8Array([0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16]); 16018 var inv_s = new Uint8Array([0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]); 16019 var mixCol = new Uint8Array(256); 16020 for (var i = 0; i < 256; i++) { 16021 if (i < 128) { 16022 mixCol[i] = i << 1; 16023 } else { 16024 mixCol[i] = i << 1 ^ 0x1b; 16025 } 16026 } 16027 var mix = new Uint32Array([0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a
vendor: 3,799 bytes, lines 16027-16095
16027750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); 16028 function expandKey256(cipherKey) { 16029 var b = 240, 16030 result = new Uint8Array(b); 16031 var r = 1; 16032 result.set(cipherKey); 16033 for (var j = 32, i = 1; j < b; ++i) { 16034 var t1, t2, t3, t4; 16035 if (j % 32 === 16) { 16036 t1 = s[t1]; 16037 t2 = s[t2]; 16038 t3 = s[t3]; 16039 t4 = s[t4]; 16040 } else if (j % 32 === 0) { 16041 t1 = result[j - 3]; 16042 t2 = result[j - 2]; 16043 t3 = result[j - 1]; 16044 t4 = result[j - 4]; 16045 t1 = s[t1]; 16046 t2 = s[t2]; 16047 t3 = s[t3]; 16048 t4 = s[t4]; 16049 t1 = t1 ^ r; 16050 if ((r <<= 1) >= 256) { 16051 r = (r ^ 0x1b) & 0xFF; 16052 } 16053 } 16054 for (var n = 0; n < 4; ++n) { 16055 result[j] = t1 ^= result[j - 32]; 16056 j++; 16057 result[j] = t2 ^= result[j - 32]; 16058 j++; 16059 result[j] = t3 ^= result[j - 32]; 16060 j++; 16061 result[j] = t4 ^= result[j - 32]; 16062 j++; 16063 } 16064 } 16065 return result; 16066 } 16067 function decrypt256(input, key) { 16068 var state = new Uint8Array(16); 16069 state.set(input); 16070 var i, j, k; 16071 var t, u, v; 16072 for (j = 0, k = 224; j < 16; ++j, ++k) { 16073 state[j] ^= key[k]; 16074 } 16075 for (i = 13; i >= 1; --i) { 16076 t = state[13]; 16077 state[13] = state[9]; 16078 state[9] = state[5]; 16079 state[5] = state[1]; 16080 state[1] = t; 16081 t = state[14]; 16082 u = state[10]; 16083 state[14] = state[6]; 16084 state[10] = state[2]; 16085 state[6] = t; 16086 state[2] = u; 16087 t = state[15]; 16088 u = state[11]; 16089 v = state[7]; 16090 state[15] = state[3]; 16091 state[11] = t; 16092 state[7] = u; 16093 state[3] = v; 16094 for (j = 0; j < 16; ++j) { 16095 state[j] = inv_s[state[j]];
vendor: 1,337 bytes, lines 16096-16145
16096 } 16097 for (j = 0, k = i * 16; j < 16; ++j, ++k) { 16098 state[j] ^= key[k]; 16099 } 16100 for (j = 0; j < 16; j += 4) { 16101 var s0 = mix[state[j]], 16102 s1 = mix[state[j + 1]], 16103 s2 = mix[state[j + 2]], 16104 s3 = mix[state[j + 3]]; 16105 t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8; 16106 state[j] = t >>> 24 & 0xFF; 16107 state[j + 1] = t >> 16 & 0xFF; 16108 state[j + 2] = t >> 8 & 0xFF; 16109 state[j + 3] = t & 0xFF; 16110 } 16111 } 16112 t = state[13]; 16113 state[13] = state[9]; 16114 state[9] = state[5]; 16115 state[5] = state[1]; 16116 state[1] = t; 16117 t = state[14]; 16118 u = state[10]; 16119 state[14] = state[6]; 16120 state[10] = state[2]; 16121 state[6] = t; 16122 state[2] = u; 16123 t = state[15]; 16124 u = state[11]; 16125 v = state[7]; 16126 state[15] = state[3]; 16127 state[11] = t; 16128 state[7] = u; 16129 state[3] = v; 16130 for (j = 0; j < 16; ++j) { 16131 state[j] = inv_s[state[j]]; 16132 state[j] ^= key[j]; 16133 } 16134 return state; 16135 } 16136 function encrypt256(input, key) { 16137 var t, u, v, i, j, k; 16138 var state = new Uint8Array(16); 16139 state.set(input); 16140 for (j = 0; j < 16; ++j) { 16141 state[j] ^= key[j]; 16142 } 16143 for (i = 1; i < 14; i++) { 16144 for (j = 0; j < 16; ++j) { 16145 state[j] = s[state[j]];
vendor: 14,928 bytes, lines 16146-16565
16146 } 16147 v = state[1]; 16148 state[1] = state[5]; 16149 state[5] = state[9]; 16150 state[9] = state[13]; 16151 state[13] = v; 16152 v = state[2]; 16153 u = state[6]; 16154 state[2] = state[10]; 16155 state[6] = state[14]; 16156 state[10] = v; 16157 state[14] = u; 16158 v = state[3]; 16159 u = state[7]; 16160 t = state[11]; 16161 state[3] = state[15]; 16162 state[7] = v; 16163 state[11] = u; 16164 state[15] = t; 16165 for (j = 0; j < 16; j += 4) { 16166 var s0 = state[j + 0], 16167 s1 = state[j + 1]; 16168 var s2 = state[j + 2], 16169 s3 = state[j + 3]; 16170 t = s0 ^ s1 ^ s2 ^ s3; 16171 state[j + 0] ^= t ^ mixCol[s0 ^ s1]; 16172 state[j + 1] ^= t ^ mixCol[s1 ^ s2]; 16173 state[j + 2] ^= t ^ mixCol[s2 ^ s3]; 16174 state[j + 3] ^= t ^ mixCol[s3 ^ s0]; 16175 } 16176 for (j = 0, k = i * 16; j < 16; ++j, ++k) { 16177 state[j] ^= key[k]; 16178 } 16179 } 16180 for (j = 0; j < 16; ++j) { 16181 state[j] = s[state[j]]; 16182 } 16183 v = state[1]; 16184 state[1] = state[5]; 16185 state[5] = state[9]; 16186 state[9] = state[13]; 16187 state[13] = v; 16188 v = state[2]; 16189 u = state[6]; 16190 state[2] = state[10]; 16191 state[6] = state[14]; 16192 state[10] = v; 16193 state[14] = u; 16194 v = state[3]; 16195 u = state[7]; 16196 t = state[11]; 16197 state[3] = state[15]; 16198 state[7] = v; 16199 state[11] = u; 16200 state[15] = t; 16201 for (j = 0, k = 224; j < 16; ++j, ++k) { 16202 state[j] ^= key[k]; 16203 } 16204 return state; 16205 } 16206 function AES256Cipher(key) { 16207 this.key = expandKey256(key); 16208 this.buffer = new Uint8Array(16); 16209 this.bufferPosition = 0; 16210 } 16211 function decryptBlock2(data, finalize) { 16212 var i, 16213 j, 16214 ii, 16215 sourceLength = data.length, 16216 buffer = this.buffer, 16217 bufferLength = this.bufferPosition, 16218 result = [], 16219 iv = this.iv; 16220 for (i = 0; i < sourceLength; ++i) { 16221 buffer[bufferLength] = data[i]; 16222 ++bufferLength; 16223 if (bufferLength < 16) { 16224 continue; 16225 } 16226 var plain = decrypt256(buffer, this.key); 16227 for (j = 0; j < 16; ++j) { 16228 plain[j] ^= iv[j]; 16229 } 16230 iv = buffer; 16231 result.push(plain); 16232 buffer = new Uint8Array(16); 16233 bufferLength = 0; 16234 } 16235 this.buffer = buffer; 16236 this.bufferLength = bufferLength; 16237 this.iv = iv; 16238 if (result.length === 0) { 16239 return new Uint8Array([]); 16240 } 16241 var outputLength = 16 * result.length; 16242 if (finalize) { 16243 var lastBlock = result[result.length - 1]; 16244 var psLen = lastBlock[15]; 16245 if (psLen <= 16) { 16246 for (i = 15, ii = 16 - psLen; i >= ii; --i) { 16247 if (lastBlock[i] !== psLen) { 16248 psLen = 0; 16249 break; 16250 } 16251 } 16252 outputLength -= psLen; 16253 result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); 16254 } 16255 } 16256 var output = new Uint8Array(outputLength); 16257 for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { 16258 output.set(result[i], j); 16259 } 16260 return output; 16261 } 16262 AES256Cipher.prototype = { 16263 decryptBlock: function AES256Cipher_decryptBlock(data, finalize, iv) { 16264 var i, 16265 sourceLength = data.length; 16266 var buffer = this.buffer, 16267 bufferLength = this.bufferPosition; 16268 if (iv) { 16269 this.iv = iv; 16270 } else { 16271 for (i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { 16272 buffer[bufferLength] = data[i]; 16273 } 16274 if (bufferLength < 16) { 16275 this.bufferLength = bufferLength; 16276 return new Uint8Array([]); 16277 } 16278 this.iv = buffer; 16279 data = data.subarray(16); 16280 } 16281 this.buffer = new Uint8Array(16); 16282 this.bufferLength = 0; 16283 this.decryptBlock = decryptBlock2; 16284 return this.decryptBlock(data, finalize); 16285 }, 16286 encrypt: function AES256Cipher_encrypt(data, iv) { 16287 var i, 16288 j, 16289 ii, 16290 sourceLength = data.length, 16291 buffer = this.buffer, 16292 bufferLength = this.bufferPosition, 16293 result = []; 16294 if (!iv) { 16295 iv = new Uint8Array(16); 16296 } 16297 for (i = 0; i < sourceLength; ++i) { 16298 buffer[bufferLength] = data[i]; 16299 ++bufferLength; 16300 if (bufferLength < 16) { 16301 continue; 16302 } 16303 for (j = 0; j < 16; ++j) { 16304 buffer[j] ^= iv[j]; 16305 } 16306 var cipher = encrypt256(buffer, this.key); 16307 this.iv = cipher; 16308 result.push(cipher); 16309 buffer = new Uint8Array(16); 16310 bufferLength = 0; 16311 } 16312 this.buffer = buffer; 16313 this.bufferLength = bufferLength; 16314 this.iv = iv; 16315 if (result.length === 0) { 16316 return new Uint8Array([]); 16317 } 16318 var outputLength = 16 * result.length; 16319 var output = new Uint8Array(outputLength); 16320 for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { 16321 output.set(result[i], j); 16322 } 16323 return output; 16324 } 16325 }; 16326 return AES256Cipher; 16327}(); 16328var PDF17 = function PDF17Closure() { 16329 function compareByteArrays(array1, array2) { 16330 if (array1.length !== array2.length) { 16331 return false; 16332 } 16333 for (var i = 0; i < array1.length; i++) { 16334 if (array1[i] !== array2[i]) { 16335 return false; 16336 } 16337 } 16338 return true; 16339 } 16340 function PDF17() {} 16341 PDF17.prototype = { 16342 checkOwnerPassword: function PDF17_checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { 16343 var hashData = new Uint8Array(password.length + 56); 16344 hashData.set(password, 0); 16345 hashData.set(ownerValidationSalt, password.length); 16346 hashData.set(userBytes, password.length + ownerValidationSalt.length); 16347 var result = calculateSHA256(hashData, 0, hashData.length); 16348 return compareByteArrays(result, ownerPassword); 16349 }, 16350 checkUserPassword: function PDF17_checkUserPassword(password, userValidationSalt, userPassword) { 16351 var hashData = new Uint8Array(password.length + 8); 16352 hashData.set(password, 0); 16353 hashData.set(userValidationSalt, password.length); 16354 var result = calculateSHA256(hashData, 0, hashData.length); 16355 return compareByteArrays(result, userPassword); 16356 }, 16357 getOwnerKey: function PDF17_getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { 16358 var hashData = new Uint8Array(password.length + 56); 16359 hashData.set(password, 0); 16360 hashData.set(ownerKeySalt, password.length); 16361 hashData.set(userBytes, password.length + ownerKeySalt.length); 16362 var key = calculateSHA256(hashData, 0, hashData.length); 16363 var cipher = new AES256Cipher(key); 16364 return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); 16365 }, 16366 getUserKey: function PDF17_getUserKey(password, userKeySalt, userEncryption) { 16367 var hashData = new Uint8Array(password.length + 8); 16368 hashData.set(password, 0); 16369 hashData.set(userKeySalt, password.length); 16370 var key = calculateSHA256(hashData, 0, hashData.length); 16371 var cipher = new AES256Cipher(key); 16372 return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); 16373 } 16374 }; 16375 return PDF17; 16376}(); 16377var PDF20 = function PDF20Closure() { 16378 function concatArrays(array1, array2) { 16379 var t = new Uint8Array(array1.length + array2.length); 16380 t.set(array1, 0); 16381 t.set(array2, array1.length); 16382 return t; 16383 } 16384 function calculatePDF20Hash(password, input, userBytes) { 16385 var k = calculateSHA256(input, 0, input.length).subarray(0, 32); 16386 var e = [0]; 16387 var i = 0; 16388 while (i < 64 || e[e.length - 1] > i - 32) { 16389 var arrayLength = password.length + k.length + userBytes.length; 16390 var k1 = new Uint8Array(arrayLength * 64); 16391 var array = concatArrays(password, k); 16392 array = concatArrays(array, userBytes); 16393 for (var j = 0, pos = 0; j < 64; j++, pos += arrayLength) { 16394 k1.set(array, pos); 16395 } 16396 var cipher = new AES128Cipher(k.subarray(0, 16)); 16397 e = cipher.encrypt(k1, k.subarray(16, 32)); 16398 var remainder = 0; 16399 for (var z = 0; z < 16; z++) { 16400 remainder *= 256 % 3; 16401 remainder %= 3; 16402 remainder += (e[z] >>> 0) % 3; 16403 remainder %= 3; 16404 } 16405 if (remainder === 0) { 16406 k = calculateSHA256(e, 0, e.length); 16407 } else if (remainder === 1) { 16408 k = calculateSHA384(e, 0, e.length); 16409 } else if (remainder === 2) { 16410 k = calculateSHA512(e, 0, e.length); 16411 } 16412 i++; 16413 } 16414 return k.subarray(0, 32); 16415 } 16416 function PDF20() {} 16417 function compareByteArrays(array1, array2) { 16418 if (array1.length !== array2.length) { 16419 return false; 16420 } 16421 for (var i = 0; i < array1.length; i++) { 16422 if (array1[i] !== array2[i]) { 16423 return false; 16424 } 16425 } 16426 return true; 16427 } 16428 PDF20.prototype = { 16429 hash: function PDF20_hash(password, concatBytes, userBytes) { 16430 return calculatePDF20Hash(password, concatBytes, userBytes); 16431 }, 16432 checkOwnerPassword: function PDF20_checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { 16433 var hashData = new Uint8Array(password.length + 56); 16434 hashData.set(password, 0); 16435 hashData.set(ownerValidationSalt, password.length); 16436 hashData.set(userBytes, password.length + ownerValidationSalt.length); 16437 var result = calculatePDF20Hash(password, hashData, userBytes); 16438 return compareByteArrays(result, ownerPassword); 16439 }, 16440 checkUserPassword: function PDF20_checkUserPassword(password, userValidationSalt, userPassword) { 16441 var hashData = new Uint8Array(password.length + 8); 16442 hashData.set(password, 0); 16443 hashData.set(userValidationSalt, password.length); 16444 var result = calculatePDF20Hash(password, hashData, []); 16445 return compareByteArrays(result, userPassword); 16446 }, 16447 getOwnerKey: function PDF20_getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { 16448 var hashData = new Uint8Array(password.length + 56); 16449 hashData.set(password, 0); 16450 hashData.set(ownerKeySalt, password.length); 16451 hashData.set(userBytes, password.length + ownerKeySalt.length); 16452 var key = calculatePDF20Hash(password, hashData, userBytes); 16453 var cipher = new AES256Cipher(key); 16454 return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); 16455 }, 16456 getUserKey: function PDF20_getUserKey(password, userKeySalt, userEncryption) { 16457 var hashData = new Uint8Array(password.length + 8); 16458 hashData.set(password, 0); 16459 hashData.set(userKeySalt, password.length); 16460 var key = calculatePDF20Hash(password, hashData, []); 16461 var cipher = new AES256Cipher(key); 16462 return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); 16463 } 16464 }; 16465 return PDF20; 16466}(); 16467var CipherTransform = function CipherTransformClosure() { 16468 function CipherTransform(stringCipherConstructor, streamCipherConstructor) { 16469 this.StringCipherConstructor = stringCipherConstructor; 16470 this.StreamCipherConstructor = streamCipherConstructor; 16471 } 16472 CipherTransform.prototype = { 16473 createStream: function CipherTransform_createStream(stream, length) { 16474 var cipher = new this.StreamCipherConstructor(); 16475 return new _stream.DecryptStream(stream, length, function cipherTransformDecryptStream(data, finalize) { 16476 return cipher.decryptBlock(data, finalize); 16477 }); 16478 }, 16479 decryptString: function CipherTransform_decryptString(s) { 16480 var cipher = new this.StringCipherConstructor(); 16481 var data = (0, _util.stringToBytes)(s); 16482 data = cipher.decryptBlock(data, true); 16483 return (0, _util.bytesToString)(data); 16484 } 16485 }; 16486 return CipherTransform; 16487}(); 16488var CipherTransformFactory = function CipherTransformFactoryClosure() { 16489 var defaultPasswordBytes = new Uint8Array([0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08, 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A]); 16490 function createEncryptionKey20(revision, password, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms) { 16491 if (password) { 16492 var passwordLength = Math.min(127, password.length); 16493 password = password.subarray(0, passwordLength); 16494 } else { 16495 password = []; 16496 } 16497 var pdfAlgorithm; 16498 if (revision === 6) { 16499 pdfAlgorithm = new PDF20(); 16500 } else { 16501 pdfAlgorithm = new PDF17(); 16502 } 16503 if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, userPassword)) { 16504 return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption); 16505 } else if (password.length && pdfAlgorithm.checkOwnerPassword(password, ownerValidationSalt, uBytes, ownerPassword)) { 16506 return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, ownerEncryption); 16507 } 16508 return null; 16509 } 16510 function prepareKeyData(fileId, password, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata) { 16511 var hashDataSize = 40 + ownerPassword.length + fileId.length; 16512 var hashData = new Uint8Array(hashDataSize), 16513 i = 0, 16514 j, 16515 n; 16516 if (password) { 16517 n = Math.min(32, password.length); 16518 for (; i < n; ++i) { 16519 hashData[i] = password[i]; 16520 } 16521 } 16522 j = 0; 16523 while (i < 32) { 16524 hashData[i++] = defaultPasswordBytes[j++]; 16525 } 16526 for (j = 0, n = ownerPassword.length; j < n; ++j) { 16527 hashData[i++] = ownerPassword[j]; 16528 } 16529 hashData[i++] = flags & 0xFF; 16530 hashData[i++] = flags >> 8 & 0xFF; 16531 hashData[i++] = flags >> 16 & 0xFF; 16532 hashData[i++] = flags >>> 24 & 0xFF; 16533 for (j = 0, n = fileId.length; j < n; ++j) { 16534 hashData[i++] = fileId[j]; 16535 } 16536 if (revision >= 4 && !encryptMetadata) { 16537 hashData[i++] = 0xFF; 16538 hashData[i++] = 0xFF; 16539 hashData[i++] = 0xFF; 16540 hashData[i++] = 0xFF; 16541 } 16542 var hash = calculateMD5(hashData, 0, i); 16543 var keyLengthInBytes = keyLength >> 3; 16544 if (revision >= 3) { 16545 for (j = 0; j < 50; ++j) { 16546 hash = calculateMD5(hash, 0, keyLengthInBytes); 16547 } 16548 } 16549 var encryptionKey = hash.subarray(0, keyLengthInBytes); 16550 var cipher, checkData; 16551 if (revision >= 3) { 16552 for (i = 0; i < 32; ++i) { 16553 hashData[i] = defaultPasswordBytes[i]; 16554 } 16555 for (j = 0, n = fileId.length; j < n; ++j) { 16556 hashData[i++] = fileId[j]; 16557 } 16558 cipher = new ARCFourCipher(encryptionKey); 16559 checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i)); 16560 n = encryptionKey.length; 16561 var derivedKey = new Uint8Array(n), 16562 k; 16563 for (j = 1; j <= 19; ++j) { 16564 for (k = 0; k < n; ++k) { 16565 derivedKey[k] = encryptionKey[k] ^ j;
16566 } 16567 cipher = new ARCFourCipher(derivedKey); 16568 checkData = cipher.encryptBlock(checkData); 16569 } 16570 for (j = 0, n = checkData.length; j < n; ++j) { 16571 if (userPassword[j] !== checkData[j]) { 16572 return null; 16573 } 16574 } 16575 } else { 16576 cipher = new ARCFourCipher(encryptionKey); 16577 checkData = cipher.encryptBlock(defaultPasswordBytes); 16578 for (j = 0, n = checkData.length; j < n; ++j) { 16579 if (userPassword[j] !== checkData[j]) { 16580 return null; 16581 } 16582 } 16583 } 16584 return encryptionKey; 16585 } 16586 function decodeUserPassword(password, ownerPassword, revision, keyLength) { 16587 var hashData = new Uint8Array(32), 16588 i = 0, 16589 j, 16590 n; 16591 n = Math.min(32, password.length); 16592 for (; i < n; ++i) { 16593 hashData[i] = password[i]; 16594 } 16595 j = 0; 16596 while (i < 32) { 16597 hashData[i++] = defaultPasswordBytes[j++]; 16598 } 16599 var hash = calculateMD5(hashData, 0, i); 16600 var keyLengthInBytes = keyLength >> 3; 16601 if (revision >= 3) { 16602 for (j = 0; j < 50; ++j) { 16603 hash = calculateMD5(hash, 0, hash.length); 16604 } 16605 } 16606 var cipher, userPassword; 16607 if (revision >= 3) { 16608 userPassword = ownerPassword; 16609 var derivedKey = new Uint8Array(keyLengthInBytes), 16610 k; 16611 for (j = 19; j >= 0; j--) { 16612 for (k = 0; k < keyLengthInBytes; ++k) { 16613 derivedKey[k] = hash[k] ^ j; 16614 } 16615 cipher = new ARCFourCipher(derivedKey); 16616 userPassword = cipher.encryptBlock(userPassword); 16617 } 16618 } else { 16619 cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes)); 16620 userPassword = cipher.encryptBlock(ownerPassword); 16621 } 16622 return userPassword; 16623 } 16624 var identityName = _primitives.Name.get('Identity'); 16625 function CipherTransformFactory(dict, fileId, password) { 16626 var filter = dict.get('Filter'); 16627 if (!(0, _primitives.isName)(filter, 'Standard')) { 16628 throw new _util.FormatError('unknown encryption method'); 16629 } 16630 this.dict = dict; 16631 var algorithm = dict.get('V'); 16632 if (!Number.isInteger(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) { 16633 throw new _util.FormatError('unsupported encryption algorithm'); 16634 } 16635 this.algorithm = algorithm; 16636 var keyLength = dict.get('Length'); 16637 if (!keyLength) { 16638 if (algorithm <= 3) { 16639 keyLength = 40; 16640 } else { 16641 var cfDict = dict.get('CF'); 16642 var streamCryptoName = dict.get('StmF'); 16643 if ((0, _primitives.isDict)(cfDict) && (0, _primitives.isName)(streamCryptoName)) { 16644 cfDict.suppressEncryption = true; 16645 var handlerDict = cfDict.get(streamCryptoName.name); 16646 keyLength = handlerDict && handlerDict.get('Length') || 128; 16647 if (keyLength < 40) { 16648 keyLength <<= 3; 16649 } 16650 } 16651 } 16652 } 16653 if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) { 16654 throw new _util.FormatError('invalid key length'); 16655 } 16656 var ownerPassword = (0, _util.stringToBytes)(dict.get('O')).subarray(0, 32); 16657 var userPassword = (0, _util.stringToBytes)(dict.get('U')).subarray(0, 32); 16658 var flags = dict.get('P'); 16659 var revision = dict.get('R'); 16660 var encryptMetadata = (algorithm === 4 || algorithm === 5) && dict.get('EncryptMetadata') !== false; 16661 this.encryptMetadata = encryptMetadata; 16662 var fileIdBytes = (0, _util.stringToBytes)(fileId); 16663 var passwordBytes; 16664 if (password) { 16665 if (revision === 6) { 16666 try { 16667 password = (0, _util.utf8StringToString)(password); 16668 } catch (ex) { 16669 (0, _util.warn)('CipherTransformFactory: ' + 'Unable to convert UTF8 encoded password.'); 16670 } 16671 } 16672 passwordBytes = (0, _util.stringToBytes)(password); 16673 } 16674 var encryptionKey; 16675 if (algorithm !== 5) { 16676 encryptionKey = prepareKeyData(fileIdBytes, passwordBytes, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); 16677 } else { 16678 var ownerValidationSalt = (0, _util.stringToBytes)(dict.get('O')).subarray(32, 40);
16679 var ownerKeySalt = (0, _util.stringToBytes)(dict.get('O')).subarray(40, 48); 16680 var uBytes = (0, _util.stringToBytes)(dict.get('U')).subarray(0, 48); 16681 var userValidationSalt = (0, _util.stringToBytes)(dict.get('U')).subarray(32, 40); 16682 var userKeySalt = (0, _util.stringToBytes)(dict.get('U')).subarray(40, 48); 16683 var ownerEncryption = (0, _util.stringToBytes)(dict.get('OE')); 16684 var userEncryption = (0, _util.stringToBytes)(dict.get('UE')); 16685 var perms = (0, _util.stringToBytes)(dict.get('Perms')); 16686 encryptionKey = createEncryptionKey20(revision, passwordBytes, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms); 16687 } 16688 if (!encryptionKey && !password) { 16689 throw new _util.PasswordException('No password given', _util.PasswordResponses.NEED_PASSWORD); 16690 } else if (!encryptionKey && password) { 16691 var decodedPassword = decodeUserPassword(passwordBytes, ownerPassword, revision, keyLength); 16692 encryptionKey = prepareKeyData(fileIdBytes, decodedPassword, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); 16693 } 16694 if (!encryptionKey) { 16695 throw new _util.PasswordException('Incorrect Password', _util.PasswordResponses.INCORRECT_PASSWORD); 16696 } 16697 this.encryptionKey = encryptionKey; 16698 if (algorithm >= 4) { 16699 var cf = dict.get('CF'); 16700 if ((0, _primitives.isDict)(cf)) { 16701 cf.suppressEncryption = true; 16702 } 16703 this.cf = cf; 16704 this.stmf = dict.get('StmF') || identityName; 16705 this.strf = dict.get('StrF') || identityName; 16706 this.eff = dict.get('EFF') || this.stmf; 16707 } 16708 } 16709 function buildObjectKey(num, gen, encryptionKey, isAes) { 16710 var key = new Uint8Array(encryptionKey.length + 9), 16711 i, 16712 n; 16713 for (i = 0, n = encryptionKey.length; i < n; ++i) { 16714 key[i] = encryptionKey[i]; 16715 } 16716 key[i++] = num & 0xFF; 16717 key[i++] = num >> 8 & 0xFF; 16718 key[i++] = num >> 16 & 0xFF; 16719 key[i++] = gen & 0xFF; 16720 key[i++] = gen >> 8 & 0xFF; 16721 if (isAes) { 16722 key[i++] = 0x73; 16723 key[i++] = 0x41; 16724 key[i++] = 0x6C; 16725 key[i++] = 0x54; 16726 } 16727 var hash = calculateMD5(key, 0, i); 16728 return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); 16729 } 16730 function buildCipherConstructor(cf, name, num, gen, key) { 16731 if (!(0, _primitives.isName)(name)) { 16732 throw new _util.FormatError('Invalid crypt filter name.'); 16733 } 16734 var cryptFilter = cf.get(name.name); 16735 var cfm;
vendor: 11,796 bytes, lines 16736-17033
16736 if (cryptFilter !== null && cryptFilter !== undefined) { 16737 cfm = cryptFilter.get('CFM'); 16738 } 16739 if (!cfm || cfm.name === 'None') { 16740 return function cipherTransformFactoryBuildCipherConstructorNone() { 16741 return new NullCipher(); 16742 }; 16743 } 16744 if (cfm.name === 'V2') { 16745 return function cipherTransformFactoryBuildCipherConstructorV2() { 16746 return new ARCFourCipher(buildObjectKey(num, gen, key, false)); 16747 }; 16748 } 16749 if (cfm.name === 'AESV2') { 16750 return function cipherTransformFactoryBuildCipherConstructorAESV2() { 16751 return new AES128Cipher(buildObjectKey(num, gen, key, true)); 16752 }; 16753 } 16754 if (cfm.name === 'AESV3') { 16755 return function cipherTransformFactoryBuildCipherConstructorAESV3() { 16756 return new AES256Cipher(key); 16757 }; 16758 } 16759 throw new _util.FormatError('Unknown crypto method'); 16760 } 16761 CipherTransformFactory.prototype = { 16762 createCipherTransform: function CipherTransformFactory_createCipherTransform(num, gen) { 16763 if (this.algorithm === 4 || this.algorithm === 5) { 16764 return new CipherTransform(buildCipherConstructor(this.cf, this.stmf, num, gen, this.encryptionKey), buildCipherConstructor(this.cf, this.strf, num, gen, this.encryptionKey)); 16765 } 16766 var key = buildObjectKey(num, gen, this.encryptionKey, false); 16767 var cipherConstructor = function buildCipherCipherConstructor() { 16768 return new ARCFourCipher(key); 16769 }; 16770 return new CipherTransform(cipherConstructor, cipherConstructor); 16771 } 16772 }; 16773 return CipherTransformFactory; 16774}(); 16775exports.AES128Cipher = AES128Cipher; 16776exports.AES256Cipher = AES256Cipher; 16777exports.ARCFourCipher = ARCFourCipher; 16778exports.CipherTransformFactory = CipherTransformFactory; 16779exports.PDF17 = PDF17; 16780exports.PDF20 = PDF20; 16781exports.calculateMD5 = calculateMD5; 16782exports.calculateSHA256 = calculateSHA256; 16783exports.calculateSHA384 = calculateSHA384; 16784exports.calculateSHA512 = calculateSHA512; 16785 16786/***/ }), 16787/* 68 */ 16788/***/ (function(module, exports, __w_pdfjs_require__) { 16789 16790"use strict"; 16791 16792 16793Object.defineProperty(exports, "__esModule", { 16794 value: true 16795}); 16796exports.CFFCompiler = exports.CFFPrivateDict = exports.CFFTopDict = exports.CFFCharset = exports.CFFIndex = exports.CFFStrings = exports.CFFHeader = exports.CFF = exports.CFFParser = exports.CFFStandardStrings = undefined; 16797 16798var _util = __w_pdfjs_require__(0); 16799 16800var _charsets = __w_pdfjs_require__(138); 16801 16802var _encodings = __w_pdfjs_require__(21); 16803 16804var MAX_SUBR_NESTING = 10; 16805var CFFStandardStrings = ['.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', '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', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'quoteleft', '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', 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', 'questiondown', 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'emdash', 'AE', 'ordfeminine', 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', 'dotlessi', 'lslash', 'oslash', 'oe', 'germandbls', 'onesuperior', 'logicalnot', 'mu', 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', 'onequarter', 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', 'twosuperior', 'registered', 'minus', 'eth', 'multiply', 'threesuperior', 'copyright', 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', 'Atilde', 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', 'Ocircumflex', 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', 'Ucircumflex', 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', 'aacute', 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', 'ccedilla', 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', 'icircumflex', 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', 'odieresis', 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', 'udieresis', 'ugrave', 'yacute', 'ydieresis', 'zcaron', 'exclamsmall', 'Hungarumlautsmall', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'questionsmall', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', 'tsuperior', 'ff', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', 'Tildesmall', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', 'Dotaccentsmall', 'Macronsmall', 'figuredash', 'hypheninferior', 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', 'Ydieresissmall', '001.000', '001.001', '001.002', '001.003', 'Black', 'Bold', 'Book', 'Light', 'Medium', 'Regular', 'Roman', 'Semibold']; 16806var CFFParser = function CFFParserClosure() { 16807 var CharstringValidationData = [null, { 16808 id: 'hstem', 16809 min: 2, 16810 stackClearing: true, 16811 stem: true 16812 }, null, { 16813 id: 'vstem', 16814 min: 2, 16815 stackClearing: true, 16816 stem: true 16817 }, { 16818 id: 'vmoveto', 16819 min: 1, 16820 stackClearing: true 16821 }, { 16822 id: 'rlineto', 16823 min: 2, 16824 resetStack: true 16825 }, { 16826 id: 'hlineto', 16827 min: 1, 16828 resetStack: true 16829 }, { 16830 id: 'vlineto', 16831 min: 1, 16832 resetStack: true 16833 }, { 16834 id: 'rrcurveto', 16835 min: 6, 16836 resetStack: true 16837 }, null, { 16838 id: 'callsubr', 16839 min: 1, 16840 undefStack: true 16841 }, { 16842 id: 'return', 16843 min: 0, 16844 undefStack: true 16845 }, null, null, { 16846 id: 'endchar', 16847 min: 0, 16848 stackClearing: true 16849 }, null, null, null, { 16850 id: 'hstemhm', 16851 min: 2, 16852 stackClearing: true, 16853 stem: true 16854 }, { 16855 id: 'hintmask', 16856 min: 0, 16857 stackClearing: true 16858 }, { 16859 id: 'cntrmask', 16860 min: 0, 16861 stackClearing: true 16862 }, { 16863 id: 'rmoveto', 16864 min: 2, 16865 stackClearing: true 16866 }, { 16867 id: 'hmoveto', 16868 min: 1, 16869 stackClearing: true 16870 }, { 16871 id: 'vstemhm', 16872 min: 2, 16873 stackClearing: true, 16874 stem: true 16875 }, { 16876 id: 'rcurveline', 16877 min: 8, 16878 resetStack: true 16879 }, { 16880 id: 'rlinecurve', 16881 min: 8, 16882 resetStack: true 16883 }, { 16884 id: 'vvcurveto', 16885 min: 4, 16886 resetStack: true 16887 }, { 16888 id: 'hhcurveto', 16889 min: 4, 16890 resetStack: true 16891 }, null, { 16892 id: 'callgsubr', 16893 min: 1, 16894 undefStack: true 16895 }, { 16896 id: 'vhcurveto', 16897 min: 4, 16898 resetStack: true 16899 }, { 16900 id: 'hvcurveto', 16901 min: 4, 16902 resetStack: true 16903 }]; 16904 var CharstringValidationData12 = [null, null, null, { 16905 id: 'and', 16906 min: 2, 16907 stackDelta: -1 16908 }, { 16909 id: 'or', 16910 min: 2, 16911 stackDelta: -1 16912 }, { 16913 id: 'not', 16914 min: 1, 16915 stackDelta: 0 16916 }, null, null, null, { 16917 id: 'abs', 16918 min: 1, 16919 stackDelta: 0 16920 }, { 16921 id: 'add', 16922 min: 2, 16923 stackDelta: -1, 16924 stackFn: function stack_div(stack, index) { 16925 stack[index - 2] = stack[index - 2] + stack[index - 1]; 16926 } 16927 }, { 16928 id: 'sub', 16929 min: 2, 16930 stackDelta: -1, 16931 stackFn: function stack_div(stack, index) { 16932 stack[index - 2] = stack[index - 2] - stack[index - 1]; 16933 } 16934 }, { 16935 id: 'div', 16936 min: 2, 16937 stackDelta: -1, 16938 stackFn: function stack_div(stack, index) { 16939 stack[index - 2] = stack[index - 2] / stack[index - 1]; 16940 } 16941 }, null, { 16942 id: 'neg', 16943 min: 1, 16944 stackDelta: 0, 16945 stackFn: function stack_div(stack, index) { 16946 stack[index - 1] = -stack[index - 1]; 16947 } 16948 }, { 16949 id: 'eq', 16950 min: 2, 16951 stackDelta: -1 16952 }, null, null, { 16953 id: 'drop', 16954 min: 1, 16955 stackDelta: -1 16956 }, null, { 16957 id: 'put', 16958 min: 2, 16959 stackDelta: -2 16960 }, { 16961 id: 'get', 16962 min: 1, 16963 stackDelta: 0 16964 }, { 16965 id: 'ifelse', 16966 min: 4, 16967 stackDelta: -3 16968 }, { 16969 id: 'random', 16970 min: 0, 16971 stackDelta: 1 16972 }, { 16973 id: 'mul', 16974 min: 2, 16975 stackDelta: -1, 16976 stackFn: function stack_div(stack, index) { 16977 stack[index - 2] = stack[index - 2] * stack[index - 1]; 16978 } 16979 }, null, { 16980 id: 'sqrt', 16981 min: 1, 16982 stackDelta: 0 16983 }, { 16984 id: 'dup', 16985 min: 1, 16986 stackDelta: 1 16987 }, { 16988 id: 'exch', 16989 min: 2, 16990 stackDelta: 0 16991 }, { 16992 id: 'index', 16993 min: 2, 16994 stackDelta: 0 16995 }, { 16996 id: 'roll', 16997 min: 3, 16998 stackDelta: -2 16999 }, null, null, null, { 17000 id: 'hflex', 17001 min: 7, 17002 resetStack: true 17003 }, { 17004 id: 'flex', 17005 min: 13, 17006 resetStack: true 17007 }, { 17008 id: 'hflex1', 17009 min: 9, 17010 resetStack: true 17011 }, { 17012 id: 'flex1', 17013 min: 11, 17014 resetStack: true 17015 }]; 17016 function CFFParser(file, properties, seacAnalysisEnabled) { 17017 this.bytes = file.getBytes(); 17018 this.properties = properties; 17019 this.seacAnalysisEnabled = !!seacAnalysisEnabled; 17020 } 17021 CFFParser.prototype = { 17022 parse: function CFFParser_parse() { 17023 var properties = this.properties; 17024 var cff = new CFF(); 17025 this.cff = cff; 17026 var header = this.parseHeader(); 17027 var nameIndex = this.parseIndex(header.endPos); 17028 var topDictIndex = this.parseIndex(nameIndex.endPos); 17029 var stringIndex = this.parseIndex(topDictIndex.endPos); 17030 var globalSubrIndex = this.parseIndex(stringIndex.endPos); 17031 var topDictParsed = this.parseDict(topDictIndex.obj.get(0)); 17032 var topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings); 17033 cff.header = header.obj;
17034 cff.names = this.parseNameIndex(nameIndex.obj); 17035 cff.strings = this.parseStringIndex(stringIndex.obj); 17036 cff.topDict = topDict; 17037 cff.globalSubrIndex = globalSubrIndex.obj; 17038 this.parsePrivateDict(cff.topDict); 17039 cff.isCIDFont = topDict.hasName('ROS'); 17040 var charStringOffset = topDict.getByName('CharStrings'); 17041 var charStringIndex = this.parseIndex(charStringOffset).obj; 17042 var fontMatrix = topDict.getByName('FontMatrix'); 17043 if (fontMatrix) { 17044 properties.fontMatrix = fontMatrix; 17045 } 17046 var fontBBox = topDict.getByName('FontBBox'); 17047 if (fontBBox) { 17048 properties.ascent = Math.max(fontBBox[3], fontBBox[1]); 17049 properties.descent = Math.min(fontBBox[1], fontBBox[3]); 17050 properties.ascentScaled = true; 17051 } 17052 var charset, encoding; 17053 if (cff.isCIDFont) { 17054 var fdArrayIndex = this.parseIndex(topDict.getByName('FDArray')).obj; 17055 for (var i = 0, ii = fdArrayIndex.count; i < ii; ++i) { 17056 var dictRaw = fdArrayIndex.get(i); 17057 var fontDict = this.createDict(CFFTopDict, this.parseDict(dictRaw), cff.strings); 17058 this.parsePrivateDict(fontDict); 17059 cff.fdArray.push(fontDict); 17060 } 17061 encoding = null; 17062 charset = this.parseCharsets(topDict.getByName('charset'), charStringIndex.count, cff.strings, true); 17063 cff.fdSelect = this.parseFDSelect(topDict.getByName('FDSelect'), charStringIndex.count); 17064 } else { 17065 charset = this.parseCharsets(topDict.getByName('charset'), charStringIndex.count, cff.strings, false); 17066 encoding = this.parseEncoding(topDict.getByName('Encoding'), properties, cff.strings, charset.charset); 17067 } 17068 cff.charset = charset; 17069 cff.encoding = encoding; 17070 var charStringsAndSeacs = this.parseCharStrings({ 17071 charStrings: charStringIndex, 17072 localSubrIndex: topDict.privateDict.subrsIndex, 17073 globalSubrIndex: globalSubrIndex.obj, 17074 fdSelect: cff.fdSelect, 17075 fdArray: cff.fdArray, 17076 privateDict: topDict.privateDict 17077 }); 17078 cff.charStrings = charStringsAndSeacs.charStrings; 17079 cff.seacs = charStringsAndSeacs.seacs; 17080 cff.widths = charStringsAndSeacs.widths; 17081 return cff; 17082 }, 17083 parseHeader: function CFFParser_parseHeader() { 17084 var bytes = this.bytes; 17085 var bytesLength = bytes.length; 17086 var offset = 0; 17087 while (offset < bytesLength && bytes[offset] !== 1) { 17088 ++offset; 17089 } 17090 if (offset >= bytesLength) { 17091 throw new _util.FormatError('Invalid CFF header'); 17092 } 17093 if (offset !== 0) { 17094 (0, _util.info)('cff data is shifted'); 17095 bytes = bytes.subarray(offset); 17096 this.bytes = bytes; 17097 } 17098 var major = bytes[0]; 17099 var minor = bytes[1]; 17100 var hdrSize = bytes[2]; 17101 var offSize = bytes[3]; 17102 var header = new CFFHeader(major, minor, hdrSize, offSize); 17103 return { 17104 obj: header, 17105 endPos: hdrSize 17106 }; 17107 }, 17108 parseDict: function CFFParser_parseDict(dict) { 17109 var pos = 0; 17110 function parseOperand() { 17111 var value = dict[pos++]; 17112 if (value === 30) { 17113 return parseFloatOperand(); 17114 } else if (value === 28) { 17115 value = dict[pos++]; 17116 value = (value << 24 | dict[pos++] << 16) >> 16; 17117 return value; 17118 } else if (value === 29) { 17119 value = dict[pos++]; 17120 value = value << 8 | dict[pos++]; 17121 value = value << 8 | dict[pos++]; 17122 value = value << 8 | dict[pos++]; 17123 return value; 17124 } else if (value >= 32 && value <= 246) { 17125 return value - 139; 17126 } else if (value >= 247 && value <= 250) { 17127 return (value - 247) * 256 + dict[pos++] + 108; 17128 } else if (value >= 251 && value <= 254) { 17129 return -((value - 251) * 256) - dict[pos++] - 108; 17130 } 17131 (0, _util.warn)('CFFParser_parseDict: "' + value + '" is a reserved command.'); 17132 return NaN; 17133 } 17134 function parseFloatOperand() { 17135 var str = ''; 17136 var eof = 15; 17137 var lookup = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', 'E', 'E-', null, '-']; 17138 var length = dict.length; 17139 while (pos < length) { 17140 var b = dict[pos++]; 17141 var b1 = b >> 4; 17142 var b2 = b & 15;
17143 if (b1 === eof) { 17144 break; 17145 } 17146 str += lookup[b1]; 17147 if (b2 === eof) { 17148 break; 17149 } 17150 str += lookup[b2]; 17151 } 17152 return parseFloat(str); 17153 } 17154 var operands = []; 17155 var entries = []; 17156 pos = 0; 17157 var end = dict.length; 17158 while (pos < end) { 17159 var b = dict[pos]; 17160 if (b <= 21) { 17161 if (b === 12) { 17162 b = b << 8 | dict[++pos]; 17163 } 17164 entries.push([b, operands]); 17165 operands = []; 17166 ++pos; 17167 } else { 17168 operands.push(parseOperand()); 17169 } 17170 } 17171 return entries; 17172 }, 17173 parseIndex: function CFFParser_parseIndex(pos) { 17174 var cffIndex = new CFFIndex(); 17175 var bytes = this.bytes; 17176 var count = bytes[pos++] << 8 | bytes[pos++]; 17177 var offsets = []; 17178 var end = pos; 17179 var i, ii; 17180 if (count !== 0) { 17181 var offsetSize = bytes[pos++]; 17182 var startPos = pos + (count + 1) * offsetSize - 1; 17183 for (i = 0, ii = count + 1; i < ii; ++i) { 17184 var offset = 0; 17185 for (var j = 0; j < offsetSize; ++j) { 17186 offset <<= 8; 17187 offset += bytes[pos++]; 17188 } 17189 offsets.push(startPos + offset); 17190 } 17191 end = offsets[count]; 17192 } 17193 for (i = 0, ii = offsets.length - 1; i < ii; ++i) { 17194 var offsetStart = offsets[i]; 17195 var offsetEnd = offsets[i + 1]; 17196 cffIndex.add(bytes.subarray(offsetStart, offsetEnd)); 17197 } 17198 return { 17199 obj: cffIndex, 17200 endPos: end 17201 }; 17202 }, 17203 parseNameIndex: function CFFParser_parseNameIndex(index) { 17204 var names = []; 17205 for (var i = 0, ii = index.count; i < ii; ++i) { 17206 var name = index.get(i); 17207 names.push((0, _util.bytesToString)(name)); 17208 } 17209 return names; 17210 }, 17211 parseStringIndex: function CFFParser_parseStringIndex(index) { 17212 var strings = new CFFStrings(); 17213 for (var i = 0, ii = index.count; i < ii; ++i) { 17214 var data = index.get(i); 17215 strings.add((0, _util.bytesToString)(data)); 17216 } 17217 return strings; 17218 }, 17219 createDict: function CFFParser_createDict(Type, dict, strings) { 17220 var cffDict = new Type(strings); 17221 for (var i = 0, ii = dict.length; i < ii; ++i) { 17222 var pair = dict[i]; 17223 var key = pair[0]; 17224 var value = pair[1]; 17225 cffDict.setByKey(key, value); 17226 } 17227 return cffDict; 17228 }, 17229 parseCharString: function CFFParser_parseCharString(state, data, localSubrIndex, globalSubrIndex) { 17230 if (!data || state.callDepth > MAX_SUBR_NESTING) { 17231 return false; 17232 } 17233 var stackSize = state.stackSize; 17234 var stack = state.stack; 17235 var length = data.length; 17236 for (var j = 0; j < length;) { 17237 var value = data[j++]; 17238 var validationCommand = null; 17239 if (value === 12) { 17240 var q = data[j++]; 17241 if (q === 0) { 17242 data[j - 2] = 139; 17243 data[j - 1] = 22; 17244 stackSize = 0; 17245 } else { 17246 validationCommand = CharstringValidationData12[q]; 17247 } 17248 } else if (value === 28) { 17249 stack[stackSize] = (data[j] << 24 | data[j + 1] << 16) >> 16; 17250 j += 2; 17251 stackSize++; 17252 } else if (value === 14) { 17253 if (stackSize >= 4) { 17254 stackSize -= 4; 17255 if (this.seacAnalysisEnabled) { 17256 state.seac = stack.slice(stackSize, stackSize + 4); 17257 return false; 17258 } 17259 } 17260 validationCommand = CharstringValidationData[value]; 17261 } else if (value >= 32 && value <= 246) { 17262 stack[stackSize] = value - 139; 17263 stackSize++; 17264 } else if (value >= 247 && value <= 254) { 17265 stack[stackSize] = value < 251 ? (value - 247 << 8) + data[j] + 108 : -(value - 251 << 8) - data[j] - 108; 17266 j++; 17267 stackSize++; 17268 } else if (value === 255) { 17269 stack[stackSize] = (data[j] << 24 | data[j + 1] << 16 | data[j + 2] << 8 | data[j + 3]) / 65536; 17270 j += 4; 17271 stackSize++; 17272 } else if (value === 19 || value === 20) { 17273 state.hints += stackSize >> 1; 17274 j += state.hints + 7 >> 3; 17275 stackSize %= 2; 17276 validationCommand = CharstringValidationData[value]; 17277 } else if (value === 10 || value === 29) { 17278 var subrsIndex; 17279 if (value === 10) { 17280 subrsIndex = localSubrIndex; 17281 } else { 17282 subrsIndex = globalSubrIndex; 17283 } 17284 if (!subrsIndex) { 17285 validationCommand = CharstringValidationData[value]; 17286 (0, _util.warn)('Missing subrsIndex for ' + validationCommand.id); 17287 return false; 17288 } 17289 var bias = 32768; 17290 if (subrsIndex.count < 1240) { 17291 bias = 107; 17292 } else if (subrsIndex.count < 33900) { 17293 bias = 1131; 17294 } 17295 var subrNumber = stack[--stackSize] + bias; 17296 if (subrNumber < 0 || subrNumber >= subrsIndex.count || isNaN(subrNumber)) { 17297 validationCommand = CharstringValidationData[value]; 17298 (0, _util.warn)('Out of bounds subrIndex for ' + validationCommand.id); 17299 return false; 17300 } 17301 state.stackSize = stackSize; 17302 state.callDepth++;
17303 var valid = this.parseCharString(state, subrsIndex.get(subrNumber), localSubrIndex, globalSubrIndex); 17304 if (!valid) { 17305 return false; 17306 } 17307 state.callDepth--; 17308 stackSize = state.stackSize; 17309 continue; 17310 } else if (value === 11) { 17311 state.stackSize = stackSize; 17312 return true; 17313 } else { 17314 validationCommand = CharstringValidationData[value]; 17315 } 17316 if (validationCommand) { 17317 if (validationCommand.stem) { 17318 state.hints += stackSize >> 1; 17319 } 17320 if ('min' in validationCommand) { 17321 if (!state.undefStack && stackSize < validationCommand.min) { 17322 (0, _util.warn)('Not enough parameters for ' + validationCommand.id + '; actual: ' + stackSize + ', expected: ' + validationCommand.min); 17323 return false; 17324 } 17325 } 17326 if (state.firstStackClearing && validationCommand.stackClearing) { 17327 state.firstStackClearing = false; 17328 stackSize -= validationCommand.min; 17329 if (stackSize >= 2 && validationCommand.stem) { 17330 stackSize %= 2; 17331 } else if (stackSize > 1) { 17332 (0, _util.warn)('Found too many parameters for stack-clearing command'); 17333 } 17334 if (stackSize > 0 && stack[stackSize - 1] >= 0) { 17335 state.width = stack[stackSize - 1]; 17336 } 17337 } 17338 if ('stackDelta' in validationCommand) { 17339 if ('stackFn' in validationCommand) { 17340 validationCommand.stackFn(stack, stackSize); 17341 } 17342 stackSize += validationCommand.stackDelta; 17343 } else if (validationCommand.stackClearing) { 17344 stackSize = 0; 17345 } else if (validationCommand.resetStack) { 17346 stackSize = 0; 17347 state.undefStack = false; 17348 } else if (validationCommand.undefStack) { 17349 stackSize = 0; 17350 state.undefStack = true; 17351 state.firstStackClearing = false; 17352 } 17353 } 17354 } 17355 state.stackSize = stackSize; 17356 return true; 17357 }, 17358 parseCharStrings: function parseCharStrings(_ref) { 17359 var charStrings = _ref.charStrings, 17360 localSubrIndex = _ref.localSubrIndex, 17361 globalSubrIndex = _ref.globalSubrIndex, 17362 fdSelect = _ref.fdSelect, 17363 fdArray = _ref.fdArray, 17364 privateDict = _ref.privateDict; 17365 17366 var seacs = []; 17367 var widths = []; 17368 var count = charStrings.count; 17369 for (var i = 0; i < count; i++) { 17370 var charstring = charStrings.get(i); 17371 var state = { 17372 callDepth: 0, 17373 stackSize: 0, 17374 stack: [], 17375 undefStack: true, 17376 hints: 0, 17377 firstStackClearing: true, 17378 seac: null, 17379 width: null 17380 }; 17381 var valid = true; 17382 var localSubrToUse = null; 17383 var privateDictToUse = privateDict; 17384 if (fdSelect && fdArray.length) { 17385 var fdIndex = fdSelect.getFDIndex(i); 17386 if (fdIndex === -1) { 17387 (0, _util.warn)('Glyph index is not in fd select.'); 17388 valid = false; 17389 } 17390 if (fdIndex >= fdArray.length) { 17391 (0, _util.warn)('Invalid fd index for glyph index.'); 17392 valid = false; 17393 } 17394 if (valid) { 17395 privateDictToUse = fdArray[fdIndex].privateDict; 17396 localSubrToUse = privateDictToUse.subrsIndex; 17397 } 17398 } else if (localSubrIndex) { 17399 localSubrToUse = localSubrIndex; 17400 } 17401 if (valid) { 17402 valid = this.parseCharString(state, charstring, localSubrToUse, globalSubrIndex); 17403 } 17404 if (state.width !== null) { 17405 var nominalWidth = privateDictToUse.getByName('nominalWidthX'); 17406 widths[i] = nominalWidth + state.width; 17407 } else { 17408 var defaultWidth = privateDictToUse.getByName('defaultWidthX'); 17409 widths[i] = defaultWidth; 17410 } 17411 if (state.seac !== null) { 17412 seacs[i] = state.seac; 17413 } 17414 if (!valid) { 17415 charStrings.set(i, new Uint8Array([14])); 17416 } 17417 } 17418 return { 17419 charStrings: charStrings, 17420 seacs: seacs, 17421 widths: widths 17422 }; 17423 }, 17424 17425 emptyPrivateDictionary: function CFFParser_emptyPrivateDictionary(parentDict) { 17426 var privateDict = this.createDict(CFFPrivateDict, [], parentDict.strings); 17427 parentDict.setByKey(18, [0, 0]); 17428 parentDict.privateDict = privateDict; 17429 }, 17430 parsePrivateDict: function CFFParser_parsePrivateDict(parentDict) { 17431 if (!parentDict.hasName('Private')) { 17432 this.emptyPrivateDictionary(parentDict); 17433 return; 17434 } 17435 var privateOffset = parentDict.getByName('Private'); 17436 if (!Array.isArray(privateOffset) || privateOffset.length !== 2) { 17437 parentDict.removeByName('Private'); 17438 return; 17439 } 17440 var size = privateOffset[0]; 17441 var offset = privateOffset[1]; 17442 if (size === 0 || offset >= this.bytes.length) { 17443 this.emptyPrivateDictionary(parentDict); 17444 return; 17445 } 17446 var privateDictEnd = offset + size; 17447 var dictData = this.bytes.subarray(offset, privateDictEnd); 17448 var dict = this.parseDict(dictData); 17449 var privateDict = this.createDict(CFFPrivateDict, dict, parentDict.strings); 17450 parentDict.privateDict = privateDict; 17451 if (!privateDict.getByName('Subrs')) { 17452 return; 17453 } 17454 var subrsOffset = privateDict.getByName('Subrs'); 17455 var relativeOffset = offset + subrsOffset; 17456 if (subrsOffset === 0 || relativeOffset >= this.bytes.length) { 17457 this.emptyPrivateDictionary(parentDict); 17458 return; 17459 } 17460 var subrsIndex = this.parseIndex(relativeOffset); 17461 privateDict.subrsIndex = subrsIndex.obj; 17462 }, 17463 parseCharsets: function CFFParser_parseCharsets(pos, length, strings, cid) { 17464 if (pos === 0) { 17465 return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, _charsets.ISOAdobeCharset); 17466 } else if (pos === 1) { 17467 return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT, _charsets.ExpertCharset); 17468 } else if (pos === 2) { 17469 return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT_SUBSET, _charsets.ExpertSubsetCharset); 17470 } 17471 var bytes = this.bytes; 17472 var start = pos; 17473 var format = bytes[pos++]; 17474 var charset = ['.notdef']; 17475 var id, count, i; 17476 length -= 1; 17477 switch (format) { 17478 case 0: 17479 for (i = 0; i < length; i++) {
vendor: 4,673 bytes, lines 17480-17614
17480 id = bytes[pos++] << 8 | bytes[pos++]; 17481 charset.push(cid ? id : strings.get(id)); 17482 } 17483 break; 17484 case 1: 17485 while (charset.length <= length) { 17486 id = bytes[pos++] << 8 | bytes[pos++]; 17487 count = bytes[pos++]; 17488 for (i = 0; i <= count; i++) { 17489 charset.push(cid ? id++ : strings.get(id++)); 17490 } 17491 } 17492 break; 17493 case 2: 17494 while (charset.length <= length) { 17495 id = bytes[pos++] << 8 | bytes[pos++]; 17496 count = bytes[pos++] << 8 | bytes[pos++]; 17497 for (i = 0; i <= count; i++) { 17498 charset.push(cid ? id++ : strings.get(id++)); 17499 } 17500 } 17501 break; 17502 default: 17503 throw new _util.FormatError('Unknown charset format'); 17504 } 17505 var end = pos; 17506 var raw = bytes.subarray(start, end); 17507 return new CFFCharset(false, format, charset, raw); 17508 }, 17509 parseEncoding: function CFFParser_parseEncoding(pos, properties, strings, charset) { 17510 var encoding = Object.create(null); 17511 var bytes = this.bytes; 17512 var predefined = false; 17513 var format, i, ii; 17514 var raw = null; 17515 function readSupplement() { 17516 var supplementsCount = bytes[pos++]; 17517 for (i = 0; i < supplementsCount; i++) { 17518 var code = bytes[pos++]; 17519 var sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff); 17520 encoding[code] = charset.indexOf(strings.get(sid)); 17521 } 17522 } 17523 if (pos === 0 || pos === 1) { 17524 predefined = true; 17525 format = pos; 17526 var baseEncoding = pos ? _encodings.ExpertEncoding : _encodings.StandardEncoding; 17527 for (i = 0, ii = charset.length; i < ii; i++) { 17528 var index = baseEncoding.indexOf(charset[i]); 17529 if (index !== -1) { 17530 encoding[index] = i; 17531 } 17532 } 17533 } else { 17534 var dataStart = pos; 17535 format = bytes[pos++]; 17536 switch (format & 0x7f) { 17537 case 0: 17538 var glyphsCount = bytes[pos++]; 17539 for (i = 1; i <= glyphsCount; i++) { 17540 encoding[bytes[pos++]] = i; 17541 } 17542 break; 17543 case 1: 17544 var rangesCount = bytes[pos++]; 17545 var gid = 1; 17546 for (i = 0; i < rangesCount; i++) { 17547 var start = bytes[pos++]; 17548 var left = bytes[pos++]; 17549 for (var j = start; j <= start + left; j++) { 17550 encoding[j] = gid++; 17551 } 17552 } 17553 break; 17554 default: 17555 throw new _util.FormatError('Unknown encoding format: ' + format + ' in CFF'); 17556 } 17557 var dataEnd = pos; 17558 if (format & 0x80) { 17559 bytes[dataStart] &= 0x7f; 17560 readSupplement(); 17561 } 17562 raw = bytes.subarray(dataStart, dataEnd); 17563 } 17564 format = format & 0x7f; 17565 return new CFFEncoding(predefined, format, encoding, raw); 17566 }, 17567 parseFDSelect: function CFFParser_parseFDSelect(pos, length) { 17568 var start = pos; 17569 var bytes = this.bytes; 17570 var format = bytes[pos++]; 17571 var fdSelect = [], 17572 rawBytes; 17573 var i, 17574 invalidFirstGID = false; 17575 switch (format) { 17576 case 0: 17577 for (i = 0; i < length; ++i) { 17578 var id = bytes[pos++]; 17579 fdSelect.push(id); 17580 } 17581 rawBytes = bytes.subarray(start, pos); 17582 break; 17583 case 3: 17584 var rangesCount = bytes[pos++] << 8 | bytes[pos++]; 17585 for (i = 0; i < rangesCount; ++i) { 17586 var first = bytes[pos++] << 8 | bytes[pos++]; 17587 if (i === 0 && first !== 0) { 17588 (0, _util.warn)('parseFDSelect: The first range must have a first GID of 0' + ' -- trying to recover.'); 17589 invalidFirstGID = true; 17590 first = 0; 17591 } 17592 var fdIndex = bytes[pos++]; 17593 var next = bytes[pos] << 8 | bytes[pos + 1]; 17594 for (var j = first; j < next; ++j) { 17595 fdSelect.push(fdIndex); 17596 } 17597 } 17598 pos += 2; 17599 rawBytes = bytes.subarray(start, pos); 17600 if (invalidFirstGID) { 17601 rawBytes[3] = rawBytes[4] = 0; 17602 } 17603 break; 17604 default: 17605 throw new _util.FormatError('parseFDSelect: Unknown format "' + format + '".'); 17606 } 17607 if (fdSelect.length !== length) { 17608 throw new _util.FormatError('parseFDSelect: Invalid font data.'); 17609 } 17610 return new CFFFDSelect(fdSelect, rawBytes); 17611 } 17612 }; 17613 return CFFParser; 17614}();
vendor: 15,360 bytes, lines 17615-18008
17615var CFF = function CFFClosure() { 17616 function CFF() { 17617 this.header = null; 17618 this.names = []; 17619 this.topDict = null; 17620 this.strings = new CFFStrings(); 17621 this.globalSubrIndex = null; 17622 this.encoding = null; 17623 this.charset = null; 17624 this.charStrings = null; 17625 this.fdArray = []; 17626 this.fdSelect = null; 17627 this.isCIDFont = false; 17628 } 17629 return CFF; 17630}(); 17631var CFFHeader = function CFFHeaderClosure() { 17632 function CFFHeader(major, minor, hdrSize, offSize) { 17633 this.major = major; 17634 this.minor = minor; 17635 this.hdrSize = hdrSize; 17636 this.offSize = offSize; 17637 } 17638 return CFFHeader; 17639}(); 17640var CFFStrings = function CFFStringsClosure() { 17641 function CFFStrings() { 17642 this.strings = []; 17643 } 17644 CFFStrings.prototype = { 17645 get: function CFFStrings_get(index) { 17646 if (index >= 0 && index <= 390) { 17647 return CFFStandardStrings[index]; 17648 } 17649 if (index - 391 <= this.strings.length) { 17650 return this.strings[index - 391]; 17651 } 17652 return CFFStandardStrings[0]; 17653 }, 17654 add: function CFFStrings_add(value) { 17655 this.strings.push(value); 17656 }, 17657 get count() { 17658 return this.strings.length; 17659 } 17660 }; 17661 return CFFStrings; 17662}(); 17663var CFFIndex = function CFFIndexClosure() { 17664 function CFFIndex() { 17665 this.objects = []; 17666 this.length = 0; 17667 } 17668 CFFIndex.prototype = { 17669 add: function CFFIndex_add(data) { 17670 this.length += data.length; 17671 this.objects.push(data); 17672 }, 17673 set: function CFFIndex_set(index, data) { 17674 this.length += data.length - this.objects[index].length; 17675 this.objects[index] = data; 17676 }, 17677 get: function CFFIndex_get(index) { 17678 return this.objects[index]; 17679 }, 17680 get count() { 17681 return this.objects.length; 17682 } 17683 }; 17684 return CFFIndex; 17685}(); 17686var CFFDict = function CFFDictClosure() { 17687 function CFFDict(tables, strings) { 17688 this.keyToNameMap = tables.keyToNameMap; 17689 this.nameToKeyMap = tables.nameToKeyMap; 17690 this.defaults = tables.defaults; 17691 this.types = tables.types; 17692 this.opcodes = tables.opcodes; 17693 this.order = tables.order; 17694 this.strings = strings; 17695 this.values = Object.create(null); 17696 } 17697 CFFDict.prototype = { 17698 setByKey: function CFFDict_setByKey(key, value) { 17699 if (!(key in this.keyToNameMap)) { 17700 return false; 17701 } 17702 var valueLength = value.length; 17703 if (valueLength === 0) { 17704 return true; 17705 } 17706 for (var i = 0; i < valueLength; i++) { 17707 if (isNaN(value[i])) { 17708 (0, _util.warn)('Invalid CFFDict value: "' + value + '" for key "' + key + '".'); 17709 return true; 17710 } 17711 } 17712 var type = this.types[key]; 17713 if (type === 'num' || type === 'sid' || type === 'offset') { 17714 value = value[0]; 17715 } 17716 this.values[key] = value; 17717 return true; 17718 }, 17719 setByName: function CFFDict_setByName(name, value) { 17720 if (!(name in this.nameToKeyMap)) { 17721 throw new _util.FormatError('Invalid dictionary name "' + name + '"'); 17722 } 17723 this.values[this.nameToKeyMap[name]] = value; 17724 }, 17725 hasName: function CFFDict_hasName(name) { 17726 return this.nameToKeyMap[name] in this.values; 17727 }, 17728 getByName: function CFFDict_getByName(name) { 17729 if (!(name in this.nameToKeyMap)) { 17730 throw new _util.FormatError('Invalid dictionary name ' + name + '"'); 17731 } 17732 var key = this.nameToKeyMap[name]; 17733 if (!(key in this.values)) { 17734 return this.defaults[key]; 17735 } 17736 return this.values[key]; 17737 }, 17738 removeByName: function CFFDict_removeByName(name) { 17739 delete this.values[this.nameToKeyMap[name]]; 17740 } 17741 }; 17742 CFFDict.createTables = function CFFDict_createTables(layout) { 17743 var tables = { 17744 keyToNameMap: {}, 17745 nameToKeyMap: {}, 17746 defaults: {}, 17747 types: {}, 17748 opcodes: {}, 17749 order: [] 17750 }; 17751 for (var i = 0, ii = layout.length; i < ii; ++i) { 17752 var entry = layout[i]; 17753 var key = Array.isArray(entry[0]) ? (entry[0][0] << 8) + entry[0][1] : entry[0]; 17754 tables.keyToNameMap[key] = entry[1]; 17755 tables.nameToKeyMap[entry[1]] = key; 17756 tables.types[key] = entry[2]; 17757 tables.defaults[key] = entry[3]; 17758 tables.opcodes[key] = Array.isArray(entry[0]) ? entry[0] : [entry[0]]; 17759 tables.order.push(key); 17760 } 17761 return tables; 17762 }; 17763 return CFFDict; 17764}(); 17765var CFFTopDict = function CFFTopDictClosure() { 17766 var layout = [[[12, 30], 'ROS', ['sid', 'sid', 'num'], null], [[12, 20], 'SyntheticBase', 'num', null], [0, 'version', 'sid', null], [1, 'Notice', 'sid', null], [[12, 0], 'Copyright', 'sid', null], [2, 'FullName', 'sid', null], [3, 'FamilyName', 'sid', null], [4, 'Weight', 'sid', null], [[12, 1], 'isFixedPitch', 'num', 0], [[12, 2], 'ItalicAngle', 'num', 0], [[12, 3], 'UnderlinePosition', 'num', -100], [[12, 4], 'UnderlineThickness', 'num', 50], [[12, 5], 'PaintType', 'num', 0], [[12, 6], 'CharstringType', 'num', 2], [[12, 7], 'FontMatrix', ['num', 'num', 'num', 'num', 'num', 'num'], [0.001, 0, 0, 0.001, 0, 0]], [13, 'UniqueID', 'num', null], [5, 'FontBBox', ['num', 'num', 'num', 'num'], [0, 0, 0, 0]], [[12, 8], 'StrokeWidth', 'num', 0], [14, 'XUID', 'array', null], [15, 'charset', 'offset', 0], [16, 'Encoding', 'offset', 0], [17, 'CharStrings', 'offset', 0], [18, 'Private', ['offset', 'offset'], null], [[12, 21], 'PostScript', 'sid', null], [[12, 22], 'BaseFontName', 'sid', null], [[12, 23], 'BaseFontBlend', 'delta', null], [[12, 31], 'CIDFontVersion', 'num', 0], [[12, 32], 'CIDFontRevision', 'num', 0], [[12, 33], 'CIDFontType', 'num', 0], [[12, 34], 'CIDCount', 'num', 8720], [[12, 35], 'UIDBase', 'num', null], [[12, 37], 'FDSelect', 'offset', null], [[12, 36], 'FDArray', 'offset', null], [[12, 38], 'FontName', 'sid', null]]; 17767 var tables = null; 17768 function CFFTopDict(strings) { 17769 if (tables === null) { 17770 tables = CFFDict.createTables(layout); 17771 } 17772 CFFDict.call(this, tables, strings); 17773 this.privateDict = null; 17774 } 17775 CFFTopDict.prototype = Object.create(CFFDict.prototype); 17776 return CFFTopDict; 17777}(); 17778var CFFPrivateDict = function CFFPrivateDictClosure() { 17779 var layout = [[6, 'BlueValues', 'delta', null], [7, 'OtherBlues', 'delta', null], [8, 'FamilyBlues', 'delta', null], [9, 'FamilyOtherBlues', 'delta', null], [[12, 9], 'BlueScale', 'num', 0.039625], [[12, 10], 'BlueShift', 'num', 7], [[12, 11], 'BlueFuzz', 'num', 1], [10, 'StdHW', 'num', null], [11, 'StdVW', 'num', null], [[12, 12], 'StemSnapH', 'delta', null], [[12, 13], 'StemSnapV', 'delta', null], [[12, 14], 'ForceBold', 'num', 0], [[12, 17], 'LanguageGroup', 'num', 0], [[12, 18], 'ExpansionFactor', 'num', 0.06], [[12, 19], 'initialRandomSeed', 'num', 0], [20, 'defaultWidthX', 'num', 0], [21, 'nominalWidthX', 'num', 0], [19, 'Subrs', 'offset', null]]; 17780 var tables = null; 17781 function CFFPrivateDict(strings) { 17782 if (tables === null) { 17783 tables = CFFDict.createTables(layout); 17784 } 17785 CFFDict.call(this, tables, strings); 17786 this.subrsIndex = null; 17787 } 17788 CFFPrivateDict.prototype = Object.create(CFFDict.prototype); 17789 return CFFPrivateDict; 17790}(); 17791var CFFCharsetPredefinedTypes = { 17792 ISO_ADOBE: 0, 17793 EXPERT: 1, 17794 EXPERT_SUBSET: 2 17795}; 17796var CFFCharset = function CFFCharsetClosure() { 17797 function CFFCharset(predefined, format, charset, raw) { 17798 this.predefined = predefined; 17799 this.format = format; 17800 this.charset = charset; 17801 this.raw = raw; 17802 } 17803 return CFFCharset; 17804}(); 17805var CFFEncoding = function CFFEncodingClosure() { 17806 function CFFEncoding(predefined, format, encoding, raw) { 17807 this.predefined = predefined; 17808 this.format = format; 17809 this.encoding = encoding; 17810 this.raw = raw; 17811 } 17812 return CFFEncoding; 17813}(); 17814var CFFFDSelect = function CFFFDSelectClosure() { 17815 function CFFFDSelect(fdSelect, raw) { 17816 this.fdSelect = fdSelect; 17817 this.raw = raw; 17818 } 17819 CFFFDSelect.prototype = { 17820 getFDIndex: function CFFFDSelect_get(glyphIndex) { 17821 if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { 17822 return -1; 17823 } 17824 return this.fdSelect[glyphIndex]; 17825 } 17826 }; 17827 return CFFFDSelect; 17828}(); 17829var CFFOffsetTracker = function CFFOffsetTrackerClosure() { 17830 function CFFOffsetTracker() { 17831 this.offsets = Object.create(null); 17832 } 17833 CFFOffsetTracker.prototype = { 17834 isTracking: function CFFOffsetTracker_isTracking(key) { 17835 return key in this.offsets; 17836 }, 17837 track: function CFFOffsetTracker_track(key, location) { 17838 if (key in this.offsets) { 17839 throw new _util.FormatError('Already tracking location of ' + key); 17840 } 17841 this.offsets[key] = location; 17842 }, 17843 offset: function CFFOffsetTracker_offset(value) { 17844 for (var key in this.offsets) { 17845 this.offsets[key] += value; 17846 } 17847 }, 17848 setEntryLocation: function CFFOffsetTracker_setEntryLocation(key, values, output) { 17849 if (!(key in this.offsets)) { 17850 throw new _util.FormatError('Not tracking location of ' + key); 17851 } 17852 var data = output.data; 17853 var dataOffset = this.offsets[key]; 17854 var size = 5; 17855 for (var i = 0, ii = values.length; i < ii; ++i) { 17856 var offset0 = i * size + dataOffset; 17857 var offset1 = offset0 + 1; 17858 var offset2 = offset0 + 2; 17859 var offset3 = offset0 + 3; 17860 var offset4 = offset0 + 4; 17861 if (data[offset0] !== 0x1d || data[offset1] !== 0 || data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { 17862 throw new _util.FormatError('writing to an offset that is not empty'); 17863 } 17864 var value = values[i]; 17865 data[offset0] = 0x1d; 17866 data[offset1] = value >> 24 & 0xFF; 17867 data[offset2] = value >> 16 & 0xFF; 17868 data[offset3] = value >> 8 & 0xFF; 17869 data[offset4] = value & 0xFF; 17870 } 17871 } 17872 }; 17873 return CFFOffsetTracker; 17874}(); 17875var CFFCompiler = function CFFCompilerClosure() { 17876 function CFFCompiler(cff) { 17877 this.cff = cff; 17878 } 17879 CFFCompiler.prototype = { 17880 compile: function CFFCompiler_compile() { 17881 var cff = this.cff; 17882 var output = { 17883 data: [], 17884 length: 0, 17885 add: function CFFCompiler_add(data) { 17886 this.data = this.data.concat(data); 17887 this.length = this.data.length; 17888 } 17889 }; 17890 var header = this.compileHeader(cff.header); 17891 output.add(header); 17892 var nameIndex = this.compileNameIndex(cff.names); 17893 output.add(nameIndex); 17894 if (cff.isCIDFont) { 17895 if (cff.topDict.hasName('FontMatrix')) { 17896 var base = cff.topDict.getByName('FontMatrix'); 17897 cff.topDict.removeByName('FontMatrix'); 17898 for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { 17899 var subDict = cff.fdArray[i]; 17900 var matrix = base.slice(0); 17901 if (subDict.hasName('FontMatrix')) { 17902 matrix = _util.Util.transform(matrix, subDict.getByName('FontMatrix')); 17903 } 17904 subDict.setByName('FontMatrix', matrix); 17905 } 17906 } 17907 } 17908 var compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont); 17909 output.add(compiled.output); 17910 var topDictTracker = compiled.trackers[0]; 17911 var stringIndex = this.compileStringIndex(cff.strings.strings); 17912 output.add(stringIndex); 17913 var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); 17914 output.add(globalSubrIndex); 17915 if (cff.encoding && cff.topDict.hasName('Encoding')) { 17916 if (cff.encoding.predefined) { 17917 topDictTracker.setEntryLocation('Encoding', [cff.encoding.format], output); 17918 } else { 17919 var encoding = this.compileEncoding(cff.encoding); 17920 topDictTracker.setEntryLocation('Encoding', [output.length], output); 17921 output.add(encoding); 17922 } 17923 } 17924 if (cff.charset && cff.topDict.hasName('charset')) { 17925 if (cff.charset.predefined) { 17926 topDictTracker.setEntryLocation('charset', [cff.charset.format], output); 17927 } else { 17928 var charset = this.compileCharset(cff.charset); 17929 topDictTracker.setEntryLocation('charset', [output.length], output); 17930 output.add(charset); 17931 } 17932 } 17933 var charStrings = this.compileCharStrings(cff.charStrings); 17934 topDictTracker.setEntryLocation('CharStrings', [output.length], output); 17935 output.add(charStrings); 17936 if (cff.isCIDFont) { 17937 topDictTracker.setEntryLocation('FDSelect', [output.length], output); 17938 var fdSelect = this.compileFDSelect(cff.fdSelect.raw); 17939 output.add(fdSelect); 17940 compiled = this.compileTopDicts(cff.fdArray, output.length, true); 17941 topDictTracker.setEntryLocation('FDArray', [output.length], output); 17942 output.add(compiled.output); 17943 var fontDictTrackers = compiled.trackers; 17944 this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); 17945 } 17946 this.compilePrivateDicts([cff.topDict], [topDictTracker], output); 17947 output.add([0]); 17948 return output.data; 17949 }, 17950 encodeNumber: function CFFCompiler_encodeNumber(value) { 17951 if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) { 17952 return this.encodeInteger(value); 17953 } 17954 return this.encodeFloat(value); 17955 }, 17956 encodeFloat: function CFFCompiler_encodeFloat(num) { 17957 var value = num.toString(); 17958 var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(value); 17959 if (m) { 17960 var epsilon = parseFloat('1e' + ((m[2] ? +m[2] : 0) + m[1].length)); 17961 value = (Math.round(num * epsilon) / epsilon).toString(); 17962 } 17963 var nibbles = ''; 17964 var i, ii; 17965 for (i = 0, ii = value.length; i < ii; ++i) { 17966 var a = value[i]; 17967 if (a === 'e') { 17968 nibbles += value[++i] === '-' ? 'c' : 'b'; 17969 } else if (a === '.') { 17970 nibbles += 'a'; 17971 } else if (a === '-') { 17972 nibbles += 'e'; 17973 } else { 17974 nibbles += a; 17975 } 17976 } 17977 nibbles += nibbles.length & 1 ? 'f' : 'ff'; 17978 var out = [30]; 17979 for (i = 0, ii = nibbles.length; i < ii; i += 2) { 17980 out.push(parseInt(nibbles.substr(i, 2), 16)); 17981 } 17982 return out; 17983 }, 17984 encodeInteger: function CFFCompiler_encodeInteger(value) { 17985 var code; 17986 if (value >= -107 && value <= 107) { 17987 code = [value + 139]; 17988 } else if (value >= 108 && value <= 1131) { 17989 value = value - 108; 17990 code = [(value >> 8) + 247, value & 0xFF]; 17991 } else if (value >= -1131 && value <= -108) { 17992 value = -value - 108; 17993 code = [(value >> 8) + 251, value & 0xFF]; 17994 } else if (value >= -32768 && value <= 32767) { 17995 code = [0x1c, value >> 8 & 0xFF, value & 0xFF]; 17996 } else { 17997 code = [0x1d, value >> 24 & 0xFF, value >> 16 & 0xFF, value >> 8 & 0xFF, value & 0xFF]; 17998 } 17999 return code; 18000 }, 18001 compileHeader: function CFFCompiler_compileHeader(header) { 18002 return [header.major, header.minor, header.hdrSize, header.offSize]; 18003 }, 18004 compileNameIndex: function CFFCompiler_compileNameIndex(names) { 18005 var nameIndex = new CFFIndex(); 18006 for (var i = 0, ii = names.length; i < ii; ++i) { 18007 var name = names[i]; 18008 var length = Math.min(name.length, 127);
18009 var sanitizedName = new Array(length); 18010 for (var j = 0; j < length; j++) { 18011 var char = name[j]; 18012 if (char < '!' || char > '~' || char === '[' || char === ']' || char === '(' || char === ')' || char === '{' || char === '}' || char === '<' || char === '>' || char === '/' || char === '%') { 18013 char = '_'; 18014 } 18015 sanitizedName[j] = char; 18016 } 18017 sanitizedName = sanitizedName.join(''); 18018 if (sanitizedName === '') { 18019 sanitizedName = 'Bad_Font_Name'; 18020 } 18021 nameIndex.add((0, _util.stringToBytes)(sanitizedName)); 18022 } 18023 return this.compileIndex(nameIndex); 18024 }, 18025 compileTopDicts: function CFFCompiler_compileTopDicts(dicts, length, removeCidKeys) { 18026 var fontDictTrackers = []; 18027 var fdArrayIndex = new CFFIndex(); 18028 for (var i = 0, ii = dicts.length; i < ii; ++i) { 18029 var fontDict = dicts[i]; 18030 if (removeCidKeys) { 18031 fontDict.removeByName('CIDFontVersion'); 18032 fontDict.removeByName('CIDFontRevision'); 18033 fontDict.removeByName('CIDFontType'); 18034 fontDict.removeByName('CIDCount'); 18035 fontDict.removeByName('UIDBase'); 18036 } 18037 var fontDictTracker = new CFFOffsetTracker(); 18038 var fontDictData = this.compileDict(fontDict, fontDictTracker); 18039 fontDictTrackers.push(fontDictTracker); 18040 fdArrayIndex.add(fontDictData); 18041 fontDictTracker.offset(length); 18042 } 18043 fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); 18044 return { 18045 trackers: fontDictTrackers, 18046 output: fdArrayIndex 18047 }; 18048 }, 18049 compilePrivateDicts: function CFFCompiler_compilePrivateDicts(dicts, trackers, output) { 18050 for (var i = 0, ii = dicts.length; i < ii; ++i) { 18051 var fontDict = dicts[i]; 18052 var privateDict = fontDict.privateDict; 18053 if (!privateDict || !fontDict.hasName('Private')) { 18054 throw new _util.FormatError('There must be a private dictionary.'); 18055 } 18056 var privateDictTracker = new CFFOffsetTracker(); 18057 var privateDictData = this.compileDict(privateDict, privateDictTracker); 18058 var outputLength = output.length; 18059 privateDictTracker.offset(outputLength); 18060 if (!privateDictData.length) { 18061 outputLength = 0; 18062 } 18063 trackers[i].setEntryLocation('Private', [privateDictData.length, outputLength], output); 18064 output.add(privateDictData); 18065 if (privateDict.subrsIndex && privateDict.hasName('Subrs')) { 18066 var subrs = this.compileIndex(privateDict.subrsIndex); 18067 privateDictTracker.setEntryLocation('Subrs', [privateDictData.length], output); 18068 output.add(subrs); 18069 } 18070 } 18071 }, 18072 compileDict: function CFFCompiler_compileDict(dict, offsetTracker) { 18073 var out = []; 18074 var order = dict.order; 18075 for (var i = 0; i < order.length; ++i) { 18076 var key = order[i]; 18077 if (!(key in dict.values)) { 18078 continue; 18079 } 18080 var values = dict.values[key]; 18081 var types = dict.types[key]; 18082 if (!Array.isArray(types)) { 18083 types = [types]; 18084 } 18085 if (!Array.isArray(values)) { 18086 values = [values]; 18087 } 18088 if (values.length === 0) { 18089 continue; 18090 } 18091 for (var j = 0, jj = types.length; j < jj; ++j) { 18092 var type = types[j]; 18093 var value = values[j]; 18094 switch (type) { 18095 case 'num': 18096 case 'sid': 18097 out = out.concat(this.encodeNumber(value)); 18098 break; 18099 case 'offset': 18100 var name = dict.keyToNameMap[key]; 18101 if (!offsetTracker.isTracking(name)) { 18102 offsetTracker.track(name, out.length); 18103 } 18104 out = out.concat([0x1d, 0, 0, 0, 0]); 18105 break; 18106 case 'array': 18107 case 'delta': 18108 out = out.concat(this.encodeNumber(value)); 18109 for (var k = 1, kk = values.length; k < kk; ++k) { 18110 out = out.concat(this.encodeNumber(values[k])); 18111 } 18112 break; 18113 default: 18114 throw new _util.FormatError('Unknown data type of ' + type); 18115 } 18116 } 18117 out = out.concat(dict.opcodes[key]); 18118 } 18119 return out; 18120 }, 18121 compileStringIndex: function CFFCompiler_compileStringIndex(strings) { 18122 var stringIndex = new CFFIndex(); 18123 for (var i = 0, ii = strings.length; i < ii; ++i) {
vendor: 9,180 bytes, lines 18124-18370
18124 stringIndex.add((0, _util.stringToBytes)(strings[i])); 18125 } 18126 return this.compileIndex(stringIndex); 18127 }, 18128 compileGlobalSubrIndex: function CFFCompiler_compileGlobalSubrIndex() { 18129 var globalSubrIndex = this.cff.globalSubrIndex; 18130 this.out.writeByteArray(this.compileIndex(globalSubrIndex)); 18131 }, 18132 compileCharStrings: function CFFCompiler_compileCharStrings(charStrings) { 18133 return this.compileIndex(charStrings); 18134 }, 18135 compileCharset: function CFFCompiler_compileCharset(charset) { 18136 return this.compileTypedArray(charset.raw); 18137 }, 18138 compileEncoding: function CFFCompiler_compileEncoding(encoding) { 18139 return this.compileTypedArray(encoding.raw); 18140 }, 18141 compileFDSelect: function CFFCompiler_compileFDSelect(fdSelect) { 18142 return this.compileTypedArray(fdSelect); 18143 }, 18144 compileTypedArray: function CFFCompiler_compileTypedArray(data) { 18145 var out = []; 18146 for (var i = 0, ii = data.length; i < ii; ++i) { 18147 out[i] = data[i]; 18148 } 18149 return out; 18150 }, 18151 compileIndex: function CFFCompiler_compileIndex(index, trackers) { 18152 trackers = trackers || []; 18153 var objects = index.objects; 18154 var count = objects.length; 18155 if (count === 0) { 18156 return [0, 0, 0]; 18157 } 18158 var data = [count >> 8 & 0xFF, count & 0xff]; 18159 var lastOffset = 1, 18160 i; 18161 for (i = 0; i < count; ++i) { 18162 lastOffset += objects[i].length; 18163 } 18164 var offsetSize; 18165 if (lastOffset < 0x100) { 18166 offsetSize = 1; 18167 } else if (lastOffset < 0x10000) { 18168 offsetSize = 2; 18169 } else if (lastOffset < 0x1000000) { 18170 offsetSize = 3; 18171 } else { 18172 offsetSize = 4; 18173 } 18174 data.push(offsetSize); 18175 var relativeOffset = 1; 18176 for (i = 0; i < count + 1; i++) { 18177 if (offsetSize === 1) { 18178 data.push(relativeOffset & 0xFF); 18179 } else if (offsetSize === 2) { 18180 data.push(relativeOffset >> 8 & 0xFF, relativeOffset & 0xFF); 18181 } else if (offsetSize === 3) { 18182 data.push(relativeOffset >> 16 & 0xFF, relativeOffset >> 8 & 0xFF, relativeOffset & 0xFF); 18183 } else { 18184 data.push(relativeOffset >>> 24 & 0xFF, relativeOffset >> 16 & 0xFF, relativeOffset >> 8 & 0xFF, relativeOffset & 0xFF); 18185 } 18186 if (objects[i]) { 18187 relativeOffset += objects[i].length; 18188 } 18189 } 18190 for (i = 0; i < count; i++) { 18191 if (trackers[i]) { 18192 trackers[i].offset(data.length); 18193 } 18194 for (var j = 0, jj = objects[i].length; j < jj; j++) { 18195 data.push(objects[i][j]); 18196 } 18197 } 18198 return data; 18199 } 18200 }; 18201 return CFFCompiler; 18202}(); 18203exports.CFFStandardStrings = CFFStandardStrings; 18204exports.CFFParser = CFFParser; 18205exports.CFF = CFF; 18206exports.CFFHeader = CFFHeader; 18207exports.CFFStrings = CFFStrings; 18208exports.CFFIndex = CFFIndex; 18209exports.CFFCharset = CFFCharset; 18210exports.CFFTopDict = CFFTopDict; 18211exports.CFFPrivateDict = CFFPrivateDict; 18212exports.CFFCompiler = CFFCompiler; 18213 18214/***/ }), 18215/* 69 */ 18216/***/ (function(module, exports, __w_pdfjs_require__) { 18217 18218"use strict"; 18219 18220 18221Object.defineProperty(exports, "__esModule", { 18222 value: true 18223}); 18224exports.getSupplementalGlyphMapForCalibri = exports.getSupplementalGlyphMapForArialBlack = exports.getGlyphMapForStandardFonts = exports.getSymbolsFonts = exports.getSerifFonts = exports.getNonStdFontMap = exports.getStdFontMap = undefined; 18225 18226var _util = __w_pdfjs_require__(0); 18227 18228var getStdFontMap = (0, _util.getLookupTableFactory)(function (t) { 18229 t['ArialNarrow'] = 'Helvetica'; 18230 t['ArialNarrow-Bold'] = 'Helvetica-Bold'; 18231 t['ArialNarrow-BoldItalic'] = 'Helvetica-BoldOblique'; 18232 t['ArialNarrow-Italic'] = 'Helvetica-Oblique'; 18233 t['ArialBlack'] = 'Helvetica'; 18234 t['ArialBlack-Bold'] = 'Helvetica-Bold'; 18235 t['ArialBlack-BoldItalic'] = 'Helvetica-BoldOblique'; 18236 t['ArialBlack-Italic'] = 'Helvetica-Oblique'; 18237 t['Arial-Black'] = 'Helvetica'; 18238 t['Arial-Black-Bold'] = 'Helvetica-Bold'; 18239 t['Arial-Black-BoldItalic'] = 'Helvetica-BoldOblique'; 18240 t['Arial-Black-Italic'] = 'Helvetica-Oblique'; 18241 t['Arial'] = 'Helvetica'; 18242 t['Arial-Bold'] = 'Helvetica-Bold'; 18243 t['Arial-BoldItalic'] = 'Helvetica-BoldOblique'; 18244 t['Arial-Italic'] = 'Helvetica-Oblique'; 18245 t['Arial-BoldItalicMT'] = 'Helvetica-BoldOblique'; 18246 t['Arial-BoldMT'] = 'Helvetica-Bold'; 18247 t['Arial-ItalicMT'] = 'Helvetica-Oblique'; 18248 t['ArialMT'] = 'Helvetica'; 18249 t['Courier-Bold'] = 'Courier-Bold'; 18250 t['Courier-BoldItalic'] = 'Courier-BoldOblique'; 18251 t['Courier-Italic'] = 'Courier-Oblique'; 18252 t['CourierNew'] = 'Courier'; 18253 t['CourierNew-Bold'] = 'Courier-Bold'; 18254 t['CourierNew-BoldItalic'] = 'Courier-BoldOblique'; 18255 t['CourierNew-Italic'] = 'Courier-Oblique'; 18256 t['CourierNewPS-BoldItalicMT'] = 'Courier-BoldOblique'; 18257 t['CourierNewPS-BoldMT'] = 'Courier-Bold'; 18258 t['CourierNewPS-ItalicMT'] = 'Courier-Oblique'; 18259 t['CourierNewPSMT'] = 'Courier'; 18260 t['Helvetica'] = 'Helvetica'; 18261 t['Helvetica-Bold'] = 'Helvetica-Bold'; 18262 t['Helvetica-BoldItalic'] = 'Helvetica-BoldOblique'; 18263 t['Helvetica-BoldOblique'] = 'Helvetica-BoldOblique'; 18264 t['Helvetica-Italic'] = 'Helvetica-Oblique'; 18265 t['Helvetica-Oblique'] = 'Helvetica-Oblique'; 18266 t['SegoeUISymbol'] = 'Helvetica'; 18267 t['Symbol-Bold'] = 'Symbol'; 18268 t['Symbol-BoldItalic'] = 'Symbol'; 18269 t['Symbol-Italic'] = 'Symbol'; 18270 t['TimesNewRoman'] = 'Times-Roman'; 18271 t['TimesNewRoman-Bold'] = 'Times-Bold'; 18272 t['TimesNewRoman-BoldItalic'] = 'Times-BoldItalic'; 18273 t['TimesNewRoman-Italic'] = 'Times-Italic'; 18274 t['TimesNewRomanPS'] = 'Times-Roman'; 18275 t['TimesNewRomanPS-Bold'] = 'Times-Bold'; 18276 t['TimesNewRomanPS-BoldItalic'] = 'Times-BoldItalic'; 18277 t['TimesNewRomanPS-BoldItalicMT'] = 'Times-BoldItalic'; 18278 t['TimesNewRomanPS-BoldMT'] = 'Times-Bold'; 18279 t['TimesNewRomanPS-Italic'] = 'Times-Italic'; 18280 t['TimesNewRomanPS-ItalicMT'] = 'Times-Italic'; 18281 t['TimesNewRomanPSMT'] = 'Times-Roman'; 18282 t['TimesNewRomanPSMT-Bold'] = 'Times-Bold'; 18283 t['TimesNewRomanPSMT-BoldItalic'] = 'Times-BoldItalic'; 18284 t['TimesNewRomanPSMT-Italic'] = 'Times-Italic'; 18285}); 18286var getNonStdFontMap = (0, _util.getLookupTableFactory)(function (t) { 18287 t['Calibri'] = 'Helvetica'; 18288 t['Calibri-Bold'] = 'Helvetica-Bold'; 18289 t['Calibri-BoldItalic'] = 'Helvetica-BoldOblique'; 18290 t['Calibri-Italic'] = 'Helvetica-Oblique'; 18291 t['CenturyGothic'] = 'Helvetica'; 18292 t['CenturyGothic-Bold'] = 'Helvetica-Bold'; 18293 t['CenturyGothic-BoldItalic'] = 'Helvetica-BoldOblique'; 18294 t['CenturyGothic-Italic'] = 'Helvetica-Oblique'; 18295 t['ComicSansMS'] = 'Comic Sans MS'; 18296 t['ComicSansMS-Bold'] = 'Comic Sans MS-Bold'; 18297 t['ComicSansMS-BoldItalic'] = 'Comic Sans MS-BoldItalic'; 18298 t['ComicSansMS-Italic'] = 'Comic Sans MS-Italic'; 18299 t['LucidaConsole'] = 'Courier'; 18300 t['LucidaConsole-Bold'] = 'Courier-Bold'; 18301 t['LucidaConsole-BoldItalic'] = 'Courier-BoldOblique'; 18302 t['LucidaConsole-Italic'] = 'Courier-Oblique'; 18303 t['LucidaSans-Demi'] = 'Helvetica-Bold'; 18304 t['MS-Gothic'] = 'MS Gothic'; 18305 t['MS-Gothic-Bold'] = 'MS Gothic-Bold'; 18306 t['MS-Gothic-BoldItalic'] = 'MS Gothic-BoldItalic'; 18307 t['MS-Gothic-Italic'] = 'MS Gothic-Italic'; 18308 t['MS-Mincho'] = 'MS Mincho'; 18309 t['MS-Mincho-Bold'] = 'MS Mincho-Bold'; 18310 t['MS-Mincho-BoldItalic'] = 'MS Mincho-BoldItalic'; 18311 t['MS-Mincho-Italic'] = 'MS Mincho-Italic'; 18312 t['MS-PGothic'] = 'MS PGothic'; 18313 t['MS-PGothic-Bold'] = 'MS PGothic-Bold'; 18314 t['MS-PGothic-BoldItalic'] = 'MS PGothic-BoldItalic'; 18315 t['MS-PGothic-Italic'] = 'MS PGothic-Italic'; 18316 t['MS-PMincho'] = 'MS PMincho'; 18317 t['MS-PMincho-Bold'] = 'MS PMincho-Bold'; 18318 t['MS-PMincho-BoldItalic'] = 'MS PMincho-BoldItalic'; 18319 t['MS-PMincho-Italic'] = 'MS PMincho-Italic'; 18320 t['NuptialScript'] = 'Times-Italic'; 18321 t['Wingdings'] = 'ZapfDingbats'; 18322}); 18323var getSerifFonts = (0, _util.getLookupTableFactory)(function (t) { 18324 t['Adobe Jenson'] = true; 18325 t['Adobe Text'] = true; 18326 t['Albertus'] = true; 18327 t['Aldus'] = true; 18328 t['Alexandria'] = true; 18329 t['Algerian'] = true; 18330 t['American Typewriter'] = true; 18331 t['Antiqua'] = true; 18332 t['Apex'] = true; 18333 t['Arno'] = true; 18334 t['Aster'] = true; 18335 t['Aurora'] = true; 18336 t['Baskerville'] = true; 18337 t['Bell'] = true; 18338 t['Bembo'] = true; 18339 t['Bembo Schoolbook'] = true; 18340 t['Benguiat'] = true; 18341 t['Berkeley Old Style'] = true; 18342 t['Bernhard Modern'] = true; 18343 t['Berthold City'] = true; 18344 t['Bodoni'] = true; 18345 t['Bauer Bodoni'] = true; 18346 t['Book Antiqua'] = true; 18347 t['Bookman'] = true; 18348 t['Bordeaux Roman'] = true; 18349 t['Californian FB'] = true; 18350 t['Calisto'] = true; 18351 t['Calvert'] = true; 18352 t['Capitals'] = true; 18353 t['Cambria'] = true; 18354 t['Cartier'] = true; 18355 t['Caslon'] = true; 18356 t['Catull'] = true; 18357 t['Centaur'] = true; 18358 t['Century Old Style'] = true; 18359 t['Century Schoolbook'] = true; 18360 t['Chaparral'] = true; 18361 t['Charis SIL'] = true; 18362 t['Cheltenham'] = true; 18363 t['Cholla Slab'] = true; 18364 t['Clarendon'] = true; 18365 t['Clearface'] = true; 18366 t['Cochin'] = true; 18367 t['Colonna'] = true; 18368 t['Computer Modern'] = true; 18369 t['Concrete Roman'] = true; 18370 t['Constantia'] = true;
18371 t['Cooper Black'] = true; 18372 t['Corona'] = true; 18373 t['Ecotype'] = true; 18374 t['Egyptienne'] = true; 18375 t['Elephant'] = true; 18376 t['Excelsior'] = true; 18377 t['Fairfield'] = true; 18378 t['FF Scala'] = true; 18379 t['Folkard'] = true; 18380 t['Footlight'] = true; 18381 t['FreeSerif'] = true; 18382 t['Friz Quadrata'] = true; 18383 t['Garamond'] = true; 18384 t['Gentium'] = true; 18385 t['Georgia'] = true; 18386 t['Gloucester'] = true; 18387 t['Goudy Old Style'] = true; 18388 t['Goudy Schoolbook'] = true; 18389 t['Goudy Pro Font'] = true; 18390 t['Granjon'] = true; 18391 t['Guardian Egyptian'] = true; 18392 t['Heather'] = true; 18393 t['Hercules'] = true; 18394 t['High Tower Text'] = true; 18395 t['Hiroshige'] = true; 18396 t['Hoefler Text'] = true; 18397 t['Humana Serif'] = true; 18398 t['Imprint'] = true; 18399 t['Ionic No. 5'] = true; 18400 t['Janson'] = true; 18401 t['Joanna'] = true; 18402 t['Korinna'] = true; 18403 t['Lexicon'] = true; 18404 t['Liberation Serif'] = true; 18405 t['Linux Libertine'] = true; 18406 t['Literaturnaya'] = true; 18407 t['Lucida'] = true; 18408 t['Lucida Bright'] = true; 18409 t['Melior'] = true; 18410 t['Memphis'] = true; 18411 t['Miller'] = true; 18412 t['Minion'] = true; 18413 t['Modern'] = true; 18414 t['Mona Lisa'] = true; 18415 t['Mrs Eaves'] = true; 18416 t['MS Serif'] = true; 18417 t['Museo Slab'] = true; 18418 t['New York'] = true; 18419 t['Nimbus Roman'] = true; 18420 t['NPS Rawlinson Roadway'] = true; 18421 t['NuptialScript'] = true; 18422 t['Palatino'] = true; 18423 t['Perpetua'] = true; 18424 t['Plantin'] = true; 18425 t['Plantin Schoolbook'] = true; 18426 t['Playbill'] = true; 18427 t['Poor Richard'] = true; 18428 t['Rawlinson Roadway'] = true; 18429 t['Renault'] = true; 18430 t['Requiem'] = true; 18431 t['Rockwell'] = true; 18432 t['Roman'] = true; 18433 t['Rotis Serif'] = true; 18434 t['Sabon'] = true; 18435 t['Scala'] = true; 18436 t['Seagull'] = true; 18437 t['Sistina'] = true; 18438 t['Souvenir'] = true; 18439 t['STIX'] = true; 18440 t['Stone Informal'] = true; 18441 t['Stone Serif'] = true; 18442 t['Sylfaen'] = true; 18443 t['Times'] = true; 18444 t['Trajan'] = true; 18445 t['Trinité'] = true; 18446 t['Trump Mediaeval'] = true; 18447 t['Utopia'] = true; 18448 t['Vale Type'] = true; 18449 t['Bitstream Vera'] = true; 18450 t['Vera Serif'] = true; 18451 t['Versailles'] = true;
18452 t['Wanted'] = true; 18453 t['Weiss'] = true; 18454 t['Wide Latin'] = true; 18455 t['Windsor'] = true; 18456 t['XITS'] = true; 18457}); 18458var getSymbolsFonts = (0, _util.getLookupTableFactory)(function (t) { 18459 t['Dingbats'] = true; 18460 t['Symbol'] = true; 18461 t['ZapfDingbats'] = true; 18462}); 18463var getGlyphMapForStandardFonts = (0, _util.getLookupTableFactory)(function (t) { 18464 t[2] = 10; 18465 t[3] = 32; 18466 t[4] = 33; 18467 t[5] = 34; 18468 t[6] = 35; 18469 t[7] = 36; 18470 t[8] = 37; 18471 t[9] = 38; 18472 t[10] = 39; 18473 t[11] = 40; 18474 t[12] = 41; 18475 t[13] = 42; 18476 t[14] = 43; 18477 t[15] = 44; 18478 t[16] = 45; 18479 t[17] = 46; 18480 t[18] = 47; 18481 t[19] = 48; 18482 t[20] = 49; 18483 t[21] = 50; 18484 t[22] = 51; 18485 t[23] = 52; 18486 t[24] = 53; 18487 t[25] = 54; 18488 t[26] = 55; 18489 t[27] = 56; 18490 t[28] = 57; 18491 t[29] = 58; 18492 t[30] = 894; 18493 t[31] = 60; 18494 t[32] = 61; 18495 t[33] = 62; 18496 t[34] = 63; 18497 t[35] = 64; 18498 t[36] = 65; 18499 t[37] = 66; 18500 t[38] = 67; 18501 t[39] = 68; 18502 t[40] = 69; 18503 t[41] = 70; 18504 t[42] = 71; 18505 t[43] = 72; 18506 t[44] = 73; 18507 t[45] = 74; 18508 t[46] = 75; 18509 t[47] = 76; 18510 t[48] = 77; 18511 t[49] = 78; 18512 t[50] = 79; 18513 t[51] = 80; 18514 t[52] = 81; 18515 t[53] = 82; 18516 t[54] = 83; 18517 t[55] = 84; 18518 t[56] = 85; 18519 t[57] = 86; 18520 t[58] = 87; 18521 t[59] = 88; 18522 t[60] = 89; 18523 t[61] = 90; 18524 t[62] = 91; 18525 t[63] = 92; 18526 t[64] = 93; 18527 t[65] = 94; 18528 t[66] = 95; 18529 t[67] = 96; 18530 t[68] = 97; 18531 t[69] = 98; 18532 t[70] = 99; 18533 t[71] = 100; 18534 t[72] = 101; 18535 t[73] = 102; 18536 t[74] = 103; 18537 t[75] = 104; 18538 t[76] = 105; 18539 t[77] = 106; 18540 t[78] = 107; 18541 t[79] = 108; 18542 t[80] = 109; 18543 t[81] = 110; 18544 t[82] = 111; 18545 t[83] = 112; 18546 t[84] = 113; 18547 t[85] = 114; 18548 t[86] = 115; 18549 t[87] = 116; 18550 t[88] = 117; 18551 t[89] = 118; 18552 t[90] = 119; 18553 t[91] = 120; 18554 t[92] = 121; 18555 t[93] = 122; 18556 t[94] = 123; 18557 t[95] = 124; 18558 t[96] = 125; 18559 t[97] = 126; 18560 t[98] = 196; 18561 t[99] = 197; 18562 t[100] = 199; 18563 t[101] = 201; 18564 t[102] = 209; 18565 t[103] = 214; 18566 t[104] = 220; 18567 t[105] = 225; 18568 t[106] = 224; 18569 t[107] = 226; 18570 t[108] = 228; 18571 t[109] = 227; 18572 t[110] = 229; 18573 t[111] = 231; 18574 t[112] = 233; 18575 t[113] = 232; 18576 t[114] = 234; 18577 t[115] = 235; 18578 t[116] = 237; 18579 t[117] = 236; 18580 t[118] = 238; 18581 t[119] = 239; 18582 t[120] = 241; 18583 t[121] = 243; 18584 t[122] = 242; 18585 t[123] = 244; 18586 t[124] = 246; 18587 t[125] = 245; 18588 t[126] = 250; 18589 t[127] = 249; 18590 t[128] = 251; 18591 t[129] = 252; 18592 t[130] = 8224; 18593 t[131] = 176; 18594 t[132] = 162; 18595 t[133] = 163; 18596 t[134] = 167; 18597 t[135] = 8226; 18598 t[136] = 182; 18599 t[137] = 223; 18600 t[138] = 174; 18601 t[139] = 169; 18602 t[140] = 8482; 18603 t[141] = 180; 18604 t[142] = 168; 18605 t[143] = 8800; 18606 t[144] = 198; 18607 t[145] = 216; 18608 t[146] = 8734; 18609 t[147] = 177; 18610 t[148] = 8804; 18611 t[149] = 8805; 18612 t[150] = 165; 18613 t[151] = 181; 18614 t[152] = 8706; 18615 t[153] = 8721; 18616 t[154] = 8719; 18617 t[156] = 8747; 18618 t[157] = 170; 18619 t[158] = 186; 18620 t[159] = 8486; 18621 t[160] = 230; 18622 t[161] = 248; 18623 t[162] = 191; 18624 t[163] = 161; 18625 t[164] = 172; 18626 t[165] = 8730; 18627 t[166] = 402; 18628 t[167] = 8776; 18629 t[168] = 8710; 18630 t[169] = 171; 18631 t[170] = 187; 18632 t[171] = 8230; 18633 t[210] = 218; 18634 t[223] = 711; 18635 t[224] = 321; 18636 t[225] = 322; 18637 t[227] = 353; 18638 t[229] = 382; 18639 t[234] = 253; 18640 t[252] = 263; 18641 t[253] = 268; 18642 t[254] = 269; 18643 t[258] = 258; 18644 t[260] = 260; 18645 t[261] = 261; 18646 t[265] = 280; 18647 t[266] = 281; 18648 t[268] = 283; 18649 t[269] = 313; 18650 t[275] = 323; 18651 t[276] = 324; 18652 t[278] = 328; 18653 t[284] = 345; 18654 t[285] = 346; 18655 t[286] = 347; 18656 t[292] = 367; 18657 t[295] = 377; 18658 t[296] = 378; 18659 t[298] = 380; 18660 t[305] = 963; 18661 t[306] = 964; 18662 t[307] = 966; 18663 t[308] = 8215; 18664 t[309] = 8252; 18665 t[310] = 8319; 18666 t[311] = 8359; 18667 t[312] = 8592; 18668 t[313] = 8593; 18669 t[337] = 9552; 18670 t[493] = 1039; 18671 t[494] = 1040; 18672 t[705] = 1524; 18673 t[706] = 8362; 18674 t[710] = 64288; 18675 t[711] = 64298; 18676 t[759] = 1617; 18677 t[761] = 1776; 18678 t[763] = 1778; 18679 t[775] = 1652; 18680 t[777] = 1764; 18681 t[778] = 1780; 18682 t[779] = 1781; 18683 t[780] = 1782; 18684 t[782] = 771; 18685 t[783] = 64726; 18686 t[786] = 8363; 18687 t[788] = 8532; 18688 t[790] = 768; 18689 t[791] = 769; 18690 t[792] = 768; 18691 t[795] = 803; 18692 t[797] = 64336; 18693 t[798] = 64337; 18694 t[799] = 64342;
18695 t[800] = 64343; 18696 t[801] = 64344; 18697 t[802] = 64345; 18698 t[803] = 64362; 18699 t[804] = 64363; 18700 t[805] = 64364; 18701 t[2424] = 7821; 18702 t[2425] = 7822; 18703 t[2426] = 7823; 18704 t[2427] = 7824; 18705 t[2428] = 7825; 18706 t[2429] = 7826; 18707 t[2430] = 7827; 18708 t[2433] = 7682; 18709 t[2678] = 8045; 18710 t[2679] = 8046; 18711 t[2830] = 1552; 18712 t[2838] = 686; 18713 t[2840] = 751; 18714 t[2842] = 753; 18715 t[2843] = 754; 18716 t[2844] = 755; 18717 t[2846] = 757; 18718 t[2856] = 767; 18719 t[2857] = 848; 18720 t[2858] = 849; 18721 t[2862] = 853; 18722 t[2863] = 854; 18723 t[2864] = 855; 18724 t[2865] = 861; 18725 t[2866] = 862; 18726 t[2906] = 7460; 18727 t[2908] = 7462; 18728 t[2909] = 7463; 18729 t[2910] = 7464; 18730 t[2912] = 7466; 18731 t[2913] = 7467; 18732 t[2914] = 7468; 18733 t[2916] = 7470; 18734 t[2917] = 7471; 18735 t[2918] = 7472; 18736 t[2920] = 7474; 18737 t[2921] = 7475; 18738 t[2922] = 7476; 18739 t[2924] = 7478; 18740 t[2925] = 7479; 18741 t[2926] = 7480; 18742 t[2928] = 7482; 18743 t[2929] = 7483; 18744 t[2930] = 7484; 18745 t[2932] = 7486; 18746 t[2933] = 7487; 18747 t[2934] = 7488; 18748 t[2936] = 7490; 18749 t[2937] = 7491; 18750 t[2938] = 7492; 18751 t[2940] = 7494; 18752 t[2941] = 7495; 18753 t[2942] = 7496; 18754 t[2944] = 7498; 18755 t[2946] = 7500; 18756 t[2948] = 7502; 18757 t[2950] = 7504; 18758 t[2951] = 7505; 18759 t[2952] = 7506; 18760 t[2954] = 7508; 18761 t[2955] = 7509; 18762 t[2956] = 7510; 18763 t[2958] = 7512; 18764 t[2959] = 7513; 18765 t[2960] = 7514; 18766 t[2962] = 7516; 18767 t[2963] = 7517; 18768 t[2964] = 7518; 18769 t[2966] = 7520; 18770 t[2967] = 7521; 18771 t[2968] = 7522; 18772 t[2970] = 7524; 18773 t[2971] = 7525; 18774 t[2972] = 7526; 18775 t[2974] = 7528; 18776 t[2975] = 7529; 18777 t[2976] = 7530; 18778 t[2978] = 1537; 18779 t[2979] = 1538; 18780 t[2980] = 1539; 18781 t[2982] = 1549; 18782 t[2983] = 1551; 18783 t[2984] = 1552; 18784 t[2986] = 1554; 18785 t[2987] = 1555; 18786 t[2988] = 1556; 18787 t[2990] = 1623; 18788 t[2991] = 1624; 18789 t[2995] = 1775; 18790 t[2999] = 1791; 18791 t[3002] = 64290; 18792 t[3003] = 64291; 18793 t[3004] = 64292; 18794 t[3006] = 64294; 18795 t[3007] = 64295; 18796 t[3008] = 64296; 18797 t[3011] = 1900; 18798 t[3014] = 8223; 18799 t[3015] = 8244; 18800 t[3017] = 7532; 18801 t[3018] = 7533; 18802 t[3019] = 7534; 18803 t[3075] = 7590;
18804 t[3076] = 7591; 18805 t[3079] = 7594; 18806 t[3080] = 7595; 18807 t[3083] = 7598; 18808 t[3084] = 7599; 18809 t[3087] = 7602; 18810 t[3088] = 7603; 18811 t[3091] = 7606; 18812 t[3092] = 7607; 18813 t[3095] = 7610; 18814 t[3096] = 7611; 18815 t[3099] = 7614; 18816 t[3100] = 7615; 18817 t[3103] = 7618; 18818 t[3104] = 7619; 18819 t[3107] = 8337; 18820 t[3108] = 8338; 18821 t[3116] = 1884; 18822 t[3119] = 1885; 18823 t[3120] = 1885; 18824 t[3123] = 1886; 18825 t[3124] = 1886; 18826 t[3127] = 1887; 18827 t[3128] = 1887; 18828 t[3131] = 1888; 18829 t[3132] = 1888; 18830 t[3135] = 1889; 18831 t[3136] = 1889; 18832 t[3139] = 1890; 18833 t[3140] = 1890; 18834 t[3143] = 1891; 18835 t[3144] = 1891; 18836 t[3147] = 1892; 18837 t[3148] = 1892; 18838 t[3153] = 580; 18839 t[3154] = 581; 18840 t[3157] = 584; 18841 t[3158] = 585; 18842 t[3161] = 588; 18843 t[3162] = 589; 18844 t[3165] = 891; 18845 t[3166] = 892; 18846 t[3169] = 1274; 18847 t[3170] = 1275; 18848 t[3173] = 1278; 18849 t[3174] = 1279; 18850 t[3181] = 7622; 18851 t[3182] = 7623; 18852 t[3282] = 11799; 18853 t[3316] = 578; 18854 t[3379] = 42785; 18855 t[3393] = 1159; 18856 t[3416] = 8377; 18857}); 18858var getSupplementalGlyphMapForArialBlack = (0, _util.getLookupTableFactory)(function (t) { 18859 t[227] = 322; 18860 t[264] = 261; 18861 t[291] = 346; 18862}); 18863var getSupplementalGlyphMapForCalibri = (0, _util.getLookupTableFactory)(function (t) { 18864 t[1] = 32; 18865 t[4] = 65; 18866 t[17] = 66; 18867 t[18] = 67; 18868 t[24] = 68; 18869 t[28] = 69; 18870 t[38] = 70; 18871 t[39] = 71; 18872 t[44] = 72; 18873 t[47] = 73; 18874 t[58] = 74; 18875 t[60] = 75; 18876 t[62] = 76; 18877 t[68] = 77; 18878 t[69] = 78; 18879 t[75] = 79; 18880 t[87] = 80; 18881 t[89] = 81; 18882 t[90] = 82; 18883 t[94] = 83; 18884 t[100] = 84; 18885 t[104] = 85; 18886 t[115] = 86; 18887 t[116] = 87; 18888 t[121] = 88; 18889 t[122] = 89; 18890 t[127] = 90; 18891 t[258] = 97; 18892 t[268] = 261; 18893 t[271] = 98; 18894 t[272] = 99; 18895 t[273] = 263; 18896 t[282] = 100; 18897 t[286] = 101; 18898 t[295] = 281; 18899 t[296] = 102; 18900 t[336] = 103; 18901 t[346] = 104; 18902 t[349] = 105; 18903 t[361] = 106; 18904 t[364] = 107; 18905 t[367] = 108; 18906 t[371] = 322; 18907 t[373] = 109; 18908 t[374] = 110; 18909 t[381] = 111; 18910 t[383] = 243; 18911 t[393] = 112; 18912 t[395] = 113; 18913 t[396] = 114; 18914 t[400] = 115; 18915 t[401] = 347; 18916 t[410] = 116; 18917 t[437] = 117; 18918 t[448] = 118; 18919 t[449] = 119; 18920 t[454] = 120; 18921 t[455] = 121; 18922 t[460] = 122; 18923 t[463] = 380; 18924 t[853] = 44; 18925 t[855] = 58; 18926 t[856] = 46; 18927 t[876] = 47; 18928 t[878] = 45; 18929 t[882] = 45; 18930 t[894] = 40; 18931 t[895] = 41; 18932 t[896] = 91; 18933 t[897] = 93; 18934 t[923] = 64; 18935 t[1004] = 48; 18936 t[1005] = 49; 18937 t[1006] = 50; 18938 t[1007] = 51; 18939 t[1008] = 52; 18940 t[1009] = 53; 18941 t[1010] = 54; 18942 t[1011] = 55; 18943 t[1012] = 56; 18944 t[1013] = 57; 18945 t[1081] = 37; 18946 t[1085] = 43; 18947 t[1086] = 45; 18948}); 18949exports.getStdFontMap = getStdFontMap; 18950exports.getNonStdFontMap = getNonStdFontMap; 18951exports.getSerifFonts = getSerifFonts; 18952exports.getSymbolsFonts = getSymbolsFonts; 18953exports.getGlyphMapForStandardFonts = getGlyphMapForStandardFonts; 18954exports.getSupplementalGlyphMapForArialBlack = getSupplementalGlyphMapForArialBlack; 18955exports.getSupplementalGlyphMapForCalibri = getSupplementalGlyphMapForCalibri; 18956 18957/***/ }), 18958/* 70 */ 18959/***/ (function(module, exports, __w_pdfjs_require__) { 18960 18961var getLookupTableFactory = __w_pdfjs_require__(0).getLookupTableFactory;
vendor: 5,684 bytes, lines 18962-19390
18962var getSpecialPUASymbols = getLookupTableFactory(function (t) { 18963 t[63721] = 0x00A9; 18964 t[63193] = 0x00A9; 18965 t[63720] = 0x00AE; 18966 t[63194] = 0x00AE; 18967 t[63722] = 0x2122; 18968 t[63195] = 0x2122; 18969 t[63729] = 0x23A7; 18970 t[63730] = 0x23A8; 18971 t[63731] = 0x23A9; 18972 t[63740] = 0x23AB; 18973 t[63741] = 0x23AC; 18974 t[63742] = 0x23AD; 18975 t[63726] = 0x23A1; 18976 t[63727] = 0x23A2; 18977 t[63728] = 0x23A3; 18978 t[63737] = 0x23A4; 18979 t[63738] = 0x23A5; 18980 t[63739] = 0x23A6; 18981 t[63723] = 0x239B; 18982 t[63724] = 0x239C; 18983 t[63725] = 0x239D; 18984 t[63734] = 0x239E; 18985 t[63735] = 0x239F; 18986 t[63736] = 0x23A0; 18987}); 18988function mapSpecialUnicodeValues(code) { 18989 if (code >= 0xFFF0 && code <= 0xFFFF) { 18990 return 0; 18991 } else if (code >= 0xF600 && code <= 0xF8FF) { 18992 return getSpecialPUASymbols()[code] || code; 18993 } else if (code === 0x00AD) { 18994 return 0x002D; 18995 } 18996 return code; 18997} 18998function getUnicodeForGlyph(name, glyphsUnicodeMap) { 18999 var unicode = glyphsUnicodeMap[name]; 19000 if (unicode !== undefined) { 19001 return unicode; 19002 } 19003 if (!name) { 19004 return -1; 19005 } 19006 if (name[0] === 'u') { 19007 var nameLen = name.length, hexStr; 19008 if (nameLen === 7 && name[1] === 'n' && name[2] === 'i') { 19009 hexStr = name.substr(3); 19010 } else if (nameLen >= 5 && nameLen <= 7) { 19011 hexStr = name.substr(1); 19012 } else { 19013 return -1; 19014 } 19015 if (hexStr === hexStr.toUpperCase()) { 19016 unicode = parseInt(hexStr, 16); 19017 if (unicode >= 0) { 19018 return unicode; 19019 } 19020 } 19021 } 19022 return -1; 19023} 19024var UnicodeRanges = [ 19025 { 19026 'begin': 0x0000, 19027 'end': 0x007F 19028 }, 19029 { 19030 'begin': 0x0080, 19031 'end': 0x00FF 19032 }, 19033 { 19034 'begin': 0x0100, 19035 'end': 0x017F 19036 }, 19037 { 19038 'begin': 0x0180, 19039 'end': 0x024F 19040 }, 19041 { 19042 'begin': 0x0250, 19043 'end': 0x02AF 19044 }, 19045 { 19046 'begin': 0x02B0, 19047 'end': 0x02FF 19048 }, 19049 { 19050 'begin': 0x0300, 19051 'end': 0x036F 19052 }, 19053 { 19054 'begin': 0x0370, 19055 'end': 0x03FF 19056 }, 19057 { 19058 'begin': 0x2C80, 19059 'end': 0x2CFF 19060 }, 19061 { 19062 'begin': 0x0400, 19063 'end': 0x04FF 19064 }, 19065 { 19066 'begin': 0x0530, 19067 'end': 0x058F 19068 }, 19069 { 19070 'begin': 0x0590, 19071 'end': 0x05FF 19072 }, 19073 { 19074 'begin': 0xA500, 19075 'end': 0xA63F 19076 }, 19077 { 19078 'begin': 0x0600, 19079 'end': 0x06FF 19080 }, 19081 { 19082 'begin': 0x07C0, 19083 'end': 0x07FF 19084 }, 19085 { 19086 'begin': 0x0900, 19087 'end': 0x097F 19088 }, 19089 { 19090 'begin': 0x0980, 19091 'end': 0x09FF 19092 }, 19093 { 19094 'begin': 0x0A00, 19095 'end': 0x0A7F 19096 }, 19097 { 19098 'begin': 0x0A80, 19099 'end': 0x0AFF 19100 }, 19101 { 19102 'begin': 0x0B00, 19103 'end': 0x0B7F 19104 }, 19105 { 19106 'begin': 0x0B80, 19107 'end': 0x0BFF 19108 }, 19109 { 19110 'begin': 0x0C00, 19111 'end': 0x0C7F 19112 }, 19113 { 19114 'begin': 0x0C80, 19115 'end': 0x0CFF 19116 }, 19117 { 19118 'begin': 0x0D00, 19119 'end': 0x0D7F 19120 }, 19121 { 19122 'begin': 0x0E00, 19123 'end': 0x0E7F 19124 }, 19125 { 19126 'begin': 0x0E80, 19127 'end': 0x0EFF 19128 }, 19129 { 19130 'begin': 0x10A0, 19131 'end': 0x10FF 19132 }, 19133 { 19134 'begin': 0x1B00, 19135 'end': 0x1B7F 19136 }, 19137 { 19138 'begin': 0x1100, 19139 'end': 0x11FF 19140 }, 19141 { 19142 'begin': 0x1E00, 19143 'end': 0x1EFF 19144 }, 19145 { 19146 'begin': 0x1F00, 19147 'end': 0x1FFF 19148 }, 19149 { 19150 'begin': 0x2000, 19151 'end': 0x206F 19152 }, 19153 { 19154 'begin': 0x2070, 19155 'end': 0x209F 19156 }, 19157 { 19158 'begin': 0x20A0, 19159 'end': 0x20CF 19160 }, 19161 { 19162 'begin': 0x20D0, 19163 'end': 0x20FF 19164 }, 19165 { 19166 'begin': 0x2100, 19167 'end': 0x214F 19168 }, 19169 { 19170 'begin': 0x2150, 19171 'end': 0x218F 19172 }, 19173 { 19174 'begin': 0x2190, 19175 'end': 0x21FF 19176 }, 19177 { 19178 'begin': 0x2200, 19179 'end': 0x22FF 19180 }, 19181 { 19182 'begin': 0x2300, 19183 'end': 0x23FF 19184 }, 19185 { 19186 'begin': 0x2400, 19187 'end': 0x243F 19188 }, 19189 { 19190 'begin': 0x2440, 19191 'end': 0x245F 19192 }, 19193 { 19194 'begin': 0x2460, 19195 'end': 0x24FF 19196 }, 19197 { 19198 'begin': 0x2500, 19199 'end': 0x257F 19200 }, 19201 { 19202 'begin': 0x2580, 19203 'end': 0x259F 19204 }, 19205 { 19206 'begin': 0x25A0, 19207 'end': 0x25FF 19208 }, 19209 { 19210 'begin': 0x2600, 19211 'end': 0x26FF 19212 }, 19213 { 19214 'begin': 0x2700, 19215 'end': 0x27BF 19216 }, 19217 { 19218 'begin': 0x3000, 19219 'end': 0x303F 19220 }, 19221 { 19222 'begin': 0x3040, 19223 'end': 0x309F 19224 }, 19225 { 19226 'begin': 0x30A0, 19227 'end': 0x30FF 19228 }, 19229 { 19230 'begin': 0x3100, 19231 'end': 0x312F 19232 }, 19233 { 19234 'begin': 0x3130, 19235 'end': 0x318F 19236 }, 19237 { 19238 'begin': 0xA840, 19239 'end': 0xA87F 19240 }, 19241 { 19242 'begin': 0x3200, 19243 'end': 0x32FF 19244 }, 19245 { 19246 'begin': 0x3300, 19247 'end': 0x33FF 19248 }, 19249 { 19250 'begin': 0xAC00, 19251 'end': 0xD7AF 19252 }, 19253 { 19254 'begin': 0xD800, 19255 'end': 0xDFFF 19256 }, 19257 { 19258 'begin': 0x10900, 19259 'end': 0x1091F 19260 }, 19261 { 19262 'begin': 0x4E00, 19263 'end': 0x9FFF 19264 }, 19265 { 19266 'begin': 0xE000, 19267 'end': 0xF8FF 19268 }, 19269 { 19270 'begin': 0x31C0, 19271 'end': 0x31EF 19272 }, 19273 { 19274 'begin': 0xFB00, 19275 'end': 0xFB4F 19276 }, 19277 { 19278 'begin': 0xFB50, 19279 'end': 0xFDFF 19280 }, 19281 { 19282 'begin': 0xFE20, 19283 'end': 0xFE2F 19284 }, 19285 { 19286 'begin': 0xFE10, 19287 'end': 0xFE1F 19288 }, 19289 { 19290 'begin': 0xFE50, 19291 'end': 0xFE6F 19292 }, 19293 { 19294 'begin': 0xFE70, 19295 'end': 0xFEFF 19296 }, 19297 { 19298 'begin': 0xFF00, 19299 'end': 0xFFEF 19300 }, 19301 { 19302 'begin': 0xFFF0, 19303 'end': 0xFFFF 19304 }, 19305 { 19306 'begin': 0x0F00, 19307 'end': 0x0FFF 19308 }, 19309 { 19310 'begin': 0x0700, 19311 'end': 0x074F 19312 }, 19313 { 19314 'begin': 0x0780, 19315 'end': 0x07BF 19316 }, 19317 { 19318 'begin': 0x0D80, 19319 'end': 0x0DFF 19320 }, 19321 { 19322 'begin': 0x1000, 19323 'end': 0x109F 19324 }, 19325 { 19326 'begin': 0x1200, 19327 'end': 0x137F 19328 }, 19329 { 19330 'begin': 0x13A0, 19331 'end': 0x13FF 19332 }, 19333 { 19334 'begin': 0x1400, 19335 'end': 0x167F 19336 }, 19337 { 19338 'begin': 0x1680, 19339 'end': 0x169F 19340 }, 19341 { 19342 'begin': 0x16A0, 19343 'end': 0x16FF 19344 }, 19345 { 19346 'begin': 0x1780, 19347 'end': 0x17FF 19348 }, 19349 { 19350 'begin': 0x1800, 19351 'end': 0x18AF 19352 }, 19353 { 19354 'begin': 0x2800, 19355 'end': 0x28FF 19356 }, 19357 { 19358 'begin': 0xA000, 19359 'end': 0xA48F 19360 }, 19361 { 19362 'begin': 0x1700, 19363 'end': 0x171F 19364 }, 19365 { 19366 'begin': 0x10300, 19367 'end': 0x1032F 19368 }, 19369 { 19370 'begin': 0x10330, 19371 'end': 0x1034F 19372 }, 19373 { 19374 'begin': 0x10400, 19375 'end': 0x1044F 19376 }, 19377 { 19378 'begin': 0x1D000, 19379 'end': 0x1D0FF 19380 }, 19381 { 19382 'begin': 0x1D400, 19383 'end': 0x1D7FF 19384 }, 19385 { 19386 'begin': 0xFF000, 19387 'end': 0xFFFFD 19388 }, 19389 { 19390 'begin': 0xFE00,
19391 'end': 0xFE0F 19392 }, 19393 { 19394 'begin': 0xE0000, 19395 'end': 0xE007F 19396 }, 19397 { 19398 'begin': 0x1900, 19399 'end': 0x194F 19400 }, 19401 { 19402 'begin': 0x1950, 19403 'end': 0x197F 19404 }, 19405 { 19406 'begin': 0x1980, 19407 'end': 0x19DF 19408 }, 19409 { 19410 'begin': 0x1A00, 19411 'end': 0x1A1F 19412 }, 19413 { 19414 'begin': 0x2C00, 19415 'end': 0x2C5F 19416 }, 19417 { 19418 'begin': 0x2D30, 19419 'end': 0x2D7F 19420 }, 19421 { 19422 'begin': 0x4DC0, 19423 'end': 0x4DFF 19424 }, 19425 { 19426 'begin': 0xA800, 19427 'end': 0xA82F 19428 }, 19429 { 19430 'begin': 0x10000, 19431 'end': 0x1007F 19432 }, 19433 { 19434 'begin': 0x10140, 19435 'end': 0x1018F 19436 }, 19437 { 19438 'begin': 0x10380, 19439 'end': 0x1039F 19440 }, 19441 { 19442 'begin': 0x103A0, 19443 'end': 0x103DF 19444 }, 19445 { 19446 'begin': 0x10450, 19447 'end': 0x1047F 19448 }, 19449 { 19450 'begin': 0x10480, 19451 'end': 0x104AF 19452 }, 19453 { 19454 'begin': 0x10800, 19455 'end': 0x1083F 19456 }, 19457 { 19458 'begin': 0x10A00, 19459 'end': 0x10A5F 19460 }, 19461 { 19462 'begin': 0x1D300, 19463 'end': 0x1D35F 19464 }, 19465 { 19466 'begin': 0x12000, 19467 'end': 0x123FF 19468 }, 19469 { 19470 'begin': 0x1D360, 19471 'end': 0x1D37F 19472 }, 19473 { 19474 'begin': 0x1B80, 19475 'end': 0x1BBF 19476 }, 19477 { 19478 'begin': 0x1C00, 19479 'end': 0x1C4F 19480 }, 19481 { 19482 'begin': 0x1C50, 19483 'end': 0x1C7F 19484 }, 19485 { 19486 'begin': 0xA880, 19487 'end': 0xA8DF 19488 }, 19489 { 19490 'begin': 0xA900, 19491 'end': 0xA92F 19492 }, 19493 { 19494 'begin': 0xA930, 19495 'end': 0xA95F 19496 }, 19497 { 19498 'begin': 0xAA00, 19499 'end': 0xAA5F 19500 }, 19501 { 19502 'begin': 0x10190, 19503 'end': 0x101CF 19504 }, 19505 { 19506 'begin': 0x101D0, 19507 'end': 0x101FF 19508 }, 19509 { 19510 'begin': 0x102A0, 19511 'end': 0x102DF 19512 }, 19513 { 19514 'begin': 0x1F030, 19515 'end': 0x1F09F 19516 } 19517]; 19518function getUnicodeRangeFor(value) { 19519 for (var i = 0, ii = UnicodeRanges.length; i < ii; i++) { 19520 var range = UnicodeRanges[i]; 19521 if (value >= range.begin && value < range.end) { 19522 return i; 19523 } 19524 } 19525 return -1; 19526} 19527function isRTLRangeFor(value) { 19528 var range = UnicodeRanges[13]; 19529 if (value >= range.begin && value < range.end) { 19530 return true; 19531 } 19532 range = UnicodeRanges[11]; 19533 if (value >= range.begin && value < range.end) { 19534 return true; 19535 } 19536 return false; 19537} 19538var getNormalizedUnicodes = getLookupTableFactory(function (t) { 19539 t['\u00A8'] = '\u0020\u0308'; 19540 t['\u00AF'] = '\u0020\u0304'; 19541 t['\u00B4'] = '\u0020\u0301'; 19542 t['\u00B5'] = '\u03BC'; 19543 t['\u00B8'] = '\u0020\u0327'; 19544 t['\u0132'] = '\u0049\u004A'; 19545 t['\u0133'] = '\u0069\u006A'; 19546 t['\u013F'] = '\u004C\u00B7'; 19547 t['\u0140'] = '\u006C\u00B7'; 19548 t['\u0149'] = '\u02BC\u006E'; 19549 t['\u017F'] = '\u0073'; 19550 t['\u01C4'] = '\u0044\u017D'; 19551 t['\u01C5'] = '\u0044\u017E'; 19552 t['\u01C6'] = '\u0064\u017E'; 19553 t['\u01C7'] = '\u004C\u004A'; 19554 t['\u01C8'] = '\u004C\u006A'; 19555 t['\u01C9'] = '\u006C\u006A'; 19556 t['\u01CA'] = '\u004E\u004A'; 19557 t['\u01CB'] = '\u004E\u006A'; 19558 t['\u01CC'] = '\u006E\u006A'; 19559 t['\u01F1'] = '\u0044\u005A'; 19560 t['\u01F2'] = '\u0044\u007A'; 19561 t['\u01F3'] = '\u0064\u007A'; 19562 t['\u02D8'] = '\u0020\u0306'; 19563 t['\u02D9'] = '\u0020\u0307'; 19564 t['\u02DA'] = '\u0020\u030A'; 19565 t['\u02DB'] = '\u0020\u0328'; 19566 t['\u02DC'] = '\u0020\u0303'; 19567 t['\u02DD'] = '\u0020\u030B'; 19568 t['\u037A'] = '\u0020\u0345'; 19569 t['\u0384'] = '\u0020\u0301'; 19570 t['\u03D0'] = '\u03B2'; 19571 t['\u03D1'] = '\u03B8'; 19572 t['\u03D2'] = '\u03A5'; 19573 t['\u03D5'] = '\u03C6'; 19574 t['\u03D6'] = '\u03C0'; 19575 t['\u03F0'] = '\u03BA'; 19576 t['\u03F1'] = '\u03C1'; 19577 t['\u03F2'] = '\u03C2'; 19578 t['\u03F4'] = '\u0398'; 19579 t['\u03F5'] = '\u03B5'; 19580 t['\u03F9'] = '\u03A3'; 19581 t['\u0587'] = '\u0565\u0582'; 19582 t['\u0675'] = '\u0627\u0674'; 19583 t['\u0676'] = '\u0648\u0674'; 19584 t['\u0677'] = '\u06C7\u0674'; 19585 t['\u0678'] = '\u064A\u0674'; 19586 t['\u0E33'] = '\u0E4D\u0E32'; 19587 t['\u0EB3'] = '\u0ECD\u0EB2'; 19588 t['\u0EDC'] = '\u0EAB\u0E99'; 19589 t['\u0EDD'] = '\u0EAB\u0EA1'; 19590 t['\u0F77'] = '\u0FB2\u0F81'; 19591 t['\u0F79'] = '\u0FB3\u0F81'; 19592 t['\u1E9A'] = '\u0061\u02BE'; 19593 t['\u1FBD'] = '\u0020\u0313'; 19594 t['\u1FBF'] = '\u0020\u0313'; 19595 t['\u1FC0'] = '\u0020\u0342'; 19596 t['\u1FFE'] = '\u0020\u0314'; 19597 t['\u2002'] = '\u0020'; 19598 t['\u2003'] = '\u0020'; 19599 t['\u2004'] = '\u0020'; 19600 t['\u2005'] = '\u0020'; 19601 t['\u2006'] = '\u0020'; 19602 t['\u2008'] = '\u0020'; 19603 t['\u2009'] = '\u0020'; 19604 t['\u200A'] = '\u0020'; 19605 t['\u2017'] = '\u0020\u0333'; 19606 t['\u2024'] = '\u002E'; 19607 t['\u2025'] = '\u002E\u002E'; 19608 t['\u2026'] = '\u002E\u002E\u002E'; 19609 t['\u2033'] = '\u2032\u2032'; 19610 t['\u2034'] = '\u2032\u2032\u2032'; 19611 t['\u2036'] = '\u2035\u2035'; 19612 t['\u2037'] = '\u2035\u2035\u2035'; 19613 t['\u203C'] = '\u0021\u0021'; 19614 t['\u203E'] = '\u0020\u0305'; 19615 t['\u2047'] = '\u003F\u003F'; 19616 t['\u2048'] = '\u003F\u0021'; 19617 t['\u2049'] = '\u0021\u003F'; 19618 t['\u2057'] = '\u2032\u2032\u2032\u2032'; 19619 t['\u205F'] = '\u0020'; 19620 t['\u20A8'] = '\u0052\u0073';
19621 t['\u2100'] = '\u0061\u002F\u0063'; 19622 t['\u2101'] = '\u0061\u002F\u0073'; 19623 t['\u2103'] = '\u00B0\u0043'; 19624 t['\u2105'] = '\u0063\u002F\u006F'; 19625 t['\u2106'] = '\u0063\u002F\u0075'; 19626 t['\u2107'] = '\u0190'; 19627 t['\u2109'] = '\u00B0\u0046'; 19628 t['\u2116'] = '\u004E\u006F'; 19629 t['\u2121'] = '\u0054\u0045\u004C'; 19630 t['\u2135'] = '\u05D0'; 19631 t['\u2136'] = '\u05D1'; 19632 t['\u2137'] = '\u05D2'; 19633 t['\u2138'] = '\u05D3'; 19634 t['\u213B'] = '\u0046\u0041\u0058'; 19635 t['\u2160'] = '\u0049'; 19636 t['\u2161'] = '\u0049\u0049'; 19637 t['\u2162'] = '\u0049\u0049\u0049'; 19638 t['\u2163'] = '\u0049\u0056'; 19639 t['\u2164'] = '\u0056'; 19640 t['\u2165'] = '\u0056\u0049'; 19641 t['\u2166'] = '\u0056\u0049\u0049'; 19642 t['\u2167'] = '\u0056\u0049\u0049\u0049'; 19643 t['\u2168'] = '\u0049\u0058'; 19644 t['\u2169'] = '\u0058'; 19645 t['\u216A'] = '\u0058\u0049'; 19646 t['\u216B'] = '\u0058\u0049\u0049'; 19647 t['\u216C'] = '\u004C'; 19648 t['\u216D'] = '\u0043'; 19649 t['\u216E'] = '\u0044'; 19650 t['\u216F'] = '\u004D'; 19651 t['\u2170'] = '\u0069'; 19652 t['\u2171'] = '\u0069\u0069'; 19653 t['\u2172'] = '\u0069\u0069\u0069'; 19654 t['\u2173'] = '\u0069\u0076'; 19655 t['\u2174'] = '\u0076'; 19656 t['\u2175'] = '\u0076\u0069'; 19657 t['\u2176'] = '\u0076\u0069\u0069'; 19658 t['\u2177'] = '\u0076\u0069\u0069\u0069'; 19659 t['\u2178'] = '\u0069\u0078'; 19660 t['\u2179'] = '\u0078'; 19661 t['\u217A'] = '\u0078\u0069'; 19662 t['\u217B'] = '\u0078\u0069\u0069'; 19663 t['\u217C'] = '\u006C'; 19664 t['\u217D'] = '\u0063'; 19665 t['\u217E'] = '\u0064'; 19666 t['\u217F'] = '\u006D'; 19667 t['\u222C'] = '\u222B\u222B'; 19668 t['\u222D'] = '\u222B\u222B\u222B'; 19669 t['\u222F'] = '\u222E\u222E'; 19670 t['\u2230'] = '\u222E\u222E\u222E'; 19671 t['\u2474'] = '\u0028\u0031\u0029'; 19672 t['\u2475'] = '\u0028\u0032\u0029'; 19673 t['\u2476'] = '\u0028\u0033\u0029'; 19674 t['\u2477'] = '\u0028\u0034\u0029'; 19675 t['\u2478'] = '\u0028\u0035\u0029'; 19676 t['\u2479'] = '\u0028\u0036\u0029'; 19677 t['\u247A'] = '\u0028\u0037\u0029'; 19678 t['\u247B'] = '\u0028\u0038\u0029'; 19679 t['\u247C'] = '\u0028\u0039\u0029'; 19680 t['\u247D'] = '\u0028\u0031\u0030\u0029'; 19681 t['\u247E'] = '\u0028\u0031\u0031\u0029'; 19682 t['\u247F'] = '\u0028\u0031\u0032\u0029'; 19683 t['\u2480'] = '\u0028\u0031\u0033\u0029'; 19684 t['\u2481'] = '\u0028\u0031\u0034\u0029'; 19685 t['\u2482'] = '\u0028\u0031\u0035\u0029'; 19686 t['\u2483'] = '\u0028\u0031\u0036\u0029'; 19687 t['\u2484'] = '\u0028\u0031\u0037\u0029'; 19688 t['\u2485'] = '\u0028\u0031\u0038\u0029'; 19689 t['\u2486'] = '\u0028\u0031\u0039\u0029'; 19690 t['\u2487'] = '\u0028\u0032\u0030\u0029'; 19691 t['\u2488'] = '\u0031\u002E'; 19692 t['\u2489'] = '\u0032\u002E'; 19693 t['\u248A'] = '\u0033\u002E'; 19694 t['\u248B'] = '\u0034\u002E'; 19695 t['\u248C'] = '\u0035\u002E'; 19696 t['\u248D'] = '\u0036\u002E'; 19697 t['\u248E'] = '\u0037\u002E'; 19698 t['\u248F'] = '\u0038\u002E'; 19699 t['\u2490'] = '\u0039\u002E'; 19700 t['\u2491'] = '\u0031\u0030\u002E'; 19701 t['\u2492'] = '\u0031\u0031\u002E'; 19702 t['\u2493'] = '\u0031\u0032\u002E'; 19703 t['\u2494'] = '\u0031\u0033\u002E'; 19704 t['\u2495'] = '\u0031\u0034\u002E'; 19705 t['\u2496'] = '\u0031\u0035\u002E'; 19706 t['\u2497'] = '\u0031\u0036\u002E'; 19707 t['\u2498'] = '\u0031\u0037\u002E'; 19708 t['\u2499'] = '\u0031\u0038\u002E'; 19709 t['\u249A'] = '\u0031\u0039\u002E'; 19710 t['\u249B'] = '\u0032\u0030\u002E'; 19711 t['\u249C'] = '\u0028\u0061\u0029'; 19712 t['\u249D'] = '\u0028\u0062\u0029'; 19713 t['\u249E'] = '\u0028\u0063\u0029'; 19714 t['\u249F'] = '\u0028\u0064\u0029'; 19715 t['\u24A0'] = '\u0028\u0065\u0029'; 19716 t['\u24A1'] = '\u0028\u0066\u0029'; 19717 t['\u24A2'] = '\u0028\u0067\u0029'; 19718 t['\u24A3'] = '\u0028\u0068\u0029'; 19719 t['\u24A4'] = '\u0028\u0069\u0029'; 19720 t['\u24A5'] = '\u0028\u006A\u0029'; 19721 t['\u24A6'] = '\u0028\u006B\u0029'; 19722 t['\u24A7'] = '\u0028\u006C\u0029'; 19723 t['\u24A8'] = '\u0028\u006D\u0029'; 19724 t['\u24A9'] = '\u0028\u006E\u0029'; 19725 t['\u24AA'] = '\u0028\u006F\u0029'; 19726 t['\u24AB'] = '\u0028\u0070\u0029'; 19727 t['\u24AC'] = '\u0028\u0071\u0029'; 19728 t['\u24AD'] = '\u0028\u0072\u0029'; 19729 t['\u24AE'] = '\u0028\u0073\u0029'; 19730 t['\u24AF'] = '\u0028\u0074\u0029'; 19731 t['\u24B0'] = '\u0028\u0075\u0029'; 19732 t['\u24B1'] = '\u0028\u0076\u0029'; 19733 t['\u24B2'] = '\u0028\u0077\u0029'; 19734 t['\u24B3'] = '\u0028\u0078\u0029'; 19735 t['\u24B4'] = '\u0028\u0079\u0029'; 19736 t['\u24B5'] = '\u0028\u007A\u0029'; 19737 t['\u2A0C'] = '\u222B\u222B\u222B\u222B'; 19738 t['\u2A74'] = '\u003A\u003A\u003D'; 19739 t['\u2A75'] = '\u003D\u003D'; 19740 t['\u2A76'] = '\u003D\u003D\u003D'; 19741 t['\u2E9F'] = '\u6BCD'; 19742 t['\u2EF3'] = '\u9F9F'; 19743 t['\u2F00'] = '\u4E00'; 19744 t['\u2F01'] = '\u4E28'; 19745 t['\u2F02'] = '\u4E36'; 19746 t['\u2F03'] = '\u4E3F'; 19747 t['\u2F04'] = '\u4E59'; 19748 t['\u2F05'] = '\u4E85'; 19749 t['\u2F06'] = '\u4E8C'; 19750 t['\u2F07'] = '\u4EA0'; 19751 t['\u2F08'] = '\u4EBA'; 19752 t['\u2F09'] = '\u513F'; 19753 t['\u2F0A'] = '\u5165'; 19754 t['\u2F0B'] = '\u516B';
19755 t['\u2F0C'] = '\u5182'; 19756 t['\u2F0D'] = '\u5196'; 19757 t['\u2F0E'] = '\u51AB'; 19758 t['\u2F0F'] = '\u51E0'; 19759 t['\u2F10'] = '\u51F5'; 19760 t['\u2F11'] = '\u5200'; 19761 t['\u2F12'] = '\u529B'; 19762 t['\u2F13'] = '\u52F9'; 19763 t['\u2F14'] = '\u5315'; 19764 t['\u2F15'] = '\u531A'; 19765 t['\u2F16'] = '\u5338'; 19766 t['\u2F17'] = '\u5341'; 19767 t['\u2F18'] = '\u535C'; 19768 t['\u2F19'] = '\u5369'; 19769 t['\u2F1A'] = '\u5382'; 19770 t['\u2F1B'] = '\u53B6'; 19771 t['\u2F1C'] = '\u53C8'; 19772 t['\u2F1D'] = '\u53E3'; 19773 t['\u2F1E'] = '\u56D7'; 19774 t['\u2F1F'] = '\u571F'; 19775 t['\u2F20'] = '\u58EB'; 19776 t['\u2F21'] = '\u5902'; 19777 t['\u2F22'] = '\u590A'; 19778 t['\u2F23'] = '\u5915'; 19779 t['\u2F24'] = '\u5927'; 19780 t['\u2F25'] = '\u5973'; 19781 t['\u2F26'] = '\u5B50'; 19782 t['\u2F27'] = '\u5B80'; 19783 t['\u2F28'] = '\u5BF8'; 19784 t['\u2F29'] = '\u5C0F'; 19785 t['\u2F2A'] = '\u5C22'; 19786 t['\u2F2B'] = '\u5C38'; 19787 t['\u2F2C'] = '\u5C6E'; 19788 t['\u2F2D'] = '\u5C71'; 19789 t['\u2F2E'] = '\u5DDB'; 19790 t['\u2F2F'] = '\u5DE5'; 19791 t['\u2F30'] = '\u5DF1'; 19792 t['\u2F31'] = '\u5DFE'; 19793 t['\u2F32'] = '\u5E72'; 19794 t['\u2F33'] = '\u5E7A'; 19795 t['\u2F34'] = '\u5E7F'; 19796 t['\u2F35'] = '\u5EF4'; 19797 t['\u2F36'] = '\u5EFE'; 19798 t['\u2F37'] = '\u5F0B'; 19799 t['\u2F38'] = '\u5F13'; 19800 t['\u2F39'] = '\u5F50'; 19801 t['\u2F3A'] = '\u5F61'; 19802 t['\u2F3B'] = '\u5F73'; 19803 t['\u2F3C'] = '\u5FC3'; 19804 t['\u2F3D'] = '\u6208'; 19805 t['\u2F3E'] = '\u6236'; 19806 t['\u2F3F'] = '\u624B'; 19807 t['\u2F40'] = '\u652F'; 19808 t['\u2F41'] = '\u6534'; 19809 t['\u2F42'] = '\u6587'; 19810 t['\u2F43'] = '\u6597'; 19811 t['\u2F44'] = '\u65A4'; 19812 t['\u2F45'] = '\u65B9'; 19813 t['\u2F46'] = '\u65E0'; 19814 t['\u2F47'] = '\u65E5'; 19815 t['\u2F48'] = '\u66F0'; 19816 t['\u2F49'] = '\u6708'; 19817 t['\u2F4A'] = '\u6728'; 19818 t['\u2F4B'] = '\u6B20'; 19819 t['\u2F4C'] = '\u6B62'; 19820 t['\u2F4D'] = '\u6B79'; 19821 t['\u2F4E'] = '\u6BB3'; 19822 t['\u2F4F'] = '\u6BCB'; 19823 t['\u2F50'] = '\u6BD4'; 19824 t['\u2F51'] = '\u6BDB'; 19825 t['\u2F52'] = '\u6C0F'; 19826 t['\u2F53'] = '\u6C14'; 19827 t['\u2F54'] = '\u6C34'; 19828 t['\u2F55'] = '\u706B'; 19829 t['\u2F56'] = '\u722A'; 19830 t['\u2F57'] = '\u7236'; 19831 t['\u2F58'] = '\u723B'; 19832 t['\u2F59'] = '\u723F'; 19833 t['\u2F5A'] = '\u7247'; 19834 t['\u2F5B'] = '\u7259'; 19835 t['\u2F5C'] = '\u725B'; 19836 t['\u2F5D'] = '\u72AC'; 19837 t['\u2F5E'] = '\u7384'; 19838 t['\u2F5F'] = '\u7389'; 19839 t['\u2F60'] = '\u74DC'; 19840 t['\u2F61'] = '\u74E6'; 19841 t['\u2F62'] = '\u7518'; 19842 t['\u2F63'] = '\u751F'; 19843 t['\u2F64'] = '\u7528'; 19844 t['\u2F65'] = '\u7530'; 19845 t['\u2F66'] = '\u758B'; 19846 t['\u2F67'] = '\u7592'; 19847 t['\u2F68'] = '\u7676'; 19848 t['\u2F69'] = '\u767D'; 19849 t['\u2F6A'] = '\u76AE'; 19850 t['\u2F6B'] = '\u76BF'; 19851 t['\u2F6C'] = '\u76EE'; 19852 t['\u2F6D'] = '\u77DB'; 19853 t['\u2F6E'] = '\u77E2'; 19854 t['\u2F6F'] = '\u77F3'; 19855 t['\u2F70'] = '\u793A'; 19856 t['\u2F71'] = '\u79B8'; 19857 t['\u2F72'] = '\u79BE'; 19858 t['\u2F73'] = '\u7A74'; 19859 t['\u2F74'] = '\u7ACB'; 19860 t['\u2F75'] = '\u7AF9'; 19861 t['\u2F76'] = '\u7C73'; 19862 t['\u2F77'] = '\u7CF8'; 19863 t['\u2F78'] = '\u7F36'; 19864 t['\u2F79'] = '\u7F51'; 19865 t['\u2F7A'] = '\u7F8A'; 19866 t['\u2F7B'] = '\u7FBD'; 19867 t['\u2F7C'] = '\u8001'; 19868 t['\u2F7D'] = '\u800C'; 19869 t['\u2F7E'] = '\u8012'; 19870 t['\u2F7F'] = '\u8033'; 19871 t['\u2F80'] = '\u807F'; 19872 t['\u2F81'] = '\u8089'; 19873 t['\u2F82'] = '\u81E3'; 19874 t['\u2F83'] = '\u81EA'; 19875 t['\u2F84'] = '\u81F3'; 19876 t['\u2F85'] = '\u81FC'; 19877 t['\u2F86'] = '\u820C'; 19878 t['\u2F87'] = '\u821B'; 19879 t['\u2F88'] = '\u821F'; 19880 t['\u2F89'] = '\u826E'; 19881 t['\u2F8A'] = '\u8272'; 19882 t['\u2F8B'] = '\u8278'; 19883 t['\u2F8C'] = '\u864D'; 19884 t['\u2F8D'] = '\u866B'; 19885 t['\u2F8E'] = '\u8840'; 19886 t['\u2F8F'] = '\u884C'; 19887 t['\u2F90'] = '\u8863'; 19888 t['\u2F91'] = '\u897E'; 19889 t['\u2F92'] = '\u898B'; 19890 t['\u2F93'] = '\u89D2'; 19891 t['\u2F94'] = '\u8A00'; 19892 t['\u2F95'] = '\u8C37'; 19893 t['\u2F96'] = '\u8C46'; 19894 t['\u2F97'] = '\u8C55'; 19895 t['\u2F98'] = '\u8C78'; 19896 t['\u2F99'] = '\u8C9D'; 19897 t['\u2F9A'] = '\u8D64'; 19898 t['\u2F9B'] = '\u8D70'; 19899 t['\u2F9C'] = '\u8DB3'; 19900 t['\u2F9D'] = '\u8EAB'; 19901 t['\u2F9E'] = '\u8ECA'; 19902 t['\u2F9F'] = '\u8F9B'; 19903 t['\u2FA0'] = '\u8FB0'; 19904 t['\u2FA1'] = '\u8FB5'; 19905 t['\u2FA2'] = '\u9091'; 19906 t['\u2FA3'] = '\u9149'; 19907 t['\u2FA4'] = '\u91C6'; 19908 t['\u2FA5'] = '\u91CC'; 19909 t['\u2FA6'] = '\u91D1'; 19910 t['\u2FA7'] = '\u9577'; 19911 t['\u2FA8'] = '\u9580'; 19912 t['\u2FA9'] = '\u961C'; 19913 t['\u2FAA'] = '\u96B6'; 19914 t['\u2FAB'] = '\u96B9'; 19915 t['\u2FAC'] = '\u96E8'; 19916 t['\u2FAD'] = '\u9751'; 19917 t['\u2FAE'] = '\u975E'; 19918 t['\u2FAF'] = '\u9762'; 19919 t['\u2FB0'] = '\u9769'; 19920 t['\u2FB1'] = '\u97CB'; 19921 t['\u2FB2'] = '\u97ED'; 19922 t['\u2FB3'] = '\u97F3'; 19923 t['\u2FB4'] = '\u9801'; 19924 t['\u2FB5'] = '\u98A8'; 19925 t['\u2FB6'] = '\u98DB'; 19926 t['\u2FB7'] = '\u98DF'; 19927 t['\u2FB8'] = '\u9996'; 19928 t['\u2FB9'] = '\u9999'; 19929 t['\u2FBA'] = '\u99AC'; 19930 t['\u2FBB'] = '\u9AA8'; 19931 t['\u2FBC'] = '\u9AD8'; 19932 t['\u2FBD'] = '\u9ADF'; 19933 t['\u2FBE'] = '\u9B25'; 19934 t['\u2FBF'] = '\u9B2F'; 19935 t['\u2FC0'] = '\u9B32'; 19936 t['\u2FC1'] = '\u9B3C';
19937 t['\u2FC2'] = '\u9B5A'; 19938 t['\u2FC3'] = '\u9CE5'; 19939 t['\u2FC4'] = '\u9E75'; 19940 t['\u2FC5'] = '\u9E7F'; 19941 t['\u2FC6'] = '\u9EA5'; 19942 t['\u2FC7'] = '\u9EBB'; 19943 t['\u2FC8'] = '\u9EC3'; 19944 t['\u2FC9'] = '\u9ECD'; 19945 t['\u2FCA'] = '\u9ED1'; 19946 t['\u2FCB'] = '\u9EF9'; 19947 t['\u2FCC'] = '\u9EFD'; 19948 t['\u2FCD'] = '\u9F0E'; 19949 t['\u2FCE'] = '\u9F13'; 19950 t['\u2FCF'] = '\u9F20'; 19951 t['\u2FD0'] = '\u9F3B'; 19952 t['\u2FD1'] = '\u9F4A'; 19953 t['\u2FD2'] = '\u9F52'; 19954 t['\u2FD3'] = '\u9F8D'; 19955 t['\u2FD4'] = '\u9F9C'; 19956 t['\u2FD5'] = '\u9FA0'; 19957 t['\u3036'] = '\u3012'; 19958 t['\u3038'] = '\u5341'; 19959 t['\u3039'] = '\u5344'; 19960 t['\u303A'] = '\u5345'; 19961 t['\u309B'] = '\u0020\u3099'; 19962 t['\u309C'] = '\u0020\u309A'; 19963 t['\u3131'] = '\u1100'; 19964 t['\u3132'] = '\u1101'; 19965 t['\u3133'] = '\u11AA'; 19966 t['\u3134'] = '\u1102'; 19967 t['\u3135'] = '\u11AC'; 19968 t['\u3136'] = '\u11AD'; 19969 t['\u3137'] = '\u1103'; 19970 t['\u3138'] = '\u1104'; 19971 t['\u3139'] = '\u1105'; 19972 t['\u313A'] = '\u11B0'; 19973 t['\u313B'] = '\u11B1'; 19974 t['\u313C'] = '\u11B2'; 19975 t['\u313D'] = '\u11B3'; 19976 t['\u313E'] = '\u11B4'; 19977 t['\u313F'] = '\u11B5'; 19978 t['\u3140'] = '\u111A'; 19979 t['\u3141'] = '\u1106'; 19980 t['\u3142'] = '\u1107'; 19981 t['\u3143'] = '\u1108'; 19982 t['\u3144'] = '\u1121'; 19983 t['\u3145'] = '\u1109'; 19984 t['\u3146'] = '\u110A'; 19985 t['\u3147'] = '\u110B'; 19986 t['\u3148'] = '\u110C'; 19987 t['\u3149'] = '\u110D'; 19988 t['\u314A'] = '\u110E'; 19989 t['\u314B'] = '\u110F'; 19990 t['\u314C'] = '\u1110'; 19991 t['\u314D'] = '\u1111'; 19992 t['\u314E'] = '\u1112'; 19993 t['\u314F'] = '\u1161'; 19994 t['\u3150'] = '\u1162'; 19995 t['\u3151'] = '\u1163'; 19996 t['\u3152'] = '\u1164'; 19997 t['\u3153'] = '\u1165'; 19998 t['\u3154'] = '\u1166'; 19999 t['\u3155'] = '\u1167'; 20000 t['\u3156'] = '\u1168'; 20001 t['\u3157'] = '\u1169'; 20002 t['\u3158'] = '\u116A'; 20003 t['\u3159'] = '\u116B'; 20004 t['\u315A'] = '\u116C'; 20005 t['\u315B'] = '\u116D'; 20006 t['\u315C'] = '\u116E'; 20007 t['\u315D'] = '\u116F'; 20008 t['\u315E'] = '\u1170'; 20009 t['\u315F'] = '\u1171'; 20010 t['\u3160'] = '\u1172'; 20011 t['\u3161'] = '\u1173'; 20012 t['\u3162'] = '\u1174'; 20013 t['\u3163'] = '\u1175'; 20014 t['\u3164'] = '\u1160'; 20015 t['\u3165'] = '\u1114'; 20016 t['\u3166'] = '\u1115'; 20017 t['\u3167'] = '\u11C7'; 20018 t['\u3168'] = '\u11C8'; 20019 t['\u3169'] = '\u11CC'; 20020 t['\u316A'] = '\u11CE'; 20021 t['\u316B'] = '\u11D3'; 20022 t['\u316C'] = '\u11D7'; 20023 t['\u316D'] = '\u11D9'; 20024 t['\u316E'] = '\u111C'; 20025 t['\u316F'] = '\u11DD'; 20026 t['\u3170'] = '\u11DF'; 20027 t['\u3171'] = '\u111D'; 20028 t['\u3172'] = '\u111E'; 20029 t['\u3173'] = '\u1120'; 20030 t['\u3174'] = '\u1122'; 20031 t['\u3175'] = '\u1123'; 20032 t['\u3176'] = '\u1127'; 20033 t['\u3177'] = '\u1129'; 20034 t['\u3178'] = '\u112B'; 20035 t['\u3179'] = '\u112C'; 20036 t['\u317A'] = '\u112D'; 20037 t['\u317B'] = '\u112E'; 20038 t['\u317C'] = '\u112F'; 20039 t['\u317D'] = '\u1132'; 20040 t['\u317E'] = '\u1136'; 20041 t['\u317F'] = '\u1140'; 20042 t['\u3180'] = '\u1147'; 20043 t['\u3181'] = '\u114C'; 20044 t['\u3182'] = '\u11F1'; 20045 t['\u3183'] = '\u11F2'; 20046 t['\u3184'] = '\u1157'; 20047 t['\u3185'] = '\u1158'; 20048 t['\u3186'] = '\u1159'; 20049 t['\u3187'] = '\u1184'; 20050 t['\u3188'] = '\u1185'; 20051 t['\u3189'] = '\u1188'; 20052 t['\u318A'] = '\u1191'; 20053 t['\u318B'] = '\u1192'; 20054 t['\u318C'] = '\u1194'; 20055 t['\u318D'] = '\u119E'; 20056 t['\u318E'] = '\u11A1'; 20057 t['\u3200'] = '\u0028\u1100\u0029'; 20058 t['\u3201'] = '\u0028\u1102\u0029'; 20059 t['\u3202'] = '\u0028\u1103\u0029'; 20060 t['\u3203'] = '\u0028\u1105\u0029'; 20061 t['\u3204'] = '\u0028\u1106\u0029'; 20062 t['\u3205'] = '\u0028\u1107\u0029'; 20063 t['\u3206'] = '\u0028\u1109\u0029'; 20064 t['\u3207'] = '\u0028\u110B\u0029'; 20065 t['\u3208'] = '\u0028\u110C\u0029'; 20066 t['\u3209'] = '\u0028\u110E\u0029'; 20067 t['\u320A'] = '\u0028\u110F\u0029'; 20068 t['\u320B'] = '\u0028\u1110\u0029'; 20069 t['\u320C'] = '\u0028\u1111\u0029'; 20070 t['\u320D'] = '\u0028\u1112\u0029'; 20071 t['\u320E'] = '\u0028\u1100\u1161\u0029'; 20072 t['\u320F'] = '\u0028\u1102\u1161\u0029'; 20073 t['\u3210'] = '\u0028\u1103\u1161\u0029'; 20074 t['\u3211'] = '\u0028\u1105\u1161\u0029'; 20075 t['\u3212'] = '\u0028\u1106\u1161\u0029'; 20076 t['\u3213'] = '\u0028\u1107\u1161\u0029'; 20077 t['\u3214'] = '\u0028\u1109\u1161\u0029'; 20078 t['\u3215'] = '\u0028\u110B\u1161\u0029'; 20079 t['\u3216'] = '\u0028\u110C\u1161\u0029'; 20080 t['\u3217'] = '\u0028\u110E\u1161\u0029'; 20081 t['\u3218'] = '\u0028\u110F\u1161\u0029'; 20082 t['\u3219'] = '\u0028\u1110\u1161\u0029'; 20083 t['\u321A'] = '\u0028\u1111\u1161\u0029'; 20084 t['\u321B'] = '\u0028\u1112\u1161\u0029'; 20085 t['\u321C'] = '\u0028\u110C\u116E\u0029'; 20086 t['\u321D'] = '\u0028\u110B\u1169\u110C\u1165\u11AB\u0029'; 20087 t['\u321E'] = '\u0028\u110B\u1169\u1112\u116E\u0029'; 20088 t['\u3220'] = '\u0028\u4E00\u0029'; 20089 t['\u3221'] = '\u0028\u4E8C\u0029'; 20090 t['\u3222'] = '\u0028\u4E09\u0029'; 20091 t['\u3223'] = '\u0028\u56DB\u0029'; 20092 t['\u3224'] = '\u0028\u4E94\u0029'; 20093 t['\u3225'] = '\u0028\u516D\u0029'; 20094 t['\u3226'] = '\u0028\u4E03\u0029'; 20095 t['\u3227'] = '\u0028\u516B\u0029'; 20096 t['\u3228'] = '\u0028\u4E5D\u0029'; 20097 t['\u3229'] = '\u0028\u5341\u0029'; 20098 t['\u322A'] = '\u0028\u6708\u0029'; 20099 t['\u322B'] = '\u0028\u706B\u0029'; 20100 t['\u322C'] = '\u0028\u6C34\u0029'; 20101 t['\u322D'] = '\u0028\u6728\u0029'; 20102 t['\u322E'] = '\u0028\u91D1\u0029';
20103 t['\u322F'] = '\u0028\u571F\u0029'; 20104 t['\u3230'] = '\u0028\u65E5\u0029'; 20105 t['\u3231'] = '\u0028\u682A\u0029'; 20106 t['\u3232'] = '\u0028\u6709\u0029'; 20107 t['\u3233'] = '\u0028\u793E\u0029'; 20108 t['\u3234'] = '\u0028\u540D\u0029'; 20109 t['\u3235'] = '\u0028\u7279\u0029'; 20110 t['\u3236'] = '\u0028\u8CA1\u0029'; 20111 t['\u3237'] = '\u0028\u795D\u0029'; 20112 t['\u3238'] = '\u0028\u52B4\u0029'; 20113 t['\u3239'] = '\u0028\u4EE3\u0029'; 20114 t['\u323A'] = '\u0028\u547C\u0029'; 20115 t['\u323B'] = '\u0028\u5B66\u0029'; 20116 t['\u323C'] = '\u0028\u76E3\u0029'; 20117 t['\u323D'] = '\u0028\u4F01\u0029'; 20118 t['\u323E'] = '\u0028\u8CC7\u0029'; 20119 t['\u323F'] = '\u0028\u5354\u0029'; 20120 t['\u3240'] = '\u0028\u796D\u0029'; 20121 t['\u3241'] = '\u0028\u4F11\u0029'; 20122 t['\u3242'] = '\u0028\u81EA\u0029'; 20123 t['\u3243'] = '\u0028\u81F3\u0029'; 20124 t['\u32C0'] = '\u0031\u6708'; 20125 t['\u32C1'] = '\u0032\u6708'; 20126 t['\u32C2'] = '\u0033\u6708'; 20127 t['\u32C3'] = '\u0034\u6708'; 20128 t['\u32C4'] = '\u0035\u6708'; 20129 t['\u32C5'] = '\u0036\u6708'; 20130 t['\u32C6'] = '\u0037\u6708'; 20131 t['\u32C7'] = '\u0038\u6708'; 20132 t['\u32C8'] = '\u0039\u6708'; 20133 t['\u32C9'] = '\u0031\u0030\u6708'; 20134 t['\u32CA'] = '\u0031\u0031\u6708'; 20135 t['\u32CB'] = '\u0031\u0032\u6708'; 20136 t['\u3358'] = '\u0030\u70B9'; 20137 t['\u3359'] = '\u0031\u70B9'; 20138 t['\u335A'] = '\u0032\u70B9'; 20139 t['\u335B'] = '\u0033\u70B9'; 20140 t['\u335C'] = '\u0034\u70B9'; 20141 t['\u335D'] = '\u0035\u70B9'; 20142 t['\u335E'] = '\u0036\u70B9'; 20143 t['\u335F'] = '\u0037\u70B9'; 20144 t['\u3360'] = '\u0038\u70B9'; 20145 t['\u3361'] = '\u0039\u70B9'; 20146 t['\u3362'] = '\u0031\u0030\u70B9'; 20147 t['\u3363'] = '\u0031\u0031\u70B9'; 20148 t['\u3364'] = '\u0031\u0032\u70B9'; 20149 t['\u3365'] = '\u0031\u0033\u70B9'; 20150 t['\u3366'] = '\u0031\u0034\u70B9'; 20151 t['\u3367'] = '\u0031\u0035\u70B9'; 20152 t['\u3368'] = '\u0031\u0036\u70B9'; 20153 t['\u3369'] = '\u0031\u0037\u70B9'; 20154 t['\u336A'] = '\u0031\u0038\u70B9'; 20155 t['\u336B'] = '\u0031\u0039\u70B9'; 20156 t['\u336C'] = '\u0032\u0030\u70B9'; 20157 t['\u336D'] = '\u0032\u0031\u70B9'; 20158 t['\u336E'] = '\u0032\u0032\u70B9'; 20159 t['\u336F'] = '\u0032\u0033\u70B9'; 20160 t['\u3370'] = '\u0032\u0034\u70B9'; 20161 t['\u33E0'] = '\u0031\u65E5'; 20162 t['\u33E1'] = '\u0032\u65E5'; 20163 t['\u33E2'] = '\u0033\u65E5'; 20164 t['\u33E3'] = '\u0034\u65E5'; 20165 t['\u33E4'] = '\u0035\u65E5'; 20166 t['\u33E5'] = '\u0036\u65E5'; 20167 t['\u33E6'] = '\u0037\u65E5'; 20168 t['\u33E7'] = '\u0038\u65E5'; 20169 t['\u33E8'] = '\u0039\u65E5'; 20170 t['\u33E9'] = '\u0031\u0030\u65E5'; 20171 t['\u33EA'] = '\u0031\u0031\u65E5'; 20172 t['\u33EB'] = '\u0031\u0032\u65E5'; 20173 t['\u33EC'] = '\u0031\u0033\u65E5'; 20174 t['\u33ED'] = '\u0031\u0034\u65E5'; 20175 t['\u33EE'] = '\u0031\u0035\u65E5'; 20176 t['\u33EF'] = '\u0031\u0036\u65E5'; 20177 t['\u33F0'] = '\u0031\u0037\u65E5'; 20178 t['\u33F1'] = '\u0031\u0038\u65E5'; 20179 t['\u33F2'] = '\u0031\u0039\u65E5'; 20180 t['\u33F3'] = '\u0032\u0030\u65E5'; 20181 t['\u33F4'] = '\u0032\u0031\u65E5'; 20182 t['\u33F5'] = '\u0032\u0032\u65E5'; 20183 t['\u33F6'] = '\u0032\u0033\u65E5'; 20184 t['\u33F7'] = '\u0032\u0034\u65E5'; 20185 t['\u33F8'] = '\u0032\u0035\u65E5'; 20186 t['\u33F9'] = '\u0032\u0036\u65E5'; 20187 t['\u33FA'] = '\u0032\u0037\u65E5'; 20188 t['\u33FB'] = '\u0032\u0038\u65E5'; 20189 t['\u33FC'] = '\u0032\u0039\u65E5'; 20190 t['\u33FD'] = '\u0033\u0030\u65E5'; 20191 t['\u33FE'] = '\u0033\u0031\u65E5'; 20192 t['\uFB00'] = '\u0066\u0066'; 20193 t['\uFB01'] = '\u0066\u0069'; 20194 t['\uFB02'] = '\u0066\u006C'; 20195 t['\uFB03'] = '\u0066\u0066\u0069'; 20196 t['\uFB04'] = '\u0066\u0066\u006C'; 20197 t['\uFB05'] = '\u017F\u0074'; 20198 t['\uFB06'] = '\u0073\u0074'; 20199 t['\uFB13'] = '\u0574\u0576'; 20200 t['\uFB14'] = '\u0574\u0565'; 20201 t['\uFB15'] = '\u0574\u056B'; 20202 t['\uFB16'] = '\u057E\u0576'; 20203 t['\uFB17'] = '\u0574\u056D'; 20204 t['\uFB4F'] = '\u05D0\u05DC'; 20205 t['\uFB50'] = '\u0671'; 20206 t['\uFB51'] = '\u0671'; 20207 t['\uFB52'] = '\u067B'; 20208 t['\uFB53'] = '\u067B'; 20209 t['\uFB54'] = '\u067B'; 20210 t['\uFB55'] = '\u067B'; 20211 t['\uFB56'] = '\u067E'; 20212 t['\uFB57'] = '\u067E'; 20213 t['\uFB58'] = '\u067E'; 20214 t['\uFB59'] = '\u067E'; 20215 t['\uFB5A'] = '\u0680'; 20216 t['\uFB5B'] = '\u0680'; 20217 t['\uFB5C'] = '\u0680'; 20218 t['\uFB5D'] = '\u0680'; 20219 t['\uFB5E'] = '\u067A'; 20220 t['\uFB5F'] = '\u067A'; 20221 t['\uFB60'] = '\u067A';
20222 t['\uFB61'] = '\u067A'; 20223 t['\uFB62'] = '\u067F'; 20224 t['\uFB63'] = '\u067F'; 20225 t['\uFB64'] = '\u067F'; 20226 t['\uFB65'] = '\u067F'; 20227 t['\uFB66'] = '\u0679'; 20228 t['\uFB67'] = '\u0679'; 20229 t['\uFB68'] = '\u0679'; 20230 t['\uFB69'] = '\u0679'; 20231 t['\uFB6A'] = '\u06A4'; 20232 t['\uFB6B'] = '\u06A4'; 20233 t['\uFB6C'] = '\u06A4'; 20234 t['\uFB6D'] = '\u06A4'; 20235 t['\uFB6E'] = '\u06A6'; 20236 t['\uFB6F'] = '\u06A6'; 20237 t['\uFB70'] = '\u06A6'; 20238 t['\uFB71'] = '\u06A6'; 20239 t['\uFB72'] = '\u0684'; 20240 t['\uFB73'] = '\u0684'; 20241 t['\uFB74'] = '\u0684'; 20242 t['\uFB75'] = '\u0684'; 20243 t['\uFB76'] = '\u0683'; 20244 t['\uFB77'] = '\u0683'; 20245 t['\uFB78'] = '\u0683'; 20246 t['\uFB79'] = '\u0683'; 20247 t['\uFB7A'] = '\u0686'; 20248 t['\uFB7B'] = '\u0686'; 20249 t['\uFB7C'] = '\u0686'; 20250 t['\uFB7D'] = '\u0686'; 20251 t['\uFB7E'] = '\u0687'; 20252 t['\uFB7F'] = '\u0687'; 20253 t['\uFB80'] = '\u0687'; 20254 t['\uFB81'] = '\u0687'; 20255 t['\uFB82'] = '\u068D'; 20256 t['\uFB83'] = '\u068D'; 20257 t['\uFB84'] = '\u068C'; 20258 t['\uFB85'] = '\u068C'; 20259 t['\uFB86'] = '\u068E'; 20260 t['\uFB87'] = '\u068E'; 20261 t['\uFB88'] = '\u0688'; 20262 t['\uFB89'] = '\u0688'; 20263 t['\uFB8A'] = '\u0698'; 20264 t['\uFB8B'] = '\u0698'; 20265 t['\uFB8C'] = '\u0691'; 20266 t['\uFB8D'] = '\u0691'; 20267 t['\uFB8E'] = '\u06A9'; 20268 t['\uFB8F'] = '\u06A9'; 20269 t['\uFB90'] = '\u06A9'; 20270 t['\uFB91'] = '\u06A9'; 20271 t['\uFB92'] = '\u06AF'; 20272 t['\uFB93'] = '\u06AF'; 20273 t['\uFB94'] = '\u06AF'; 20274 t['\uFB95'] = '\u06AF'; 20275 t['\uFB96'] = '\u06B3'; 20276 t['\uFB97'] = '\u06B3'; 20277 t['\uFB98'] = '\u06B3'; 20278 t['\uFB99'] = '\u06B3'; 20279 t['\uFB9A'] = '\u06B1'; 20280 t['\uFB9B'] = '\u06B1'; 20281 t['\uFB9C'] = '\u06B1'; 20282 t['\uFB9D'] = '\u06B1'; 20283 t['\uFB9E'] = '\u06BA'; 20284 t['\uFB9F'] = '\u06BA'; 20285 t['\uFBA0'] = '\u06BB'; 20286 t['\uFBA1'] = '\u06BB'; 20287 t['\uFBA2'] = '\u06BB'; 20288 t['\uFBA3'] = '\u06BB'; 20289 t['\uFBA4'] = '\u06C0'; 20290 t['\uFBA5'] = '\u06C0'; 20291 t['\uFBA6'] = '\u06C1'; 20292 t['\uFBA7'] = '\u06C1'; 20293 t['\uFBA8'] = '\u06C1'; 20294 t['\uFBA9'] = '\u06C1'; 20295 t['\uFBAA'] = '\u06BE'; 20296 t['\uFBAB'] = '\u06BE'; 20297 t['\uFBAC'] = '\u06BE'; 20298 t['\uFBAD'] = '\u06BE'; 20299 t['\uFBAE'] = '\u06D2'; 20300 t['\uFBAF'] = '\u06D2'; 20301 t['\uFBB0'] = '\u06D3'; 20302 t['\uFBB1'] = '\u06D3'; 20303 t['\uFBD3'] = '\u06AD'; 20304 t['\uFBD4'] = '\u06AD'; 20305 t['\uFBD5'] = '\u06AD'; 20306 t['\uFBD6'] = '\u06AD'; 20307 t['\uFBD7'] = '\u06C7'; 20308 t['\uFBD8'] = '\u06C7'; 20309 t['\uFBD9'] = '\u06C6'; 20310 t['\uFBDA'] = '\u06C6'; 20311 t['\uFBDB'] = '\u06C8'; 20312 t['\uFBDC'] = '\u06C8'; 20313 t['\uFBDD'] = '\u0677'; 20314 t['\uFBDE'] = '\u06CB'; 20315 t['\uFBDF'] = '\u06CB'; 20316 t['\uFBE0'] = '\u06C5'; 20317 t['\uFBE1'] = '\u06C5'; 20318 t['\uFBE2'] = '\u06C9'; 20319 t['\uFBE3'] = '\u06C9'; 20320 t['\uFBE4'] = '\u06D0'; 20321 t['\uFBE5'] = '\u06D0'; 20322 t['\uFBE6'] = '\u06D0'; 20323 t['\uFBE7'] = '\u06D0'; 20324 t['\uFBE8'] = '\u0649'; 20325 t['\uFBE9'] = '\u0649'; 20326 t['\uFBEA'] = '\u0626\u0627'; 20327 t['\uFBEB'] = '\u0626\u0627'; 20328 t['\uFBEC'] = '\u0626\u06D5'; 20329 t['\uFBED'] = '\u0626\u06D5'; 20330 t['\uFBEE'] = '\u0626\u0648'; 20331 t['\uFBEF'] = '\u0626\u0648'; 20332 t['\uFBF0'] = '\u0626\u06C7'; 20333 t['\uFBF1'] = '\u0626\u06C7'; 20334 t['\uFBF2'] = '\u0626\u06C6'; 20335 t['\uFBF3'] = '\u0626\u06C6'; 20336 t['\uFBF4'] = '\u0626\u06C8'; 20337 t['\uFBF5'] = '\u0626\u06C8'; 20338 t['\uFBF6'] = '\u0626\u06D0'; 20339 t['\uFBF7'] = '\u0626\u06D0'; 20340 t['\uFBF8'] = '\u0626\u06D0'; 20341 t['\uFBF9'] = '\u0626\u0649'; 20342 t['\uFBFA'] = '\u0626\u0649'; 20343 t['\uFBFB'] = '\u0626\u0649'; 20344 t['\uFBFC'] = '\u06CC'; 20345 t['\uFBFD'] = '\u06CC'; 20346 t['\uFBFE'] = '\u06CC'; 20347 t['\uFBFF'] = '\u06CC'; 20348 t['\uFC00'] = '\u0626\u062C'; 20349 t['\uFC01'] = '\u0626\u062D'; 20350 t['\uFC02'] = '\u0626\u0645'; 20351 t['\uFC03'] = '\u0626\u0649'; 20352 t['\uFC04'] = '\u0626\u064A'; 20353 t['\uFC05'] = '\u0628\u062C'; 20354 t['\uFC06'] = '\u0628\u062D'; 20355 t['\uFC07'] = '\u0628\u062E'; 20356 t['\uFC08'] = '\u0628\u0645'; 20357 t['\uFC09'] = '\u0628\u0649'; 20358 t['\uFC0A'] = '\u0628\u064A'; 20359 t['\uFC0B'] = '\u062A\u062C'; 20360 t['\uFC0C'] = '\u062A\u062D'; 20361 t['\uFC0D'] = '\u062A\u062E'; 20362 t['\uFC0E'] = '\u062A\u0645'; 20363 t['\uFC0F'] = '\u062A\u0649'; 20364 t['\uFC10'] = '\u062A\u064A'; 20365 t['\uFC11'] = '\u062B\u062C'; 20366 t['\uFC12'] = '\u062B\u0645'; 20367 t['\uFC13'] = '\u062B\u0649'; 20368 t['\uFC14'] = '\u062B\u064A'; 20369 t['\uFC15'] = '\u062C\u062D'; 20370 t['\uFC16'] = '\u062C\u0645'; 20371 t['\uFC17'] = '\u062D\u062C'; 20372 t['\uFC18'] = '\u062D\u0645'; 20373 t['\uFC19'] = '\u062E\u062C'; 20374 t['\uFC1A'] = '\u062E\u062D'; 20375 t['\uFC1B'] = '\u062E\u0645';
20376 t['\uFC1C'] = '\u0633\u062C'; 20377 t['\uFC1D'] = '\u0633\u062D'; 20378 t['\uFC1E'] = '\u0633\u062E'; 20379 t['\uFC1F'] = '\u0633\u0645'; 20380 t['\uFC20'] = '\u0635\u062D'; 20381 t['\uFC21'] = '\u0635\u0645'; 20382 t['\uFC22'] = '\u0636\u062C'; 20383 t['\uFC23'] = '\u0636\u062D'; 20384 t['\uFC24'] = '\u0636\u062E'; 20385 t['\uFC25'] = '\u0636\u0645'; 20386 t['\uFC26'] = '\u0637\u062D'; 20387 t['\uFC27'] = '\u0637\u0645'; 20388 t['\uFC28'] = '\u0638\u0645'; 20389 t['\uFC29'] = '\u0639\u062C'; 20390 t['\uFC2A'] = '\u0639\u0645'; 20391 t['\uFC2B'] = '\u063A\u062C'; 20392 t['\uFC2C'] = '\u063A\u0645'; 20393 t['\uFC2D'] = '\u0641\u062C'; 20394 t['\uFC2E'] = '\u0641\u062D'; 20395 t['\uFC2F'] = '\u0641\u062E'; 20396 t['\uFC30'] = '\u0641\u0645'; 20397 t['\uFC31'] = '\u0641\u0649'; 20398 t['\uFC32'] = '\u0641\u064A'; 20399 t['\uFC33'] = '\u0642\u062D'; 20400 t['\uFC34'] = '\u0642\u0645'; 20401 t['\uFC35'] = '\u0642\u0649'; 20402 t['\uFC36'] = '\u0642\u064A'; 20403 t['\uFC37'] = '\u0643\u0627'; 20404 t['\uFC38'] = '\u0643\u062C'; 20405 t['\uFC39'] = '\u0643\u062D'; 20406 t['\uFC3A'] = '\u0643\u062E'; 20407 t['\uFC3B'] = '\u0643\u0644'; 20408 t['\uFC3C'] = '\u0643\u0645'; 20409 t['\uFC3D'] = '\u0643\u0649'; 20410 t['\uFC3E'] = '\u0643\u064A'; 20411 t['\uFC3F'] = '\u0644\u062C'; 20412 t['\uFC40'] = '\u0644\u062D'; 20413 t['\uFC41'] = '\u0644\u062E'; 20414 t['\uFC42'] = '\u0644\u0645'; 20415 t['\uFC43'] = '\u0644\u0649'; 20416 t['\uFC44'] = '\u0644\u064A'; 20417 t['\uFC45'] = '\u0645\u062C'; 20418 t['\uFC46'] = '\u0645\u062D'; 20419 t['\uFC47'] = '\u0645\u062E'; 20420 t['\uFC48'] = '\u0645\u0645'; 20421 t['\uFC49'] = '\u0645\u0649'; 20422 t['\uFC4A'] = '\u0645\u064A'; 20423 t['\uFC4B'] = '\u0646\u062C'; 20424 t['\uFC4C'] = '\u0646\u062D'; 20425 t['\uFC4D'] = '\u0646\u062E'; 20426 t['\uFC4E'] = '\u0646\u0645'; 20427 t['\uFC4F'] = '\u0646\u0649'; 20428 t['\uFC50'] = '\u0646\u064A'; 20429 t['\uFC51'] = '\u0647\u062C'; 20430 t['\uFC52'] = '\u0647\u0645'; 20431 t['\uFC53'] = '\u0647\u0649'; 20432 t['\uFC54'] = '\u0647\u064A'; 20433 t['\uFC55'] = '\u064A\u062C'; 20434 t['\uFC56'] = '\u064A\u062D'; 20435 t['\uFC57'] = '\u064A\u062E'; 20436 t['\uFC58'] = '\u064A\u0645'; 20437 t['\uFC59'] = '\u064A\u0649'; 20438 t['\uFC5A'] = '\u064A\u064A'; 20439 t['\uFC5B'] = '\u0630\u0670'; 20440 t['\uFC5C'] = '\u0631\u0670'; 20441 t['\uFC5D'] = '\u0649\u0670'; 20442 t['\uFC5E'] = '\u0020\u064C\u0651'; 20443 t['\uFC5F'] = '\u0020\u064D\u0651'; 20444 t['\uFC60'] = '\u0020\u064E\u0651'; 20445 t['\uFC61'] = '\u0020\u064F\u0651'; 20446 t['\uFC62'] = '\u0020\u0650\u0651'; 20447 t['\uFC63'] = '\u0020\u0651\u0670'; 20448 t['\uFC64'] = '\u0626\u0631'; 20449 t['\uFC65'] = '\u0626\u0632'; 20450 t['\uFC66'] = '\u0626\u0645'; 20451 t['\uFC67'] = '\u0626\u0646'; 20452 t['\uFC68'] = '\u0626\u0649'; 20453 t['\uFC69'] = '\u0626\u064A'; 20454 t['\uFC6A'] = '\u0628\u0631'; 20455 t['\uFC6B'] = '\u0628\u0632'; 20456 t['\uFC6C'] = '\u0628\u0645'; 20457 t['\uFC6D'] = '\u0628\u0646'; 20458 t['\uFC6E'] = '\u0628\u0649'; 20459 t['\uFC6F'] = '\u0628\u064A'; 20460 t['\uFC70'] = '\u062A\u0631'; 20461 t['\uFC71'] = '\u062A\u0632'; 20462 t['\uFC72'] = '\u062A\u0645'; 20463 t['\uFC73'] = '\u062A\u0646'; 20464 t['\uFC74'] = '\u062A\u0649'; 20465 t['\uFC75'] = '\u062A\u064A'; 20466 t['\uFC76'] = '\u062B\u0631'; 20467 t['\uFC77'] = '\u062B\u0632'; 20468 t['\uFC78'] = '\u062B\u0645'; 20469 t['\uFC79'] = '\u062B\u0646'; 20470 t['\uFC7A'] = '\u062B\u0649'; 20471 t['\uFC7B'] = '\u062B\u064A'; 20472 t['\uFC7C'] = '\u0641\u0649'; 20473 t['\uFC7D'] = '\u0641\u064A'; 20474 t['\uFC7E'] = '\u0642\u0649'; 20475 t['\uFC7F'] = '\u0642\u064A'; 20476 t['\uFC80'] = '\u0643\u0627'; 20477 t['\uFC81'] = '\u0643\u0644'; 20478 t['\uFC82'] = '\u0643\u0645'; 20479 t['\uFC83'] = '\u0643\u0649'; 20480 t['\uFC84'] = '\u0643\u064A'; 20481 t['\uFC85'] = '\u0644\u0645'; 20482 t['\uFC86'] = '\u0644\u0649'; 20483 t['\uFC87'] = '\u0644\u064A'; 20484 t['\uFC88'] = '\u0645\u0627'; 20485 t['\uFC89'] = '\u0645\u0645'; 20486 t['\uFC8A'] = '\u0646\u0631'; 20487 t['\uFC8B'] = '\u0646\u0632'; 20488 t['\uFC8C'] = '\u0646\u0645'; 20489 t['\uFC8D'] = '\u0646\u0646'; 20490 t['\uFC8E'] = '\u0646\u0649'; 20491 t['\uFC8F'] = '\u0646\u064A'; 20492 t['\uFC90'] = '\u0649\u0670'; 20493 t['\uFC91'] = '\u064A\u0631'; 20494 t['\uFC92'] = '\u064A\u0632'; 20495 t['\uFC93'] = '\u064A\u0645'; 20496 t['\uFC94'] = '\u064A\u0646'; 20497 t['\uFC95'] = '\u064A\u0649'; 20498 t['\uFC96'] = '\u064A\u064A'; 20499 t['\uFC97'] = '\u0626\u062C'; 20500 t['\uFC98'] = '\u0626\u062D'; 20501 t['\uFC99'] = '\u0626\u062E'; 20502 t['\uFC9A'] = '\u0626\u0645'; 20503 t['\uFC9B'] = '\u0626\u0647'; 20504 t['\uFC9C'] = '\u0628\u062C'; 20505 t['\uFC9D'] = '\u0628\u062D'; 20506 t['\uFC9E'] = '\u0628\u062E'; 20507 t['\uFC9F'] = '\u0628\u0645'; 20508 t['\uFCA0'] = '\u0628\u0647'; 20509 t['\uFCA1'] = '\u062A\u062C'; 20510 t['\uFCA2'] = '\u062A\u062D'; 20511 t['\uFCA3'] = '\u062A\u062E'; 20512 t['\uFCA4'] = '\u062A\u0645'; 20513 t['\uFCA5'] = '\u062A\u0647'; 20514 t['\uFCA6'] = '\u062B\u0645'; 20515 t['\uFCA7'] = '\u062C\u062D'; 20516 t['\uFCA8'] = '\u062C\u0645'; 20517 t['\uFCA9'] = '\u062D\u062C'; 20518 t['\uFCAA'] = '\u062D\u0645'; 20519 t['\uFCAB'] = '\u062E\u062C'; 20520 t['\uFCAC'] = '\u062E\u0645';
20521 t['\uFCAD'] = '\u0633\u062C'; 20522 t['\uFCAE'] = '\u0633\u062D'; 20523 t['\uFCAF'] = '\u0633\u062E'; 20524 t['\uFCB0'] = '\u0633\u0645'; 20525 t['\uFCB1'] = '\u0635\u062D'; 20526 t['\uFCB2'] = '\u0635\u062E'; 20527 t['\uFCB3'] = '\u0635\u0645'; 20528 t['\uFCB4'] = '\u0636\u062C'; 20529 t['\uFCB5'] = '\u0636\u062D'; 20530 t['\uFCB6'] = '\u0636\u062E'; 20531 t['\uFCB7'] = '\u0636\u0645'; 20532 t['\uFCB8'] = '\u0637\u062D'; 20533 t['\uFCB9'] = '\u0638\u0645'; 20534 t['\uFCBA'] = '\u0639\u062C'; 20535 t['\uFCBB'] = '\u0639\u0645'; 20536 t['\uFCBC'] = '\u063A\u062C'; 20537 t['\uFCBD'] = '\u063A\u0645'; 20538 t['\uFCBE'] = '\u0641\u062C'; 20539 t['\uFCBF'] = '\u0641\u062D'; 20540 t['\uFCC0'] = '\u0641\u062E'; 20541 t['\uFCC1'] = '\u0641\u0645'; 20542 t['\uFCC2'] = '\u0642\u062D'; 20543 t['\uFCC3'] = '\u0642\u0645'; 20544 t['\uFCC4'] = '\u0643\u062C'; 20545 t['\uFCC5'] = '\u0643\u062D'; 20546 t['\uFCC6'] = '\u0643\u062E'; 20547 t['\uFCC7'] = '\u0643\u0644'; 20548 t['\uFCC8'] = '\u0643\u0645'; 20549 t['\uFCC9'] = '\u0644\u062C'; 20550 t['\uFCCA'] = '\u0644\u062D'; 20551 t['\uFCCB'] = '\u0644\u062E'; 20552 t['\uFCCC'] = '\u0644\u0645'; 20553 t['\uFCCD'] = '\u0644\u0647'; 20554 t['\uFCCE'] = '\u0645\u062C'; 20555 t['\uFCCF'] = '\u0645\u062D'; 20556 t['\uFCD0'] = '\u0645\u062E'; 20557 t['\uFCD1'] = '\u0645\u0645'; 20558 t['\uFCD2'] = '\u0646\u062C'; 20559 t['\uFCD3'] = '\u0646\u062D'; 20560 t['\uFCD4'] = '\u0646\u062E'; 20561 t['\uFCD5'] = '\u0646\u0645'; 20562 t['\uFCD6'] = '\u0646\u0647'; 20563 t['\uFCD7'] = '\u0647\u062C'; 20564 t['\uFCD8'] = '\u0647\u0645'; 20565 t['\uFCD9'] = '\u0647\u0670'; 20566 t['\uFCDA'] = '\u064A\u062C'; 20567 t['\uFCDB'] = '\u064A\u062D'; 20568 t['\uFCDC'] = '\u064A\u062E'; 20569 t['\uFCDD'] = '\u064A\u0645'; 20570 t['\uFCDE'] = '\u064A\u0647'; 20571 t['\uFCDF'] = '\u0626\u0645'; 20572 t['\uFCE0'] = '\u0626\u0647'; 20573 t['\uFCE1'] = '\u0628\u0645'; 20574 t['\uFCE2'] = '\u0628\u0647'; 20575 t['\uFCE3'] = '\u062A\u0645'; 20576 t['\uFCE4'] = '\u062A\u0647'; 20577 t['\uFCE5'] = '\u062B\u0645'; 20578 t['\uFCE6'] = '\u062B\u0647'; 20579 t['\uFCE7'] = '\u0633\u0645'; 20580 t['\uFCE8'] = '\u0633\u0647'; 20581 t['\uFCE9'] = '\u0634\u0645'; 20582 t['\uFCEA'] = '\u0634\u0647'; 20583 t['\uFCEB'] = '\u0643\u0644'; 20584 t['\uFCEC'] = '\u0643\u0645'; 20585 t['\uFCED'] = '\u0644\u0645'; 20586 t['\uFCEE'] = '\u0646\u0645'; 20587 t['\uFCEF'] = '\u0646\u0647'; 20588 t['\uFCF0'] = '\u064A\u0645'; 20589 t['\uFCF1'] = '\u064A\u0647'; 20590 t['\uFCF2'] = '\u0640\u064E\u0651'; 20591 t['\uFCF3'] = '\u0640\u064F\u0651'; 20592 t['\uFCF4'] = '\u0640\u0650\u0651'; 20593 t['\uFCF5'] = '\u0637\u0649'; 20594 t['\uFCF6'] = '\u0637\u064A'; 20595 t['\uFCF7'] = '\u0639\u0649'; 20596 t['\uFCF8'] = '\u0639\u064A'; 20597 t['\uFCF9'] = '\u063A\u0649'; 20598 t['\uFCFA'] = '\u063A\u064A'; 20599 t['\uFCFB'] = '\u0633\u0649'; 20600 t['\uFCFC'] = '\u0633\u064A'; 20601 t['\uFCFD'] = '\u0634\u0649'; 20602 t['\uFCFE'] = '\u0634\u064A'; 20603 t['\uFCFF'] = '\u062D\u0649'; 20604 t['\uFD00'] = '\u062D\u064A'; 20605 t['\uFD01'] = '\u062C\u0649'; 20606 t['\uFD02'] = '\u062C\u064A'; 20607 t['\uFD03'] = '\u062E\u0649'; 20608 t['\uFD04'] = '\u062E\u064A'; 20609 t['\uFD05'] = '\u0635\u0649'; 20610 t['\uFD06'] = '\u0635\u064A'; 20611 t['\uFD07'] = '\u0636\u0649'; 20612 t['\uFD08'] = '\u0636\u064A'; 20613 t['\uFD09'] = '\u0634\u062C'; 20614 t['\uFD0A'] = '\u0634\u062D'; 20615 t['\uFD0B'] = '\u0634\u062E'; 20616 t['\uFD0C'] = '\u0634\u0645'; 20617 t['\uFD0D'] = '\u0634\u0631'; 20618 t['\uFD0E'] = '\u0633\u0631'; 20619 t['\uFD0F'] = '\u0635\u0631'; 20620 t['\uFD10'] = '\u0636\u0631'; 20621 t['\uFD11'] = '\u0637\u0649'; 20622 t['\uFD12'] = '\u0637\u064A'; 20623 t['\uFD13'] = '\u0639\u0649'; 20624 t['\uFD14'] = '\u0639\u064A'; 20625 t['\uFD15'] = '\u063A\u0649'; 20626 t['\uFD16'] = '\u063A\u064A'; 20627 t['\uFD17'] = '\u0633\u0649'; 20628 t['\uFD18'] = '\u0633\u064A'; 20629 t['\uFD19'] = '\u0634\u0649'; 20630 t['\uFD1A'] = '\u0634\u064A'; 20631 t['\uFD1B'] = '\u062D\u0649'; 20632 t['\uFD1C'] = '\u062D\u064A'; 20633 t['\uFD1D'] = '\u062C\u0649'; 20634 t['\uFD1E'] = '\u062C\u064A'; 20635 t['\uFD1F'] = '\u062E\u0649'; 20636 t['\uFD20'] = '\u062E\u064A'; 20637 t['\uFD21'] = '\u0635\u0649'; 20638 t['\uFD22'] = '\u0635\u064A'; 20639 t['\uFD23'] = '\u0636\u0649'; 20640 t['\uFD24'] = '\u0636\u064A'; 20641 t['\uFD25'] = '\u0634\u062C'; 20642 t['\uFD26'] = '\u0634\u062D'; 20643 t['\uFD27'] = '\u0634\u062E'; 20644 t['\uFD28'] = '\u0634\u0645'; 20645 t['\uFD29'] = '\u0634\u0631'; 20646 t['\uFD2A'] = '\u0633\u0631'; 20647 t['\uFD2B'] = '\u0635\u0631'; 20648 t['\uFD2C'] = '\u0636\u0631'; 20649 t['\uFD2D'] = '\u0634\u062C'; 20650 t['\uFD2E'] = '\u0634\u062D'; 20651 t['\uFD2F'] = '\u0634\u062E'; 20652 t['\uFD30'] = '\u0634\u0645'; 20653 t['\uFD31'] = '\u0633\u0647'; 20654 t['\uFD32'] = '\u0634\u0647'; 20655 t['\uFD33'] = '\u0637\u0645';
20656 t['\uFD34'] = '\u0633\u062C'; 20657 t['\uFD35'] = '\u0633\u062D'; 20658 t['\uFD36'] = '\u0633\u062E'; 20659 t['\uFD37'] = '\u0634\u062C'; 20660 t['\uFD38'] = '\u0634\u062D'; 20661 t['\uFD39'] = '\u0634\u062E'; 20662 t['\uFD3A'] = '\u0637\u0645'; 20663 t['\uFD3B'] = '\u0638\u0645'; 20664 t['\uFD3C'] = '\u0627\u064B'; 20665 t['\uFD3D'] = '\u0627\u064B'; 20666 t['\uFD50'] = '\u062A\u062C\u0645'; 20667 t['\uFD51'] = '\u062A\u062D\u062C'; 20668 t['\uFD52'] = '\u062A\u062D\u062C'; 20669 t['\uFD53'] = '\u062A\u062D\u0645'; 20670 t['\uFD54'] = '\u062A\u062E\u0645'; 20671 t['\uFD55'] = '\u062A\u0645\u062C'; 20672 t['\uFD56'] = '\u062A\u0645\u062D'; 20673 t['\uFD57'] = '\u062A\u0645\u062E'; 20674 t['\uFD58'] = '\u062C\u0645\u062D'; 20675 t['\uFD59'] = '\u062C\u0645\u062D'; 20676 t['\uFD5A'] = '\u062D\u0645\u064A'; 20677 t['\uFD5B'] = '\u062D\u0645\u0649'; 20678 t['\uFD5C'] = '\u0633\u062D\u062C'; 20679 t['\uFD5D'] = '\u0633\u062C\u062D'; 20680 t['\uFD5E'] = '\u0633\u062C\u0649'; 20681 t['\uFD5F'] = '\u0633\u0645\u062D'; 20682 t['\uFD60'] = '\u0633\u0645\u062D'; 20683 t['\uFD61'] = '\u0633\u0645\u062C'; 20684 t['\uFD62'] = '\u0633\u0645\u0645'; 20685 t['\uFD63'] = '\u0633\u0645\u0645'; 20686 t['\uFD64'] = '\u0635\u062D\u062D'; 20687 t['\uFD65'] = '\u0635\u062D\u062D'; 20688 t['\uFD66'] = '\u0635\u0645\u0645'; 20689 t['\uFD67'] = '\u0634\u062D\u0645'; 20690 t['\uFD68'] = '\u0634\u062D\u0645'; 20691 t['\uFD69'] = '\u0634\u062C\u064A'; 20692 t['\uFD6A'] = '\u0634\u0645\u062E'; 20693 t['\uFD6B'] = '\u0634\u0645\u062E'; 20694 t['\uFD6C'] = '\u0634\u0645\u0645'; 20695 t['\uFD6D'] = '\u0634\u0645\u0645'; 20696 t['\uFD6E'] = '\u0636\u062D\u0649'; 20697 t['\uFD6F'] = '\u0636\u062E\u0645'; 20698 t['\uFD70'] = '\u0636\u062E\u0645'; 20699 t['\uFD71'] = '\u0637\u0645\u062D'; 20700 t['\uFD72'] = '\u0637\u0645\u062D'; 20701 t['\uFD73'] = '\u0637\u0645\u0645'; 20702 t['\uFD74'] = '\u0637\u0645\u064A'; 20703 t['\uFD75'] = '\u0639\u062C\u0645'; 20704 t['\uFD76'] = '\u0639\u0645\u0645'; 20705 t['\uFD77'] = '\u0639\u0645\u0645'; 20706 t['\uFD78'] = '\u0639\u0645\u0649'; 20707 t['\uFD79'] = '\u063A\u0645\u0645'; 20708 t['\uFD7A'] = '\u063A\u0645\u064A'; 20709 t['\uFD7B'] = '\u063A\u0645\u0649'; 20710 t['\uFD7C'] = '\u0641\u062E\u0645'; 20711 t['\uFD7D'] = '\u0641\u062E\u0645'; 20712 t['\uFD7E'] = '\u0642\u0645\u062D'; 20713 t['\uFD7F'] = '\u0642\u0645\u0645'; 20714 t['\uFD80'] = '\u0644\u062D\u0645'; 20715 t['\uFD81'] = '\u0644\u062D\u064A'; 20716 t['\uFD82'] = '\u0644\u062D\u0649'; 20717 t['\uFD83'] = '\u0644\u062C\u062C'; 20718 t['\uFD84'] = '\u0644\u062C\u062C'; 20719 t['\uFD85'] = '\u0644\u062E\u0645'; 20720 t['\uFD86'] = '\u0644\u062E\u0645'; 20721 t['\uFD87'] = '\u0644\u0645\u062D'; 20722 t['\uFD88'] = '\u0644\u0645\u062D'; 20723 t['\uFD89'] = '\u0645\u062D\u062C'; 20724 t['\uFD8A'] = '\u0645\u062D\u0645'; 20725 t['\uFD8B'] = '\u0645\u062D\u064A'; 20726 t['\uFD8C'] = '\u0645\u062C\u062D'; 20727 t['\uFD8D'] = '\u0645\u062C\u0645'; 20728 t['\uFD8E'] = '\u0645\u062E\u062C'; 20729 t['\uFD8F'] = '\u0645\u062E\u0645'; 20730 t['\uFD92'] = '\u0645\u062C\u062E'; 20731 t['\uFD93'] = '\u0647\u0645\u062C'; 20732 t['\uFD94'] = '\u0647\u0645\u0645'; 20733 t['\uFD95'] = '\u0646\u062D\u0645'; 20734 t['\uFD96'] = '\u0646\u062D\u0649'; 20735 t['\uFD97'] = '\u0646\u062C\u0645'; 20736 t['\uFD98'] = '\u0646\u062C\u0645'; 20737 t['\uFD99'] = '\u0646\u062C\u0649'; 20738 t['\uFD9A'] = '\u0646\u0645\u064A'; 20739 t['\uFD9B'] = '\u0646\u0645\u0649'; 20740 t['\uFD9C'] = '\u064A\u0645\u0645'; 20741 t['\uFD9D'] = '\u064A\u0645\u0645'; 20742 t['\uFD9E'] = '\u0628\u062E\u064A'; 20743 t['\uFD9F'] = '\u062A\u062C\u064A'; 20744 t['\uFDA0'] = '\u062A\u062C\u0649'; 20745 t['\uFDA1'] = '\u062A\u062E\u064A'; 20746 t['\uFDA2'] = '\u062A\u062E\u0649'; 20747 t['\uFDA3'] = '\u062A\u0645\u064A'; 20748 t['\uFDA4'] = '\u062A\u0645\u0649'; 20749 t['\uFDA5'] = '\u062C\u0645\u064A'; 20750 t['\uFDA6'] = '\u062C\u062D\u0649'; 20751 t['\uFDA7'] = '\u062C\u0645\u0649'; 20752 t['\uFDA8'] = '\u0633\u062E\u0649'; 20753 t['\uFDA9'] = '\u0635\u062D\u064A'; 20754 t['\uFDAA'] = '\u0634\u062D\u064A'; 20755 t['\uFDAB'] = '\u0636\u062D\u064A'; 20756 t['\uFDAC'] = '\u0644\u062C\u064A'; 20757 t['\uFDAD'] = '\u0644\u0645\u064A'; 20758 t['\uFDAE'] = '\u064A\u062D\u064A'; 20759 t['\uFDAF'] = '\u064A\u062C\u064A'; 20760 t['\uFDB0'] = '\u064A\u0645\u064A'; 20761 t['\uFDB1'] = '\u0645\u0645\u064A'; 20762 t['\uFDB2'] = '\u0642\u0645\u064A'; 20763 t['\uFDB3'] = '\u0646\u062D\u064A'; 20764 t['\uFDB4'] = '\u0642\u0645\u062D'; 20765 t['\uFDB5'] = '\u0644\u062D\u0645'; 20766 t['\uFDB6'] = '\u0639\u0645\u064A'; 20767 t['\uFDB7'] = '\u0643\u0645\u064A'; 20768 t['\uFDB8'] = '\u0646\u062C\u062D'; 20769 t['\uFDB9'] = '\u0645\u062E\u064A'; 20770 t['\uFDBA'] = '\u0644\u062C\u0645'; 20771 t['\uFDBB'] = '\u0643\u0645\u0645'; 20772 t['\uFDBC'] = '\u0644\u062C\u0645'; 20773 t['\uFDBD'] = '\u0646\u062C\u062D'; 20774 t['\uFDBE'] = '\u062C\u062D\u064A'; 20775 t['\uFDBF'] = '\u062D\u062C\u064A'; 20776 t['\uFDC0'] = '\u0645\u062C\u064A'; 20777 t['\uFDC1'] = '\u0641\u0645\u064A'; 20778 t['\uFDC2'] = '\u0628\u062D\u064A'; 20779 t['\uFDC3'] = '\u0643\u0645\u0645'; 20780 t['\uFDC4'] = '\u0639\u062C\u0645'; 20781 t['\uFDC5'] = '\u0635\u0645\u0645'; 20782 t['\uFDC6'] = '\u0633\u062E\u064A'; 20783 t['\uFDC7'] = '\u0646\u062C\u064A'; 20784 t['\uFE49'] = '\u203E'; 20785 t['\uFE4A'] = '\u203E';
20786 t['\uFE4B'] = '\u203E'; 20787 t['\uFE4C'] = '\u203E'; 20788 t['\uFE4D'] = '\u005F'; 20789 t['\uFE4E'] = '\u005F'; 20790 t['\uFE4F'] = '\u005F'; 20791 t['\uFE80'] = '\u0621'; 20792 t['\uFE81'] = '\u0622'; 20793 t['\uFE82'] = '\u0622'; 20794 t['\uFE83'] = '\u0623'; 20795 t['\uFE84'] = '\u0623'; 20796 t['\uFE85'] = '\u0624'; 20797 t['\uFE86'] = '\u0624'; 20798 t['\uFE87'] = '\u0625'; 20799 t['\uFE88'] = '\u0625'; 20800 t['\uFE89'] = '\u0626'; 20801 t['\uFE8A'] = '\u0626'; 20802 t['\uFE8B'] = '\u0626'; 20803 t['\uFE8C'] = '\u0626'; 20804 t['\uFE8D'] = '\u0627'; 20805 t['\uFE8E'] = '\u0627'; 20806 t['\uFE8F'] = '\u0628'; 20807 t['\uFE90'] = '\u0628'; 20808 t['\uFE91'] = '\u0628'; 20809 t['\uFE92'] = '\u0628'; 20810 t['\uFE93'] = '\u0629'; 20811 t['\uFE94'] = '\u0629'; 20812 t['\uFE95'] = '\u062A'; 20813 t['\uFE96'] = '\u062A'; 20814 t['\uFE97'] = '\u062A'; 20815 t['\uFE98'] = '\u062A'; 20816 t['\uFE99'] = '\u062B'; 20817 t['\uFE9A'] = '\u062B'; 20818 t['\uFE9B'] = '\u062B'; 20819 t['\uFE9C'] = '\u062B'; 20820 t['\uFE9D'] = '\u062C'; 20821 t['\uFE9E'] = '\u062C'; 20822 t['\uFE9F'] = '\u062C'; 20823 t['\uFEA0'] = '\u062C'; 20824 t['\uFEA1'] = '\u062D'; 20825 t['\uFEA2'] = '\u062D'; 20826 t['\uFEA3'] = '\u062D'; 20827 t['\uFEA4'] = '\u062D'; 20828 t['\uFEA5'] = '\u062E'; 20829 t['\uFEA6'] = '\u062E'; 20830 t['\uFEA7'] = '\u062E'; 20831 t['\uFEA8'] = '\u062E'; 20832 t['\uFEA9'] = '\u062F'; 20833 t['\uFEAA'] = '\u062F'; 20834 t['\uFEAB'] = '\u0630'; 20835 t['\uFEAC'] = '\u0630'; 20836 t['\uFEAD'] = '\u0631'; 20837 t['\uFEAE'] = '\u0631'; 20838 t['\uFEAF'] = '\u0632'; 20839 t['\uFEB0'] = '\u0632'; 20840 t['\uFEB1'] = '\u0633'; 20841 t['\uFEB2'] = '\u0633'; 20842 t['\uFEB3'] = '\u0633'; 20843 t['\uFEB4'] = '\u0633'; 20844 t['\uFEB5'] = '\u0634'; 20845 t['\uFEB6'] = '\u0634'; 20846 t['\uFEB7'] = '\u0634'; 20847 t['\uFEB8'] = '\u0634'; 20848 t['\uFEB9'] = '\u0635'; 20849 t['\uFEBA'] = '\u0635'; 20850 t['\uFEBB'] = '\u0635'; 20851 t['\uFEBC'] = '\u0635'; 20852 t['\uFEBD'] = '\u0636'; 20853 t['\uFEBE'] = '\u0636'; 20854 t['\uFEBF'] = '\u0636'; 20855 t['\uFEC0'] = '\u0636'; 20856 t['\uFEC1'] = '\u0637'; 20857 t['\uFEC2'] = '\u0637'; 20858 t['\uFEC3'] = '\u0637'; 20859 t['\uFEC4'] = '\u0637'; 20860 t['\uFEC5'] = '\u0638'; 20861 t['\uFEC6'] = '\u0638'; 20862 t['\uFEC7'] = '\u0638'; 20863 t['\uFEC8'] = '\u0638'; 20864 t['\uFEC9'] = '\u0639'; 20865 t['\uFECA'] = '\u0639'; 20866 t['\uFECB'] = '\u0639'; 20867 t['\uFECC'] = '\u0639'; 20868 t['\uFECD'] = '\u063A'; 20869 t['\uFECE'] = '\u063A'; 20870 t['\uFECF'] = '\u063A'; 20871 t['\uFED0'] = '\u063A'; 20872 t['\uFED1'] = '\u0641'; 20873 t['\uFED2'] = '\u0641'; 20874 t['\uFED3'] = '\u0641'; 20875 t['\uFED4'] = '\u0641'; 20876 t['\uFED5'] = '\u0642'; 20877 t['\uFED6'] = '\u0642'; 20878 t['\uFED7'] = '\u0642'; 20879 t['\uFED8'] = '\u0642'; 20880 t['\uFED9'] = '\u0643'; 20881 t['\uFEDA'] = '\u0643'; 20882 t['\uFEDB'] = '\u0643'; 20883 t['\uFEDC'] = '\u0643'; 20884 t['\uFEDD'] = '\u0644'; 20885 t['\uFEDE'] = '\u0644'; 20886 t['\uFEDF'] = '\u0644'; 20887 t['\uFEE0'] = '\u0644'; 20888 t['\uFEE1'] = '\u0645'; 20889 t['\uFEE2'] = '\u0645'; 20890 t['\uFEE3'] = '\u0645'; 20891 t['\uFEE4'] = '\u0645'; 20892 t['\uFEE5'] = '\u0646'; 20893 t['\uFEE6'] = '\u0646'; 20894 t['\uFEE7'] = '\u0646'; 20895 t['\uFEE8'] = '\u0646'; 20896 t['\uFEE9'] = '\u0647'; 20897 t['\uFEEA'] = '\u0647'; 20898 t['\uFEEB'] = '\u0647'; 20899 t['\uFEEC'] = '\u0647'; 20900 t['\uFEED'] = '\u0648'; 20901 t['\uFEEE'] = '\u0648'; 20902 t['\uFEEF'] = '\u0649'; 20903 t['\uFEF0'] = '\u0649'; 20904 t['\uFEF1'] = '\u064A'; 20905 t['\uFEF2'] = '\u064A'; 20906 t['\uFEF3'] = '\u064A'; 20907 t['\uFEF4'] = '\u064A'; 20908 t['\uFEF5'] = '\u0644\u0622'; 20909 t['\uFEF6'] = '\u0644\u0622'; 20910 t['\uFEF7'] = '\u0644\u0623'; 20911 t['\uFEF8'] = '\u0644\u0623'; 20912 t['\uFEF9'] = '\u0644\u0625'; 20913 t['\uFEFA'] = '\u0644\u0625'; 20914 t['\uFEFB'] = '\u0644\u0627'; 20915 t['\uFEFC'] = '\u0644\u0627'; 20916}); 20917function reverseIfRtl(chars) { 20918 var charsLength = chars.length; 20919 if (charsLength <= 1 || !isRTLRangeFor(chars.charCodeAt(0))) { 20920 return chars; 20921 } 20922 var s = ''; 20923 for (var ii = charsLength - 1; ii >= 0; ii--) { 20924 s += chars[ii]; 20925 } 20926 return s; 20927} 20928exports.mapSpecialUnicodeValues = mapSpecialUnicodeValues; 20929exports.reverseIfRtl = reverseIfRtl; 20930exports.getUnicodeRangeFor = getUnicodeRangeFor; 20931exports.getNormalizedUnicodes = getNormalizedUnicodes; 20932exports.getUnicodeForGlyph = getUnicodeForGlyph; 20933 20934/***/ }), 20935/* 71 */ 20936/***/ (function(module, exports, __w_pdfjs_require__) { 20937 20938"use strict"; 20939 20940 20941Object.defineProperty(exports, "__esModule", { 20942 value: true 20943}); 20944exports.PostScriptCompiler = exports.PostScriptEvaluator = exports.PDFFunctionFactory = exp
20944orts.isPDFFunction = undefined; 20945 20946var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 20947 20948var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 20949 20950var _util = __w_pdfjs_require__(0); 20951 20952var _primitives = __w_pdfjs_require__(1); 20953 20954var _ps_parser = __w_pdfjs_require__(144); 20955 20956function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 20957 20958var IsEvalSupportedCached = { 20959 get value() { 20960 return (0, _util.shadow)(this, 'value', (0, _util.isEvalSupported)()); 20961 } 20962}; 20963 20964var PDFFunctionFactory = function () { 20965 function PDFFunctionFactory(_ref) { 20966 var xref = _ref.xref, 20967 _ref$isEvalSupported = _ref.isEvalSupported, 20968 isEvalSupported = _ref$isEvalSupported === undefined ? true : _ref$isEvalSupported; 20969 20970 _classCallCheck(this, PDFFunctionFactory); 20971 20972 this.xref = xref; 20973 this.isEvalSupported = isEvalSupported !== false; 20974 } 20975 20976 _createClass(PDFFunctionFactory, [{ 20977 key: 'create', 20978 value: function create(fn) { 20979 return PDFFunction.parse({ 20980 xref: this.xref, 20981 isEvalSupported: this.isEvalSupported, 20982 fn: fn 20983 }); 20984 } 20985 }, { 20986 key: 'createFromArray', 20987 value: function createFromArray(fnObj) { 20988 return PDFFunction.parseArray({ 20989 xref: this.xref, 20990 isEvalSupported: this.isEvalSupported, 20991 fnObj: fnObj 20992 }); 20993 } 20994 }, { 20995 key: 'createFromIR', 20996 value: function createFromIR(IR) { 20997 return PDFFunction.fromIR({ 20998 xref: this.xref, 20999 isEvalSupported: this.isEvalSupported, 21000 IR: IR 21001 }); 21002 } 21003 }, { 21004 key: 'createIR', 21005 value: function createIR(fn) { 21006 return PDFFunction.getIR({ 21007 xref: this.xref, 21008 isEvalSupported: this.isEvalSupported, 21009 fn: fn 21010 }); 21011 } 21012 }]); 21013 21014 return PDFFunctionFactory; 21015}(); 21016 21017var PDFFunction = function PDFFunctionClosure() { 21018 var CONSTRUCT_SAMPLED = 0; 21019 var CONSTRUCT_INTERPOLATED = 2; 21020 var CONSTRUCT_STICHED = 3; 21021 var CONSTRUCT_POSTSCRIPT = 4; 21022 return { 21023 getSampleArray: function getSampleArray(size, outputSize, bps, stream) { 21024 var i, ii; 21025 var length = 1; 21026 for (i = 0, ii = size.length; i < ii; i++) { 21027 length *= size[i]; 21028 } 21029 length *= outputSize; 21030 var array = new Array(length); 21031 var codeSize = 0; 21032 var codeBuf = 0; 21033 var sampleMul = 1.0 / (Math.pow(2.0, bps) - 1); 21034 var strBytes = stream.getBytes((length * bps + 7) / 8); 21035 var strIdx = 0; 21036 for (i = 0; i < length; i++) { 21037 while (codeSize < bps) { 21038 codeBuf <<= 8; 21039 codeBuf |= strBytes[strIdx++]; 21040 codeSize += 8; 21041 } 21042 codeSize -= bps; 21043 array[i] = (codeBuf >> codeSize) * sampleMul; 21044 codeBuf &= (1 << codeSize) - 1; 21045 } 21046 return array; 21047 }, 21048 getIR: function getIR(_ref2) { 21049 var xref = _ref2.xref, 21050 isEvalSupported = _ref2.isEvalSupported, 21051 fn = _ref2.fn; 21052 21053 var dict = fn.dict; 21054 if (!dict) { 21055 dict = fn; 21056 } 21057 var types = [this.constructSampled, null, this.constructInterpolated, this.constructStiched, this.constructPostScript]; 21058 var typeNum = dict.get('FunctionType'); 21059 var typeFn = types[typeNum]; 21060 if (!typeFn) { 21061 throw new _util.FormatError('Unknown type of function'); 21062 } 21063 return typeFn.call(this, { 21064 xref: xref, 21065 isEvalSupported: isEvalSupported, 21066 fn: fn, 21067 dict: dict 21068 }); 21069 }, 21070 fromIR: function fromIR(_ref3) { 21071 var xref = _ref3.xref, 21072 isEvalSupported = _ref3.isEvalSupported, 21073 IR = _ref3.IR; 21074 21075 var type = IR[0]; 21076 switch (type) { 21077 case CONSTRUCT_SAMPLED: 21078 return this.constructSampledFromIR({ 21079 xref: xref, 21080 isEvalSupported: isEvalSupported, 21081 IR: IR 21082 }); 21083 case CONSTRUCT_INTERPOLATED: 21084 return this.constructInterpolatedFromIR({ 21085 xref: xref, 21086 isEvalSupported: isEvalSupported, 21087 IR: IR 21088 }); 21089 case CONSTRUCT_STICHED: 21090 return this.constructStichedFromIR({ 21091 xref: xref, 21092 isEvalSupported: isEvalSupported, 21093 IR: IR 21094 }); 21095 default: 21096 return this.constructPostScriptFromIR({ 21097 xref: xref, 21098 isEvalSupported: isEvalSupported, 21099 IR: IR 21100 }); 21101 } 21102 }, 21103 parse: function parse(_ref4) { 21104 var xref = _ref4.xref, 21105 isEvalSupported = _ref4.isEvalSupported, 21106 fn = _ref4.fn; 21107 21108 var IR = this.getIR({ 21109 xref: xref, 21110 isEvalSupported: isEvalSupported, 21111 fn: fn 21112 }); 21113 return this.fromIR({ 21114 xref: xref, 21115 isEvalSupported: isEvalSupported, 21116 IR: IR 21117 }); 21118 }, 21119 parseArray: function parseArray(_ref5) { 21120 var xref = _ref5.xref, 21121 isEvalSupported = _ref5.isEvalSupported, 21122 fnObj = _ref5.fnObj; 21123 21124 if (!Array.isArray(fnObj)) { 21125 return this.parse({ 21126 xref: xref, 21127 isEvalSupported: isEvalSupported, 21128 fn: fnObj 21129 }); 21130 } 21131 var fnArray = []; 21132 for (var j = 0, jj = fnObj.length; j < jj; j++) { 21133 fnArray.push(this.parse({ 21134 xref: xref, 21135 isEvalSupported: isEvalSupported, 21136 fn: xref.fetchIfRef(fnObj[j]) 21137 })); 21138 }
vendor: 5,112 bytes, lines 21139-21282
21139 return function (src, srcOffset, dest, destOffset) { 21140 for (var i = 0, ii = fnArray.length; i < ii; i++) { 21141 fnArray[i](src, srcOffset, dest, destOffset + i); 21142 } 21143 }; 21144 }, 21145 constructSampled: function constructSampled(_ref6) { 21146 var xref = _ref6.xref, 21147 isEvalSupported = _ref6.isEvalSupported, 21148 fn = _ref6.fn, 21149 dict = _ref6.dict; 21150 21151 function toMultiArray(arr) { 21152 var inputLength = arr.length; 21153 var out = []; 21154 var index = 0; 21155 for (var i = 0; i < inputLength; i += 2) { 21156 out[index] = [arr[i], arr[i + 1]]; 21157 ++index; 21158 } 21159 return out; 21160 } 21161 var domain = dict.getArray('Domain'); 21162 var range = dict.getArray('Range'); 21163 if (!domain || !range) { 21164 throw new _util.FormatError('No domain or range'); 21165 } 21166 var inputSize = domain.length / 2; 21167 var outputSize = range.length / 2; 21168 domain = toMultiArray(domain); 21169 range = toMultiArray(range); 21170 var size = dict.get('Size'); 21171 var bps = dict.get('BitsPerSample'); 21172 var order = dict.get('Order') || 1; 21173 if (order !== 1) { 21174 (0, _util.info)('No support for cubic spline interpolation: ' + order); 21175 } 21176 var encode = dict.getArray('Encode'); 21177 if (!encode) { 21178 encode = []; 21179 for (var i = 0; i < inputSize; ++i) { 21180 encode.push(0); 21181 encode.push(size[i] - 1); 21182 } 21183 } 21184 encode = toMultiArray(encode); 21185 var decode = dict.getArray('Decode'); 21186 if (!decode) { 21187 decode = range; 21188 } else { 21189 decode = toMultiArray(decode); 21190 } 21191 var samples = this.getSampleArray(size, outputSize, bps, fn); 21192 return [CONSTRUCT_SAMPLED, inputSize, domain, encode, decode, samples, size, outputSize, Math.pow(2, bps) - 1, range]; 21193 }, 21194 constructSampledFromIR: function constructSampledFromIR(_ref7) { 21195 var xref = _ref7.xref, 21196 isEvalSupported = _ref7.isEvalSupported, 21197 IR = _ref7.IR; 21198 21199 function interpolate(x, xmin, xmax, ymin, ymax) { 21200 return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); 21201 } 21202 return function constructSampledFromIRResult(src, srcOffset, dest, destOffset) { 21203 var m = IR[1]; 21204 var domain = IR[2]; 21205 var encode = IR[3]; 21206 var decode = IR[4]; 21207 var samples = IR[5]; 21208 var size = IR[6]; 21209 var n = IR[7]; 21210 var range = IR[9]; 21211 var cubeVertices = 1 << m; 21212 var cubeN = new Float64Array(cubeVertices); 21213 var cubeVertex = new Uint32Array(cubeVertices); 21214 var i, j; 21215 for (j = 0; j < cubeVertices; j++) { 21216 cubeN[j] = 1; 21217 } 21218 var k = n, 21219 pos = 1; 21220 for (i = 0; i < m; ++i) { 21221 var domain_2i = domain[i][0]; 21222 var domain_2i_1 = domain[i][1]; 21223 var xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1); 21224 var e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]); 21225 var size_i = size[i]; 21226 e = Math.min(Math.max(e, 0), size_i - 1); 21227 var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; 21228 var n0 = e0 + 1 - e; 21229 var n1 = e - e0; 21230 var offset0 = e0 * k; 21231 var offset1 = offset0 + k; 21232 for (j = 0; j < cubeVertices; j++) { 21233 if (j & pos) { 21234 cubeN[j] *= n1; 21235 cubeVertex[j] += offset1; 21236 } else { 21237 cubeN[j] *= n0; 21238 cubeVertex[j] += offset0; 21239 } 21240 } 21241 k *= size_i; 21242 pos <<= 1; 21243 } 21244 for (j = 0; j < n; ++j) { 21245 var rj = 0; 21246 for (i = 0; i < cubeVertices; i++) { 21247 rj += samples[cubeVertex[i] + j] * cubeN[i]; 21248 } 21249 rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); 21250 dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]); 21251 } 21252 }; 21253 }, 21254 constructInterpolated: function constructInterpolated(_ref8) { 21255 var xref = _ref8.xref, 21256 isEvalSupported = _ref8.isEvalSupported, 21257 fn = _ref8.fn, 21258 dict = _ref8.dict; 21259 21260 var c0 = dict.getArray('C0') || [0]; 21261 var c1 = dict.getArray('C1') || [1]; 21262 var n = dict.get('N'); 21263 if (!Array.isArray(c0) || !Array.isArray(c1)) { 21264 throw new _util.FormatError('Illegal dictionary for interpolated function'); 21265 } 21266 var length = c0.length; 21267 var diff = []; 21268 for (var i = 0; i < length; ++i) { 21269 diff.push(c1[i] - c0[i]); 21270 } 21271 return [CONSTRUCT_INTERPOLATED, c0, diff, n]; 21272 }, 21273 constructInterpolatedFromIR: function constructInterpolatedFromIR(_ref9) { 21274 var xref = _ref9.xref, 21275 isEvalSupported = _ref9.isEvalSupported, 21276 IR = _ref9.IR; 21277 21278 var c0 = IR[1]; 21279 var diff = IR[2]; 21280 var n = IR[3]; 21281 var length = diff.length; 21282 return function constructInterpolatedFromIRResult(src, srcOffset, dest, destOff
21282set) { 21283 var x = n === 1 ? src[srcOffset] : Math.pow(src[srcOffset], n); 21284 for (var j = 0; j < length; ++j) { 21285 dest[destOffset + j] = c0[j] + x * diff[j]; 21286 } 21287 }; 21288 }, 21289 constructStiched: function constructStiched(_ref10) { 21290 var xref = _ref10.xref, 21291 isEvalSupported = _ref10.isEvalSupported, 21292 fn = _ref10.fn, 21293 dict = _ref10.dict; 21294 21295 var domain = dict.getArray('Domain'); 21296 if (!domain) { 21297 throw new _util.FormatError('No domain'); 21298 } 21299 var inputSize = domain.length / 2; 21300 if (inputSize !== 1) { 21301 throw new _util.FormatError('Bad domain for stiched function'); 21302 } 21303 var fnRefs = dict.get('Functions'); 21304 var fns = []; 21305 for (var i = 0, ii = fnRefs.length; i < ii; ++i) { 21306 fns.push(this.getIR({ 21307 xref: xref, 21308 isEvalSupported: isEvalSupported, 21309 fn: xref.fetchIfRef(fnRefs[i]) 21310 })); 21311 } 21312 var bounds = dict.getArray('Bounds'); 21313 var encode = dict.getArray('Encode'); 21314 return [CONSTRUCT_STICHED, domain, bounds, encode, fns]; 21315 }, 21316 constructStichedFromIR: function constructStichedFromIR(_ref11) { 21317 var xref = _ref11.xref, 21318 isEvalSupported = _ref11.isEvalSupported, 21319 IR = _ref11.IR; 21320 21321 var domain = IR[1]; 21322 var bounds = IR[2]; 21323 var encode = IR[3]; 21324 var fnsIR = IR[4]; 21325 var fns = []; 21326 var tmpBuf = new Float32Array(1); 21327 for (var i = 0, ii = fnsIR.length; i < ii; i++) { 21328 fns.push(this.fromIR({ 21329 xref: xref, 21330 isEvalSupported: isEvalSupported, 21331 IR: fnsIR[i] 21332 })); 21333 } 21334 return function constructStichedFromIRResult(src, srcOffset, dest, destOffset) { 21335 var clip = function constructStichedFromIRClip(v, min, max) { 21336 if (v > max) { 21337 v = max; 21338 } else if (v < min) { 21339 v = min; 21340 } 21341 return v; 21342 }; 21343 var v = clip(src[srcOffset], domain[0], domain[1]); 21344 for (var i = 0, ii = bounds.length; i < ii; ++i) { 21345 if (v < bounds[i]) { 21346 break; 21347 } 21348 } 21349 var dmin = domain[0]; 21350 if (i > 0) { 21351 dmin = bounds[i - 1]; 21352 } 21353 var dmax = domain[1]; 21354 if (i < bounds.length) { 21355 dmax = bounds[i]; 21356 } 21357 var rmin = encode[2 * i]; 21358 var rmax = encode[2 * i + 1]; 21359 tmpBuf[0] = dmin === dmax ? rmin : rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); 21360 fns[i](tmpBuf, 0, dest, destOffset); 21361 }; 21362 }, 21363 constructPostScript: function constructPostScript(_ref12) { 21364 var xref = _ref12.xref, 21365 isEvalSupported = _ref12.isEvalSupported, 21366 fn = _ref12.fn, 21367 dict = _ref12.dict; 21368 21369 var domain = dict.getArray('Domain'); 21370 var range = dict.getArray('Range'); 21371 if (!domain) { 21372 throw new _util.FormatError('No domain.'); 21373 } 21374 if (!range) { 21375 throw new _util.FormatError('No range.'); 21376 } 21377 var lexer = new _ps_parser.PostScriptLexer(fn); 21378 var parser = new _ps_parser.PostScriptParser(lexer); 21379 var code = parser.parse(); 21380 return [CONSTRUCT_POSTSCRIPT, domain, range, code]; 21381 }, 21382 constructPostScriptFromIR: function constructPostScriptFromIR(_ref13) { 21383 var xref = _ref13.xref, 21384 isEvalSupported = _ref13.isEvalSupported, 21385 IR = _ref13.IR; 21386 21387 var domain = IR[1]; 21388 var range = IR[2]; 21389 var code = IR[3]; 21390 if (isEvalSupported && IsEvalSupportedCached.value) { 21391 var compiled = new PostScriptCompiler().compile(code, domain, range); 21392 if (compiled) { 21393 return new Function('src', 'srcOffset', 'dest', 'destOffset', compiled); 21394 } 21395 } 21396 (0, _util.info)('Unable to compile PS function'); 21397 var numOutputs = range.length >> 1; 21398 var numInputs = domain.length >> 1; 21399 var evaluator = new PostScriptEvaluator(code); 21400 var cache = Object.create(null); 21401 var MAX_CACHE_SIZE = 2048 * 4; 21402 var cache_available = MAX_CACHE_SIZE; 21403 var tmpBuf = new Float32Array(numInputs); 21404 return function constructPostScriptFromIRResult(src, srcOffset, dest, destOff
vendor: 4,185 bytes, lines 21404-21543
21404set) { 21405 var i, value; 21406 var key = ''; 21407 var input = tmpBuf; 21408 for (i = 0; i < numInputs; i++) { 21409 value = src[srcOffset + i]; 21410 input[i] = value; 21411 key += value + '_'; 21412 } 21413 var cachedValue = cache[key]; 21414 if (cachedValue !== undefined) { 21415 dest.set(cachedValue, destOffset); 21416 return; 21417 } 21418 var output = new Float32Array(numOutputs); 21419 var stack = evaluator.execute(input); 21420 var stackIndex = stack.length - numOutputs; 21421 for (i = 0; i < numOutputs; i++) { 21422 value = stack[stackIndex + i]; 21423 var bound = range[i * 2]; 21424 if (value < bound) { 21425 value = bound; 21426 } else { 21427 bound = range[i * 2 + 1]; 21428 if (value > bound) { 21429 value = bound; 21430 } 21431 } 21432 output[i] = value; 21433 } 21434 if (cache_available > 0) { 21435 cache_available--; 21436 cache[key] = output; 21437 } 21438 dest.set(output, destOffset); 21439 }; 21440 } 21441 }; 21442}(); 21443function isPDFFunction(v) { 21444 var fnDict; 21445 if ((typeof v === 'undefined' ? 'undefined' : _typeof(v)) !== 'object') { 21446 return false; 21447 } else if ((0, _primitives.isDict)(v)) { 21448 fnDict = v; 21449 } else if ((0, _primitives.isStream)(v)) { 21450 fnDict = v.dict; 21451 } else { 21452 return false; 21453 } 21454 return fnDict.has('FunctionType'); 21455} 21456var PostScriptStack = function PostScriptStackClosure() { 21457 var MAX_STACK_SIZE = 100; 21458 function PostScriptStack(initialStack) { 21459 this.stack = !initialStack ? [] : Array.prototype.slice.call(initialStack, 0); 21460 } 21461 PostScriptStack.prototype = { 21462 push: function PostScriptStack_push(value) { 21463 if (this.stack.length >= MAX_STACK_SIZE) { 21464 throw new Error('PostScript function stack overflow.'); 21465 } 21466 this.stack.push(value); 21467 }, 21468 pop: function PostScriptStack_pop() { 21469 if (this.stack.length <= 0) { 21470 throw new Error('PostScript function stack underflow.'); 21471 } 21472 return this.stack.pop(); 21473 }, 21474 copy: function PostScriptStack_copy(n) { 21475 if (this.stack.length + n >= MAX_STACK_SIZE) { 21476 throw new Error('PostScript function stack overflow.'); 21477 } 21478 var stack = this.stack; 21479 for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { 21480 stack.push(stack[i]); 21481 } 21482 }, 21483 index: function PostScriptStack_index(n) { 21484 this.push(this.stack[this.stack.length - n - 1]); 21485 }, 21486 roll: function PostScriptStack_roll(n, p) { 21487 var stack = this.stack; 21488 var l = stack.length - n; 21489 var r = stack.length - 1, 21490 c = l + (p - Math.floor(p / n) * n), 21491 i, 21492 j, 21493 t; 21494 for (i = l, j = r; i < j; i++, j--) { 21495 t = stack[i]; 21496 stack[i] = stack[j]; 21497 stack[j] = t; 21498 } 21499 for (i = l, j = c - 1; i < j; i++, j--) { 21500 t = stack[i]; 21501 stack[i] = stack[j]; 21502 stack[j] = t; 21503 } 21504 for (i = c, j = r; i < j; i++, j--) { 21505 t = stack[i]; 21506 stack[i] = stack[j]; 21507 stack[j] = t; 21508 } 21509 } 21510 }; 21511 return PostScriptStack; 21512}(); 21513var PostScriptEvaluator = function PostScriptEvaluatorClosure() { 21514 function PostScriptEvaluator(operators) { 21515 this.operators = operators; 21516 } 21517 PostScriptEvaluator.prototype = { 21518 execute: function PostScriptEvaluator_execute(initialStack) { 21519 var stack = new PostScriptStack(initialStack); 21520 var counter = 0; 21521 var operators = this.operators; 21522 var length = operators.length; 21523 var operator, a, b; 21524 while (counter < length) { 21525 operator = operators[counter++]; 21526 if (typeof operator === 'number') { 21527 stack.push(operator); 21528 continue; 21529 } 21530 switch (operator) { 21531 case 'jz': 21532 b = stack.pop(); 21533 a = stack.pop(); 21534 if (!a) { 21535 counter = b; 21536 } 21537 break; 21538 case 'j': 21539 a = stack.pop(); 21540 counter = a; 21541 break; 21542 case 'abs': 21543 a = stack.pop();
vendor: 5,440 bytes, lines 21544-21742
21544 stack.push(Math.abs(a)); 21545 break; 21546 case 'add': 21547 b = stack.pop(); 21548 a = stack.pop(); 21549 stack.push(a + b); 21550 break; 21551 case 'and': 21552 b = stack.pop(); 21553 a = stack.pop(); 21554 if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { 21555 stack.push(a && b); 21556 } else { 21557 stack.push(a & b); 21558 } 21559 break; 21560 case 'atan': 21561 a = stack.pop(); 21562 stack.push(Math.atan(a)); 21563 break; 21564 case 'bitshift': 21565 b = stack.pop(); 21566 a = stack.pop(); 21567 if (a > 0) { 21568 stack.push(a << b); 21569 } else { 21570 stack.push(a >> b); 21571 } 21572 break; 21573 case 'ceiling': 21574 a = stack.pop(); 21575 stack.push(Math.ceil(a)); 21576 break; 21577 case 'copy': 21578 a = stack.pop(); 21579 stack.copy(a); 21580 break; 21581 case 'cos': 21582 a = stack.pop(); 21583 stack.push(Math.cos(a)); 21584 break; 21585 case 'cvi': 21586 a = stack.pop() | 0; 21587 stack.push(a); 21588 break; 21589 case 'cvr': 21590 break; 21591 case 'div': 21592 b = stack.pop(); 21593 a = stack.pop(); 21594 stack.push(a / b); 21595 break; 21596 case 'dup': 21597 stack.copy(1); 21598 break; 21599 case 'eq': 21600 b = stack.pop(); 21601 a = stack.pop(); 21602 stack.push(a === b); 21603 break; 21604 case 'exch': 21605 stack.roll(2, 1); 21606 break; 21607 case 'exp': 21608 b = stack.pop(); 21609 a = stack.pop(); 21610 stack.push(Math.pow(a, b)); 21611 break; 21612 case 'false': 21613 stack.push(false); 21614 break; 21615 case 'floor': 21616 a = stack.pop(); 21617 stack.push(Math.floor(a)); 21618 break; 21619 case 'ge': 21620 b = stack.pop(); 21621 a = stack.pop(); 21622 stack.push(a >= b); 21623 break; 21624 case 'gt': 21625 b = stack.pop(); 21626 a = stack.pop(); 21627 stack.push(a > b); 21628 break; 21629 case 'idiv': 21630 b = stack.pop(); 21631 a = stack.pop(); 21632 stack.push(a / b | 0); 21633 break; 21634 case 'index': 21635 a = stack.pop(); 21636 stack.index(a); 21637 break; 21638 case 'le': 21639 b = stack.pop(); 21640 a = stack.pop(); 21641 stack.push(a <= b); 21642 break; 21643 case 'ln': 21644 a = stack.pop(); 21645 stack.push(Math.log(a)); 21646 break; 21647 case 'log': 21648 a = stack.pop(); 21649 stack.push(Math.log(a) / Math.LN10); 21650 break; 21651 case 'lt': 21652 b = stack.pop(); 21653 a = stack.pop(); 21654 stack.push(a < b); 21655 break; 21656 case 'mod': 21657 b = stack.pop(); 21658 a = stack.pop(); 21659 stack.push(a % b); 21660 break; 21661 case 'mul': 21662 b = stack.pop(); 21663 a = stack.pop(); 21664 stack.push(a * b); 21665 break; 21666 case 'ne': 21667 b = stack.pop(); 21668 a = stack.pop(); 21669 stack.push(a !== b); 21670 break; 21671 case 'neg': 21672 a = stack.pop(); 21673 stack.push(-a); 21674 break; 21675 case 'not': 21676 a = stack.pop(); 21677 if ((0, _util.isBool)(a)) { 21678 stack.push(!a); 21679 } else { 21680 stack.push(~a); 21681 } 21682 break; 21683 case 'or': 21684 b = stack.pop(); 21685 a = stack.pop(); 21686 if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { 21687 stack.push(a || b); 21688 } else { 21689 stack.push(a | b); 21690 } 21691 break; 21692 case 'pop': 21693 stack.pop(); 21694 break; 21695 case 'roll': 21696 b = stack.pop(); 21697 a = stack.pop(); 21698 stack.roll(a, b); 21699 break; 21700 case 'round': 21701 a = stack.pop(); 21702 stack.push(Math.round(a)); 21703 break; 21704 case 'sin': 21705 a = stack.pop(); 21706 stack.push(Math.sin(a)); 21707 break; 21708 case 'sqrt': 21709 a = stack.pop(); 21710 stack.push(Math.sqrt(a)); 21711 break; 21712 case 'sub': 21713 b = stack.pop(); 21714 a = stack.pop(); 21715 stack.push(a - b); 21716 break; 21717 case 'true': 21718 stack.push(true); 21719 break; 21720 case 'truncate': 21721 a = stack.pop(); 21722 a = a < 0 ? Math.ceil(a) : Math.floor(a); 21723 stack.push(a); 21724 break; 21725 case 'xor': 21726 b = stack.pop(); 21727 a = stack.pop(); 21728 if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { 21729 stack.push(a !== b); 21730 } else { 21731 stack.push(a ^ b); 21732 } 21733 break; 21734 default: 21735 throw new _util.FormatError('Unknown operator ' + operator); 21736 } 21737 } 21738 return stack.stack; 21739 } 21740 }; 21741 return PostScriptEvaluator; 21742}();
vendor: 10,685 bytes, lines 21743-22056
21743var PostScriptCompiler = function PostScriptCompilerClosure() { 21744 function AstNode(type) { 21745 this.type = type; 21746 } 21747 AstNode.prototype.visit = function (visitor) { 21748 (0, _util.unreachable)('abstract method'); 21749 }; 21750 function AstArgument(index, min, max) { 21751 AstNode.call(this, 'args'); 21752 this.index = index; 21753 this.min = min; 21754 this.max = max; 21755 } 21756 AstArgument.prototype = Object.create(AstNode.prototype); 21757 AstArgument.prototype.visit = function (visitor) { 21758 visitor.visitArgument(this); 21759 }; 21760 function AstLiteral(number) { 21761 AstNode.call(this, 'literal'); 21762 this.number = number; 21763 this.min = number; 21764 this.max = number; 21765 } 21766 AstLiteral.prototype = Object.create(AstNode.prototype); 21767 AstLiteral.prototype.visit = function (visitor) { 21768 visitor.visitLiteral(this); 21769 }; 21770 function AstBinaryOperation(op, arg1, arg2, min, max) { 21771 AstNode.call(this, 'binary'); 21772 this.op = op; 21773 this.arg1 = arg1; 21774 this.arg2 = arg2; 21775 this.min = min; 21776 this.max = max; 21777 } 21778 AstBinaryOperation.prototype = Object.create(AstNode.prototype); 21779 AstBinaryOperation.prototype.visit = function (visitor) { 21780 visitor.visitBinaryOperation(this); 21781 }; 21782 function AstMin(arg, max) { 21783 AstNode.call(this, 'max'); 21784 this.arg = arg; 21785 this.min = arg.min; 21786 this.max = max; 21787 } 21788 AstMin.prototype = Object.create(AstNode.prototype); 21789 AstMin.prototype.visit = function (visitor) { 21790 visitor.visitMin(this); 21791 }; 21792 function AstVariable(index, min, max) { 21793 AstNode.call(this, 'var'); 21794 this.index = index; 21795 this.min = min; 21796 this.max = max; 21797 } 21798 AstVariable.prototype = Object.create(AstNode.prototype); 21799 AstVariable.prototype.visit = function (visitor) { 21800 visitor.visitVariable(this); 21801 }; 21802 function AstVariableDefinition(variable, arg) { 21803 AstNode.call(this, 'definition'); 21804 this.variable = variable; 21805 this.arg = arg; 21806 } 21807 AstVariableDefinition.prototype = Object.create(AstNode.prototype); 21808 AstVariableDefinition.prototype.visit = function (visitor) { 21809 visitor.visitVariableDefinition(this); 21810 }; 21811 function ExpressionBuilderVisitor() { 21812 this.parts = []; 21813 } 21814 ExpressionBuilderVisitor.prototype = { 21815 visitArgument: function visitArgument(arg) { 21816 this.parts.push('Math.max(', arg.min, ', Math.min(', arg.max, ', src[srcOffset + ', arg.index, ']))'); 21817 }, 21818 visitVariable: function visitVariable(variable) { 21819 this.parts.push('v', variable.index); 21820 }, 21821 visitLiteral: function visitLiteral(literal) { 21822 this.parts.push(literal.number); 21823 }, 21824 visitBinaryOperation: function visitBinaryOperation(operation) { 21825 this.parts.push('('); 21826 operation.arg1.visit(this); 21827 this.parts.push(' ', operation.op, ' '); 21828 operation.arg2.visit(this); 21829 this.parts.push(')'); 21830 }, 21831 visitVariableDefinition: function visitVariableDefinition(definition) { 21832 this.parts.push('var '); 21833 definition.variable.visit(this); 21834 this.parts.push(' = '); 21835 definition.arg.visit(this); 21836 this.parts.push(';'); 21837 }, 21838 visitMin: function visitMin(max) { 21839 this.parts.push('Math.min('); 21840 max.arg.visit(this); 21841 this.parts.push(', ', max.max, ')'); 21842 }, 21843 toString: function toString() { 21844 return this.parts.join(''); 21845 } 21846 }; 21847 function buildAddOperation(num1, num2) { 21848 if (num2.type === 'literal' && num2.number === 0) { 21849 return num1; 21850 } 21851 if (num1.type === 'literal' && num1.number === 0) { 21852 return num2; 21853 } 21854 if (num2.type === 'literal' && num1.type === 'literal') { 21855 return new AstLiteral(num1.number + num2.number); 21856 } 21857 return new AstBinaryOperation('+', num1, num2, num1.min + num2.min, num1.max + num2.max); 21858 } 21859 function buildMulOperation(num1, num2) { 21860 if (num2.type === 'literal') { 21861 if (num2.number === 0) { 21862 return new AstLiteral(0); 21863 } else if (num2.number === 1) { 21864 return num1; 21865 } else if (num1.type === 'literal') { 21866 return new AstLiteral(num1.number * num2.number); 21867 } 21868 } 21869 if (num1.type === 'literal') { 21870 if (num1.number === 0) { 21871 return new AstLiteral(0); 21872 } else if (num1.number === 1) { 21873 return num2; 21874 } 21875 } 21876 var min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); 21877 var max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); 21878 return new AstBinaryOperation('*', num1, num2, min, max); 21879 } 21880 function buildSubOperation(num1, num2) { 21881 if (num2.type === 'literal') { 21882 if (num2.number === 0) { 21883 return num1; 21884 } else if (num1.type === 'literal') { 21885 return new AstLiteral(num1.number - num2.number); 21886 } 21887 } 21888 if (num2.type === 'binary' && num2.op === '-' && num1.type === 'literal' && num1.number === 1 && num2.arg1.type === 'literal' && num2.arg1.number === 1) { 21889 return num2.arg2; 21890 } 21891 return new AstBinaryOperation('-', num1, num2, num1.min - num2.max, num1.max - num2.min); 21892 } 21893 function buildMinOperation(num1, max) { 21894 if (num1.min >= max) { 21895 return new AstLiteral(max); 21896 } else if (num1.max <= max) { 21897 return num1; 21898 } 21899 return new AstMin(num1, max); 21900 } 21901 function PostScriptCompiler() {} 21902 PostScriptCompiler.prototype = { 21903 compile: function PostScriptCompiler_compile(code, domain, range) { 21904 var stack = []; 21905 var i, ii; 21906 var instructions = []; 21907 var inputSize = domain.length >> 1, 21908 outputSize = range.length >> 1; 21909 var lastRegister = 0; 21910 var n, j; 21911 var num1, num2, ast1, ast2, tmpVar, item; 21912 for (i = 0; i < inputSize; i++) { 21913 stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); 21914 } 21915 for (i = 0, ii = code.length; i < ii; i++) { 21916 item = code[i]; 21917 if (typeof item === 'number') { 21918 stack.push(new AstLiteral(item)); 21919 continue; 21920 } 21921 switch (item) { 21922 case 'add': 21923 if (stack.length < 2) { 21924 return null; 21925 } 21926 num2 = stack.pop(); 21927 num1 = stack.pop(); 21928 stack.push(buildAddOperation(num1, num2)); 21929 break; 21930 case 'cvr': 21931 if (stack.length < 1) { 21932 return null; 21933 } 21934 break; 21935 case 'mul': 21936 if (stack.length < 2) { 21937 return null; 21938 } 21939 num2 = stack.pop(); 21940 num1 = stack.pop(); 21941 stack.push(buildMulOperation(num1, num2)); 21942 break; 21943 case 'sub': 21944 if (stack.length < 2) { 21945 return null; 21946 } 21947 num2 = stack.pop(); 21948 num1 = stack.pop(); 21949 stack.push(buildSubOperation(num1, num2)); 21950 break; 21951 case 'exch': 21952 if (stack.length < 2) { 21953 return null; 21954 } 21955 ast1 = stack.pop(); 21956 ast2 = stack.pop(); 21957 stack.push(ast1, ast2); 21958 break; 21959 case 'pop': 21960 if (stack.length < 1) { 21961 return null; 21962 } 21963 stack.pop(); 21964 break; 21965 case 'index': 21966 if (stack.length < 1) { 21967 return null; 21968 } 21969 num1 = stack.pop(); 21970 if (num1.type !== 'literal') { 21971 return null; 21972 } 21973 n = num1.number; 21974 if (n < 0 || !Number.isInteger(n) || stack.length < n) { 21975 return null; 21976 } 21977 ast1 = stack[stack.length - n - 1]; 21978 if (ast1.type === 'literal' || ast1.type === 'var') { 21979 stack.push(ast1); 21980 break; 21981 } 21982 tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); 21983 stack[stack.length - n - 1] = tmpVar; 21984 stack.push(tmpVar); 21985 instructions.push(new AstVariableDefinition(tmpVar, ast1)); 21986 break; 21987 case 'dup': 21988 if (stack.length < 1) { 21989 return null; 21990 } 21991 if (typeof code[i + 1] === 'number' && code[i + 2] === 'gt' && code[i + 3] === i + 7 && code[i + 4] === 'jz' && code[i + 5] === 'pop' && code[i + 6] === code[i + 1]) { 21992 num1 = stack.pop(); 21993 stack.push(buildMinOperation(num1, code[i + 1])); 21994 i += 6; 21995 break; 21996 } 21997 ast1 = stack[stack.length - 1]; 21998 if (ast1.type === 'literal' || ast1.type === 'var') { 21999 stack.push(ast1); 22000 break; 22001 } 22002 tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); 22003 stack[stack.length - 1] = tmpVar; 22004 stack.push(tmpVar); 22005 instructions.push(new AstVariableDefinition(tmpVar, ast1)); 22006 break; 22007 case 'roll': 22008 if (stack.length < 2) { 22009 return null; 22010 } 22011 num2 = stack.pop(); 22012 num1 = stack.pop(); 22013 if (num2.type !== 'literal' || num1.type !== 'literal') { 22014 return null; 22015 } 22016 j = num2.number; 22017 n = num1.number; 22018 if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) { 22019 return null; 22020 } 22021 j = (j % n + n) % n; 22022 if (j === 0) { 22023 break; 22024 } 22025 Array.prototype.push.apply(stack, stack.splice(stack.length - n, n - j)); 22026 break; 22027 default: 22028 return null; 22029 } 22030 } 22031 if (stack.length !== outputSize) { 22032 return null; 22033 } 22034 var result = []; 22035 instructions.forEach(function (instruction) { 22036 var statementBuilder = new ExpressionBuilderVisitor(); 22037 instruction.visit(statementBuilder); 22038 result.push(statementBuilder.toString()); 22039 }); 22040 stack.forEach(function (expr, i) { 22041 var statementBuilder = new ExpressionBuilderVisitor(); 22042 expr.visit(statementBuilder); 22043 var min = range[i * 2], 22044 max = range[i * 2 + 1]; 22045 var out = [statementBuilder.toString()]; 22046 if (min > expr.min) { 22047 out.unshift('Math.max(', min, ', '); 22048 out.push(')'); 22049 } 22050 if (max < expr.max) { 22051 out.unshift('Math.min(', max, ', '); 22052 out.push(')'); 22053 } 22054 out.unshift('dest[destOffset + ', i, '] = '); 22055 out.push(';'); 22056 result.push(out.join(''));
22057 }); 22058 return result.join('\n'); 22059 } 22060 }; 22061 return PostScriptCompiler; 22062}(); 22063exports.isPDFFunction = isPDFFunction; 22064exports.PDFFunctionFactory = PDFFunctionFactory; 22065exports.PostScriptEvaluator = PostScriptEvaluator; 22066exports.PostScriptCompiler = PostScriptCompiler; 22067 22068/***/ }), 22069/* 72 */ 22070/***/ (function(module, exports, __w_pdfjs_require__) { 22071 22072"use strict"; 22073 22074 22075var pdfjsVersion = '2.0.288'; 22076var pdfjsBuild = 'f0216484'; 22077var pdfjsCoreWorker = __w_pdfjs_require__(73); 22078exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler; 22079 22080/***/ }), 22081/* 73 */ 22082/***/ (function(module, exports, __w_pdfjs_require__) { 22083 22084"use strict"; 22085 22086 22087Object.defineProperty(exports, "__esModule", { 22088 value: true 22089}); 22090exports.WorkerMessageHandler = exports.WorkerTask = undefined; 22091 22092var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 22093 22094var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 22095 22096var _util = __w_pdfjs_require__(0); 22097 22098var _pdf_manager = __w_pdfjs_require__(126); 22099 22100var _is_node = __w_pdfjs_require__(44); 22101 22102var _is_node2 = _interopRequireDefault(_is_node); 22103 22104var _primitives = __w_pdfjs_require__(1); 22105 22106function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 22107 22108var WorkerTask = function WorkerTaskClosure() { 22109 function WorkerTask(name) { 22110 this.name = name; 22111 this.terminated = false; 22112 this._capability = (0, _util.createPromiseCapability)(); 22113 } 22114 WorkerTask.prototype = { 22115 get finished() { 22116 return this._capability.promise; 22117 }, 22118 finish: function finish() { 22119 this._capability.resolve(); 22120 }, 22121 terminate: function terminate() { 22122 this.terminated = true; 22123 }, 22124 ensureNotTerminated: function ensureNotTerminated() { 22125 if (this.terminated) { 22126 throw new Error('Worker task was terminated'); 22127 } 22128 } 22129 }; 22130 return WorkerTask; 22131}(); 22132; 22133var PDFWorkerStream = function PDFWorkerStreamClosure() { 22134 function PDFWorkerStream(msgHandler) { 22135 this._msgHandler = msgHandler; 22136 this._contentLength = null; 22137 this._fullRequestReader = null; 22138 this._rangeRequestReaders = []; 22139 } 22140 PDFWorkerStream.prototype = { 22141 getFullReader: function getFullReader() { 22142 (0, _util.assert)(!this._fullRequestReader); 22143 this._fullRequestReader = new PDFWorkerStreamReader(this._msgHandler); 22144 return this._fullRequestReader; 22145 }, 22146 getRangeReader: function getRangeReader(begin, end) { 22147 var reader = new PDFWorkerStreamRangeReader(begin, end, this._msgHandler); 22148 this._rangeRequestReaders.push(reader); 22149 return reader; 22150 }, 22151 cancelAllRequests: function cancelAllRequests(reason) { 22152 if (this._fullRequestReader) { 22153 this._fullRequestReader.cancel(reason); 22154 } 22155 var readers = this._rangeRequestReaders.slice(0); 22156 readers.forEach(function (reader) { 22157 reader.cancel(reason); 22158 }); 22159 } 22160 }; 22161 function PDFWorkerStreamReader(msgHandler) { 22162 var _this = this; 22163 22164 this._msgHandler = msgHandler; 22165 this._contentLength = null; 22166 this._isRangeSupported = false; 22167 this._isStreamingSupported = false; 22168 var readableStream = this._msgHandler.sendWithStream('GetReader'); 22169 this._reader = readableStream.getReader();
22170 this._headersReady = this._msgHandler.sendWithPromise('ReaderHeadersReady').then(function (data) { 22171 _this._isStreamingSupported = data.isStreamingSupported; 22172 _this._isRangeSupported = data.isRangeSupported; 22173 _this._contentLength = data.contentLength; 22174 }); 22175 } 22176 PDFWorkerStreamReader.prototype = { 22177 get headersReady() { 22178 return this._headersReady; 22179 }, 22180 get contentLength() { 22181 return this._contentLength; 22182 }, 22183 get isStreamingSupported() { 22184 return this._isStreamingSupported; 22185 }, 22186 get isRangeSupported() { 22187 return this._isRangeSupported; 22188 }, 22189 read: function read() { 22190 return this._reader.read().then(function (_ref) { 22191 var value = _ref.value, 22192 done = _ref.done; 22193 22194 if (done) { 22195 return { 22196 value: undefined, 22197 done: true 22198 }; 22199 } 22200 return { 22201 value: value.buffer, 22202 done: false 22203 }; 22204 }); 22205 }, 22206 cancel: function cancel(reason) { 22207 this._reader.cancel(reason); 22208 } 22209 }; 22210 function PDFWorkerStreamRangeReader(begin, end, msgHandler) { 22211 this._msgHandler = msgHandler; 22212 this.onProgress = null; 22213 var readableStream = this._msgHandler.sendWithStream('GetRangeReader', { 22214 begin: begin, 22215 end: end 22216 }); 22217 this._reader = readableStream.getReader(); 22218 } 22219 PDFWorkerStreamRangeReader.prototype = { 22220 get isStreamingSupported() { 22221 return false; 22222 }, 22223 read: function read() { 22224 return this._reader.read().then(function (_ref2) { 22225 var value = _ref2.value, 22226 done = _ref2.done; 22227 22228 if (done) { 22229 return { 22230 value: undefined, 22231 done: true 22232 }; 22233 } 22234 return { 22235 value: value.buffer, 22236 done: false 22237 }; 22238 }); 22239 }, 22240 cancel: function cancel(reason) { 22241 this._reader.cancel(reason); 22242 } 22243 }; 22244 return PDFWorkerStream; 22245}(); 22246var WorkerMessageHandler = { 22247 setup: function setup(handler, port) { 22248 var testMessageProcessed = false; 22249 handler.on('test', function wphSetupTest(data) { 22250 if (testMessageProcessed) { 22251 return; 22252 } 22253 testMessageProcessed = true; 22254 if (!(data instanceof Uint8Array)) { 22255 handler.send('test', 'main', false); 22256 return; 22257 } 22258 var supportTransfers = data[0] === 255; 22259 handler.postMessageTransfers = supportTransfers; 22260 var xhr = new XMLHttpRequest(); 22261 var responseExists = 'response' in xhr; 22262 try { 22263 xhr.responseType; 22264 } catch (e) { 22265 responseExists = false; 22266 } 22267 if (!responseExists) { 22268 handler.send('test', false); 22269 return; 22270 } 22271 handler.send('test', { 22272 supportTypedArray: true, 22273 supportTransfers: supportTransfers 22274 }); 22275 }); 22276 handler.on('configure', function wphConfigure(data) { 22277 (0, _util.setVerbosityLevel)(data.verbosity); 22278 }); 22279 handler.on('GetDocRequest', function wphSetupDoc(data) { 22280 return WorkerMessageHandler.createDocumentHandler(data, port); 22281 }); 22282 }, 22283 createDocumentHandler: function createDocumentHandler(docParams, port) { 22284 var pdfManager; 22285 var terminated = false; 22286 var cancelXHRs = null; 22287 var WorkerTasks = []; 22288 var apiVersion = docParams.apiVersion; 22289 var workerVersion = '2.0.288'; 22290 if (apiVersion !== null && apiVersion !== workerVersion) { 22291 throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".')); 22292 } 22293 var docId = docParams.docId; 22294 var docBaseUrl = docParams.docBaseUrl; 22295 var workerHandlerName = docParams.docId + '_worker'; 22296 var handler = new _util.MessageHandler(workerHandlerName, docId, port); 22297 handler.postMessageTransfers = docParams.postMessageTransfers; 22298 function ensureNotTerminated() { 22299 if (terminated) { 22300 throw new Error('Worker was terminated'); 22301 } 22302 } 22303 function startWorkerTask(task) { 22304 WorkerTasks.push(task); 22305 } 22306 function finishWorkerTask(task) { 22307 task.finish(); 22308 var i = WorkerTasks.indexOf(task); 22309 WorkerTasks.splice(i, 1); 22310 } 22311 function loadDocument(recoveryMode) { 22312 var loadDocumentCapability = (0, _util.createPromiseCapability)(); 22313 var parseSuccess = function parseSuccess() { 22314 Promise.all([pdfManager.ensureDoc('numPages'), pdfManager.ensureDoc('fingerprint')]).then(function (_ref3) { 22315 var _ref4 = _slicedToArray(_ref3, 2), 22316 numPages = _ref4[0], 22317 fingerprint = _ref4[1]; 22318 22319 loadDocumentCapability.resolve({ 22320 numPages: numPages, 22321 fingerprint: fingerprint 22322 }); 22323 }, parseFailure); 22324 }; 22325 var parseFailure = function parseFailure(e) { 22326 loadDocumentCapability.reject(e); 22327 }; 22328 pdfManager.ensureDoc('checkHeader', []).then(function () { 22329 pdfManager.ensureDoc('parseStartXRef', []).then(function () { 22330 pdfManager.ensureDoc('parse', [recoveryMode]).then(parseSuccess, parseFailure); 22331 }, parseFailure); 22332 }, parseFailure); 22333 return loadDocumentCapability.promise; 22334 } 22335 function getPdfManager(data, evaluatorOptions) { 22336 var pdfManagerCapability = (0, _util.createPromiseCapability)(); 22337 var pdfManager; 22338 var source = data.source; 22339 if (source.data) { 22340 try { 22341 pdfManager = new _pdf_manager.LocalPdfManager(docId, source.data, source.password, evaluatorOptions, docBaseUrl); 22342 pdfManagerCapability.resolve(pdfManager); 22343 } catch (ex) { 22344 pdfManagerCapability.reject(ex); 22345 } 22346 return pdfManagerCapability.promise; 22347 } 22348 var pdfStream, 22349 cachedChunks = [];
22350 try { 22351 pdfStream = new PDFWorkerStream(handler); 22352 } catch (ex) { 22353 pdfManagerCapability.reject(ex); 22354 return pdfManagerCapability.promise; 22355 } 22356 var fullRequest = pdfStream.getFullReader(); 22357 fullRequest.headersReady.then(function () { 22358 if (!fullRequest.isRangeSupported) { 22359 return; 22360 } 22361 var disableAutoFetch = source.disableAutoFetch || fullRequest.isStreamingSupported; 22362 pdfManager = new _pdf_manager.NetworkPdfManager(docId, pdfStream, { 22363 msgHandler: handler, 22364 url: source.url, 22365 password: source.password, 22366 length: fullRequest.contentLength, 22367 disableAutoFetch: disableAutoFetch, 22368 rangeChunkSize: source.rangeChunkSize 22369 }, evaluatorOptions, docBaseUrl); 22370 for (var i = 0; i < cachedChunks.length; i++) { 22371 pdfManager.sendProgressiveData(cachedChunks[i]); 22372 } 22373 cachedChunks = []; 22374 pdfManagerCapability.resolve(pdfManager); 22375 cancelXHRs = null; 22376 }).catch(function (reason) { 22377 pdfManagerCapability.reject(reason); 22378 cancelXHRs = null; 22379 }); 22380 var loaded = 0; 22381 var flushChunks = function flushChunks() { 22382 var pdfFile = (0, _util.arraysToBytes)(cachedChunks); 22383 if (source.length && pdfFile.length !== source.length) { 22384 (0, _util.warn)('reported HTTP length is different from actual'); 22385 } 22386 try { 22387 pdfManager = new _pdf_manager.LocalPdfManager(docId, pdfFile, source.password, evaluatorOptions, docBaseUrl); 22388 pdfManagerCapability.resolve(pdfManager); 22389 } catch (ex) { 22390 pdfManagerCapability.reject(ex); 22391 } 22392 cachedChunks = []; 22393 }; 22394 var readPromise = new Promise(function (resolve, reject) { 22395 var readChunk = function readChunk(chunk) { 22396 try { 22397 ensureNotTerminated(); 22398 if (chunk.done) { 22399 if (!pdfManager) { 22400 flushChunks(); 22401 } 22402 cancelXHRs = null; 22403 return; 22404 } 22405 var data = chunk.value; 22406 loaded += (0, _util.arrayByteLength)(data); 22407 if (!fullRequest.isStreamingSupported) { 22408 handler.send('DocProgress', { 22409 loaded: loaded, 22410 total: Math.max(loaded, fullRequest.contentLength || 0) 22411 }); 22412 } 22413 if (pdfManager) { 22414 pdfManager.sendProgressiveData(data); 22415 } else { 22416 cachedChunks.push(data); 22417 } 22418 fullRequest.read().then(readChunk, reject); 22419 } catch (e) { 22420 reject(e); 22421 } 22422 }; 22423 fullRequest.read().then(readChunk, reject); 22424 }); 22425 readPromise.catch(function (e) { 22426 pdfManagerCapability.reject(e); 22427 cancelXHRs = null; 22428 }); 22429 cancelXHRs = function cancelXHRs() { 22430 pdfStream.cancelAllRequests('abort'); 22431 }; 22432 return pdfManagerCapability.promise; 22433 } 22434 function setupDoc(data) { 22435 function onSuccess(doc) { 22436 ensureNotTerminated(); 22437 handler.send('GetDoc', { pdfInfo: doc }); 22438 } 22439 function onFailure(e) { 22440 ensureNotTerminated(); 22441 if (e instanceof _util.PasswordException) { 22442 var task = new WorkerTask('PasswordException: response ' + e.code); 22443 startWorkerTask(task); 22444 handler.sendWithPromise('PasswordRequest', e).then(function (data) { 22445 finishWorkerTask(task); 22446 pdfManager.updatePassword(data.password); 22447 pdfManagerReady(); 22448 }).catch(function (ex) { 22449 finishWorkerTask(task); 22450 handler.send('PasswordException', ex); 22451 }.bind(null, e)); 22452 } else if (e instanceof _util.InvalidPDFException) { 22453 handler.send('InvalidPDF', e); 22454 } else if (e instanceof _util.MissingPDFException) { 22455 handler.send('MissingPDF', e); 22456 } else if (e instanceof _util.UnexpectedResponseException) { 22457 handler.send('UnexpectedResponse', e); 22458 } else { 22459 handler.send('UnknownError', new _util.UnknownErrorException(e.message, e.toString())); 22460 } 22461 } 22462 function pdfManagerReady() { 22463 ensureNotTerminated(); 22464 loadDocument(false).then(onSuccess, function loadFailure(ex) { 22465 ensureNotTerminated(); 22466 if (!(ex instanceof _util.XRefParseException)) { 22467 onFailure(ex); 22468 return; 22469 } 22470 pdfManager.requestLoadedStream(); 22471 pdfManager.onLoadedStream().then(function () { 22472 ensureNotTerminated();
22473 loadDocument(true).then(onSuccess, onFailure); 22474 }); 22475 }, onFailure); 22476 } 22477 ensureNotTerminated(); 22478 var evaluatorOptions = { 22479 forceDataSchema: data.disableCreateObjectURL, 22480 maxImageSize: data.maxImageSize === undefined ? -1 : data.maxImageSize, 22481 disableFontFace: data.disableFontFace, 22482 nativeImageDecoderSupport: data.nativeImageDecoderSupport, 22483 ignoreErrors: data.ignoreErrors, 22484 isEvalSupported: data.isEvalSupported 22485 }; 22486 getPdfManager(data, evaluatorOptions).then(function (newPdfManager) { 22487 if (terminated) { 22488 newPdfManager.terminate(); 22489 throw new Error('Worker was terminated'); 22490 } 22491 pdfManager = newPdfManager; 22492 handler.send('PDFManagerReady', null); 22493 pdfManager.onLoadedStream().then(function (stream) { 22494 handler.send('DataLoaded', { length: stream.bytes.byteLength }); 22495 }); 22496 }).then(pdfManagerReady, onFailure); 22497 } 22498 handler.on('GetPage', function wphSetupGetPage(data) { 22499 return pdfManager.getPage(data.pageIndex).then(function (page) { 22500 var rotatePromise = pdfManager.ensure(page, 'rotate'); 22501 var refPromise = pdfManager.ensure(page, 'ref'); 22502 var userUnitPromise = pdfManager.ensure(page, 'userUnit'); 22503 var viewPromise = pdfManager.ensure(page, 'view'); 22504 return Promise.all([rotatePromise, refPromise, userUnitPromise, viewPromise]).then(function (results) { 22505 return { 22506 rotate: results[0], 22507 ref: results[1], 22508 userUnit: results[2], 22509 view: results[3] 22510 }; 22511 }); 22512 }); 22513 }); 22514 handler.on('GetPageIndex', function wphSetupGetPageIndex(data) { 22515 var ref = new _primitives.Ref(data.ref.num, data.ref.gen); 22516 var catalog = pdfManager.pdfDocument.catalog; 22517 return catalog.getPageIndex(ref); 22518 }); 22519 handler.on('GetDestinations', function wphSetupGetDestinations(data) { 22520 return pdfManager.ensureCatalog('destinations'); 22521 }); 22522 handler.on('GetDestination', function wphSetupGetDestination(data) { 22523 return pdfManager.ensureCatalog('getDestination', [data.id]); 22524 }); 22525 handler.on('GetPageLabels', function wphSetupGetPageLabels(data) { 22526 return pdfManager.ensureCatalog('pageLabels'); 22527 }); 22528 handler.on('GetPageMode', function wphSetupGetPageMode(data) { 22529 return pdfManager.ensureCatalog('pageMode'); 22530 }); 22531 handler.on('GetAttachments', function wphSetupGetAttachments(data) { 22532 return pdfManager.ensureCatalog('attachments'); 22533 }); 22534 handler.on('GetJavaScript', function wphSetupGetJavaScript(data) { 22535 return pdfManager.ensureCatalog('javaScript'); 22536 }); 22537 handler.on('GetOutline', function wphSetupGetOutline(data) { 22538 return pdfManager.ensureCatalog('documentOutline'); 22539 }); 22540 handler.on('GetMetadata', function wphSetupGetMetadata(data) { 22541 return Promise.all([pdfManager.ensureDoc('documentInfo'), pdfManager.ensureCatalog('metadata')]); 22542 }); 22543 handler.on('GetData', function wphSetupGetData(data) { 22544 pdfManager.requestLoadedStream(); 22545 return pdfManager.onLoadedStream().then(function (stream) { 22546 return stream.bytes; 22547 }); 22548 }); 22549 handler.on('GetStats', function wphSetupGetStats(data) { 22550 return pdfManager.pdfDocument.xref.stats; 22551 }); 22552 handler.on('GetAnnotations', function wphSetupGetAnnotations(data) { 22553 return pdfManager.getPage(data.pageIndex).then(function (page) { 22554 return pdfManager.ensure(page, 'getAnnotationsData', [data.intent]); 22555 }); 22556 }); 22557 handler.on('RenderPageRequest', function wphSetupRenderPage(data) { 22558 var pageIndex = data.pageIndex; 22559 pdfManager.getPage(pageIndex).then(function (page) { 22560 var task = new WorkerTask('RenderPageRequest: page ' + pageIndex); 22561 startWorkerTask(task); 22562 var pageNum = pageIndex + 1; 22563 var start = Date.now(); 22564 page.getOperatorList({ 22565 handler: handler, 22566 task: task, 22567 intent: data.intent, 22568 renderInteractiveForms: data.renderInteractiveForms 22569 }).then(function (operatorList) { 22570 finishWorkerTask(task); 22571 (0, _util.info)('page=' + pageNum + ' - getOperatorList: time=' + (Date.now() - start) + 'ms, len=' + operatorList.totalLength); 22572 }, function (e) { 22573 finishWorkerTask(task); 22574 if (task.terminated) { 22575 return; 22576 } 22577 handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.unknown }); 22578 var minimumStackMessage = 'worker.js: while trying to getPage() and getOperatorList()'; 22579 var wrappedException; 22580 if (typeof e === 'string') { 22581 wrappedException = { 22582 message: e, 22583 stack: minimumStackMessage 22584 }; 22585 } else if ((typeof e === 'undefined' ? 'undefined' : _typeof(e)) === 'object') { 22586 wrappedException = { 22587 message: e.message || e.toString(), 22588 stack: e.stack || minimumStackMessage 22589 }; 22590 } else { 22591 wrappedException = { 22592 message: 'Unknown exception type: ' + (typeof e === 'undefined' ? 'undefined' : _typeof(e)), 22593 stack: minimumStackMessage 22594 }; 22595 } 22596 handler.send('PageError', { 22597 pageNum: pageNum, 22598 error: wrappedException, 22599 intent: data.intent 22600 }); 22601 }); 22602 }); 22603 }, this); 22604 handler.on('GetTextContent', function wphExtractText(data, sink) { 22605 var pageIndex = data.pageIndex; 22606 sink.onPull = function (desiredSize) {}; 22607 sink.onCancel = function (reason) {}; 22608 pdfManager.getPage(pageIndex).then(function (page) { 22609 var task = new WorkerTask('GetTextContent: page ' + pageIndex); 22610 startWorkerTask(task); 22611 var pageNum = pageIndex + 1; 22612 var start = Date.now(); 22613 page.extractTextContent({ 22614 handler: handler, 22615 task: task, 22616 sink: sink, 22617 normalizeWhitespace: data.normalizeWhitespace, 22618 combineTextItems: data.combineTextItems 22619 }).then(function () { 22620 finishWorkerTask(task); 22621 (0, _util.info)('text indexing: page=' + pageNum + ' - time=' + (Date.now() - start) + 'ms'); 22622 sink.close(); 22623 }, function (reason) { 22624 finishWorkerTask(task); 22625 if (task.terminated) { 22626 return; 22627 } 22628 sink.error(reason); 22629 throw reason; 22630 }); 22631 }); 22632 });
22633 handler.on('Cleanup', function wphCleanup(data) { 22634 return pdfManager.cleanup(); 22635 }); 22636 handler.on('Terminate', function wphTerminate(data) { 22637 terminated = true; 22638 if (pdfManager) { 22639 pdfManager.terminate(); 22640 pdfManager = null; 22641 } 22642 if (cancelXHRs) { 22643 cancelXHRs(); 22644 } 22645 var waitOn = []; 22646 WorkerTasks.forEach(function (task) { 22647 waitOn.push(task.finished); 22648 task.terminate(); 22649 }); 22650 return Promise.all(waitOn).then(function () { 22651 handler.destroy(); 22652 handler = null; 22653 }); 22654 }); 22655 handler.on('Ready', function wphReady(data) { 22656 setupDoc(docParams); 22657 docParams = null; 22658 }); 22659 return workerHandlerName; 22660 }, 22661 initializeFromPort: function initializeFromPort(port) { 22662 var handler = new _util.MessageHandler('worker', 'main', port); 22663 WorkerMessageHandler.setup(handler, port); 22664 handler.send('ready', null); 22665 } 22666}; 22667function isMessagePort(maybePort) { 22668 return typeof maybePort.postMessage === 'function' && 'onmessage' in maybePort; 22669} 22670if (typeof window === 'undefined' && !(0, _is_node2.default)() && typeof self !== 'undefined' && isMessagePort(self)) { 22671 WorkerMessageHandler.initializeFromPort(self); 22672} 22673exports.WorkerTask = WorkerTask; 22674exports.WorkerMessageHandler = WorkerMessageHandler; 22675 22676/***/ }), 22677/* 74 */ 22678/***/ (function(module, exports, __w_pdfjs_require__) { 22679 22680"use strict"; 22681 22682 22683var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 22684 22685if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) { 22686 var globalScope = __w_pdfjs_require__(75); 22687 var isNodeJS = __w_pdfjs_require__(44); 22688 var userAgent = typeof navigator !== 'undefined' && navigator.userAgent || ''; 22689 var isAndroid = /Android/.test(userAgent); 22690 var isIOSChrome = userAgent.indexOf('CriOS') >= 0; 22691 var isIE = userAgent.indexOf('Trident') >= 0; 22692 var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent); 22693 var isSafari = /Safari\//.test(userAgent) && !/(Chrome\/|Android\s)/.test(userAgent); 22694 var hasDOM = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && (typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object'; 22695 if (typeof PDFJS === 'undefined') { 22696 globalScope.PDFJS = {}; 22697 } 22698 PDFJS.compatibilityChecked = true; 22699 (function checkNodeBtoa() { 22700 if (globalScope.btoa || !isNodeJS()) { 22701 return; 22702 } 22703 globalScope.btoa = function (chars) { 22704 return Buffer.from(chars, 'binary').toString('base64'); 22705 }; 22706 })(); 22707 (function checkNodeAtob() { 22708 if (globalScope.atob || !isNodeJS()) { 22709 return; 22710 } 22711 globalScope.atob = function (input) { 22712 return Buffer.from(input, 'base64').toString('binary'); 22713 }; 22714 })(); 22715 (function checkOnBlobSupport() { 22716 if (isIE || isIOSChrome) { 22717 PDFJS.disableCreateObjectURL = true; 22718 } 22719 })(); 22720 (function checkNavigatorLanguage() { 22721 if (typeof navigator === 'undefined') { 22722 return; 22723 } 22724 if ('language' in navigator) { 22725 return; 22726 } 22727 PDFJS.locale = navigator.userLanguage || 'en-US'; 22728 })(); 22729 (function checkRangeRequests() { 22730 if (isSafari || isIOS) { 22731 PDFJS.disableRange = true; 22732 PDFJS.disableStream = true; 22733 } 22734 })(); 22735 (function checkCanvasSizeLimitation() { 22736 if (isIOS || isAndroid) { 22737 PDFJS.maxCanvasPixels = 5242880; 22738 } 22739 })(); 22740 (function checkFullscreenSupport() { 22741 if (!hasDOM) { 22742 return; 22743 } 22744 if (isIE && window.parent !== window) { 22745 PDFJS.disableFullscreen = true; 22746 } 22747 })(); 22748 (function checkCurrentScript() { 22749 if (!hasDOM) { 22750 return; 22751 } 22752 if ('currentScript' in document) { 22753 return; 22754 } 22755 Object.defineProperty(document, 'currentScript', { 22756 get: function get() { 22757 var scripts = document.getElementsByTagName('script'); 22758 return scripts[scripts.length - 1]; 22759 }, 22760 22761 enumerable: true, 22762 configurable: true 22763 });
22764 })(); 22765 (function checkChildNodeRemove() { 22766 if (!hasDOM) { 22767 return; 22768 } 22769 if (typeof Element.prototype.remove !== 'undefined') { 22770 return; 22771 } 22772 Element.prototype.remove = function () { 22773 if (this.parentNode) { 22774 this.parentNode.removeChild(this); 22775 } 22776 }; 22777 })(); 22778 (function checkObjectValues() { 22779 if (Object.values) { 22780 return; 22781 } 22782 Object.values = __w_pdfjs_require__(76); 22783 })(); 22784 (function checkArrayIncludes() { 22785 if (Array.prototype.includes) { 22786 return; 22787 } 22788 Array.prototype.includes = __w_pdfjs_require__(81); 22789 })(); 22790 (function checkMathLog2() { 22791 if (Math.log2) { 22792 return; 22793 } 22794 Math.log2 = __w_pdfjs_require__(83); 22795 })(); 22796 (function checkNumberIsNaN() { 22797 if (Number.isNaN) { 22798 return; 22799 } 22800 Number.isNaN = __w_pdfjs_require__(85); 22801 })(); 22802 (function checkNumberIsInteger() { 22803 if (Number.isInteger) { 22804 return; 22805 } 22806 Number.isInteger = __w_pdfjs_require__(87); 22807 })(); 22808 (function checkPromise() { 22809 if (globalScope.Promise) { 22810 return; 22811 } 22812 globalScope.Promise = __w_pdfjs_require__(90); 22813 })(); 22814 (function checkWeakMap() { 22815 if (globalScope.WeakMap) { 22816 return; 22817 } 22818 globalScope.WeakMap = __w_pdfjs_require__(108); 22819 })(); 22820 (function checkURLConstructor() { 22821 var hasWorkingUrl = false; 22822 try { 22823 if (typeof URL === 'function' && _typeof(URL.prototype) === 'object' && 'origin' in URL.prototype) { 22824 var u = new URL('b', 'http://a'); 22825 u.pathname = 'c%20d'; 22826 hasWorkingUrl = u.href === 'http://a/c%20d'; 22827 } 22828 } catch (e) {} 22829 if (hasWorkingUrl) { 22830 return; 22831 } 22832 var relative = Object.create(null); 22833 relative['ftp'] = 21; 22834 relative['file'] = 0; 22835 relative['gopher'] = 70; 22836 relative['http'] = 80; 22837 relative['https'] = 443; 22838 relative['ws'] = 80; 22839 relative['wss'] = 443; 22840 var relativePathDotMapping = Object.create(null); 22841 relativePathDotMapping['%2e'] = '.'; 22842 relativePathDotMapping['.%2e'] = '..'; 22843 relativePathDotMapping['%2e.'] = '..'; 22844 relativePathDotMapping['%2e%2e'] = '..'; 22845 function isRelativeScheme(scheme) { 22846 return relative[scheme] !== undefined; 22847 }
22848 function invalid() { 22849 clear.call(this); 22850 this._isInvalid = true; 22851 } 22852 function IDNAToASCII(h) { 22853 if (h === '') { 22854 invalid.call(this); 22855 } 22856 return h.toLowerCase(); 22857 } 22858 function percentEscape(c) { 22859 var unicode = c.charCodeAt(0); 22860 if (unicode > 0x20 && unicode < 0x7F && [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) === -1) { 22861 return c; 22862 } 22863 return encodeURIComponent(c); 22864 } 22865 function percentEscapeQuery(c) { 22866 var unicode = c.charCodeAt(0); 22867 if (unicode > 0x20 && unicode < 0x7F && [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) === -1) { 22868 return c; 22869 } 22870 return encodeURIComponent(c); 22871 } 22872 var EOF, 22873 ALPHA = /[a-zA-Z]/, 22874 ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; 22875 function parse(input, stateOverride, base) { 22876 function err(message) { 22877 errors.push(message); 22878 } 22879 var state = stateOverride || 'scheme start', 22880 cursor = 0, 22881 buffer = '', 22882 seenAt = false, 22883 seenBracket = false, 22884 errors = []; 22885 loop: while ((input[cursor - 1] !== EOF || cursor === 0) && !this._isInvalid) { 22886 var c = input[cursor]; 22887 switch (state) { 22888 case 'scheme start': 22889 if (c && ALPHA.test(c)) { 22890 buffer += c.toLowerCase(); 22891 state = 'scheme'; 22892 } else if (!stateOverride) { 22893 buffer = ''; 22894 state = 'no scheme'; 22895 continue; 22896 } else { 22897 err('Invalid scheme.'); 22898 break loop; 22899 } 22900 break; 22901 case 'scheme': 22902 if (c && ALPHANUMERIC.test(c)) { 22903 buffer += c.toLowerCase(); 22904 } else if (c === ':') { 22905 this._scheme = buffer; 22906 buffer = ''; 22907 if (stateOverride) { 22908 break loop; 22909 } 22910 if (isRelativeScheme(this._scheme)) { 22911 this._isRelative = true; 22912 } 22913 if (this._scheme === 'file') { 22914 state = 'relative'; 22915 } else if (this._isRelative && base && base._scheme === this._scheme) { 22916 state = 'relative or authority'; 22917 } else if (this._isRelative) { 22918 state = 'authority first slash'; 22919 } else { 22920 state = 'scheme data'; 22921 } 22922 } else if (!stateOverride) { 22923 buffer = ''; 22924 cursor = 0; 22925 state = 'no scheme'; 22926 continue; 22927 } else if (c === EOF) { 22928 break loop; 22929 } else { 22930 err('Code point not allowed in scheme: ' + c); 22931 break loop; 22932 } 22933 break; 22934 case 'scheme data': 22935 if (c === '?') { 22936 this._query = '?'; 22937 state = 'query'; 22938 } else if (c === '#') { 22939 this._fragment = '#'; 22940 state = 'fragment'; 22941 } else { 22942 if (c !== EOF && c !== '\t' && c !== '\n' && c !== '\r') { 22943 this._schemeData += percentEscape(c); 22944 } 22945 } 22946 break; 22947 case 'no scheme': 22948 if (!base || !isRelativeScheme(base._scheme)) { 22949 err('Missing scheme.'); 22950 invalid.call(this); 22951 } else { 22952 state = 'relative'; 22953 continue; 22954 } 22955 break; 22956 case 'relative or authority': 22957 if (c === '/' && input[cursor + 1] === '/') { 22958 state = 'authority ignore slashes'; 22959 } else { 22960 err('Expected /, got: ' + c); 22961 state = 'relative'; 22962 continue; 22963 } 22964 break; 22965 case 'relative': 22966 this._isRelative = true; 22967 if (this._scheme !== 'file') { 22968 this._scheme = base._scheme; 22969 } 22970 if (c === EOF) { 22971 this._host = base._host; 22972 this._port = base._port; 22973 this._path = base._path.slice(); 22974 this._query = base._query; 22975 this._username = base._username; 22976 this._password = base._password; 22977 break loop; 22978 } else if (c === '/' || c === '\\') { 22979 if (c === '\\') {
22980 err('\\ is an invalid code point.'); 22981 } 22982 state = 'relative slash'; 22983 } else if (c === '?') { 22984 this._host = base._host; 22985 this._port = base._port; 22986 this._path = base._path.slice(); 22987 this._query = '?'; 22988 this._username = base._username; 22989 this._password = base._password; 22990 state = 'query'; 22991 } else if (c === '#') { 22992 this._host = base._host; 22993 this._port = base._port; 22994 this._path = base._path.slice(); 22995 this._query = base._query; 22996 this._fragment = '#'; 22997 this._username = base._username; 22998 this._password = base._password; 22999 state = 'fragment'; 23000 } else { 23001 var nextC = input[cursor + 1]; 23002 var nextNextC = input[cursor + 2]; 23003 if (this._scheme !== 'file' || !ALPHA.test(c) || nextC !== ':' && nextC !== '|' || nextNextC !== EOF && nextNextC !== '/' && nextNextC !== '\\' && nextNextC !== '?' && nextNextC !== '#') { 23004 this._host = base._host; 23005 this._port = base._port; 23006 this._username = base._username; 23007 this._password = base._password; 23008 this._path = base._path.slice(); 23009 this._path.pop(); 23010 } 23011 state = 'relative path'; 23012 continue; 23013 } 23014 break; 23015 case 'relative slash': 23016 if (c === '/' || c === '\\') { 23017 if (c === '\\') { 23018 err('\\ is an invalid code point.'); 23019 } 23020 if (this._scheme === 'file') { 23021 state = 'file host'; 23022 } else { 23023 state = 'authority ignore slashes'; 23024 } 23025 } else { 23026 if (this._scheme !== 'file') { 23027 this._host = base._host; 23028 this._port = base._port; 23029 this._username = base._username; 23030 this._password = base._password; 23031 } 23032 state = 'relative path'; 23033 continue; 23034 } 23035 break; 23036 case 'authority first slash': 23037 if (c === '/') { 23038 state = 'authority second slash'; 23039 } else { 23040 err('Expected \'/\', got: ' + c); 23041 state = 'authority ignore slashes'; 23042 continue; 23043 } 23044 break; 23045 case 'authority second slash': 23046 state = 'authority ignore slashes'; 23047 if (c !== '/') { 23048 err('Expected \'/\', got: ' + c); 23049 continue; 23050 } 23051 break; 23052 case 'authority ignore slashes': 23053 if (c !== '/' && c !== '\\') { 23054 state = 'authority'; 23055 continue; 23056 } else { 23057 err('Expected authority, got: ' + c); 23058 } 23059 break; 23060 case 'authority': 23061 if (c === '@') { 23062 if (seenAt) { 23063 err('@ already seen.'); 23064 buffer += '%40'; 23065 } 23066 seenAt = true; 23067 for (var i = 0; i < buffer.length; i++) { 23068 var cp = buffer[i]; 23069 if (cp === '\t' || cp === '\n' || cp === '\r') { 23070 err('Invalid whitespace in authority.'); 23071 continue; 23072 } 23073 if (cp === ':' && this._password === null) { 23074 this._password = ''; 23075 continue; 23076 } 23077 var tempC = percentEscape(cp); 23078 if (this._password !== null) { 23079 this._password += tempC; 23080 } else { 23081 this._username += tempC; 23082 } 23083 } 23084 buffer = ''; 23085 } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') { 23086 cursor -= buffer.length; 23087 buffer = ''; 23088 state = 'host'; 23089 continue; 23090 } else { 23091 buffer += c; 23092 } 23093 break; 23094 case 'file host': 23095 if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') { 23096 if (buffer.length === 2 && ALPHA.test(buffer[0]) && (buffer[1] === ':' || buffer[1] === '|')) { 23097 state = 'relative path'; 23098 } else if (buffer.length === 0) { 23099 state = 'relative path start'; 23100 } else {
23101 this._host = IDNAToASCII.call(this, buffer); 23102 buffer = ''; 23103 state = 'relative path start'; 23104 } 23105 continue; 23106 } else if (c === '\t' || c === '\n' || c === '\r') { 23107 err('Invalid whitespace in file host.'); 23108 } else { 23109 buffer += c; 23110 } 23111 break; 23112 case 'host': 23113 case 'hostname': 23114 if (c === ':' && !seenBracket) { 23115 this._host = IDNAToASCII.call(this, buffer); 23116 buffer = ''; 23117 state = 'port'; 23118 if (stateOverride === 'hostname') { 23119 break loop; 23120 } 23121 } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') { 23122 this._host = IDNAToASCII.call(this, buffer); 23123 buffer = ''; 23124 state = 'relative path start'; 23125 if (stateOverride) { 23126 break loop; 23127 } 23128 continue; 23129 } else if (c !== '\t' && c !== '\n' && c !== '\r') { 23130 if (c === '[') { 23131 seenBracket = true; 23132 } else if (c === ']') { 23133 seenBracket = false; 23134 } 23135 buffer += c; 23136 } else { 23137 err('Invalid code point in host/hostname: ' + c); 23138 } 23139 break; 23140 case 'port': 23141 if (/[0-9]/.test(c)) { 23142 buffer += c; 23143 } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#' || stateOverride) { 23144 if (buffer !== '') { 23145 var temp = parseInt(buffer, 10); 23146 if (temp !== relative[this._scheme]) { 23147 this._port = temp + ''; 23148 } 23149 buffer = ''; 23150 } 23151 if (stateOverride) { 23152 break loop; 23153 } 23154 state = 'relative path start'; 23155 continue; 23156 } else if (c === '\t' || c === '\n' || c === '\r') { 23157 err('Invalid code point in port: ' + c); 23158 } else { 23159 invalid.call(this); 23160 } 23161 break; 23162 case 'relative path start': 23163 if (c === '\\') { 23164 err('\'\\\' not allowed in path.'); 23165 } 23166 state = 'relative path'; 23167 if (c !== '/' && c !== '\\') { 23168 continue; 23169 } 23170 break; 23171 case 'relative path': 23172 if (c === EOF || c === '/' || c === '\\' || !stateOverride && (c === '?' || c === '#')) { 23173 if (c === '\\') { 23174 err('\\ not allowed in relative path.'); 23175 } 23176 var tmp; 23177 if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { 23178 buffer = tmp; 23179 } 23180 if (buffer === '..') { 23181 this._path.pop(); 23182 if (c !== '/' && c !== '\\') { 23183 this._path.push(''); 23184 } 23185 } else if (buffer === '.' && c !== '/' && c !== '\\') { 23186 this._path.push(''); 23187 } else if (buffer !== '.') { 23188 if (this._scheme === 'file' && this._path.length === 0 && buffer.length === 2 && ALPHA.test(buffer[0]) && buffer[1] === '|') { 23189 buffer = buffer[0] + ':'; 23190 } 23191 this._path.push(buffer); 23192 } 23193 buffer = ''; 23194 if (c === '?') { 23195 this._query = '?'; 23196 state = 'query'; 23197 } else if (c === '#') { 23198 this._fragment = '#'; 23199 state = 'fragment'; 23200 } 23201 } else if (c !== '\t' && c !== '\n' && c !== '\r') { 23202 buffer += percentEscape(c); 23203 } 23204 break; 23205 case 'query': 23206 if (!stateOverride && c === '#') { 23207 this._fragment = '#'; 23208 state = 'fragment'; 23209 } else if (c !== EOF && c !== '\t' && c !== '\n' && c !== '\r') { 23210 this._query += percentEscapeQuery(c); 23211 } 23212 break; 23213 case 'fragment': 23214 if (c !== EOF && c !== '\t' && c !== '\n' && c !== '\r') { 23215 this._fragment += c; 23216 } 23217 break; 23218 } 23219 cursor++; 23220 } 23221 } 23222 function clear() { 23223 this._scheme = ''; 23224 this._schemeData = ''; 23225 this._username = ''; 23226 this._password = null; 23227 this._host = ''; 23228 this._port = ''; 23229 this._path = []; 23230 this._query = ''; 23231 this._fragment = ''; 23232 this._isInvalid = false; 23233 this._isRelative = false; 23234 } 23235 function JURL(url, base) { 23236 if (base !== undefined && !(base instanceof JURL)) { 23237 base = new JURL(String(base)); 23238 } 23239 this._url = url; 23240 clear.call(this); 23241 var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ''); 23242 parse.call(this, input, null, base); 23243 } 23244 JURL.prototype = { 23245 toString: function toString() { 23246 return this.href; 23247 }, 23248 23249 get href() { 23250 if (this._isInvalid) { 23251 return this._url; 23252 } 23253 var authority = ''; 23254 if (this._username !== '' || this._password !== null) { 23255 authority = this._username + (this._password !== null ? ':' + this._password : '') + '@'; 23256 } 23257 return this.protocol + (this._isRelative ? '//' + authority + this.host : '') + this.pathname + this._query + this._fragment; 23258 }, 23259 set href(value) { 23260 clear.call(this); 23261 parse.call(this, value); 23262 }, 23263 get protocol() { 23264 return this._scheme + ':'; 23265 }, 23266 set protocol(value) { 23267 if (this._isInvalid) { 23268 return; 23269 } 23270 parse.call(this, value + ':', 'scheme start'); 23271 }, 23272 get host() { 23273 return this._isInvalid ? '' : this._port ? this._host + ':' + this._port : this._host; 23274 }, 23275 set host(value) { 23276 if (this._isInvalid || !this._isRelative) { 23277 return; 23278 } 23279 parse.call(this, value, 'host'); 23280 }, 23281 get hostname() { 23282 return this._host; 23283 }, 23284 set hostname(value) { 23285 if (this._isInvalid || !this._isRelative) { 23286 return; 23287 } 23288 parse.call(this, value, 'hostname'); 23289 }, 23290 get port() { 23291 return this._port; 23292 }, 23293 set port(value) { 23294 if (this._isInvalid || !this._isRelative) { 23295 return; 23296 } 23297 parse.call(this, value, 'port'); 23298 }, 23299 get pathname() { 23300 return this._isInvalid ? '' : this._isRelative ? '/' + this._path.join('/') : this._schemeData; 23301 }, 23302 set pathname(value) { 23303 if (this._isInvalid || !this._isRelative) { 23304 return; 23305 } 23306 this._path = []; 23307 parse.call(this, value, 'relative path start'); 23308 }, 23309 get search() { 23310 return this._isInvalid || !this._query || this._query === '?' ? '' : this._query; 23311 }, 23312 set search(value) { 23313 if (this._isInvalid || !this._isRelative) { 23314 return; 23315 } 23316 this._query = '?'; 23317 if (value[0] === '?') { 23318 value = value.slice(1); 23319 } 23320 parse.call(this, value, 'query'); 23321 }, 23322 get hash() { 23323 return this._isInvalid || !this._fragment || this._fragment === '#' ? '' : this._fragment; 23324 }, 23325 set hash(value) { 23326 if (this._isInvalid) { 23327 return; 23328 } 23329 this._fragment = '#'; 23330 if (value[0] === '#') { 23331 value = value.slice(1); 23332 } 23333 parse.call(this, value, 'fragment'); 23334 }, 23335 get origin() { 23336 var host; 23337 if (this._isInvalid || !this._scheme) { 23338 return ''; 23339 } 23340 switch (this._scheme) { 23341 case 'data': 23342 case 'file': 23343 case 'javascript': 23344 case 'mailto': 23345 return 'null'; 23346 case 'blob': 23347 try { 23348 return new JURL(this._schemeData).origin || 'null'; 23349 } catch (_) {} 23350 return 'null'; 23351 } 23352 host = this.host; 23353 if (!host) { 23354 return ''; 23355 } 23356 return this._scheme + '://' + host; 23357 } 23358 }; 23359 var OriginalURL = globalScope.URL; 23360 if (OriginalURL) { 23361 JURL.createObjectURL = function (blob) { 23362 return OriginalURL.createObjectURL.apply(OriginalURL, arguments); 23363 }; 23364 JURL.revokeObjectURL = function (url) { 23365 OriginalURL.revokeObjectURL(url); 23366 }; 23367 } 23368 globalScope.URL = JURL; 23369 })();
23370} 23371 23372/***/ }), 23373/* 75 */ 23374/***/ (function(module, exports, __w_pdfjs_require__) { 23375 23376"use strict"; 23377 23378 23379module.exports = typeof window !== 'undefined' && window.Math === Math ? window : typeof global !== 'undefined' && global.Math === Math ? global : typeof self !== 'undefined' && self.Math === Math ? self : {}; 23380 23381/***/ }), 23382/* 76 */ 23383/***/ (function(module, exports, __w_pdfjs_require__) { 23384 23385"use strict"; 23386 23387 23388__w_pdfjs_require__(77); 23389module.exports = __w_pdfjs_require__(7).Object.values; 23390 23391/***/ }), 23392/* 77 */ 23393/***/ (function(module, exports, __w_pdfjs_require__) { 23394 23395"use strict"; 23396 23397 23398var $export = __w_pdfjs_require__(6); 23399var $values = __w_pdfjs_require__(78)(false); 23400$export($export.S, 'Object', { 23401 values: function values(it) { 23402 return $values(it); 23403 } 23404}); 23405 23406/***/ }), 23407/* 78 */ 23408/***/ (function(module, exports, __w_pdfjs_require__) { 23409 23410"use strict"; 23411 23412 23413var getKeys = __w_pdfjs_require__(23); 23414var toIObject = __w_pdfjs_require__(17); 23415var isEnum = __w_pdfjs_require__(34).f; 23416module.exports = function (isEntries) { 23417 return function (it) { 23418 var O = toIObject(it); 23419 var keys = getKeys(O); 23420 var length = keys.length; 23421 var i = 0; 23422 var result = []; 23423 var key; 23424 while (length > i) { 23425 if (isEnum.call(O, key = keys[i++])) { 23426 result.push(isEntries ? [key, O[key]] : O[key]); 23427 } 23428 }return result; 23429 }; 23430}; 23431 23432/***/ }), 23433/* 79 */ 23434/***/ (function(module, exports, __w_pdfjs_require__) { 23435 23436"use strict"; 23437 23438 23439var has = __w_pdfjs_require__(9); 23440var toIObject = __w_pdfjs_require__(17); 23441var arrayIndexOf = __w_pdfjs_require__(47)(false); 23442var IE_PROTO = __w_pdfjs_require__(33)('IE_PROTO'); 23443module.exports = function (object, names) { 23444 var O = toIObject(object); 23445 var i = 0; 23446 var result = []; 23447 var key; 23448 for (key in O) { 23449 if (key != IE_PROTO) has(O, key) && result.push(key); 23450 }while (names.length > i) { 23451 if (has(O, key = names[i++])) { 23452 ~arrayIndexOf(result, key) || result.push(key); 23453 } 23454 }return result; 23455}; 23456 23457/***/ }), 23458/* 80 */ 23459/***/ (function(module, exports, __w_pdfjs_require__) { 23460 23461"use strict"; 23462 23463 23464var toInteger = __w_pdfjs_require__(32); 23465var max = Math.max; 23466var min = Math.min; 23467module.exports = function (index, length) { 23468 index = toInteger(index); 23469 return index < 0 ? max(index + length, 0) : min(index, length); 23470}; 23471 23472/***/ }), 23473/* 81 */ 23474/***/ (function(module, exports, __w_pdfjs_require__) { 23475 23476"use strict"; 23477 23478 23479__w_pdfjs_require__(82); 23480module.exports = __w_pdfjs_require__(7).Array.includes; 23481 23482/***/ }), 23483/* 82 */ 23484/***/ (function(module, exports, __w_pdfjs_require__) { 23485 23486"use strict"; 23487 23488 23489var $export = __w_pdfjs_require__(6); 23490var $includes = __w_pdfjs_require__(47)(true); 23491$export($export.P, 'Array', { 23492 includes: function includes(el) { 23493 return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); 23494 } 23495}); 23496__w_pdfjs_require__(50)('includes'); 23497 23498/***/ }), 23499/* 83 */ 23500/***/ (function(module, exports, __w_pdfjs_require__) { 23501 23502"use strict"; 23503 23504 23505__w_pdfjs_require__(84); 23506module.exports = __w_pdfjs_require__(7).Math.log2; 23507 23508/***/ }), 23509/* 84 */ 23510/***/ (function(module, exports, __w_pdfjs_require__) { 23511 23512"use strict"; 23513 23514 23515var $export = __w_pdfjs_require__(6); 23516$export($export.S, 'Math', { 23517 log2: function log2(x) { 23518 return Math.log(x) / Math.LN2; 23519 } 23520}); 23521 23522/***/ }), 23523/* 85 */ 23524/***/ (function(module, exports, __w_pdfjs_require__) { 23525 23526"use strict"; 23527 23528 23529__w_pdfjs_require__(86); 23530module.exports = __w_pdfjs_require__(7).Number.isNaN; 23531 23532/***/ }), 23533/* 86 */ 23534/***/ (function(module, exports, __w_pdfjs_require__) { 23535 23536"use strict"; 23537 23538 23539var $export = __w_pdfjs_require__(6); 23540$export($export.S, 'Number', { 23541 isNaN: function isNaN(number) { 23542 return number != number; 23543 } 23544}); 23545 23546/***/ }), 23547/* 87 */ 23548/***/ (function(module, exports, __w_pdfjs_require__) { 23549 23550"use strict"; 23551 23552 23553__w_pdfjs_require__(88); 23554module.exports = __w_pdfjs_require__(7).Number.isInteger; 23555 23556/***/ }), 23557/* 88 */ 23558/***/ (function(module, exports, __w_pdfjs_require__) { 23559 23560"use strict"; 23561 23562 23563var $export = __w_pdfjs_require__(6); 23564$export($export.S, 'Number', { isInteger: __w_pdfjs_require__(89) }); 23565 23566/***/ }), 23567/* 89 */ 23568/***/ (function(module, exports, __w_pdfjs_require__) { 23569 23570"use strict"; 23571 23572 23573var isObject = __w_pdfjs_require__(3); 23574var floor = Math.floor; 23575module.exports = function isInteger(it) { 23576 return !isObject(it) && isFinite(it) && floor(it) === it; 23577}; 23578 23579/***/ }), 23580/* 90 */ 23581/***/ (function(module, exports, __w_pdfjs_require__) { 23582 23583"use strict"; 23584 23585 23586__w_pdfjs_require__(51); 23587__w_pdfjs_require__(91); 23588__w_pdfjs_require__(55); 23589__w_pdfjs_require__(99); 23590__w_pdfjs_require__(106); 23591__w_pdfjs_require__(107); 23592module.exports = __w_pdfjs_require__(7).Promise; 23593 23594/***/ }), 23595/* 91 */ 23596/***/ (function(module, exports, __w_pdfjs_require__) { 23597 23598"use strict"; 23599 23600 23601var $at = __w_pdfjs_require__(92)(true); 23602__w_pdfjs_require__(52)(String, 'String', function (iterated) { 23603 this._t = String(iterated); 23604 this._i = 0; 23605}, function () { 23606 var O = this._t; 23607 var index = this._i; 23608 var point; 23609 if (index >= O.length) return { 23610 value: undefined, 23611 done: true 23612 }; 23613 point = $at(O, index); 23614 this._i += point.length; 23615 return { 23616 value: point, 23617 done: false 23618 }; 23619}); 23620 23621/***/ }), 23622/* 92 */ 23623/***/ (function(module, exports, __w_pdfjs_require__) { 23624 23625"use strict"; 23626 23627 23628var toInteger = __w_pdfjs_require__(32); 23629var defined = __w_pdfjs_require__(30); 23630module.exports = function (TO_STRING) { 23631 return function (that, pos) { 23632 var s = String(defined(that)); 23633 var i = toInteger(pos); 23634 var l = s.length; 23635 var a, b; 23636 if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
vendor: 4,273 bytes, lines 23637-23788
23637 a = s.charCodeAt(i); 23638 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; 23639 }; 23640}; 23641 23642/***/ }), 23643/* 93 */ 23644/***/ (function(module, exports, __w_pdfjs_require__) { 23645 23646"use strict"; 23647 23648 23649var create = __w_pdfjs_require__(94); 23650var descriptor = __w_pdfjs_require__(28); 23651var setToStringTag = __w_pdfjs_require__(24); 23652var IteratorPrototype = {}; 23653__w_pdfjs_require__(12)(IteratorPrototype, __w_pdfjs_require__(4)('iterator'), function () { 23654 return this; 23655}); 23656module.exports = function (Constructor, NAME, next) { 23657 Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); 23658 setToStringTag(Constructor, NAME + ' Iterator'); 23659}; 23660 23661/***/ }), 23662/* 94 */ 23663/***/ (function(module, exports, __w_pdfjs_require__) { 23664 23665"use strict"; 23666 23667 23668var anObject = __w_pdfjs_require__(8); 23669var dPs = __w_pdfjs_require__(95); 23670var enumBugKeys = __w_pdfjs_require__(49); 23671var IE_PROTO = __w_pdfjs_require__(33)('IE_PROTO'); 23672var Empty = function Empty() {}; 23673var PROTOTYPE = 'prototype'; 23674var _createDict = function createDict() { 23675 var iframe = __w_pdfjs_require__(27)('iframe'); 23676 var i = enumBugKeys.length; 23677 var lt = '<'; 23678 var gt = '>'; 23679 var iframeDocument; 23680 iframe.style.display = 'none'; 23681 __w_pdfjs_require__(54).appendChild(iframe); 23682 iframe.src = 'javascript:'; 23683 iframeDocument = iframe.contentWindow.document; 23684 iframeDocument.open(); 23685 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); 23686 iframeDocument.close(); 23687 _createDict = iframeDocument.F; 23688 while (i--) { 23689 delete _createDict[PROTOTYPE][enumBugKeys[i]]; 23690 }return _createDict(); 23691}; 23692module.exports = Object.create || function create(O, Properties) { 23693 var result; 23694 if (O !== null) { 23695 Empty[PROTOTYPE] = anObject(O); 23696 result = new Empty(); 23697 Empty[PROTOTYPE] = null; 23698 result[IE_PROTO] = O; 23699 } else result = _createDict(); 23700 return Properties === undefined ? result : dPs(result, Properties); 23701}; 23702 23703/***/ }), 23704/* 95 */ 23705/***/ (function(module, exports, __w_pdfjs_require__) { 23706 23707"use strict"; 23708 23709 23710var dP = __w_pdfjs_require__(15); 23711var anObject = __w_pdfjs_require__(8); 23712var getKeys = __w_pdfjs_require__(23); 23713module.exports = __w_pdfjs_require__(13) ? Object.defineProperties : function defineProperties(O, Properties) { 23714 anObject(O); 23715 var keys = getKeys(Properties); 23716 var length = keys.length; 23717 var i = 0; 23718 var P; 23719 while (length > i) { 23720 dP.f(O, P = keys[i++], Properties[P]); 23721 }return O; 23722}; 23723 23724/***/ }), 23725/* 96 */ 23726/***/ (function(module, exports, __w_pdfjs_require__) { 23727 23728"use strict"; 23729 23730 23731var has = __w_pdfjs_require__(9); 23732var toObject = __w_pdfjs_require__(36); 23733var IE_PROTO = __w_pdfjs_require__(33)('IE_PROTO'); 23734var ObjectProto = Object.prototype; 23735module.exports = Object.getPrototypeOf || function (O) { 23736 O = toObject(O); 23737 if (has(O, IE_PROTO)) return O[IE_PROTO]; 23738 if (typeof O.constructor == 'function' && O instanceof O.constructor) { 23739 return O.constructor.prototype; 23740 } 23741 return O instanceof Object ? ObjectProto : null; 23742}; 23743 23744/***/ }), 23745/* 97 */ 23746/***/ (function(module, exports, __w_pdfjs_require__) { 23747 23748"use strict"; 23749 23750 23751var addToUnscopables = __w_pdfjs_require__(50); 23752var step = __w_pdfjs_require__(98); 23753var Iterators = __w_pdfjs_require__(19); 23754var toIObject = __w_pdfjs_require__(17); 23755module.exports = __w_pdfjs_require__(52)(Array, 'Array', function (iterated, kind) { 23756 this._t = toIObject(iterated); 23757 this._i = 0; 23758 this._k = kind; 23759}, function () { 23760 var O = this._t; 23761 var kind = this._k; 23762 var index = this._i++; 23763 if (!O || index >= O.length) { 23764 this._t = undefined; 23765 return step(1); 23766 } 23767 if (kind == 'keys') return step(0, index); 23768 if (kind == 'values') return step(0, O[index]); 23769 return step(0, [index, O[index]]); 23770}, 'values'); 23771Iterators.Arguments = Iterators.Array; 23772addToUnscopables('keys'); 23773addToUnscopables('values'); 23774addToUnscopables('entries'); 23775 23776/***/ }), 23777/* 98 */ 23778/***/ (function(module, exports, __w_pdfjs_require__) { 23779 23780"use strict"; 23781 23782 23783module.exports = function (done, value) { 23784 return { 23785 value: value, 23786 done: !!done 23787 }; 23788};
vendor: 4,894 bytes, lines 23789-23940
23789 23790/***/ }), 23791/* 99 */ 23792/***/ (function(module, exports, __w_pdfjs_require__) { 23793 23794"use strict"; 23795 23796 23797var LIBRARY = __w_pdfjs_require__(53); 23798var global = __w_pdfjs_require__(5); 23799var ctx = __w_pdfjs_require__(11); 23800var classof = __w_pdfjs_require__(35); 23801var $export = __w_pdfjs_require__(6); 23802var isObject = __w_pdfjs_require__(3); 23803var aFunction = __w_pdfjs_require__(16); 23804var anInstance = __w_pdfjs_require__(37); 23805var forOf = __w_pdfjs_require__(25); 23806var speciesConstructor = __w_pdfjs_require__(56); 23807var task = __w_pdfjs_require__(57).set; 23808var microtask = __w_pdfjs_require__(104)(); 23809var newPromiseCapabilityModule = __w_pdfjs_require__(38); 23810var perform = __w_pdfjs_require__(58); 23811var promiseResolve = __w_pdfjs_require__(59); 23812var PROMISE = 'Promise'; 23813var TypeError = global.TypeError; 23814var process = global.process; 23815var $Promise = global[PROMISE]; 23816var isNode = classof(process) == 'process'; 23817var empty = function empty() {}; 23818var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; 23819var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; 23820var USE_NATIVE = !!function () { 23821 try { 23822 var promise = $Promise.resolve(1); 23823 var FakePromise = (promise.constructor = {})[__w_pdfjs_require__(4)('species')] = function (exec) { 23824 exec(empty, empty); 23825 }; 23826 return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; 23827 } catch (e) {} 23828}(); 23829var isThenable = function isThenable(it) { 23830 var then; 23831 return isObject(it) && typeof (then = it.then) == 'function' ? then : false; 23832}; 23833var notify = function notify(promise, isReject) { 23834 if (promise._n) return; 23835 promise._n = true; 23836 var chain = promise._c; 23837 microtask(function () { 23838 var value = promise._v; 23839 var ok = promise._s == 1; 23840 var i = 0; 23841 var run = function run(reaction) { 23842 var handler = ok ? reaction.ok : reaction.fail; 23843 var resolve = reaction.resolve; 23844 var reject = reaction.reject; 23845 var domain = reaction.domain; 23846 var result, then; 23847 try { 23848 if (handler) { 23849 if (!ok) { 23850 if (promise._h == 2) onHandleUnhandled(promise); 23851 promise._h = 1; 23852 } 23853 if (handler === true) result = value;else { 23854 if (domain) domain.enter(); 23855 result = handler(value); 23856 if (domain) domain.exit(); 23857 } 23858 if (result === reaction.promise) { 23859 reject(TypeError('Promise-chain cycle')); 23860 } else if (then = isThenable(result)) { 23861 then.call(result, resolve, reject); 23862 } else resolve(result); 23863 } else reject(value); 23864 } catch (e) { 23865 reject(e); 23866 } 23867 }; 23868 while (chain.length > i) { 23869 run(chain[i++]); 23870 }promise._c = []; 23871 promise._n = false; 23872 if (isReject && !promise._h) onUnhandled(promise); 23873 }); 23874}; 23875var onUnhandled = function onUnhandled(promise) { 23876 task.call(global, function () { 23877 var value = promise._v; 23878 var unhandled = isUnhandled(promise); 23879 var result, handler, console; 23880 if (unhandled) { 23881 result = perform(function () { 23882 if (isNode) { 23883 process.emit('unhandledRejection', value, promise); 23884 } else if (handler = global.onunhandledrejection) { 23885 handler({ 23886 promise: promise, 23887 reason: value 23888 }); 23889 } else if ((console = global.console) && console.error) { 23890 console.error('Unhandled promise rejection', value); 23891 } 23892 }); 23893 promise._h = isNode || isUnhandled(promise) ? 2 : 1; 23894 } 23895 promise._a = undefined; 23896 if (unhandled && result.e) throw result.v; 23897 }); 23898}; 23899var isUnhandled = function isUnhandled(promise) { 23900 if (promise._h == 1) return false; 23901 var chain = promise._a || promise._c; 23902 var i = 0; 23903 var reaction; 23904 while (chain.length > i) { 23905 reaction = chain[i++]; 23906 if (reaction.fail || !isUnhandled(reaction.promise)) return false; 23907 } 23908 return true; 23909}; 23910var onHandleUnhandled = function onHandleUnhandled(promise) { 23911 task.call(global, function () { 23912 var handler; 23913 if (isNode) { 23914 process.emit('rejectionHandled', promise); 23915 } else if (handler = global.onrejectionhandled) { 23916 handler({ 23917 promise: promise, 23918 reason: promise._v 23919 }); 23920 } 23921 }); 23922}; 23923var $reject = function $reject(value) { 23924 var promise = this; 23925 if (promise._d) return; 23926 promise._d = true; 23927 promise = promise._w || promise; 23928 promise._v = value; 23929 promise._s = 2; 23930 if (!promise._a) promise._a = promise._c.slice(); 23931 notify(promise, true); 23932}; 23933var $resolve = function $resolve(value) { 23934 var promise = this; 23935 var then; 23936 if (promise._d) return; 23937 promise._d = true; 23938 promise = promise._w || promise; 23939 try { 23940 if (promise === value) throw TypeError("Promise can't be resolved
vendor: 9,034 bytes, lines 23940-24261
23940itself"); 23941 if (then = isThenable(value)) { 23942 microtask(function () { 23943 var wrapper = { 23944 _w: promise, 23945 _d: false 23946 }; 23947 try { 23948 then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); 23949 } catch (e) { 23950 $reject.call(wrapper, e); 23951 } 23952 }); 23953 } else { 23954 promise._v = value; 23955 promise._s = 1; 23956 notify(promise, false); 23957 } 23958 } catch (e) { 23959 $reject.call({ 23960 _w: promise, 23961 _d: false 23962 }, e); 23963 } 23964}; 23965if (!USE_NATIVE) { 23966 $Promise = function Promise(executor) { 23967 anInstance(this, $Promise, PROMISE, '_h'); 23968 aFunction(executor); 23969 Internal.call(this); 23970 try { 23971 executor(ctx($resolve, this, 1), ctx($reject, this, 1)); 23972 } catch (err) { 23973 $reject.call(this, err); 23974 } 23975 }; 23976 Internal = function Promise(executor) { 23977 this._c = []; 23978 this._a = undefined; 23979 this._s = 0; 23980 this._d = false; 23981 this._v = undefined; 23982 this._h = 0; 23983 this._n = false; 23984 }; 23985 Internal.prototype = __w_pdfjs_require__(39)($Promise.prototype, { 23986 then: function then(onFulfilled, onRejected) { 23987 var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); 23988 reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; 23989 reaction.fail = typeof onRejected == 'function' && onRejected; 23990 reaction.domain = isNode ? process.domain : undefined; 23991 this._c.push(reaction); 23992 if (this._a) this._a.push(reaction); 23993 if (this._s) notify(this, false); 23994 return reaction.promise; 23995 }, 23996 'catch': function _catch(onRejected) { 23997 return this.then(undefined, onRejected); 23998 } 23999 }); 24000 OwnPromiseCapability = function OwnPromiseCapability() { 24001 var promise = new Internal(); 24002 this.promise = promise; 24003 this.resolve = ctx($resolve, promise, 1); 24004 this.reject = ctx($reject, promise, 1); 24005 }; 24006 newPromiseCapabilityModule.f = newPromiseCapability = function newPromiseCapability(C) { 24007 return C === $Promise || C === Wrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); 24008 }; 24009} 24010$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); 24011__w_pdfjs_require__(24)($Promise, PROMISE); 24012__w_pdfjs_require__(105)(PROMISE); 24013Wrapper = __w_pdfjs_require__(7)[PROMISE]; 24014$export($export.S + $export.F * !USE_NATIVE, PROMISE, { 24015 reject: function reject(r) { 24016 var capability = newPromiseCapability(this); 24017 var $$reject = capability.reject; 24018 $$reject(r); 24019 return capability.promise; 24020 } 24021}); 24022$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { 24023 resolve: function resolve(x) { 24024 return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); 24025 } 24026}); 24027$export($export.S + $export.F * !(USE_NATIVE && __w_pdfjs_require__(60)(function (iter) { 24028 $Promise.all(iter)['catch'](empty); 24029})), PROMISE, { 24030 all: function all(iterable) { 24031 var C = this; 24032 var capability = newPromiseCapability(C); 24033 var resolve = capability.resolve; 24034 var reject = capability.reject; 24035 var result = perform(function () { 24036 var values = []; 24037 var index = 0; 24038 var remaining = 1; 24039 forOf(iterable, false, function (promise) { 24040 var $index = index++; 24041 var alreadyCalled = false; 24042 values.push(undefined); 24043 remaining++; 24044 C.resolve(promise).then(function (value) { 24045 if (alreadyCalled) return; 24046 alreadyCalled = true; 24047 values[$index] = value; 24048 --remaining || resolve(values); 24049 }, reject); 24050 }); 24051 --remaining || resolve(values); 24052 }); 24053 if (result.e) reject(result.v); 24054 return capability.promise; 24055 }, 24056 race: function race(iterable) { 24057 var C = this; 24058 var capability = newPromiseCapability(C); 24059 var reject = capability.reject; 24060 var result = perform(function () { 24061 forOf(iterable, false, function (promise) { 24062 C.resolve(promise).then(capability.resolve, reject); 24063 }); 24064 }); 24065 if (result.e) reject(result.v); 24066 return capability.promise; 24067 } 24068}); 24069 24070/***/ }), 24071/* 100 */ 24072/***/ (function(module, exports, __w_pdfjs_require__) { 24073 24074"use strict"; 24075 24076 24077var anObject = __w_pdfjs_require__(8); 24078module.exports = function (iterator, fn, value, entries) { 24079 try { 24080 return entries ? fn(anObject(value)[0], value[1]) : fn(value); 24081 } catch (e) { 24082 var ret = iterator['return']; 24083 if (ret !== undefined) anObject(ret.call(iterator)); 24084 throw e; 24085 } 24086}; 24087 24088/***/ }), 24089/* 101 */ 24090/***/ (function(module, exports, __w_pdfjs_require__) { 24091 24092"use strict"; 24093 24094 24095var Iterators = __w_pdfjs_require__(19); 24096var ITERATOR = __w_pdfjs_require__(4)('iterator'); 24097var ArrayProto = Array.prototype; 24098module.exports = function (it) { 24099 return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); 24100}; 24101 24102/***/ }), 24103/* 102 */ 24104/***/ (function(module, exports, __w_pdfjs_require__) { 24105 24106"use strict"; 24107 24108 24109var classof = __w_pdfjs_require__(35); 24110var ITERATOR = __w_pdfjs_require__(4)('iterator'); 24111var Iterators = __w_pdfjs_require__(19); 24112module.exports = __w_pdfjs_require__(7).getIteratorMethod = function (it) { 24113 if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; 24114}; 24115 24116/***/ }), 24117/* 103 */ 24118/***/ (function(module, exports, __w_pdfjs_require__) { 24119 24120"use strict"; 24121 24122 24123module.exports = function (fn, args, that) { 24124 var un = that === undefined; 24125 switch (args.length) { 24126 case 0: 24127 return un ? fn() : fn.call(that); 24128 case 1: 24129 return un ? fn(args[0]) : fn.call(that, args[0]); 24130 case 2: 24131 return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); 24132 case 3: 24133 return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); 24134 case 4: 24135 return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); 24136 } 24137 return fn.apply(that, args); 24138}; 24139 24140/***/ }), 24141/* 104 */ 24142/***/ (function(module, exports, __w_pdfjs_require__) { 24143 24144"use strict"; 24145 24146 24147var global = __w_pdfjs_require__(5); 24148var macrotask = __w_pdfjs_require__(57).set; 24149var Observer = global.MutationObserver || global.WebKitMutationObserver; 24150var process = global.process; 24151var Promise = global.Promise; 24152var isNode = __w_pdfjs_require__(18)(process) == 'process'; 24153module.exports = function () { 24154 var head, last, notify; 24155 var flush = function flush() { 24156 var parent, fn; 24157 if (isNode && (parent = process.domain)) parent.exit(); 24158 while (head) { 24159 fn = head.fn; 24160 head = head.next; 24161 try { 24162 fn(); 24163 } catch (e) { 24164 if (head) notify();else last = undefined; 24165 throw e; 24166 } 24167 } 24168 last = undefined; 24169 if (parent) parent.enter(); 24170 }; 24171 if (isNode) { 24172 notify = function notify() { 24173 process.nextTick(flush); 24174 }; 24175 } else if (Observer) { 24176 var toggle = true; 24177 var node = document.createTextNode(''); 24178 new Observer(flush).observe(node, { characterData: true }); 24179 notify = function notify() { 24180 node.data = toggle = !toggle; 24181 }; 24182 } else if (Promise && Promise.resolve) { 24183 var promise = Promise.resolve(); 24184 notify = function notify() { 24185 promise.then(flush); 24186 }; 24187 } else { 24188 notify = function notify() { 24189 macrotask.call(global, flush); 24190 }; 24191 } 24192 return function (fn) { 24193 var task = { 24194 fn: fn, 24195 next: undefined 24196 }; 24197 if (last) last.next = task; 24198 if (!head) { 24199 head = task; 24200 notify(); 24201 } 24202 last = task; 24203 }; 24204}; 24205 24206/***/ }), 24207/* 105 */ 24208/***/ (function(module, exports, __w_pdfjs_require__) { 24209 24210"use strict"; 24211 24212 24213var global = __w_pdfjs_require__(5); 24214var dP = __w_pdfjs_require__(15); 24215var DESCRIPTORS = __w_pdfjs_require__(13); 24216var SPECIES = __w_pdfjs_require__(4)('species'); 24217module.exports = function (KEY) { 24218 var C = global[KEY]; 24219 if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { 24220 configurable: true, 24221 get: function get() { 24222 return this; 24223 } 24224 }); 24225}; 24226 24227/***/ }), 24228/* 106 */ 24229/***/ (function(module, exports, __w_pdfjs_require__) { 24230 24231"use strict"; 24232 24233 24234var $export = __w_pdfjs_require__(6); 24235var core = __w_pdfjs_require__(7); 24236var global = __w_pdfjs_require__(5); 24237var speciesConstructor = __w_pdfjs_require__(56); 24238var promiseResolve = __w_pdfjs_require__(59); 24239$export($export.P + $export.R, 'Promise', { 24240 'finally': function _finally(onFinally) { 24241 var C = speciesConstructor(this, core.Promise || global.Promise); 24242 var isFunction = typeof onFinally == 'function'; 24243 return this.then(isFunction ? function (x) { 24244 return promiseResolve(C, onFinally()).then(function () { 24245 return x; 24246 }); 24247 } : onFinally, isFunction ? function (e) { 24248 return promiseResolve(C, onFinally()).then(function () { 24249 throw e; 24250 }); 24251 } : onFinally); 24252 } 24253}); 24254 24255/***/ }), 24256/* 107 */ 24257/***/ (function(module, exports, __w_pdfjs_require__) { 24258 24259"use strict"; 24260 24261
vendor: 8,772 bytes, lines 24262-24558
24262var $export = __w_pdfjs_require__(6); 24263var newPromiseCapability = __w_pdfjs_require__(38); 24264var perform = __w_pdfjs_require__(58); 24265$export($export.S, 'Promise', { 24266 'try': function _try(callbackfn) { 24267 var promiseCapability = newPromiseCapability.f(this); 24268 var result = perform(callbackfn); 24269 (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); 24270 return promiseCapability.promise; 24271 } 24272}); 24273 24274/***/ }), 24275/* 108 */ 24276/***/ (function(module, exports, __w_pdfjs_require__) { 24277 24278"use strict"; 24279 24280 24281__w_pdfjs_require__(51); 24282__w_pdfjs_require__(55); 24283__w_pdfjs_require__(109); 24284__w_pdfjs_require__(120); 24285__w_pdfjs_require__(122); 24286module.exports = __w_pdfjs_require__(7).WeakMap; 24287 24288/***/ }), 24289/* 109 */ 24290/***/ (function(module, exports, __w_pdfjs_require__) { 24291 24292"use strict"; 24293 24294 24295var each = __w_pdfjs_require__(61)(0); 24296var redefine = __w_pdfjs_require__(10); 24297var meta = __w_pdfjs_require__(40); 24298var assign = __w_pdfjs_require__(113); 24299var weak = __w_pdfjs_require__(115); 24300var isObject = __w_pdfjs_require__(3); 24301var fails = __w_pdfjs_require__(14); 24302var validate = __w_pdfjs_require__(62); 24303var WEAK_MAP = 'WeakMap'; 24304var getWeak = meta.getWeak; 24305var isExtensible = Object.isExtensible; 24306var uncaughtFrozenStore = weak.ufstore; 24307var tmp = {}; 24308var InternalMap; 24309var wrapper = function wrapper(get) { 24310 return function WeakMap() { 24311 return get(this, arguments.length > 0 ? arguments[0] : undefined); 24312 }; 24313}; 24314var methods = { 24315 get: function get(key) { 24316 if (isObject(key)) { 24317 var data = getWeak(key); 24318 if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); 24319 return data ? data[this._i] : undefined; 24320 } 24321 }, 24322 set: function set(key, value) { 24323 return weak.def(validate(this, WEAK_MAP), key, value); 24324 } 24325}; 24326var $WeakMap = module.exports = __w_pdfjs_require__(116)(WEAK_MAP, wrapper, methods, weak, true, true); 24327if (fails(function () { 24328 return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; 24329})) { 24330 InternalMap = weak.getConstructor(wrapper, WEAK_MAP); 24331 assign(InternalMap.prototype, methods); 24332 meta.NEED = true; 24333 each(['delete', 'has', 'get', 'set'], function (key) { 24334 var proto = $WeakMap.prototype; 24335 var method = proto[key]; 24336 redefine(proto, key, function (a, b) { 24337 if (isObject(a) && !isExtensible(a)) { 24338 if (!this._f) this._f = new InternalMap(); 24339 var result = this._f[key](a, b); 24340 return key == 'set' ? this : result; 24341 } 24342 return method.call(this, a, b); 24343 }); 24344 }); 24345} 24346 24347/***/ }), 24348/* 110 */ 24349/***/ (function(module, exports, __w_pdfjs_require__) { 24350 24351"use strict"; 24352 24353 24354var speciesConstructor = __w_pdfjs_require__(111); 24355module.exports = function (original, length) { 24356 return new (speciesConstructor(original))(length); 24357}; 24358 24359/***/ }), 24360/* 111 */ 24361/***/ (function(module, exports, __w_pdfjs_require__) { 24362 24363"use strict"; 24364 24365 24366var isObject = __w_pdfjs_require__(3); 24367var isArray = __w_pdfjs_require__(112); 24368var SPECIES = __w_pdfjs_require__(4)('species'); 24369module.exports = function (original) { 24370 var C; 24371 if (isArray(original)) { 24372 C = original.constructor; 24373 if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; 24374 if (isObject(C)) { 24375 C = C[SPECIES]; 24376 if (C === null) C = undefined; 24377 } 24378 } 24379 return C === undefined ? Array : C; 24380}; 24381 24382/***/ }), 24383/* 112 */ 24384/***/ (function(module, exports, __w_pdfjs_require__) { 24385 24386"use strict"; 24387 24388 24389var cof = __w_pdfjs_require__(18); 24390module.exports = Array.isArray || function isArray(arg) { 24391 return cof(arg) == 'Array'; 24392}; 24393 24394/***/ }), 24395/* 113 */ 24396/***/ (function(module, exports, __w_pdfjs_require__) { 24397 24398"use strict"; 24399 24400 24401var getKeys = __w_pdfjs_require__(23); 24402var gOPS = __w_pdfjs_require__(114); 24403var pIE = __w_pdfjs_require__(34); 24404var toObject = __w_pdfjs_require__(36); 24405var IObject = __w_pdfjs_require__(29); 24406var $assign = Object.assign; 24407module.exports = !$assign || __w_pdfjs_require__(14)(function () { 24408 var A = {}; 24409 var B = {}; 24410 var S = Symbol(); 24411 var K = 'abcdefghijklmnopqrst'; 24412 A[S] = 7; 24413 K.split('').forEach(function (k) { 24414 B[k] = k; 24415 }); 24416 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; 24417}) ? function assign(target, source) { 24418 var T = toObject(target); 24419 var aLen = arguments.length; 24420 var index = 1; 24421 var getSymbols = gOPS.f; 24422 var isEnum = pIE.f; 24423 while (aLen > index) { 24424 var S = IObject(arguments[index++]); 24425 var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); 24426 var length = keys.length; 24427 var j = 0; 24428 var key; 24429 while (length > j) { 24430 if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; 24431 } 24432 } 24433 return T; 24434} : $assign; 24435 24436/***/ }), 24437/* 114 */ 24438/***/ (function(module, exports, __w_pdfjs_require__) { 24439 24440"use strict"; 24441 24442 24443exports.f = Object.getOwnPropertySymbols; 24444 24445/***/ }), 24446/* 115 */ 24447/***/ (function(module, exports, __w_pdfjs_require__) { 24448 24449"use strict"; 24450 24451 24452var redefineAll = __w_pdfjs_require__(39); 24453var getWeak = __w_pdfjs_require__(40).getWeak; 24454var anObject = __w_pdfjs_require__(8); 24455var isObject = __w_pdfjs_require__(3); 24456var anInstance = __w_pdfjs_require__(37); 24457var forOf = __w_pdfjs_require__(25); 24458var createArrayMethod = __w_pdfjs_require__(61); 24459var $has = __w_pdfjs_require__(9); 24460var validate = __w_pdfjs_require__(62); 24461var arrayFind = createArrayMethod(5); 24462var arrayFindIndex = createArrayMethod(6); 24463var id = 0; 24464var uncaughtFrozenStore = function uncaughtFrozenStore(that) { 24465 return that._l || (that._l = new UncaughtFrozenStore()); 24466}; 24467var UncaughtFrozenStore = function UncaughtFrozenStore() { 24468 this.a = []; 24469}; 24470var findUncaughtFrozen = function findUncaughtFrozen(store, key) { 24471 return arrayFind(store.a, function (it) { 24472 return it[0] === key; 24473 }); 24474}; 24475UncaughtFrozenStore.prototype = { 24476 get: function get(key) { 24477 var entry = findUncaughtFrozen(this, key); 24478 if (entry) return entry[1]; 24479 }, 24480 has: function has(key) { 24481 return !!findUncaughtFrozen(this, key); 24482 }, 24483 set: function set(key, value) { 24484 var entry = findUncaughtFrozen(this, key); 24485 if (entry) entry[1] = value;else this.a.push([key, value]); 24486 }, 24487 'delete': function _delete(key) { 24488 var index = arrayFindIndex(this.a, function (it) { 24489 return it[0] === key; 24490 }); 24491 if (~index) this.a.splice(index, 1); 24492 return !!~index; 24493 } 24494}; 24495module.exports = { 24496 getConstructor: function getConstructor(wrapper, NAME, IS_MAP, ADDER) { 24497 var C = wrapper(function (that, iterable) { 24498 anInstance(that, C, NAME, '_i'); 24499 that._t = NAME; 24500 that._i = id++; 24501 that._l = undefined; 24502 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); 24503 }); 24504 redefineAll(C.prototype, { 24505 'delete': function _delete(key) { 24506 if (!isObject(key)) return false; 24507 var data = getWeak(key); 24508 if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); 24509 return data && $has(data, this._i) && delete data[this._i]; 24510 }, 24511 has: function has(key) { 24512 if (!isObject(key)) return false; 24513 var data = getWeak(key); 24514 if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); 24515 return data && $has(data, this._i); 24516 } 24517 }); 24518 return C; 24519 }, 24520 def: function def(that, key, value) { 24521 var data = getWeak(anObject(key), true); 24522 if (data === true) uncaughtFrozenStore(that).set(key, value);else data[that._i] = value; 24523 return that; 24524 }, 24525 ufstore: uncaughtFrozenStore 24526}; 24527 24528/***/ }), 24529/* 116 */ 24530/***/ (function(module, exports, __w_pdfjs_require__) { 24531 24532"use strict"; 24533 24534 24535var global = __w_pdfjs_require__(5); 24536var $export = __w_pdfjs_require__(6); 24537var redefine = __w_pdfjs_require__(10); 24538var redefineAll = __w_pdfjs_require__(39); 24539var meta = __w_pdfjs_require__(40); 24540var forOf = __w_pdfjs_require__(25); 24541var anInstance = __w_pdfjs_require__(37); 24542var isObject = __w_pdfjs_require__(3); 24543var fails = __w_pdfjs_require__(14); 24544var $iterDetect = __w_pdfjs_require__(60); 24545var setToStringTag = __w_pdfjs_require__(24); 24546var inheritIfRequired = __w_pdfjs_require__(117); 24547module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { 24548 var Base = global[NAME]; 24549 var C = Base; 24550 var ADDER = IS_MAP ? 'set' : 'add'; 24551 var proto = C && C.prototype; 24552 var O = {}; 24553 var fixMethod = function fixMethod(KEY) { 24554 var fn = proto[KEY]; 24555 redefine(proto, KEY, KEY == 'delete' ? function (a) { 24556 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); 24557 } : KEY == 'has' ? function has(a) { 24558 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
vendor: 4,133 bytes, lines 24559-24703
24559 } : KEY == 'get' ? function get(a) { 24560 return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); 24561 } : KEY == 'add' ? function add(a) { 24562 fn.call(this, a === 0 ? 0 : a); 24563 return this; 24564 } : function set(a, b) { 24565 fn.call(this, a === 0 ? 0 : a, b); 24566 return this; 24567 }); 24568 }; 24569 if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { 24570 new C().entries().next(); 24571 }))) { 24572 C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); 24573 redefineAll(C.prototype, methods); 24574 meta.NEED = true; 24575 } else { 24576 var instance = new C(); 24577 var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; 24578 var THROWS_ON_PRIMITIVES = fails(function () { 24579 instance.has(1); 24580 }); 24581 var ACCEPT_ITERABLES = $iterDetect(function (iter) { 24582 new C(iter); 24583 }); 24584 var BUGGY_ZERO = !IS_WEAK && fails(function () { 24585 var $instance = new C(); 24586 var index = 5; 24587 while (index--) { 24588 $instance[ADDER](index, index); 24589 }return !$instance.has(-0); 24590 }); 24591 if (!ACCEPT_ITERABLES) { 24592 C = wrapper(function (target, iterable) { 24593 anInstance(target, C, NAME); 24594 var that = inheritIfRequired(new Base(), target, C); 24595 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); 24596 return that; 24597 }); 24598 C.prototype = proto; 24599 proto.constructor = C; 24600 } 24601 if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { 24602 fixMethod('delete'); 24603 fixMethod('has'); 24604 IS_MAP && fixMethod('get'); 24605 } 24606 if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); 24607 if (IS_WEAK && proto.clear) delete proto.clear; 24608 } 24609 setToStringTag(C, NAME); 24610 O[NAME] = C; 24611 $export($export.G + $export.W + $export.F * (C != Base), O); 24612 if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); 24613 return C; 24614}; 24615 24616/***/ }), 24617/* 117 */ 24618/***/ (function(module, exports, __w_pdfjs_require__) { 24619 24620"use strict"; 24621 24622 24623var isObject = __w_pdfjs_require__(3); 24624var setPrototypeOf = __w_pdfjs_require__(118).set; 24625module.exports = function (that, target, C) { 24626 var S = target.constructor; 24627 var P; 24628 if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { 24629 setPrototypeOf(that, P); 24630 } 24631 return that; 24632}; 24633 24634/***/ }), 24635/* 118 */ 24636/***/ (function(module, exports, __w_pdfjs_require__) { 24637 24638"use strict"; 24639 24640 24641var isObject = __w_pdfjs_require__(3); 24642var anObject = __w_pdfjs_require__(8); 24643var check = function check(O, proto) { 24644 anObject(O); 24645 if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); 24646}; 24647module.exports = { 24648 set: Object.setPrototypeOf || ('__proto__' in {} ? function (test, buggy, set) { 24649 try { 24650 set = __w_pdfjs_require__(11)(Function.call, __w_pdfjs_require__(119).f(Object.prototype, '__proto__').set, 2); 24651 set(test, []); 24652 buggy = !(test instanceof Array); 24653 } catch (e) { 24654 buggy = true; 24655 } 24656 return function setPrototypeOf(O, proto) { 24657 check(O, proto); 24658 if (buggy) O.__proto__ = proto;else set(O, proto); 24659 return O; 24660 }; 24661 }({}, false) : undefined), 24662 check: check 24663}; 24664 24665/***/ }), 24666/* 119 */ 24667/***/ (function(module, exports, __w_pdfjs_require__) { 24668 24669"use strict"; 24670 24671 24672var pIE = __w_pdfjs_require__(34); 24673var createDesc = __w_pdfjs_require__(28); 24674var toIObject = __w_pdfjs_require__(17); 24675var toPrimitive = __w_pdfjs_require__(46); 24676var has = __w_pdfjs_require__(9); 24677var IE8_DOM_DEFINE = __w_pdfjs_require__(45); 24678var gOPD = Object.getOwnPropertyDescriptor; 24679exports.f = __w_pdfjs_require__(13) ? gOPD : function getOwnPropertyDescriptor(O, P) { 24680 O = toIObject(O); 24681 P = toPrimitive(P, true); 24682 if (IE8_DOM_DEFINE) try { 24683 return gOPD(O, P); 24684 } catch (e) {} 24685 if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); 24686}; 24687 24688/***/ }), 24689/* 120 */ 24690/***/ (function(module, exports, __w_pdfjs_require__) { 24691 24692"use strict"; 24693 24694 24695__w_pdfjs_require__(121)('WeakMap'); 24696 24697/***/ }), 24698/* 121 */ 24699/***/ (function(module, exports, __w_pdfjs_require__) { 24700 24701"use strict"; 24702 24703
24704var $export = __w_pdfjs_require__(6); 24705module.exports = function (COLLECTION) { 24706 $export($export.S, COLLECTION, { 24707 of: function of() { 24708 var length = arguments.length; 24709 var A = Array(length); 24710 while (length--) { 24711 A[length] = arguments[length]; 24712 }return new this(A); 24713 } 24714 }); 24715}; 24716 24717/***/ }), 24718/* 122 */ 24719/***/ (function(module, exports, __w_pdfjs_require__) { 24720 24721"use strict"; 24722 24723 24724__w_pdfjs_require__(123)('WeakMap'); 24725 24726/***/ }), 24727/* 123 */ 24728/***/ (function(module, exports, __w_pdfjs_require__) { 24729 24730"use strict"; 24731 24732 24733var $export = __w_pdfjs_require__(6); 24734var aFunction = __w_pdfjs_require__(16); 24735var ctx = __w_pdfjs_require__(11); 24736var forOf = __w_pdfjs_require__(25); 24737module.exports = function (COLLECTION) { 24738 $export($export.S, COLLECTION, { 24739 from: function from(source) { 24740 var mapFn = arguments[1]; 24741 var mapping, A, n, cb; 24742 aFunction(this); 24743 mapping = mapFn !== undefined; 24744 if (mapping) aFunction(mapFn); 24745 if (source == undefined) return new this(); 24746 A = []; 24747 if (mapping) { 24748 n = 0; 24749 cb = ctx(mapFn, arguments[2], 2); 24750 forOf(source, false, function (nextItem) { 24751 A.push(cb(nextItem, n++)); 24752 }); 24753 } else { 24754 forOf(source, false, A.push, A); 24755 } 24756 return new this(A); 24757 } 24758 }); 24759}; 24760 24761/***/ }), 24762/* 124 */ 24763/***/ (function(module, exports, __w_pdfjs_require__) { 24764 24765"use strict"; 24766 24767 24768var isReadableStreamSupported = false; 24769if (typeof ReadableStream !== 'undefined') { 24770 try { 24771 new ReadableStream({ 24772 start: function start(controller) { 24773 controller.close(); 24774 } 24775 }); 24776 isReadableStreamSupported = true; 24777 } catch (e) {} 24778} 24779if (isReadableStreamSupported) { 24780 exports.ReadableStream = ReadableStream; 24781} else { 24782 exports.ReadableStream = __w_pdfjs_require__(125).ReadableStream; 24783} 24784 24785/***/ }), 24786/* 125 */ 24787/***/ (function(module, exports, __w_pdfjs_require__) { 24788 24789"use strict"; 24790 24791 24792var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 24793 24794(function (e, a) { 24795 for (var i in a) { 24796 e[i] = a[i]; 24797 } 24798})(exports, function (modules) { 24799 var installedModules = {}; 24800 function __w_pdfjs_require__(moduleId) { 24801 if (installedModules[moduleId]) return installedModules[moduleId].exports; 24802 var module = installedModules[moduleId] = { 24803 i: moduleId, 24804 l: false, 24805 exports: {} 24806 }; 24807 modules[moduleId].call(module.exports, module, module.exports, __w_pdfjs_require__); 24808 module.l = true; 24809 return module.exports; 24810 } 24811 __w_pdfjs_require__.m = modules; 24812 __w_pdfjs_require__.c = installedModules; 24813 __w_pdfjs_require__.i = function (value) { 24814 return value; 24815 }; 24816 __w_pdfjs_require__.d = function (exports, name, getter) { 24817 if (!__w_pdfjs_require__.o(exports, name)) { 24818 Object.defineProperty(exports, name, { 24819 configurable: false, 24820 enumerable: true, 24821 get: getter 24822 }); 24823 } 24824 }; 24825 __w_pdfjs_require__.n = function (module) { 24826 var getter = module && module.__esModule ? function getDefault() { 24827 return module['default']; 24828 } : function getModuleExports() { 24829 return module; 24830 }; 24831 __w_pdfjs_require__.d(getter, 'a', getter); 24832 return getter; 24833 }; 24834 __w_pdfjs_require__.o = function (object, property) { 24835 return Object.prototype.hasOwnProperty.call(object, property); 24836 }; 24837 __w_pdfjs_require__.p = ""; 24838 return __w_pdfjs_require__(__w_pdfjs_require__.s = 7); 24839}([function (module, exports, __w_pdfjs_require__) { 24840 "use strict"; 24841 24842 var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { 24843 return typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); 24844 } : function (obj) { 24845 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); 24846 }; 24847 var _require = __w_pdfjs_require__(1), 24848 assert = _require.assert; 24849 function IsPropertyKey(argument) { 24850 return typeof argument === 'string' || (typeof argument === 'undefined' ? 'undefined' : _typeof(argument)) === 'symbol'; 24851 } 24852 exports.typeIsObject = function (x) { 24853 return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x !== null || typeof x === 'function'; 24854 }; 24855 exports.createDataProperty = function (o, p, v) { 24856 assert(exports.typeIsObject(o)); 24857 Object.defineProperty(o, p, { 24858 value: v, 24859 writable: true, 24860 enumerable: true, 24861 configurable: true 24862 });
24863 }; 24864 exports.createArrayFromList = function (elements) { 24865 return elements.slice(); 24866 }; 24867 exports.ArrayBufferCopy = function (dest, destOffset, src, srcOffset, n) { 24868 new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset); 24869 }; 24870 exports.CreateIterResultObject = function (value, done) { 24871 assert(typeof done === 'boolean'); 24872 var obj = {}; 24873 Object.defineProperty(obj, 'value', { 24874 value: value, 24875 enumerable: true, 24876 writable: true, 24877 configurable: true 24878 }); 24879 Object.defineProperty(obj, 'done', { 24880 value: done, 24881 enumerable: true, 24882 writable: true, 24883 configurable: true 24884 }); 24885 return obj; 24886 }; 24887 exports.IsFiniteNonNegativeNumber = function (v) { 24888 if (Number.isNaN(v)) { 24889 return false; 24890 } 24891 if (v === Infinity) { 24892 return false; 24893 } 24894 if (v < 0) { 24895 return false; 24896 } 24897 return true; 24898 }; 24899 function Call(F, V, args) { 24900 if (typeof F !== 'function') { 24901 throw new TypeError('Argument is not a function'); 24902 } 24903 return Function.prototype.apply.call(F, V, args); 24904 } 24905 exports.InvokeOrNoop = function (O, P, args) { 24906 assert(O !== undefined); 24907 assert(IsPropertyKey(P)); 24908 assert(Array.isArray(args)); 24909 var method = O[P]; 24910 if (method === undefined) { 24911 return undefined; 24912 } 24913 return Call(method, O, args); 24914 }; 24915 exports.PromiseInvokeOrNoop = function (O, P, args) { 24916 assert(O !== undefined); 24917 assert(IsPropertyKey(P)); 24918 assert(Array.isArray(args)); 24919 try { 24920 return Promise.resolve(exports.InvokeOrNoop(O, P, args)); 24921 } catch (returnValueE) { 24922 return Promise.reject(returnValueE); 24923 } 24924 }; 24925 exports.PromiseInvokeOrPerformFallback = function (O, P, args, F, argsF) { 24926 assert(O !== undefined); 24927 assert(IsPropertyKey(P)); 24928 assert(Array.isArray(args)); 24929 assert(Array.isArray(argsF)); 24930 var method = void 0; 24931 try { 24932 method = O[P]; 24933 } catch (methodE) { 24934 return Promise.reject(methodE); 24935 } 24936 if (method === undefined) { 24937 return F.apply(null, argsF); 24938 } 24939 try { 24940 return Promise.resolve(Call(method, O, args)); 24941 } catch (e) { 24942 return Promise.reject(e); 24943 } 24944 }; 24945 exports.TransferArrayBuffer = function (O) { 24946 return O.slice(); 24947 }; 24948 exports.ValidateAndNormalizeHighWaterMark = function (highWaterMark) { 24949 highWaterMark = Number(highWaterMark); 24950 if (Number.isNaN(highWaterMark) || highWaterMark < 0) { 24951 throw new RangeError('highWaterMark property of a queuing strategy must be non-negative and non-NaN'); 24952 } 24953 return highWaterMark; 24954 }; 24955 exports.ValidateAndNormalizeQueuingStrategy = function (size, highWaterMark) { 24956 if (size !== undefined && typeof size !== 'function') { 24957 throw new TypeError('size property of a queuing strategy must be a function'); 24958 } 24959 highWaterMark = exports.ValidateAndNormalizeHighWaterMark(highWaterMark); 24960 return { 24961 size: size, 24962 highWaterMark: highWaterMark 24963 }; 24964 }; 24965}, function (module, exports, __w_pdfjs_require__) { 24966 "use strict"; 24967 24968 function rethrowAssertionErrorRejection(e) { 24969 if (e && e.constructor === AssertionError) { 24970 setTimeout(function () { 24971 throw e; 24972 }, 0); 24973 } 24974 } 24975 function AssertionError(message) { 24976 this.name = 'AssertionError'; 24977 this.message = message || ''; 24978 this.stack = new Error().stack; 24979 } 24980 AssertionError.prototype = Object.create(Error.prototype); 24981 AssertionError.prototype.constructor = AssertionError; 24982 function assert(value, message) { 24983 if (!value) { 24984 throw new AssertionError(message); 24985 } 24986 } 24987 module.exports = { 24988 rethrowAssertionErrorRejection: rethrowAssertionErrorRejection, 24989 AssertionError: AssertionError, 24990 assert: assert 24991 }; 24992}, function (module, exports, __w_pdfjs_require__) { 24993 "use strict"; 24994 24995 var _createClass = function () { 24996 function defineProperties(target, props) { 24997 for (var i = 0; i < props.length; i++) { 24998 var descriptor = props[i]; 24999 descriptor.enumerable = descriptor.enumerable || false; 25000 descriptor.configurable = true; 25001 if ("value" in descriptor) descriptor.writable = true; 25002 Object.defineProperty(target, descriptor.key, descriptor); 25003 } 25004 } 25005 return function (Constructor, protoProps, staticProps) { 25006 if (protoProps) defineProperties(Constructor.prototype, protoProps); 25007 if (staticProps) defineProperties(Constructor, staticProps); 25008 return Constructor; 25009 }; 25010 }(); 25011 function _classCallCheck(instance, Constructor) { 25012 if (!(instance instanceof Constructor)) { 25013 throw new TypeError("Cannot call a class as a function"); 25014 } 25015 } 25016 var _require = __w_pdfjs_require__(0), 25017 InvokeOrNoop = _require.InvokeOrNoop, 25018 PromiseInvokeOrNoop = _require.PromiseInvokeOrNoop, 25019 ValidateAndNormalizeQueuingStrategy = _require.ValidateAndNormalizeQueuingStrategy, 25020 typeIsObject = _require.typeIsObject; 25021 var _require2 = __w_pdfjs_require__(1), 25022 assert = _require2.assert, 25023 rethrowAssertionErrorRejection = _require2.rethrowAssertionErrorRejection; 25024 var _require3 = __w_pdfjs_require__(3), 25025 DequeueValue = _require3.DequeueValue, 25026 EnqueueValueWithSize = _require3.EnqueueValueWithSize, 25027 PeekQueueValue = _require3.PeekQueueValue, 25028 ResetQueue = _require3.ResetQueue; 25029 var WritableStream = function () { 25030 function WritableStream() { 25031 var underlyingSink = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 25032 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 25033 size = _ref.size, 25034 _ref$highWaterMark = _ref.highWaterMark, 25035 highWaterMark = _ref$highWaterMark === undefined ? 1 : _ref$highWaterMark; 25036 _classCallCheck(this, WritableStream); 25037 this._state = 'writable'; 25038 this._storedError = undefined; 25039 this._writer = undefined; 25040 this._writableStreamController = undefined; 25041 this._writeRequests = []; 25042 this._inFlightWriteRequest = undefined; 25043 this._closeRequest = undefined; 25044 this._inFlightCloseRequest = undefined; 25045 this._pendingAbortRequest = undefined; 25046 this._backpressure = false; 25047 var type = underlyingSink.type; 25048 if (type !== undefined) { 25049 throw new RangeError('Invalid type is specified'); 25050 } 25051 this._writableStreamController = new WritableStreamDefaultController(this, underlyingSink, size, highWaterMark); 25052 this._writableStreamController.__startSteps(); 25053 } 25054 _createClass(WritableStream, [{ 25055 key: 'abort', 25056 value: function abort(reason) { 25057 if (IsWritableStream(this) === false) { 25058 return Promise.reject(streamBrandCheckException('abort')); 25059 } 25060 if (IsWritableStreamLocked(this) === true) { 25061 return Promise.reject(new TypeError('Cannot abort a stream that already has a writer')); 25062 } 25063 return WritableStreamAbort(this, reason); 25064 } 25065 }, { 25066 key: 'getWriter', 25067 value: function getWriter() { 25068 if (IsWritableStream(this) === false) { 25069 throw streamBrandCheckException('getWriter'); 25070 } 25071 return AcquireWritableStreamDefaultWriter(this); 25072 } 25073 }, { 25074 key: 'locked', 25075 get: function get() { 25076 if (IsWritableStream(this) === false) { 25077 throw streamBrandCheckException('locked'); 25078 } 25079 return IsWritableStreamLocked(this); 25080 } 25081 }]); 25082 return WritableStream; 25083 }(); 25084 module.exports = { 25085 AcquireWritableStreamDefaultWriter: AcquireWritableStreamDefaultWriter, 25086 IsWritableStream: IsWritableStream, 25087 IsWritableStreamLocked: IsWritableStreamLocked, 25088 WritableStream: WritableStream, 25089 WritableStreamAbort: WritableStreamAbort, 25090 WritableStreamDefaultControllerError: WritableStreamDefaultControllerError, 25091 WritableStreamDefaultWriterCloseWithErrorPropagation: WritableStreamDefaultWriterCloseWithErrorPropagation, 25092 WritableStreamDefaultWriterRelease: WritableStreamDefaultWriterRelease, 25093 WritableStreamDefaultWriterWrite: WritableStreamDefaultWriterWrite, 25094 WritableStreamCloseQueuedOrInFlight: WritableStreamCloseQueuedOrInFlight 25095 }; 25096 function AcquireWritableStreamDefaultWriter(stream) { 25097 return new WritableStreamDefaultWriter(stream); 25098 } 25099 function IsWritableStream(x) { 25100 if (!typeIsObject(x)) { 25101 return false; 25102 } 25103 if (!Object.prototype.hasOwnProperty.call(x, '_writableStreamController')) { 25104 return false; 25105 } 25106 return true; 25107 } 25108 function IsWritableStreamLocked(stream) {
25109 assert(IsWritableStream(stream) === true, 'IsWritableStreamLocked should only be used on known writable streams'); 25110 if (stream._writer === undefined) { 25111 return false; 25112 } 25113 return true; 25114 } 25115 function WritableStreamAbort(stream, reason) { 25116 var state = stream._state; 25117 if (state === 'closed') { 25118 return Promise.resolve(undefined); 25119 } 25120 if (state === 'errored') { 25121 return Promise.reject(stream._storedError); 25122 } 25123 var error = new TypeError('Requested to abort'); 25124 if (stream._pendingAbortRequest !== undefined) { 25125 return Promise.reject(error); 25126 } 25127 assert(state === 'writable' || state === 'erroring', 'state must be writable or erroring'); 25128 var wasAlreadyErroring = false; 25129 if (state === 'erroring') { 25130 wasAlreadyErroring = true; 25131 reason = undefined; 25132 } 25133 var promise = new Promise(function (resolve, reject) { 25134 stream._pendingAbortRequest = { 25135 _resolve: resolve, 25136 _reject: reject, 25137 _reason: reason, 25138 _wasAlreadyErroring: wasAlreadyErroring 25139 }; 25140 }); 25141 if (wasAlreadyErroring === false) { 25142 WritableStreamStartErroring(stream, error); 25143 } 25144 return promise; 25145 } 25146 function WritableStreamAddWriteRequest(stream) { 25147 assert(IsWritableStreamLocked(stream) === true); 25148 assert(stream._state === 'writable'); 25149 var promise = new Promise(function (resolve, reject) { 25150 var writeRequest = { 25151 _resolve: resolve, 25152 _reject: reject 25153 }; 25154 stream._writeRequests.push(writeRequest); 25155 }); 25156 return promise; 25157 } 25158 function WritableStreamDealWithRejection(stream, error) { 25159 var state = stream._state; 25160 if (state === 'writable') { 25161 WritableStreamStartErroring(stream, error); 25162 return; 25163 } 25164 assert(state === 'erroring'); 25165 WritableStreamFinishErroring(stream); 25166 } 25167 function WritableStreamStartErroring(stream, reason) { 25168 assert(stream._storedError === undefined, 'stream._storedError === undefined'); 25169 assert(stream._state === 'writable', 'state must be writable'); 25170 var controller = stream._writableStreamController; 25171 assert(controller !== undefined, 'controller must not be undefined'); 25172 stream._state = 'erroring'; 25173 stream._storedError = reason; 25174 var writer = stream._writer; 25175 if (writer !== undefined) { 25176 WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason); 25177 } 25178 if (WritableStreamHasOperationMarkedInFlight(stream) === false && controller._started === true) { 25179 WritableStreamFinishErroring(stream); 25180 } 25181 } 25182 function WritableStreamFinishErroring(stream) { 25183 assert(stream._state === 'erroring', 'stream._state === erroring'); 25184 assert(WritableStreamHasOperationMarkedInFlight(stream) === false, 'WritableStreamHasOperationMarkedInFlight(stream) === false'); 25185 stream._state = 'errored'; 25186 stream._writableStreamController.__errorSteps(); 25187 var storedError = stream._storedError; 25188 for (var i = 0; i < stream._writeRequests.length; i++) { 25189 var writeRequest = stream._writeRequests[i]; 25190 writeRequest._reject(storedError); 25191 } 25192 stream._writeRequests = []; 25193 if (stream._pendingAbortRequest === undefined) { 25194 WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); 25195 return; 25196 } 25197 var abortRequest = stream._pendingAbortRequest; 25198 stream._pendingAbortRequest = undefined; 25199 if (abortRequest._wasAlreadyErroring === true) { 25200 abortRequest._reject(storedError); 25201 WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); 25202 return; 25203 } 25204 var promise = stream._writableStreamController.__abortSteps(abortRequest._reason); 25205 promise.then(function () { 25206 abortRequest._resolve(); 25207 WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); 25208 }, function (reason) { 25209 abortRequest._reject(reason); 25210 WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); 25211 }); 25212 } 25213 function WritableStreamFinishInFlightWrite(stream) { 25214 assert(stream._inFlightWriteRequest !== undefined); 25215 stream._inFlightWriteRequest._resolve(undefined); 25216 stream._inFlightWriteRequest = undefined; 25217 } 25218 function WritableStreamFinishInFlightWriteWithError(stream, error) { 25219 assert(stream._inFlightWriteRequest !== undefined); 25220 stream._inFlightWriteRequest._reject(error); 25221 stream._inFlightWriteRequest = undefined; 25222 assert(stream._state === 'writable' || stream._state === 'erroring'); 25223 WritableStreamDealWithRejection(stream, error); 25224 } 25225 function WritableStreamFinishInFlightClose(stream) { 25226 assert(stream._inFlightCloseRequest !== undefined); 25227 stream._inFlightCloseRequest._resolve(undefined); 25228 stream._inFlightCloseRequest = undefined; 25229 var state = stream._state; 25230 assert(state === 'writable' || state === 'erroring'); 25231 if (state === 'erroring') { 25232 stream._storedError = undefined; 25233 if (stream._pendingAbortRequest !== undefined) { 25234 stream._pendingAbortRequest._resolve(); 25235 stream._pendingAbortRequest = undefined; 25236 } 25237 } 25238 stream._state = 'closed'; 25239 var writer = stream._writer; 25240 if (writer !== undefined) { 25241 defaultWriterClosedPromiseResolve(writer); 25242 } 25243 assert(stream._pendingAbortRequest === undefined, 'stream._pendingAbortRequest === undefined'); 25244 assert(stream._storedError === undefined, 'stream._storedError === undefined'); 25245 } 25246 function WritableStreamFinishInFlightCloseWithError(stream, error) { 25247 assert(stream._inFlightCloseRequest !== undefined); 25248 stream._inFlightCloseRequest._reject(error); 25249 stream._inFlightCloseRequest = undefined; 25250 assert(stream._state === 'writable' || stream._state === 'erroring'); 25251 if (stream._pendingAbortRequest !== undefined) { 25252 stream._pendingAbortRequest._reject(error); 25253 stream._pendingAbortRequest = undefined; 25254 } 25255 WritableStreamDealWithRejection(stream, error); 25256 } 25257 function WritableStreamCloseQueuedOrInFlight(stream) { 25258 if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) { 25259 return false; 25260 } 25261 return true; 25262 } 25263 function WritableStreamHasOperationMarkedInFlight(stream) { 25264 if (stream._inFlightWriteRequest === undefined && stream._inFlightCloseRequest === undefined) { 25265 return false; 25266 } 25267 return true; 25268 } 25269 function WritableStreamMarkCloseRequestInFlight(stream) { 25270 assert(stream._inFlightCloseRequest === undefined); 25271 assert(stream._closeRequest !== undefined); 25272 stream._inFlightCloseRequest = stream._closeRequest; 25273 stream._closeRequest = undefined; 25274 } 25275 function WritableStreamMarkFirstWriteRequestInFlight(stream) { 25276 assert(stream._inFlightWriteRequest === undefined, 'there must be no pending write request'); 25277 assert(stream._writeRequests.length !== 0, 'writeRequests must not be empty'); 25278 stream._inFlightWriteRequest = stream._writeRequests.shift(); 25279 } 25280 function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) { 25281 assert(stream._state === 'errored', '_stream_.[[state]] is `"errored"`'); 25282 if (stream._closeRequest !== undefined) { 25283 assert(stream._inFlightCloseRequest === undefined); 25284 stream._closeRequest._reject(stream._storedError); 25285 stream._closeRequest = undefined; 25286 } 25287 var writer = stream._writer; 25288 if (writer !== undefined) { 25289 defaultWriterClosedPromiseReject(writer, stream._storedError); 25290 writer._closedPromise.catch(function () {}); 25291 } 25292 } 25293 function WritableStreamUpdateBackpressure(stream, backpressure) { 25294 assert(stream._state === 'writable');
25295 assert(WritableStreamCloseQueuedOrInFlight(stream) === false); 25296 var writer = stream._writer; 25297 if (writer !== undefined && backpressure !== stream._backpressure) { 25298 if (backpressure === true) { 25299 defaultWriterReadyPromiseReset(writer); 25300 } else { 25301 assert(backpressure === false); 25302 defaultWriterReadyPromiseResolve(writer); 25303 } 25304 } 25305 stream._backpressure = backpressure; 25306 } 25307 var WritableStreamDefaultWriter = function () { 25308 function WritableStreamDefaultWriter(stream) { 25309 _classCallCheck(this, WritableStreamDefaultWriter); 25310 if (IsWritableStream(stream) === false) { 25311 throw new TypeError('WritableStreamDefaultWriter can only be constructed with a WritableStream instance'); 25312 } 25313 if (IsWritableStreamLocked(stream) === true) { 25314 throw new TypeError('This stream has already been locked for exclusive writing by another writer'); 25315 } 25316 this._ownerWritableStream = stream; 25317 stream._writer = this; 25318 var state = stream._state; 25319 if (state === 'writable') { 25320 if (WritableStreamCloseQueuedOrInFlight(stream) === false && stream._backpressure === true) { 25321 defaultWriterReadyPromiseInitialize(this); 25322 } else { 25323 defaultWriterReadyPromiseInitializeAsResolved(this); 25324 } 25325 defaultWriterClosedPromiseInitialize(this); 25326 } else if (state === 'erroring') { 25327 defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError); 25328 this._readyPromise.catch(function () {}); 25329 defaultWriterClosedPromiseInitialize(this); 25330 } else if (state === 'closed') { 25331 defaultWriterReadyPromiseInitializeAsResolved(this); 25332 defaultWriterClosedPromiseInitializeAsResolved(this); 25333 } else { 25334 assert(state === 'errored', 'state must be errored'); 25335 var storedError = stream._storedError; 25336 defaultWriterReadyPromiseInitializeAsRejected(this, storedError); 25337 this._readyPromise.catch(function () {}); 25338 defaultWriterClosedPromiseInitializeAsRejected(this, storedError); 25339 this._closedPromise.catch(function () {}); 25340 } 25341 } 25342 _createClass(WritableStreamDefaultWriter, [{ 25343 key: 'abort', 25344 value: function abort(reason) { 25345 if (IsWritableStreamDefaultWriter(this) === false) { 25346 return Promise.reject(defaultWriterBrandCheckException('abort')); 25347 } 25348 if (this._ownerWritableStream === undefined) { 25349 return Promise.reject(defaultWriterLockException('abort')); 25350 } 25351 return WritableStreamDefaultWriterAbort(this, reason); 25352 } 25353 }, { 25354 key: 'close', 25355 value: function close() { 25356 if (IsWritableStreamDefaultWriter(this) === false) { 25357 return Promise.reject(defaultWriterBrandCheckException('close')); 25358 } 25359 var stream = this._ownerWritableStream; 25360 if (stream === undefined) { 25361 return Promise.reject(defaultWriterLockException('close')); 25362 } 25363 if (WritableStreamCloseQueuedOrInFlight(stream) === true) { 25364 return Promise.reject(new TypeError('cannot close an already-closing stream')); 25365 } 25366 return WritableStreamDefaultWriterClose(this); 25367 } 25368 }, { 25369 key: 'releaseLock', 25370 value: function releaseLock() { 25371 if (IsWritableStreamDefaultWriter(this) === false) { 25372 throw defaultWriterBrandCheckException('releaseLock'); 25373 } 25374 var stream = this._ownerWritableStream; 25375 if (stream === undefined) { 25376 return; 25377 } 25378 assert(stream._writer !== undefined); 25379 WritableStreamDefaultWriterRelease(this); 25380 } 25381 }, { 25382 key: 'write', 25383 value: function write(chunk) { 25384 if (IsWritableStreamDefaultWriter(this) === false) { 25385 return Promise.reject(defaultWriterBrandCheckException('write')); 25386 } 25387 if (this._ownerWritableStream === undefined) { 25388 return Promise.reject(defaultWriterLockException('write to')); 25389 } 25390 return WritableStreamDefaultWriterWrite(this, chunk); 25391 } 25392 }, { 25393 key: 'closed', 25394 get: function get() { 25395 if (IsWritableStreamDefaultWriter(this) === false) { 25396 return Promise.reject(defaultWriterBrandCheckException('closed')); 25397 } 25398 return this._closedPromise; 25399 } 25400 }, { 25401 key: 'desiredSize', 25402 get: function get() { 25403 if (IsWritableStreamDefaultWriter(this) === false) { 25404 throw defaultWriterBrandCheckException('desiredSize'); 25405 } 25406 if (this._ownerWritableStream === undefined) { 25407 throw defaultWriterLockException('desiredSize'); 25408 } 25409 return WritableStreamDefaultWriterGetDesiredSize(this); 25410 } 25411 }, { 25412 key: 'ready', 25413 get: function get() { 25414 if (IsWritableStreamDefaultWriter(this) === false) { 25415 return Promise.reject(defaultWriterBrandCheckException('ready')); 25416 } 25417 return this._readyPromise; 25418 } 25419 }]); 25420 return WritableStreamDefaultWriter; 25421 }(); 25422 function IsWritableStreamDefaultWriter(x) { 25423 if (!typeIsObject(x)) { 25424 return false; 25425 } 25426 if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) { 25427 return false; 25428 } 25429 return true; 25430 } 25431 function WritableStreamDefaultWriterAbort(writer, reason) { 25432 var stream = writer._ownerWritableStream; 25433 assert(stream !== undefined); 25434 return WritableStreamAbort(stream, reason); 25435 } 25436 function WritableStreamDefaultWriterClose(writer) { 25437 var stream = writer._ownerWritableStream; 25438 assert(stream !== undefined); 25439 var state = stream._state; 25440 if (state === 'closed' || state === 'errored') { 25441 return Promise.reject(new TypeError('The stream (in ' + state
25441+ ' state) is not in the writable state and cannot be closed')); 25442 } 25443 assert(state === 'writable' || state === 'erroring'); 25444 assert(WritableStreamCloseQueuedOrInFlight(stream) === false); 25445 var promise = new Promise(function (resolve, reject) { 25446 var closeRequest = { 25447 _resolve: resolve, 25448 _reject: reject 25449 }; 25450 stream._closeRequest = closeRequest; 25451 }); 25452 if (stream._backpressure === true && state === 'writable') { 25453 defaultWriterReadyPromiseResolve(writer); 25454 } 25455 WritableStreamDefaultControllerClose(stream._writableStreamController); 25456 return promise; 25457 } 25458 function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) { 25459 var stream = writer._ownerWritableStream; 25460 assert(stream !== undefined); 25461 var state = stream._state; 25462 if (WritableStreamCloseQueuedOrInFlight(stream) === true || state === 'closed') { 25463 return Promise.resolve(); 25464 } 25465 if (state === 'errored') { 25466 return Promise.reject(stream._storedError); 25467 } 25468 assert(state === 'writable' || state === 'erroring'); 25469 return WritableStreamDefaultWriterClose(writer); 25470 } 25471 function WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) { 25472 if (writer._closedPromiseState === 'pending') { 25473 defaultWriterClosedPromiseReject(writer, error); 25474 } else { 25475 defaultWriterClosedPromiseResetToRejected(writer, error); 25476 } 25477 writer._closedPromise.catch(function () {}); 25478 } 25479 function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) { 25480 if (writer._readyPromiseState === 'pending') { 25481 defaultWriterReadyPromiseReject(writer, error); 25482 } else { 25483 defaultWriterReadyPromiseResetToRejected(writer, error); 25484 } 25485 writer._readyPromise.catch(function () {}); 25486 } 25487 function WritableStreamDefaultWriterGetDesiredSize(writer) { 25488 var stream = writer._ownerWritableStream; 25489 var state = stream._state; 25490 if (state === 'errored' || state === 'erroring') { 25491 return null; 25492 } 25493 if (state === 'closed') { 25494 return 0; 25495 } 25496 return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController); 25497 } 25498 function WritableStreamDefaultWriterRelease(writer) { 25499 var stream = writer._ownerWritableStream; 25500 assert(stream !== undefined); 25501 assert(stream._writer === writer); 25502 var releasedError = new TypeError('Writer was released and can no longer be used to monitor the stream\'s closedness'); 25503 WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError); 25504 WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError); 25505 stream._writer = undefined; 25506 writer._ownerWritableStream = undefined; 25507 } 25508 function WritableStreamDefaultWriterWrite(writer, chunk) { 25509 var stream = writer._ownerWritableStream; 25510 assert(stream !== undefined); 25511 var controller = stream._writableStreamController; 25512 var chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk); 25513 if (stream !== writer._ownerWritableStream) { 25514 return Promise.reject(defaultWriterLockException('write to')); 25515 } 25516 var state = stream._state; 25517 if (state === 'errored') { 25518 return Promise.reject(stream._storedError); 25519 } 25520 if (WritableStreamCloseQueuedOrInFlight(stream) === true || state === 'closed') { 25521 return Promise.reject(new TypeError('The stream is closing or closed and cannot be written to')); 25522 } 25523 if (state === 'erroring') { 25524 return Promise.reject(stream._storedError); 25525 } 25526 assert(state === 'writable'); 25527 var promise = WritableStreamAddWriteRequest(stream); 25528 WritableStreamDefaultControllerWrite(controller, chunk, chunkSize); 25529 return promise; 25530 } 25531 var WritableStreamDefaultController = function () { 25532 function WritableStreamDefaultController(stream, underlyingSink, size, highWaterMark) { 25533 _classCallCheck(this, WritableStreamDefaultController); 25534 if (IsWritableStream(stream) === false) { 25535 throw new TypeError('WritableStreamDefaultController can only be constructed with a WritableStream instance'); 25536 } 25537 if (stream._writableStreamController !== undefined) { 25538 throw new TypeError('WritableStreamDefaultController instances can only be created by the WritableStream constructor'); 25539 } 25540 this._controlledWritableStream = stream; 25541 this._underlyingSink = underlyingSink; 25542 this._queue = undefined; 25543 this._queueTotalSize = undefined; 25544 ResetQueue(this); 25545 this._started = false; 25546 var normalizedStrategy = ValidateAndNormalizeQueuingStrategy(size, highWaterMark); 25547 this._strategySize = normalizedStrategy.size; 25548 this._strategyHWM = normalizedStrategy.highWaterMark; 25549 var backpressure = WritableStreamDefaultControllerGetBackpressure(this); 25550 WritableStreamUpdateBackpressure(stream, backpressure); 25551 } 25552 _createClass(WritableStreamDefaultController, [{ 25553 key: 'error', 25554 value: function error(e) { 25555 if (IsWritableStreamDefaultController(this) === false) { 25556 throw new TypeError('WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController'); 25557 } 25558 var state = this._controlledWritableStream._state; 25559 if (state !== 'writable') { 25560 return; 25561 } 25562 WritableStreamDefaultControllerError(this, e); 25563 } 25564 }, { 25565 key: '__abortSteps', 25566 value: function __abortSteps(reason) { 25567 return PromiseInvokeOrNoop(this._underlyingSink, 'abort', [reason]); 25568 } 25569 }, { 25570 key: '__errorSteps', 25571 value: function __errorSteps() { 25572 ResetQueue(this); 25573 } 25574 }, { 25575 key: '__startSteps', 25576 value: function __startSteps() { 25577 var _this = this; 25578 var startResult = InvokeOrNoop(this._underlyingSink, 'start', [this]); 25579 var stream = this._controlledWritableStream; 25580 Promise.resolve(startResult).then(function () { 25581 assert(stream._state === 'writable' || stream._state === 'erroring'); 25582 _this._started = true; 25583 WritableStreamDefaultControllerAdvanceQueueIfNeeded(_this); 25584 }, function (r) { 25585 assert(stream._state === 'writable' || stream._state === 'erroring'); 25586 _this._started = true; 25587 WritableStreamDealWithRejection(stream, r); 25588 }).catch(rethrowAssertionErrorRejection); 25589 } 25590 }]); 25591 return WritableStreamDefaultController; 25592 }(); 25593 function WritableStreamDefaultControllerClose(controller) { 25594 EnqueueValueWithSize(controller, 'close', 0); 25595 WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); 25596 } 25597 function WritableStreamDefaultControllerGetChunkSize(controller, chunk) { 25598 var strategySize = controller._strategySize; 25599 if (strategySize === undefined) { 25600 return 1; 25601 } 25602 try { 25603 return strategySize(chunk);
25604 } catch (chunkSizeE) { 25605 WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE); 25606 return 1; 25607 } 25608 } 25609 function WritableStreamDefaultControllerGetDesiredSize(controller) { 25610 return controller._strategyHWM - controller._queueTotalSize; 25611 } 25612 function WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) { 25613 var writeRecord = { chunk: chunk }; 25614 try { 25615 EnqueueValueWithSize(controller, writeRecord, chunkSize); 25616 } catch (enqueueE) { 25617 WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE); 25618 return; 25619 } 25620 var stream = controller._controlledWritableStream; 25621 if (WritableStreamCloseQueuedOrInFlight(stream) === false && stream._state === 'writable') { 25622 var backpressure = WritableStreamDefaultControllerGetBackpressure(controller); 25623 WritableStreamUpdateBackpressure(stream, backpressure); 25624 } 25625 WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); 25626 } 25627 function IsWritableStreamDefaultController(x) { 25628 if (!typeIsObject(x)) { 25629 return false; 25630 } 25631 if (!Object.prototype.hasOwnProperty.call(x, '_underlyingSink')) { 25632 return false; 25633 } 25634 return true; 25635 } 25636 function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) { 25637 var stream = controller._controlledWritableStream; 25638 if (controller._started === false) { 25639 return; 25640 } 25641 if (stream._inFlightWriteRequest !== undefined) { 25642 return; 25643 } 25644 var state = stream._state; 25645 if (state === 'closed' || state === 'errored') { 25646 return; 25647 } 25648 if (state === 'erroring') { 25649 WritableStreamFinishErroring(stream); 25650 return; 25651 } 25652 if (controller._queue.length === 0) { 25653 return; 25654 } 25655 var writeRecord = PeekQueueValue(controller); 25656 if (writeRecord === 'close') { 25657 WritableStreamDefaultControllerProcessClose(controller); 25658 } else { 25659 WritableStreamDefaultControllerProcessWrite(controller, writeRecord.chunk); 25660 } 25661 } 25662 function WritableStreamDefaultControllerErrorIfNeeded(controller, error) { 25663 if (controller._controlledWritableStream._state === 'writable') { 25664 WritableStreamDefaultControllerError(controller, error); 25665 } 25666 } 25667 function WritableStreamDefaultControllerProcessClose(controller) { 25668 var stream = controller._controlledWritableStream; 25669 WritableStreamMarkCloseRequestInFlight(stream); 25670 DequeueValue(controller); 25671 assert(controller._queue.length === 0, 'queue must be empty once the final write record is dequeued'); 25672 var sinkClosePromise = PromiseInvokeOrNoop(controller._underlyingSink, 'close', []); 25673 sinkClosePromise.then(function () { 25674 WritableStreamFinishInFlightClose(stream); 25675 }, function (reason) { 25676 WritableStreamFinishInFlightCloseWithError(stream, reason); 25677 }).catch(rethrowAssertionErrorRejection); 25678 } 25679 function WritableStreamDefaultControllerProcessWrite(controller, chunk) { 25680 var stream = controller._controlledWritableStream; 25681 WritableStreamMarkFirstWriteRequestInFlight(stream); 25682 var sinkWritePromise = PromiseInvokeOrNoop(controller._underlyingSink, 'write', [chunk, controller]); 25683 sinkWritePromise.then(function () { 25684 WritableStreamFinishInFlightWrite(stream); 25685 var state = stream._state; 25686 assert(state === 'writable' || state === 'erroring'); 25687 DequeueValue(controller); 25688 if (WritableStreamCloseQueuedOrInFlight(stream) === false && state === 'writable') { 25689 var backpressure = WritableStreamDefaultControllerGetBackpressure(controller); 25690 WritableStreamUpdateBackpressure(stream, backpressure); 25691 } 25692 WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); 25693 }, function (reason) { 25694 WritableStreamFinishInFlightWriteWithError(stream, reason); 25695 }).catch(rethrowAssertionErrorRejection); 25696 } 25697 function WritableStreamDefaultControllerGetBackpressure(controller) { 25698 var desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller); 25699 return desiredSize <= 0; 25700 } 25701 function WritableStreamDefaultControllerError(controller, error) { 25702 var stream = controller._controlledWritableStream; 25703 assert(stream._state === 'writable'); 25704 WritableStreamStartErroring(stream, error); 25705 } 25706 function streamBrandCheckException(name) { 25707 return new TypeError('WritableStream.prototype.' + name + ' can only be used on a WritableStream'); 25708 } 25709 function defaultWriterBrandCheckException(name) { 25710 return new TypeError('WritableStreamDefaultWriter.prototype.' + name + ' can only be used on a WritableStreamDefaultWriter'); 25711 } 25712 function defaultWriterLockException(name) { 25713 return new TypeError('Cannot ' + name + ' a stream using a released writer'); 25714 } 25715 function defaultWriterClosedPromiseInitialize(writer) { 25716 writer._closedPromise = new Promise(function (resolve, reject) { 25717 writer._closedPromise_resolve = resolve; 25718 writer._closedPromise_reject = reject;
vendor: 6,075 bytes, lines 25719-25835
25719 writer._closedPromiseState = 'pending'; 25720 }); 25721 } 25722 function defaultWriterClosedPromiseInitializeAsRejected(writer, reason) { 25723 writer._closedPromise = Promise.reject(reason); 25724 writer._closedPromise_resolve = undefined; 25725 writer._closedPromise_reject = undefined; 25726 writer._closedPromiseState = 'rejected'; 25727 } 25728 function defaultWriterClosedPromiseInitializeAsResolved(writer) { 25729 writer._closedPromise = Promise.resolve(undefined); 25730 writer._closedPromise_resolve = undefined; 25731 writer._closedPromise_reject = undefined; 25732 writer._closedPromiseState = 'resolved'; 25733 } 25734 function defaultWriterClosedPromiseReject(writer, reason) { 25735 assert(writer._closedPromise_resolve !== undefined, 'writer._closedPromise_resolve !== undefined'); 25736 assert(writer._closedPromise_reject !== undefined, 'writer._closedPromise_reject !== undefined'); 25737 assert(writer._closedPromiseState === 'pending', 'writer._closedPromiseState is pending'); 25738 writer._closedPromise_reject(reason); 25739 writer._closedPromise_resolve = undefined; 25740 writer._closedPromise_reject = undefined; 25741 writer._closedPromiseState = 'rejected'; 25742 } 25743 function defaultWriterClosedPromiseResetToRejected(writer, reason) { 25744 assert(writer._closedPromise_resolve === undefined, 'writer._closedPromise_resolve === undefined'); 25745 assert(writer._closedPromise_reject === undefined, 'writer._closedPromise_reject === undefined'); 25746 assert(writer._closedPromiseState !== 'pending', 'writer._closedPromiseState is not pending'); 25747 writer._closedPromise = Promise.reject(reason); 25748 writer._closedPromiseState = 'rejected'; 25749 } 25750 function defaultWriterClosedPromiseResolve(writer) { 25751 assert(writer._closedPromise_resolve !== undefined, 'writer._closedPromise_resolve !== undefined'); 25752 assert(writer._closedPromise_reject !== undefined, 'writer._closedPromise_reject !== undefined'); 25753 assert(writer._closedPromiseState === 'pending', 'writer._closedPromiseState is pending'); 25754 writer._closedPromise_resolve(undefined); 25755 writer._closedPromise_resolve = undefined; 25756 writer._closedPromise_reject = undefined; 25757 writer._closedPromiseState = 'resolved'; 25758 } 25759 function defaultWriterReadyPromiseInitialize(writer) { 25760 writer._readyPromise = new Promise(function (resolve, reject) { 25761 writer._readyPromise_resolve = resolve; 25762 writer._readyPromise_reject = reject; 25763 }); 25764 writer._readyPromiseState = 'pending'; 25765 } 25766 function defaultWriterReadyPromiseInitializeAsRejected(writer, reason) { 25767 writer._readyPromise = Promise.reject(reason); 25768 writer._readyPromise_resolve = undefined; 25769 writer._readyPromise_reject = undefined; 25770 writer._readyPromiseState = 'rejected'; 25771 } 25772 function defaultWriterReadyPromiseInitializeAsResolved(writer) { 25773 writer._readyPromise = Promise.resolve(undefined); 25774 writer._readyPromise_resolve = undefined; 25775 writer._readyPromise_reject = undefined; 25776 writer._readyPromiseState = 'fulfilled'; 25777 } 25778 function defaultWriterReadyPromiseReject(writer, reason) { 25779 assert(writer._readyPromise_resolve !== undefined, 'writer._readyPromise_resolve !== undefined'); 25780 assert(writer._readyPromise_reject !== undefined, 'writer._readyPromise_reject !== undefined'); 25781 writer._readyPromise_reject(reason); 25782 writer._readyPromise_resolve = undefined; 25783 writer._readyPromise_reject = undefined; 25784 writer._readyPromiseState = 'rejected'; 25785 } 25786 function defaultWriterReadyPromiseReset(writer) { 25787 assert(writer._readyPromise_resolve === undefined, 'writer._readyPromise_resolve === undefined'); 25788 assert(writer._readyPromise_reject === undefined, 'writer._readyPromise_reject === undefined'); 25789 writer._readyPromise = new Promise(function (resolve, reject) { 25790 writer._readyPromise_resolve = resolve; 25791 writer._readyPromise_reject = reject; 25792 }); 25793 writer._readyPromiseState = 'pending'; 25794 } 25795 function defaultWriterReadyPromiseResetToRejected(writer, reason) { 25796 assert(writer._readyPromise_resolve === undefined, 'writer._readyPromise_resolve === undefined'); 25797 assert(writer._readyPromise_reject === undefined, 'writer._readyPromise_reject === undefined'); 25798 writer._readyPromise = Promise.reject(reason); 25799 writer._readyPromiseState = 'rejected'; 25800 } 25801 function defaultWriterReadyPromiseResolve(writer) { 25802 assert(writer._readyPromise_resolve !== undefined, 'writer._readyPromise_resolve !== undefined'); 25803 assert(writer._readyPromise_reject !== undefined, 'writer._readyPromise_reject !== undefined'); 25804 writer._readyPromise_resolve(undefined); 25805 writer._readyPromise_resolve = undefined; 25806 writer._readyPromise_reject = undefined; 25807 writer._readyPromiseState = 'fulfilled'; 25808 } 25809}, function (module, exports, __w_pdfjs_require__) { 25810 "use strict"; 25811 25812 var _require = __w_pdfjs_require__(0), 25813 IsFiniteNonNegativeNumber = _require.IsFiniteNonNegativeNumber; 25814 var _require2 = __w_pdfjs_require__(1), 25815 assert = _require2.assert; 25816 exports.DequeueValue = function (container) { 25817 assert('_queue' in container && '_queueTotalSize' in container, 'Spec-level failure: DequeueValue should only be used on containers with [[queue]] and [[queueTotalSize]].'); 25818 assert(container._queue.length > 0, 'Spec-level failure: should never dequeue from an empty queue.'); 25819 var pair = container._queue.shift(); 25820 container._queueTotalSize -= pair.size; 25821 if (container._queueTotalSize < 0) { 25822 container._queueTotalSize = 0; 25823 } 25824 return pair.value; 25825 }; 25826 exports.EnqueueValueWithSize = function (container, value, size) { 25827 assert('_queue' in container && '_queueTotalSize' in container, 'Spec-level failure: EnqueueValueWithSize should only be used on containers with [[queue]] and ' + '[[queueTotalSize]].'); 25828 size = Number(size); 25829 if (!IsFiniteNonNegativeNumber(size)) { 25830 throw new RangeError('Size must be a finite, non-NaN, non-negative number.'); 25831 } 25832 container._queue.push({ 25833 value: value, 25834 size: size 25835 });
25836 container._queueTotalSize += size; 25837 }; 25838 exports.PeekQueueValue = function (container) { 25839 assert('_queue' in container && '_queueTotalSize' in container, 'Spec-level failure: PeekQueueValue should only be used on containers with [[queue]] and [[queueTotalSize]].'); 25840 assert(container._queue.length > 0, 'Spec-level failure: should never peek at an empty queue.'); 25841 var pair = container._queue[0]; 25842 return pair.value; 25843 }; 25844 exports.ResetQueue = function (container) { 25845 assert('_queue' in container && '_queueTotalSize' in container, 'Spec-level failure: ResetQueue should only be used on containers with [[queue]] and [[queueTotalSize]].'); 25846 container._queue = []; 25847 container._queueTotalSize = 0; 25848 }; 25849}, function (module, exports, __w_pdfjs_require__) { 25850 "use strict"; 25851 25852 var _createClass = function () { 25853 function defineProperties(target, props) { 25854 for (var i = 0; i < props.length; i++) { 25855 var descriptor = props[i]; 25856 descriptor.enumerable = descriptor.enumerable || false; 25857 descriptor.configurable = true; 25858 if ("value" in descriptor) descriptor.writable = true; 25859 Object.defineProperty(target, descriptor.key, descriptor); 25860 } 25861 } 25862 return function (Constructor, protoProps, staticProps) { 25863 if (protoProps) defineProperties(Constructor.prototype, protoProps); 25864 if (staticProps) defineProperties(Constructor, staticProps); 25865 return Constructor; 25866 }; 25867 }(); 25868 function _classCallCheck(instance, Constructor) { 25869 if (!(instance instanceof Constructor)) { 25870 throw new TypeError("Cannot call a class as a function"); 25871 } 25872 } 25873 var _require = __w_pdfjs_require__(0), 25874 ArrayBufferCopy = _require.ArrayBufferCopy, 25875 CreateIterResultObject = _require.CreateIterResultObject, 25876 IsFiniteNonNegativeNumber = _require.IsFiniteNonNegativeNumber, 25877 InvokeOrNoop = _require.InvokeOrNoop, 25878 PromiseInvokeOrNoop = _require.PromiseInvokeOrNoop, 25879 TransferArrayBuffer = _require.TransferArrayBuffer, 25880 ValidateAndNormalizeQueuingStrategy = _require.ValidateAndNormalizeQueuingStrategy, 25881 ValidateAndNormalizeHighWaterMark = _require.ValidateAndNormalizeHighWaterMark; 25882 var _require2 = __w_pdfjs_require__(0), 25883 createArrayFromList = _require2.createArrayFromList, 25884 createDataProperty = _require2.createDataProperty, 25885 typeIsObject = _require2.typeIsObject; 25886 var _require3 = __w_pdfjs_require__(1), 25887 assert = _require3.assert, 25888 rethrowAssertionErrorRejection = _require3.rethrowAssertionErrorRejection; 25889 var _require4 = __w_pdfjs_require__(3), 25890 DequeueValue = _require4.DequeueValue, 25891 EnqueueValueWithSize = _require4.EnqueueValueWithSize, 25892 ResetQueue = _require4.ResetQueue; 25893 var _require5 = __w_pdfjs_require__(2), 25894 AcquireWritableStreamDefaultWriter = _require5.AcquireWritableStreamDefaultWriter, 25895 IsWritableStream = _require5.IsWritableStream, 25896 IsWritableStreamLocked = _require5.IsWritableStreamLocked, 25897 WritableStreamAbort = _require5.WritableStreamAbort, 25898 WritableStreamDefaultWriterCloseWithErrorPropagation = _require5.WritableStreamDefaultWriterCloseWithErrorPropagation, 25899 WritableStreamDefaultWriterRelease = _require5.WritableStreamDefaultWriterRelease, 25900 WritableStreamDefaultWriterWrite = _require5.WritableStreamDefaultWriterWrite, 25901 WritableStreamCloseQueuedOrInFlight = _require5.WritableStreamCloseQueuedOrInFlight; 25902 var ReadableStream = function () { 25903 function ReadableStream() { 25904 var underlyingSource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 25905 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 25906 size = _ref.size, 25907 highWaterMark = _ref.highWaterMark; 25908 _classCallCheck(this, ReadableStream); 25909 this._state = 'readable'; 25910 this._reader = undefined; 25911 this._storedError = undefined; 25912 this._disturbed = false; 25913 this._readableStreamController = undefined; 25914 var type = underlyingSource.type; 25915 var typeString = String(type); 25916 if (typeString === 'bytes') { 25917 if (highWaterMark === undefined) { 25918 highWaterMark = 0; 25919 } 25920 this._readableStreamController = new ReadableByteStreamController(this, underlyingSource, highWaterMark); 25921 } else if (type === undefined) { 25922 if (highWaterMark === undefined) { 25923 highWaterMark = 1; 25924 } 25925 this._readableStreamController = new ReadableStreamDefaultController(this, underlyingSource, size, highWaterMark); 25926 } else { 25927 throw new RangeError('Invalid type is specified'); 25928 } 25929 } 25930 _createClass(ReadableStream, [{ 25931 key: 'cancel', 25932 value: function cancel(reason) { 25933 if (IsReadableStream(this) === false) { 25934 return Promise.reject(streamBrandCheckException('cancel')); 25935 } 25936 if (IsReadableStreamLocked(this) === true) { 25937 return Promise.reject(new TypeError('Cannot cancel a stream that already has a reader')); 25938 } 25939 return ReadableStreamCancel(this, reason); 25940 } 25941 }, { 25942 key: 'getReader', 25943 value: function getReader() { 25944 var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, 25945 mode = _ref2.mode; 25946 if (IsReadableStream(this) === false) { 25947 throw streamBrandCheckException('getReader'); 25948 } 25949 if (mode === undefined) { 25950 return AcquireReadableStreamDefaultReader(this); 25951 } 25952 mode = String(mode); 25953 if (mode === 'byob') { 25954 return AcquireReadableStreamBYOBReader(this); 25955 } 25956 throw new RangeError('Invalid mode is specified'); 25957 } 25958 }, { 25959 key: 'pipeThrough', 25960 value: function pipeThrough(_ref3, options) { 25961 var writable = _ref3.writable, 25962 readable = _ref3.readable; 25963 var promise = this.pipeTo(writable, options); 25964 ifIsObjectAndHasAPromiseIsHandledInternalSlotSetPromiseIsHandledToTrue(promise); 25965 return readable; 25966 } 25967 }, { 25968 key: 'pipeTo', 25969 value: function pipeTo(dest) { 25970 var _this = this; 25971 var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 25972 preventClose = _ref4.preventClose, 25973 preventAbort = _ref4.preventAbort, 25974 preventCancel = _ref4.preventCancel; 25975 if (IsReadableStream(this) === false) { 25976 return Promise.reject(streamBrandCheckException('pipeTo')); 25977 } 25978 if (IsWritableStream(dest) === false) { 25979 return Promise.reject(new TypeError('ReadableStream.prototype.pipeTo\'s first argument must be a WritableStream')); 25980 } 25981 preventClose = Boolean(preventClose); 25982 preventAbort = Boolean(preventAbort); 25983 preventCancel = Boolean(preventCancel); 25984 if (IsReadableStreamLocked(this) === true) { 25985 return Promise.reject(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream')); 25986 } 25987 if (IsWritableStreamLocked(dest) === true) { 25988 return Promise.reject(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream')); 25989 } 25990 var reader = AcquireReadableStreamDefaultReader(this); 25991 var writer = AcquireWritableStreamDefaultWriter(dest); 25992 var shuttingDown = false; 25993 var currentWrite = Promise.resolve(); 25994 return new Promise(function (resolve, reject) { 25995 function pipeLoop() { 25996 currentWrite = Promise.resolve(); 25997 if (shuttingDown === true) { 25998 return Promise.resolve(); 25999 } 26000 return writer._readyPromise.then(function () { 26001 return ReadableStreamDefaultReaderRead(reader).then(function (_ref5) { 26002 var value = _ref5.value, 26003 done = _ref5.done; 26004 if (done === true) { 26005 return; 26006 } 26007 currentWrite = WritableStreamDefaultWriterWrite(writer, value).cat
26007ch(function () {}); 26008 }); 26009 }).then(pipeLoop); 26010 } 26011 isOrBecomesErrored(_this, reader._closedPromise, function (storedError) { 26012 if (preventAbort === false) { 26013 shutdownWithAction(function () { 26014 return WritableStreamAbort(dest, storedError); 26015 }, true, storedError); 26016 } else { 26017 shutdown(true, storedError); 26018 } 26019 }); 26020 isOrBecomesErrored(dest, writer._closedPromise, function (storedError) { 26021 if (preventCancel === false) { 26022 shutdownWithAction(function () { 26023 return ReadableStreamCancel(_this, storedError); 26024 }, true, storedError); 26025 } else { 26026 shutdown(true, storedError); 26027 } 26028 }); 26029 isOrBecomesClosed(_this, reader._closedPromise, function () { 26030 if (preventClose === false) { 26031 shutdownWithAction(function () { 26032 return WritableStreamDefaultWriterCloseWithErrorPropagation(writer); 26033 }); 26034 } else { 26035 shutdown(); 26036 } 26037 }); 26038 if (WritableStreamCloseQueuedOrInFlight(dest) === true || dest._state === 'closed') { 26039 var destClosed = new TypeError('the destination writable stream closed before all data could be piped to it'); 26040 if (preventCancel === false) { 26041 shutdownWithAction(function () { 26042 return ReadableStreamCancel(_this, destClosed); 26043 }, true, destClosed); 26044 } else { 26045 shutdown(true, destClosed); 26046 } 26047 } 26048 pipeLoop().catch(function (err) { 26049 currentWrite = Promise.resolve(); 26050 rethrowAssertionErrorRejection(err); 26051 }); 26052 function waitForWritesToFinish() { 26053 var oldCurrentWrite = currentWrite; 26054 return currentWrite.then(function () { 26055 return oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined; 26056 }); 26057 } 26058 function isOrBecomesErrored(stream, promise, action) { 26059 if (stream._state === 'errored') { 26060 action(stream._storedError); 26061 } else { 26062 promise.catch(action).catch(rethrowAssertionErrorRejection); 26063 } 26064 } 26065 function isOrBecomesClosed(stream, promise, action) { 26066 if (stream._state === 'closed') { 26067 action(); 26068 } else { 26069 promise.then(action).catch(rethrowAssertionErrorRejection); 26070 } 26071 } 26072 function shutdownWithAction(action, originalIsError, originalError) { 26073 if (shuttingDown === true) { 26074 return; 26075 } 26076 shuttingDown = true; 26077 if (dest._state === 'writable' && WritableStreamCloseQueuedOrInFlight(dest) === false) { 26078 waitForWritesToFinish().then(doTheRest); 26079 } else { 26080 doTheRest(); 26081 } 26082 function doTheRest() { 26083 action().then(function () { 26084 return finalize(originalIsError, originalError); 26085 }, function (newError) { 26086 return finalize(true, newError); 26087 }).catch(rethrowAssertionErrorRejection); 26088 } 26089 } 26090 function shutdown(isError, error) { 26091 if (shuttingDown === true) { 26092 return; 26093 } 26094 shuttingDown = true; 26095 if (dest._state === 'writable' && WritableStreamCloseQueuedOrInFlight(dest) === false) { 26096 waitForWritesToFinish().then(function () { 26097 return finalize(isError, error); 26098 }).catch(rethrowAssertionErrorRejection); 26099 } else { 26100 finalize(isError, error); 26101 } 26102 } 26103 function finalize(isError, error) { 26104 WritableStreamDefaultWriterRelease(writer); 26105 ReadableStreamReaderGenericRelease(reader); 26106 if (isError) { 26107 reject(error); 26108 } else { 26109 resolve(undefined); 26110 } 26111 } 26112 }); 26113 } 26114 }, { 26115 key: 'tee', 26116 value: function tee() { 26117 if (IsReadableStream(this) === false) { 26118 throw streamBrandCheckException('tee'); 26119 } 26120 var branches = ReadableStreamTee(this, false); 26121 return createArrayFromList(branches); 26122 } 26123 }, { 26124 key: 'locked', 26125 get: function get() { 26126 if (IsReadableStream(this) === false) { 26127 throw streamBrandCheckException('locked'); 26128 } 26129 return IsReadableStreamLocked(this); 26130 } 26131 }]); 26132 return ReadableStream; 26133 }(); 26134 module.exports = { 26135 ReadableStream: ReadableStream, 26136 IsReadableStreamDisturbed: IsReadableStreamDisturbed, 26137 ReadableStreamDefaultControllerClose: ReadableStreamDefaultControllerClose, 26138 ReadableStreamDefaultControllerEnqueue: ReadableStreamDefaultControllerEnqueue, 26139 ReadableStreamDefaultControllerError: ReadableStreamDefaultControllerError, 26140 ReadableStreamDefaultControllerGetDesiredSize: ReadableStreamDefaultControllerGetDesiredSize 26141 }; 26142 function AcquireReadableStreamBYOBReader(stream) { 26143 return new ReadableStreamBYOBReader(stream); 26144 } 26145 function AcquireReadableStreamDefaultReader(stream) { 26146 return new ReadableStreamDefaultReader(stream); 26147 } 26148 function IsReadableStream(x) { 26149 if (!typeIsObject(x)) { 26150 return false; 26151 } 26152 if (!Object.prototype.hasOwnProperty.call(x, '_readableStreamController')) { 26153 return false; 26154 } 26155 return true; 26156 } 26157 function IsReadableStreamDisturbed(stream) {
26158 assert(IsReadableStream(stream) === true, 'IsReadableStreamDisturbed should only be used on known readable streams'); 26159 return stream._disturbed; 26160 } 26161 function IsReadableStreamLocked(stream) { 26162 assert(IsReadableStream(stream) === true, 'IsReadableStreamLocked should only be used on known readable streams'); 26163 if (stream._reader === undefined) { 26164 return false; 26165 } 26166 return true; 26167 } 26168 function ReadableStreamTee(stream, cloneForBranch2) { 26169 assert(IsReadableStream(stream) === true); 26170 assert(typeof cloneForBranch2 === 'boolean'); 26171 var reader = AcquireReadableStreamDefaultReader(stream); 26172 var teeState = { 26173 closedOrErrored: false, 26174 canceled1: false, 26175 canceled2: false, 26176 reason1: undefined, 26177 reason2: undefined 26178 }; 26179 teeState.promise = new Promise(function (resolve) { 26180 teeState._resolve = resolve; 26181 }); 26182 var pull = create_ReadableStreamTeePullFunction(); 26183 pull._reader = reader; 26184 pull._teeState = teeState; 26185 pull._cloneForBranch2 = cloneForBranch2; 26186 var cancel1 = create_ReadableStreamTeeBranch1CancelFunction(); 26187 cancel1._stream = stream; 26188 cancel1._teeState = teeState; 26189 var cancel2 = create_ReadableStreamTeeBranch2CancelFunction(); 26190 cancel2._stream = stream; 26191 cancel2._teeState = teeState; 26192 var underlyingSource1 = Object.create(Object.prototype);
26193 createDataProperty(underlyingSource1, 'pull', pull); 26194 createDataProperty(underlyingSource1, 'cancel', cancel1); 26195 var branch1Stream = new ReadableStream(underlyingSource1); 26196 var underlyingSource2 = Object.create(Object.prototype); 26197 createDataProperty(underlyingSource2, 'pull', pull); 26198 createDataProperty(underlyingSource2, 'cancel', cancel2); 26199 var branch2Stream = new ReadableStream(underlyingSource2); 26200 pull._branch1 = branch1Stream._readableStreamController; 26201 pull._branch2 = branch2Stream._readableStreamController; 26202 reader._closedPromise.catch(function (r) { 26203 if (teeState.closedOrErrored === true) { 26204 return; 26205 } 26206 ReadableStreamDefaultControllerError(pull._branch1, r); 26207 ReadableStreamDefaultControllerError(pull._branch2, r); 26208 teeState.closedOrErrored = true; 26209 }); 26210 return [branch1Stream, branch2Stream]; 26211 } 26212 function create_ReadableStreamTeePullFunction() { 26213 function f() { 26214 var reader = f._reader, 26215 branch1 = f._branch1, 26216 branch2 = f._branch2, 26217 teeState = f._teeState; 26218 return ReadableStreamDefaultReaderRead(reader).then(function (result) { 26219 assert(typeIsObject(result)); 26220 var value = result.value; 26221 var done = result.done; 26222 assert(typeof done === 'boolean'); 26223 if (done === true && teeState.closedOrErrored === false) { 26224 if (teeState.canceled1 === false) { 26225 ReadableStreamDefaultControllerClose(branch1); 26226 } 26227 if (teeState.canceled2 === false) { 26228 ReadableStreamDefaultControllerClose(branch2); 26229 } 26230 teeState.closedOrErrored = true; 26231 } 26232 if (teeState.closedOrErrored === true) { 26233 return; 26234 } 26235 var value1 = value; 26236 var value2 = value; 26237 if (teeState.canceled1 === false) { 26238 ReadableStreamDefaultControllerEnqueue(branch1, value1); 26239 } 26240 if (teeState.canceled2 === false) { 26241 ReadableStreamDefaultControllerEnqueue(branch2, value2); 26242 } 26243 }); 26244 } 26245 return f; 26246 } 26247 function create_ReadableStreamTeeBranch1CancelFunction() { 26248 function f(reason) { 26249 var stream = f._stream, 26250 teeState = f._teeState; 26251 teeState.canceled1 = true; 26252 teeState.reason1 = reason; 26253 if (teeState.canceled2 === true) { 26254 var compositeReason = createArrayFromList([teeState.reason1, teeState.reason2]); 26255 var cancelResult = ReadableStreamCancel(stream, compositeReason); 26256 teeState._resolve(cancelResult); 26257 } 26258 return teeState.promise; 26259 } 26260 return f; 26261 } 26262 function create_ReadableStreamTeeBranch2CancelFunction() { 26263 function f(reason) { 26264 var stream = f._stream, 26265 teeState = f._teeState; 26266 teeState.canceled2 = true; 26267 teeState.reason2 = reason; 26268 if (teeState.canceled1 === true) { 26269 var compositeReason = createArrayFromList([teeState.reason1, teeState.reason2]); 26270 var cancelResult = ReadableStreamCancel(stream, compositeReason); 26271 teeState._resolve(cancelResult); 26272 } 26273 return teeState.promise; 26274 } 26275 return f; 26276 } 26277 function ReadableStreamAddReadIntoRequest(stream) { 26278 assert(IsReadableStreamBYOBReader(stream._reader) === true); 26279 assert(stream._state === 'readable' || stream._state === 'closed'); 26280 var promise = new Promise(function (resolve, reject) { 26281 var readIntoRequest = { 26282 _resolve: resolve, 26283 _reject: reject 26284 }; 26285 stream._reader._readIntoRequests.push(readIntoRequest); 26286 }); 26287 return promise; 26288 } 26289 function ReadableStreamAddReadRequest(stream) { 26290 assert(IsReadableStreamDefaultReader(stream._reader) === true); 26291 assert(stream._state === 'readable'); 26292 var promise = new Promise(function (resolve, reject) { 26293 var readRequest = { 26294 _resolve: resolve, 26295 _reject: reject 26296 }; 26297 stream._reader._readRequests.push(readRequest); 26298 }); 26299 return promise; 26300 } 26301 function ReadableStreamCancel(stream, reason) { 26302 stream._disturbed = true; 26303 if (stream._state === 'closed') { 26304 return Promise.resolve(undefined); 26305 } 26306 if (stream._state === 'errored') { 26307 return Promise.reject(stream._storedError); 26308 } 26309 ReadableStreamClose(stream); 26310 var sourceCancelPromise = stream._readableStreamController.__cancelSteps(reason); 26311 return sourceCancelPromise.then(function () { 26312 return undefined; 26313 });
26314 } 26315 function ReadableStreamClose(stream) { 26316 assert(stream._state === 'readable'); 26317 stream._state = 'closed'; 26318 var reader = stream._reader; 26319 if (reader === undefined) { 26320 return undefined; 26321 } 26322 if (IsReadableStreamDefaultReader(reader) === true) { 26323 for (var i = 0; i < reader._readRequests.length; i++) { 26324 var _resolve = reader._readRequests[i]._resolve; 26325 _resolve(CreateIterResultObject(undefined, true)); 26326 } 26327 reader._readRequests = []; 26328 } 26329 defaultReaderClosedPromiseResolve(reader); 26330 return undefined; 26331 } 26332 function ReadableStreamError(stream, e) { 26333 assert(IsReadableStream(stream) === true, 'stream must be ReadableStream'); 26334 assert(stream._state === 'readable', 'state must be readable'); 26335 stream._state = 'errored'; 26336 stream._storedError = e; 26337 var reader = stream._reader; 26338 if (reader === undefined) { 26339 return undefined; 26340 } 26341 if (IsReadableStreamDefaultReader(reader) === true) { 26342 for (var i = 0; i < reader._readRequests.length; i++) { 26343 var readRequest = reader._readRequests[i]; 26344 readRequest._reject(e); 26345 } 26346 reader._readRequests = []; 26347 } else { 26348 assert(IsReadableStreamBYOBReader(reader), 'reader must be ReadableStreamBYOBReader'); 26349 for (var _i = 0; _i < reader._readIntoRequests.length; _i++) { 26350 var readIntoRequest = reader._readIntoRequests[_i]; 26351 readIntoRequest._reject(e); 26352 } 26353 reader._readIntoRequests = []; 26354 } 26355 defaultReaderClosedPromiseReject(reader, e); 26356 reader._closedPromise.catch(function () {}); 26357 } 26358 function ReadableStreamFulfillReadIntoRequest(stream, chunk, done) { 26359 var reader = stream._reader; 26360 assert(reader._readIntoRequests.length > 0); 26361 var readIntoRequest = reader._readIntoRequests.shift(); 26362 readIntoRequest._resolve(CreateIterResultObject(chunk, done)); 26363 } 26364 function ReadableStreamFulfillReadRequest(stream, chunk, done) { 26365 var reader = stream._reader; 26366 assert(reader._readRequests.length > 0); 26367 var readRequest = reader._readRequests.shift(); 26368 readRequest._resolve(CreateIterResultObject(chunk, done)); 26369 } 26370 function ReadableStreamGetNumReadIntoRequests(stream) { 26371 return stream._reader._readIntoRequests.length; 26372 } 26373 function ReadableStreamGetNumReadRequests(stream) { 26374 return stream._reader._readRequests.length; 26375 } 26376 function ReadableStreamHasBYOBReader(stream) { 26377 var reader = stream._reader; 26378 if (reader === undefined) { 26379 return false; 26380 } 26381 if (IsReadableStreamBYOBReader(reader) === false) { 26382 return false; 26383 } 26384 return true; 26385 } 26386 function ReadableStreamHasDefaultReader(stream) { 26387 var reader = stream._reader; 26388 if (reader === undefined) { 26389 return false; 26390 } 26391 if (IsReadableStreamDefaultReader(reader) === false) { 26392 return false; 26393 } 26394 return true; 26395 } 26396 var ReadableStreamDefaultReader = function () { 26397 function ReadableStreamDefaultReader(stream) { 26398 _classCallCheck(this, ReadableStreamDefaultReader); 26399 if (IsReadableStream(stream) === false) { 26400 throw new TypeError('ReadableStreamDefaultReader can only be constructed with a ReadableStream instance'); 26401 } 26402 if (IsReadableStreamLocked(stream) === true) { 26403 throw new TypeError('This stream has already been locked for exclusive reading by another reader'); 26404 } 26405 ReadableStreamReaderGenericInitialize(this, stream); 26406 this._readRequests = []; 26407 } 26408 _createClass(ReadableStreamDefaultReader, [{ 26409 key: 'cancel', 26410 value: function cancel(reason) { 26411 if (IsReadableStreamDefaultReader(this) === false) { 26412 return Promise.reject(defaultReaderBrandCheckException('cancel')); 26413 } 26414 if (this._ownerReadableStream === undefined) { 26415 return Promise.reject(readerLockException('cancel')); 26416 } 26417 return ReadableStreamReaderGenericCancel(this, reason); 26418 } 26419 }, { 26420 key: 'read', 26421 value: function read() { 26422 if (IsReadableStreamDefaultReader(this) === false) { 26423 return Promise.reject(defaultReaderBrandCheckException('read')); 26424 } 26425 if (this._ownerReadableStream === undefined) { 26426 return Promise.reject(readerLockException('read from')); 26427 } 26428 return ReadableStreamDefaultReaderRead(this); 26429 } 26430 }, { 26431 key: 'releaseLock', 26432 value: function releaseLock() { 26433 if (IsReadableStreamDefaultReader(this) === false) { 26434 throw defaultReaderBrandCheckException('releaseLock'); 26435 } 26436 if (this._ownerReadableStream === undefined) { 26437 return; 26438 } 26439 if (this._readRequests.length > 0) { 26440 throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled'); 26441 } 26442 ReadableStreamReaderGenericRelease(this); 26443 } 26444 }, { 26445 key: 'closed', 26446 get: function get() { 26447 if (IsReadableStreamDefaultReader(this) === false) { 26448 return Promise.reject(defaultReaderBrandCheckException('closed')); 26449 } 26450 return this._closedPromise; 26451 } 26452 }]); 26453 return ReadableStreamDefaultReader; 26454 }(); 26455 var ReadableStreamBYOBReader = function () { 26456 function ReadableStreamBYOBReader(stream) { 26457 _classCallCheck(this, ReadableStreamBYOBReader); 26458 if (!IsReadableStream(stream)) { 26459 throw new TypeError('ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a ' + 'byte source'); 26460 } 26461 if (IsReadableByteStreamController(stream._readableStreamController) === false) { 26462 throw new TypeError('Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte ' + '
26462source'); 26463 } 26464 if (IsReadableStreamLocked(stream)) { 26465 throw new TypeError('This stream has already been locked for exclusive reading by another reader'); 26466 } 26467 ReadableStreamReaderGenericInitialize(this, stream); 26468 this._readIntoRequests = []; 26469 } 26470 _createClass(ReadableStreamBYOBReader, [{ 26471 key: 'cancel', 26472 value: function cancel(reason) { 26473 if (!IsReadableStreamBYOBReader(this)) { 26474 return Promise.reject(byobReaderBrandCheckException('cancel')); 26475 } 26476 if (this._ownerReadableStream === undefined) { 26477 return Promise.reject(readerLockException('cancel')); 26478 } 26479 return ReadableStreamReaderGenericCancel(this, reason); 26480 } 26481 }, { 26482 key: 'read', 26483 value: function read(view) { 26484 if (!IsReadableStreamBYOBReader(this)) { 26485 return Promise.reject(byobReaderBrandCheckException('read')); 26486 } 26487 if (this._ownerReadableStream === undefined) { 26488 return Promise.reject(readerLockException('read from')); 26489 } 26490 if (!ArrayBuffer.isView(view)) { 26491 return Promise.reject(new TypeError('view must be an array buffer view')); 26492 } 26493 if (view.byteLength === 0) { 26494 return Promise.reject(new TypeError('view must have non-zero byteLength')); 26495 } 26496 return ReadableStreamBYOBReaderRead(this, view); 26497 } 26498 }, { 26499 key: 'releaseLock', 26500 value: function releaseLock() { 26501 if (!IsReadableStreamBYOBReader(this)) { 26502 throw byobReaderBrandCheckException('releaseLock'); 26503 } 26504 if (this._ownerReadableStream === undefined) { 26505 return; 26506 } 26507 if (this._readIntoRequests.length > 0) { 26508 throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled'); 26509 } 26510 ReadableStreamReaderGenericRelease(this); 26511 } 26512 }, { 26513 key: 'closed', 26514 get: function get() { 26515 if (!IsReadableStreamBYOBReader(this)) { 26516 return Promise.reject(byobReaderBrandCheckException('closed')); 26517 } 26518 return this._closedPromise; 26519 } 26520 }]); 26521 return ReadableStreamBYOBReader; 26522 }(); 26523 function IsReadableStreamBYOBReader(x) { 26524 if (!typeIsObject(x)) { 26525 return false; 26526 } 26527 if (!Object.prototype.hasOwnProperty.call(x, '_readIntoRequests')) { 26528 return false; 26529 } 26530 return true; 26531 } 26532 function IsReadableStreamDefaultReader(x) { 26533 if (!typeIsObject(x)) { 26534 return false; 26535 } 26536 if (!Object.prototype.hasOwnProperty.call(x, '_readRequests')) { 26537 return false; 26538 } 26539 return true; 26540 } 26541 function ReadableStreamReaderGenericInitialize(reader, stream) { 26542 reader._ownerReadableStream = stream; 26543 stream._reader = reader; 26544 if (stream._state === 'readable') { 26545 defaultReaderClosedPromiseInitialize(reader); 26546 } else if (stream._state === 'closed') { 26547 defaultReaderClosedPromiseInitializeAsResolved(reader); 26548 } else { 26549 assert(stream._state === 'errored', 'state must be errored'); 26550 defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError); 26551 reader._closedPromise.catch(function () {}); 26552 } 26553 } 26554 function ReadableStreamReaderGenericCancel(reader, reason) { 26555 var stream = reader._ownerReadableStream; 26556 assert(stream !== undefined); 26557 return ReadableStreamCancel(stream, reason); 26558 } 26559 function ReadableStreamReaderGenericRelease(reader) { 26560 assert(reader._ownerReadableStream !== undefined); 26561 assert(reader._ownerReadableStream._reader === reader); 26562 if (reader._ownerReadableStream._state === 'readable') { 26563 defaultReaderClosedPromiseReject(reader, new TypeError('Reader was released and can no longer be used to monitor the stream\'s closedness')); 26564 } else { 26565 defaultReaderClosedPromiseResetToRejected(reader, new TypeError('Reader was released and can no longer be used to monitor the stream\'s closedness')); 26566 } 26567 reader._closedPromise.catch(function () {}); 26568 reader._ownerReadableStream._reader = undefined; 26569 reader._ownerReadableStream = undefined; 26570 } 26571 function ReadableStreamBYOBReaderRead(reader, view) { 26572 var stream = reader._ownerReadableStream; 26573 assert(stream !== undefined); 26574 stream._disturbed = true; 26575 if (stream._state === 'errored') { 26576 return Promise.reject(stream._storedError); 26577 } 26578 return ReadableByteStreamControllerPullInto(stream._readableStreamController, view); 26579 } 26580 function ReadableStreamDefaultReaderRead(reader) { 26581 var stream = reader._ownerReadableStream; 26582 assert(stream !== undefined); 26583 stream._disturbed = true; 26584 if (stream._state === 'closed') { 26585 return Promise.resolve(CreateIterResultObject(undefined, true)); 26586 } 26587 if (stream._state === 'errored') { 26588 return Promise.reject(stream._storedError); 26589 } 26590 assert(stream._state === 'readable'); 26591 return stream._readableStreamController.__pullSteps(); 26592 } 26593 var ReadableStreamDefaultController = function () { 26594 function ReadableStreamDefaultController(stream, underlyingSource, size, highWaterMark) { 26595 _classCallCheck(this, ReadableStreamDefaultController);
26596 if (IsReadableStream(stream) === false) { 26597 throw new TypeError('ReadableStreamDefaultController can only be constructed with a ReadableStream instance'); 26598 } 26599 if (stream._readableStreamController !== undefined) { 26600 throw new TypeError('ReadableStreamDefaultController instances can only be created by the ReadableStream constructor'); 26601 } 26602 this._controlledReadableStream = stream; 26603 this._underlyingSource = underlyingSource; 26604 this._queue = undefined; 26605 this._queueTotalSize = undefined; 26606 ResetQueue(this); 26607 this._started = false; 26608 this._closeRequested = false; 26609 this._pullAgain = false; 26610 this._pulling = false; 26611 var normalizedStrategy = ValidateAndNormalizeQueuingStrategy(size, highWaterMark); 26612 this._strategySize = normalizedStrategy.size; 26613 this._strategyHWM = normalizedStrategy.highWaterMark; 26614 var controller = this; 26615 var startResult = InvokeOrNoop(underlyingSource, 'start', [this]); 26616 Promise.resolve(startResult).then(function () { 26617 controller._started = true; 26618 assert(controller._pulling === false); 26619 assert(controller._pullAgain === false); 26620 ReadableStreamDefaultControllerCallPullIfNeeded(controller); 26621 }, function (r) { 26622 ReadableStreamDefaultControllerErrorIfNeeded(controller, r); 26623 }).catch(rethrowAssertionErrorRejection); 26624 } 26625 _createClass(ReadableStreamDefaultController, [{ 26626 key: 'close', 26627 value: function close() { 26628 if (IsReadableStreamDefaultController(this) === false) { 26629 throw defaultControllerBrandCheckException('close'); 26630 } 26631 if (this._closeRequested === true) { 26632 throw new TypeError('The stream has already been closed; do not close it again!'); 26633 } 26634 var state = this._controlledReadableStream._state; 26635 if (state !== 'readable') { 26636 throw new TypeError('The stream (in ' + state + ' state) is not in the readable state and cannot be closed'); 26637 } 26638 ReadableStreamDefaultControllerClose(this); 26639 } 26640 }, { 26641 key: 'enqueue', 26642 value: function enqueue(chunk) { 26643 if (IsReadableStreamDefaultController(this) === false) { 26644 throw defaultControllerBrandCheckException('enqueue'); 26645 } 26646 if (this._closeRequested === true) { 26647 throw new TypeError('stream is closed or draining'); 26648 } 26649 var state = this._controlledReadableStream._state; 26650 if (state !== 'readable') { 26651 throw new TypeError('The stream (in ' + state + ' state) is not in the readable state and cannot be enqueued to'); 26652 } 26653 return ReadableStreamDefaultControllerEnqueue(this, chunk); 26654 } 26655 }, { 26656 key: 'error', 26657 value: function error(e) { 26658 if (IsReadableStreamDefaultController(this) === false) { 26659 throw defaultControllerBrandCheckException('error'); 26660 } 26661 var stream = this._controlledReadableStream; 26662 if (stream._state !== 'readable') { 26663 throw new TypeError('The stream is ' + stream._state + ' and so cannot be errored'); 26664 } 26665 ReadableStreamDefaultControllerError(this, e); 26666 } 26667 }, { 26668 key: '__cancelSteps', 26669 value: function __cancelSteps(reason) { 26670 ResetQueue(this); 26671 return PromiseInvokeOrNoop(this._underlyingSource, 'cancel', [reason]); 26672 } 26673 }, { 26674 key: '__pullSteps', 26675 value: function __pullSteps() { 26676 var stream = this._controlledReadableStream; 26677 if (this._queue.length > 0) { 26678 var chunk = DequeueValue(this); 26679 if (this._closeRequested === true && this._queue.length === 0) { 26680 ReadableStreamClose(stream); 26681 } else { 26682 ReadableStreamDefaultControllerCallPullIfNeeded(this); 26683 } 26684 return Promise.resolve(CreateIterResultObject(chunk, false)); 26685 } 26686 var pendingPromise = ReadableStreamAddReadRequest(stream); 26687 ReadableStreamDefaultControllerCallPullIfNeeded(this); 26688 return pendingPromise; 26689 } 26690 }, { 26691 key: 'desiredSize', 26692 get: function get() { 26693 if (IsReadableStreamDefaultController(this) === false) { 26694 throw defaultControllerBrandCheckException('desiredSize'); 26695 } 26696 return ReadableStreamDefaultControllerGetDesiredSize(this); 26697 } 26698 }]); 26699 return ReadableStreamDefaultController; 26700 }(); 26701 function IsReadableStreamDefaultController(x) { 26702 if (!typeIsObject(x)) { 26703 return false; 26704 } 26705 if (!Object.prototype.hasOwnProperty.call(x, '_underlyingSource')) { 26706 return false; 26707 } 26708 return true; 26709 } 26710 function ReadableStreamDefaultControllerCallPullIfNeeded(controller) { 26711 var shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller); 26712 if (shouldPull === false) { 26713 return undefined; 26714 } 26715 if (controller._pulling === true) { 26716 controller._pullAgain = true; 26717 return undefined; 26718 } 26719 assert(controller._pullAgain === false); 26720 controller._pulling = true; 26721 var pullPromise = PromiseInvokeOrNoop(controller._underlyingSource, 'pull', [controller]); 26722 pullPromise.then(function () { 26723 controller._pulling = false; 26724 if (controller._pullAgain === true) { 26725 controller._pullAgain = false; 26726 return ReadableStreamDefaultControllerCallPullIfNeeded(controller); 26727 } 26728 return undefined; 26729 }, function (e) { 26730 ReadableStreamDefaultControllerErrorIfNeeded(controller, e); 26731 }).catch(rethrowAssertionErrorRejection); 26732 return undefined; 26733 } 26734 function ReadableStreamDefaultControllerShouldCallPull(controller) { 26735 var stream = controller._controlledReadableStream; 26736 if (stream._state === 'closed' || stream._state === 'errored') { 26737 return false; 26738 } 26739 if (controller._closeRequested === true) { 26740 return false; 26741 } 26742 if (controller._started === false) { 26743 return false; 26744 }
26745 if (IsReadableStreamLocked(stream) === true && ReadableStreamGetNumReadRequests(stream) > 0) { 26746 return true; 26747 } 26748 var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller); 26749 if (desiredSize > 0) { 26750 return true; 26751 } 26752 return false; 26753 } 26754 function ReadableStreamDefaultControllerClose(controller) { 26755 var stream = controller._controlledReadableStream; 26756 assert(controller._closeRequested === false); 26757 assert(stream._state === 'readable'); 26758 controller._closeRequested = true; 26759 if (controller._queue.length === 0) { 26760 ReadableStreamClose(stream); 26761 } 26762 } 26763 function ReadableStreamDefaultControllerEnqueue(controller, chunk) { 26764 var stream = controller._controlledReadableStream; 26765 assert(controller._closeRequested === false); 26766 assert(stream._state === 'readable'); 26767 if (IsReadableStreamLocked(stream) === true && ReadableStreamGetNumReadRequests(stream) > 0) { 26768 ReadableStreamFulfillReadRequest(stream, chunk, false); 26769 } else { 26770 var chunkSize = 1; 26771 if (controller._strategySize !== undefined) { 26772 var strategySize = controller._strategySize; 26773 try { 26774 chunkSize = strategySize(chunk); 26775 } catch (chunkSizeE) { 26776 ReadableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE); 26777 throw chunkSizeE; 26778 } 26779 } 26780 try { 26781 EnqueueValueWithSize(controller, chunk, chunkSize); 26782 } catch (enqueueE) { 26783 ReadableStreamDefaultControllerErrorIfNeeded(controller, enqueueE); 26784 throw enqueueE; 26785 } 26786 } 26787 ReadableStreamDefaultControllerCallPullIfNeeded(controller); 26788 return undefined; 26789 } 26790 function ReadableStreamDefaultControllerError(controller, e) { 26791 var stream = controller._controlledReadableStream; 26792 assert(stream._state === 'readable'); 26793 ResetQueue(controller); 26794 ReadableStreamError(stream, e); 26795 } 26796 function ReadableStreamDefaultControllerErrorIfNeeded(controller, e) { 26797 if (controller._controlledReadableStream._state === 'readable') { 26798 ReadableStreamDefaultControllerError(controller, e); 26799 } 26800 } 26801 function ReadableStreamDefaultControllerGetDesiredSize(controller) { 26802 var stream = controller._controlledReadableStream; 26803 var state = stream._state; 26804 if (state === 'errored') { 26805 return null; 26806 } 26807 if (state === 'closed') { 26808 return 0; 26809 } 26810 return controller._strategyHWM - controller._queueTotalSize; 26811 } 26812 var ReadableStreamBYOBRequest = function () { 26813 function ReadableStreamBYOBRequest(controller, view) { 26814 _classCallCheck(this, ReadableStreamBYOBRequest); 26815 this._associatedReadableByteStreamController = controller; 26816 this._view = view; 26817 } 26818 _createClass(ReadableStreamBYOBRequest, [{ 26819 key: 'respond', 26820 value: function respond(bytesWritten) { 26821 if (IsReadableStreamBYOBRequest(this) === false) { 26822 throw byobRequestBrandCheckException('respond'); 26823 } 26824 if (this._associatedReadableByteStreamController === undefined) { 26825 throw new TypeError('This BYOB request has been invalidated'); 26826 } 26827 ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten); 26828 } 26829 }, { 26830 key: 'respondWithNewView', 26831 value: function respondWithNewView(view) { 26832 if (IsReadableStreamBYOBRequest(this) === false) { 26833 throw byobRequestBrandCheckException('respond'); 26834 } 26835 if (this._associatedReadableByteStreamController === undefined) { 26836 throw new TypeError('This BYOB request has been invalidated'); 26837 } 26838 if (!ArrayBuffer.isView(view)) { 26839 throw new TypeError('You can only respond with array buffer views'); 26840 } 26841 ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view); 26842 } 26843 }, { 26844 key: 'view', 26845 get: function get() { 26846 return this._view; 26847 } 26848 }]); 26849 return ReadableStreamBYOBRequest; 26850 }(); 26851 var ReadableByteStreamController = function () { 26852 function ReadableByteStreamController(stream, underlyingByteSource, highWaterMark) { 26853 _classCallCheck(this, ReadableByteStreamController);
26854 if (IsReadableStream(stream) === false) { 26855 throw new TypeError('ReadableByteStreamController can only be constructed with a ReadableStream instance given ' + 'a byte source'); 26856 } 26857 if (stream._readableStreamController !== undefined) { 26858 throw new TypeError('ReadableByteStreamController instances can only be created by the ReadableStream constructor given a byte ' + 'source'); 26859 } 26860 this._controlledReadableStream = stream; 26861 this._underlyingByteSource = underlyingByteSource; 26862 this._pullAgain = false; 26863 this._pulling = false; 26864 ReadableByteStreamControllerClearPendingPullIntos(this); 26865 this._queue = this._queueTotalSize = undefined; 26866 ResetQueue(this); 26867 this._closeRequested = false; 26868 this._started = false; 26869 this._strategyHWM = ValidateAndNormalizeHighWaterMark(highWaterMark); 26870 var autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize; 26871 if (autoAllocateChunkSize !== undefined) { 26872 if (Number.isInteger(autoAllocateChunkSize) === false || autoAllocateChunkSize <= 0) { 26873 throw new RangeError('autoAllocateChunkSize must be a positive integer'); 26874 } 26875 } 26876 this._autoAllocateChunkSize = autoAllocateChunkSize; 26877 this._pendingPullIntos = []; 26878 var controller = this; 26879 var startResult = InvokeOrNoop(underlyingByteSource, 'start', [this]); 26880 Promise.resolve(startResult).then(function () { 26881 controller._started = true; 26882 assert(controller._pulling === false); 26883 assert(controller._pullAgain === false); 26884 ReadableByteStreamControllerCallPullIfNeeded(controller); 26885 }, function (r) { 26886 if (stream._state === 'readable') { 26887 ReadableByteStreamControllerError(controller, r); 26888 } 26889 }).catch(rethrowAssertionErrorRejection); 26890 } 26891 _createClass(ReadableByteStreamController, [{ 26892 key: 'close', 26893 value: function close() { 26894 if (IsReadableByteStreamController(this) === false) { 26895 throw byteStreamControllerBrandCheckException('close'); 26896 } 26897 if (this._closeRequested === true) { 26898 throw new TypeError('The stream has already been closed; do not close it again!'); 26899 } 26900 var state = this._controlledReadableStream._state; 26901 if (state !== 'readable') { 26902 throw new TypeError('The stream (in ' + state + ' state) is not in the readable state and cannot be closed'); 26903 } 26904 ReadableByteStreamControllerClose(this); 26905 } 26906 }, { 26907 key: 'enqueue', 26908 value: function enqueue(chunk) { 26909 if (IsReadableByteStreamController(this) === false) { 26910 throw byteStreamControllerBrandCheckException('enqueue'); 26911 } 26912 if (this._closeRequested === true) { 26913 throw new TypeError('stream is closed or draining'); 26914 } 26915 var state = this._controlledReadableStream._state; 26916 if (state !== 'readable') { 26917 throw new TypeError('The stream (in ' + state + ' state) is not in the readable state and cannot be enqueued to'); 26918 } 26919 if (!ArrayBuffer.isView(chunk)) { 26920 throw new TypeError('You can only enqueue array buffer views when using a ReadableByteStreamController'); 26921 } 26922 ReadableByteStreamControllerEnqueue(this, chunk); 26923 } 26924 }, { 26925 key: 'error', 26926 value: function error(e) { 26927 if (IsReadableByteStreamController(this) === false) { 26928 throw byteStreamControllerBrandCheckException('error'); 26929 } 26930 var stream = this._controlledReadableStream; 26931 if (stream._state !== 'readable') { 26932 throw new TypeError('The stream is ' + stream._state + ' and so cannot be errored'); 26933 } 26934 ReadableByteStreamControllerError(this, e); 26935 } 26936 }, { 26937 key: '__cancelSteps', 26938 value: function __cancelSteps(reason) { 26939 if (this._pendingPullIntos.length > 0) { 26940 var firstDescriptor = this._pendingPullIntos[0]; 26941 firstDescriptor.bytesFilled = 0; 26942 } 26943 ResetQueue(this); 26944 return PromiseInvokeOrNoop(this._underlyingByteSource, 'cancel', [reason]); 26945 } 26946 }, { 26947 key: '__pullSteps', 26948 value: function __pullSteps() { 26949 var stream = this._controlledReadableStream;
26950 assert(ReadableStreamHasDefaultReader(stream) === true); 26951 if (this._queueTotalSize > 0) { 26952 assert(ReadableStreamGetNumReadRequests(stream) === 0); 26953 var entry = this._queue.shift(); 26954 this._queueTotalSize -= entry.byteLength; 26955 ReadableByteStreamControllerHandleQueueDrain(this); 26956 var view = void 0; 26957 try { 26958 view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength); 26959 } catch (viewE) { 26960 return Promise.reject(viewE); 26961 } 26962 return Promise.resolve(CreateIterResultObject(view, false)); 26963 } 26964 var autoAllocateChunkSize = this._autoAllocateChunkSize; 26965 if (autoAllocateChunkSize !== undefined) { 26966 var buffer = void 0; 26967 try { 26968 buffer = new ArrayBuffer(autoAllocateChunkSize); 26969 } catch (bufferE) { 26970 return Promise.reject(bufferE); 26971 } 26972 var pullIntoDescriptor = { 26973 buffer: buffer, 26974 byteOffset: 0, 26975 byteLength: autoAllocateChunkSize, 26976 bytesFilled: 0, 26977 elementSize: 1, 26978 ctor: Uint8Array, 26979 readerType: 'default' 26980 }; 26981 this._pendingPullIntos.push(pullIntoDescriptor); 26982 } 26983 var promise = ReadableStreamAddReadRequest(stream); 26984 ReadableByteStreamControllerCallPullIfNeeded(this); 26985 return promise; 26986 } 26987 }, { 26988 key: 'byobRequest', 26989 get: function get() { 26990 if (IsReadableByteStreamController(this) === false) { 26991 throw byteStreamControllerBrandCheckException('byobRequest'); 26992 } 26993 if (this._byobRequest === undefined && this._pendingPullIntos.length > 0) { 26994 var firstDescriptor = this._pendingPullIntos[0]; 26995 var view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled); 26996 this._byobRequest = new ReadableStreamBYOBRequest(this, view); 26997 } 26998 return this._byobRequest; 26999 } 27000 }, { 27001 key: 'desiredSize', 27002 get: function get() { 27003 if (IsReadableByteStreamController(this) === false) { 27004 throw byteStreamControllerBrandCheckException('desiredSize'); 27005 } 27006 return ReadableByteStreamControllerGetDesiredSize(this); 27007 } 27008 }]); 27009 return ReadableByteStreamController; 27010 }(); 27011 function IsReadableByteStreamController(x) { 27012 if (!typeIsObject(x)) { 27013 return false; 27014 } 27015 if (!Object.prototype.hasOwnProperty.call(x, '_underlyingByteSource')) { 27016 return false; 27017 } 27018 return true; 27019 } 27020 function IsReadableStreamBYOBRequest(x) { 27021 if (!typeIsObject(x)) { 27022 return false; 27023 } 27024 if (!Object.prototype.hasOwnProperty.call(x, '_associatedReadableByteStreamController')) { 27025 return false; 27026 } 27027 return true; 27028 } 27029 function ReadableByteStreamControllerCallPullIfNeeded(controller) { 27030 var shouldPull = ReadableByteStreamControllerShouldCallPull(controller); 27031 if (shouldPull === false) { 27032 return undefined; 27033 } 27034 if (controller._pulling === true) { 27035 controller._pullAgain = true; 27036 return undefined; 27037 } 27038 assert(controller._pullAgain === false); 27039 controller._pulling = true; 27040 var pullPromise = PromiseInvokeOrNoop(controller._underlyingByteSource, 'pull', [controller]); 27041 pullPromise.then(function () { 27042 controller._pulling = false; 27043 if (controller._pullAgain === true) { 27044 controller._pullAgain = false; 27045 ReadableByteStreamControllerCallPullIfNeeded(controller); 27046 } 27047 }, function (e) { 27048 if (controller._controlledReadableStream._state === 'readable') { 27049 ReadableByteStreamControllerError(controller, e); 27050 } 27051 }).catch(rethrowAssertionErrorRejection); 27052 return undefined; 27053 } 27054 function ReadableByteStreamControllerClearPendingPullIntos(controller) { 27055 ReadableByteStreamControllerInvalidateBYOBRequest(controller); 27056 controller._pendingPullIntos = []; 27057 } 27058 function ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) { 27059 assert(stream._state !== 'errored', 'state must not be errored'); 27060 var done = false; 27061 if (stream._state === 'closed') { 27062 assert(pullIntoDescriptor.bytesFilled === 0); 27063 done = true; 27064 } 27065 var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); 27066 if (pullIntoDescriptor.readerType === 'default') { 27067 ReadableStreamFulfillReadRequest(stream, filledView, done); 27068 } else { 27069 assert(pullIntoDescriptor.readerType === 'byob'); 27070 ReadableStreamFulfillReadIntoRequest(stream, filledView, done); 27071 } 27072 } 27073 function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) { 27074 var bytesFilled = pullIntoDescriptor.bytesFilled; 27075 var elementSize = pullIntoDescriptor.elementSize; 27076 assert(bytesFilled <= pullIntoDescriptor.byteLength); 27077 assert(bytesFilled % elementSize === 0); 27078 return new pullIntoDescriptor.ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize); 27079 } 27080 function ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) { 27081 controller._queue.push({ 27082 buffer: buffer, 27083 byteOffset: byteOffset, 27084 byteLength: byteLength 27085 });
27086 controller._queueTotalSize += byteLength; 27087 } 27088 function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) { 27089 var elementSize = pullIntoDescriptor.elementSize; 27090 var currentAlignedBytes = pullIntoDescriptor.bytesFilled - pullIntoDescriptor.bytesFilled % elementSize; 27091 var maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled); 27092 var maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy; 27093 var maxAlignedBytes = maxBytesFilled - maxBytesFilled % elementSize; 27094 var totalBytesToCopyRemaining = maxBytesToCopy; 27095 var ready = false; 27096 if (maxAlignedBytes > currentAlignedBytes) { 27097 totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled; 27098 ready = true; 27099 } 27100 var queue = controller._queue; 27101 while (totalBytesToCopyRemaining > 0) { 27102 var headOfQueue = queue[0]; 27103 var bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength); 27104 var destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; 27105 ArrayBufferCopy(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy); 27106 if (headOfQueue.byteLength === bytesToCopy) { 27107 queue.shift(); 27108 } else { 27109 headOfQueue.byteOffset += bytesToCopy; 27110 headOfQueue.byteLength -= bytesToCopy; 27111 } 27112 controller._queueTotalSize -= bytesToCopy; 27113 ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor); 27114 totalBytesToCopyRemaining -= bytesToCopy; 27115 } 27116 if (ready === false) { 27117 assert(controller._queueTotalSize === 0, 'queue must be empty'); 27118 assert(pullIntoDescriptor.bytesFilled > 0); 27119 assert(pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize); 27120 } 27121 return ready; 27122 } 27123 function ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) { 27124 assert(controller._pendingPullIntos.length === 0 || controller._pendingPullIntos[0] === pullIntoDescriptor); 27125 ReadableByteStreamControllerInvalidateBYOBRequest(controller); 27126 pullIntoDescriptor.bytesFilled += size; 27127 } 27128 function ReadableByteStreamControllerHandleQueueDrain(controller) { 27129 assert(controller._controlledReadableStream._state === 'readable'); 27130 if (controller._queueTotalSize === 0 && controller._closeRequested === true) { 27131 ReadableStreamClose(controller._controlledReadableStream); 27132 } else { 27133 ReadableByteStreamControllerCallPullIfNeeded(controller); 27134 } 27135 } 27136 function ReadableByteStreamControllerInvalidateBYOBRequest(controller) { 27137 if (controller._byobRequest === undefined) { 27138 return; 27139 } 27140 controller._byobRequest._associatedReadableByteStreamController = undefined; 27141 controller._byobRequest._view = undefined; 27142 controller._byobRequest = undefined; 27143 } 27144 function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) { 27145 assert(controller._closeRequested === false); 27146 while (controller._pendingPullIntos.length > 0) { 27147 if (controller._queueTotalSize === 0) { 27148 return; 27149 } 27150 var pullIntoDescriptor = controller._pendingPullIntos[0]; 27151 if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) === true) { 27152 ReadableByteStreamControllerShiftPendingPullInto(controller); 27153 ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableStream, pullIntoDescriptor); 27154 } 27155 } 27156 } 27157 function ReadableByteStreamControllerPullInto(controller, view) { 27158 var stream = controller._controlledReadableStream; 27159 var elementSize = 1; 27160 if (view.constructor !== DataView) { 27161 elementSize = view.constructor.BYTES_PER_ELEMENT; 27162 } 27163 var ctor = view.constructor; 27164 var pullIntoDescriptor = { 27165 buffer: view.buffer, 27166 byteOffset: view.byteOffset, 27167 byteLength: view.byteLength, 27168 bytesFilled: 0, 27169 elementSize: elementSize, 27170 ctor: ctor, 27171 readerType: 'byob' 27172 }; 27173 if (controller._pendingPullIntos.length > 0) { 27174 pullIntoDescriptor.buffer = TransferArrayBuffer(pullIntoDescriptor.buffer); 27175 controller._pendingPullIntos.push(pullIntoDescriptor); 27176 return ReadableStreamAddReadIntoRequest(stream); 27177 } 27178 if (stream._state === 'closed') { 27179 var emptyView = new view.constructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0); 27180 return Promise.resolve(CreateIterResultObject(emptyView, true)); 27181 } 27182 if (controller._queueTotalSize > 0) { 27183 if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) === true) { 27184 var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); 27185 ReadableByteStreamControllerHandleQueueDrain(controller); 27186 return Promise.resolve(CreateIterResultObject(filledView, false)); 27187 } 27188 if (controller._closeRequested === true) { 27189 var e = new TypeError('Insufficient bytes to fill elements in the given buffer'); 27190 ReadableByteStreamControllerError(controller, e); 27191 return Promise.reject(e); 27192 } 27193 } 27194 pullIntoDescriptor.buffer = TransferArrayBuffer(pullIntoDescriptor.buffer); 27195 controller._pendingPullIntos.push(pullIntoDescriptor); 27196 var promise = ReadableStreamAddReadIntoRequest(stream); 27197 ReadableByteStreamControllerCallPullIfNeeded(controller); 27198 return promise; 27199 } 27200 function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) { 27201 firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer); 27202 assert(firstDescriptor.bytesFilled === 0, 'bytesFilled must be 0'); 27203 var stream = controller._controlledReadableStream;
27204 if (ReadableStreamHasBYOBReader(stream) === true) { 27205 while (ReadableStreamGetNumReadIntoRequests(stream) > 0) { 27206 var pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller); 27207 ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor); 27208 } 27209 } 27210 } 27211 function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) { 27212 if (pullIntoDescriptor.bytesFilled + bytesWritten > pullIntoDescriptor.byteLength) { 27213 throw new RangeError('bytesWritten out of range'); 27214 } 27215 ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor); 27216 if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize) { 27217 return; 27218 } 27219 ReadableByteStreamControllerShiftPendingPullInto(controller); 27220 var remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize; 27221 if (remainderSize > 0) { 27222 var end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; 27223 var remainder = pullIntoDescriptor.buffer.slice(end - remainderSize, end); 27224 ReadableByteStreamControllerEnqueueChunkToQueue(controller, remainder, 0, remainder.byteLength); 27225 } 27226 pullIntoDescriptor.buffer = TransferArrayBuffer(pullIntoDescriptor.buffer); 27227 pullIntoDescriptor.bytesFilled -= remainderSize; 27228 ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableStream, pullIntoDescriptor); 27229 ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); 27230 } 27231 function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) { 27232 var firstDescriptor = controller._pendingPullIntos[0]; 27233 var stream = controller._controlledReadableStream; 27234 if (stream._state === 'closed') { 27235 if (bytesWritten !== 0) { 27236 throw new TypeError('bytesWritten must be 0 when calling respond() on a closed stream'); 27237 } 27238 ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor); 27239 } else { 27240 assert(stream._state === 'readable'); 27241 ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor); 27242 } 27243 } 27244 function ReadableByteStreamControllerShiftPendingPullInto(controller) { 27245 var descriptor = controller._pendingPullIntos.shift(); 27246 ReadableByteStreamControllerInvalidateBYOBRequest(controller); 27247 return descriptor; 27248 } 27249 function ReadableByteStreamControllerShouldCallPull(controller) { 27250 var stream = controller._controlledReadableStream; 27251 if (stream._state !== 'readable') { 27252 return false; 27253 } 27254 if (controller._closeRequested === true) { 27255 return false; 27256 } 27257 if (controller._started === false) { 27258 return false; 27259 } 27260 if (ReadableStreamHasDefaultReader(stream) === true && ReadableStreamGetNumReadRequests(stream) > 0) { 27261 return true; 27262 } 27263 if (ReadableStreamHasBYOBReader(stream) === true && ReadableStreamGetNumReadIntoRequests(stream) > 0) { 27264 return true; 27265 } 27266 if (ReadableByteStreamControllerGetDesiredSize(controller) > 0) { 27267 return true; 27268 } 27269 return false; 27270 } 27271 function ReadableByteStreamControllerClose(controller) { 27272 var stream = controller._controlledReadableStream; 27273 assert(controller._closeRequested === false); 27274 assert(stream._state === 'readable'); 27275 if (controller._queueTotalSize > 0) { 27276 controller._closeRequested = true; 27277 return; 27278 } 27279 if (controller._pendingPullIntos.length > 0) { 27280 var firstPendingPullInto = controller._pendingPullIntos[0]; 27281 if (firstPendingPullInto.bytesFilled > 0) { 27282 var e = new TypeError('Insufficient bytes to fill elements in the given buffer'); 27283 ReadableByteStreamControllerError(controller, e); 27284 throw e; 27285 } 27286 } 27287 ReadableStreamClose(stream); 27288 } 27289 function ReadableByteStreamControllerEnqueue(controller, chunk) { 27290 var stream = controller._controlledReadableStream; 27291 assert(controller._closeRequested === false); 27292 assert(stream._state === 'readable'); 27293 var buffer = chunk.buffer; 27294 var byteOffset = chunk.byteOffset; 27295 var byteLength = chunk.byteLength; 27296 var transferredBuffer = TransferArrayBuffer(buffer);
27297 if (ReadableStreamHasDefaultReader(stream) === true) { 27298 if (ReadableStreamGetNumReadRequests(stream) === 0) { 27299 ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); 27300 } else { 27301 assert(controller._queue.length === 0); 27302 var transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength); 27303 ReadableStreamFulfillReadRequest(stream, transferredView, false); 27304 } 27305 } else if (ReadableStreamHasBYOBReader(stream) === true) { 27306 ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); 27307 ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); 27308 } else { 27309 assert(IsReadableStreamLocked(stream) === false, 'stream must not be locked'); 27310 ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); 27311 } 27312 } 27313 function ReadableByteStreamControllerError(controller, e) { 27314 var stream = controller._controlledReadableStream; 27315 assert(stream._state === 'readable'); 27316 ReadableByteStreamControllerClearPendingPullIntos(controller); 27317 ResetQueue(controller); 27318 ReadableStreamError(stream, e); 27319 } 27320 function ReadableByteStreamControllerGetDesiredSize(controller) { 27321 var stream = controller._controlledReadableStream; 27322 var state = stream._state; 27323 if (state === 'errored') { 27324 return null; 27325 } 27326 if (state === 'closed') { 27327 return 0; 27328 } 27329 return controller._strategyHWM - controller._queueTotalSize; 27330 } 27331 function ReadableByteStreamControllerRespond(controller, bytesWritten) { 27332 bytesWritten = Number(bytesWritten); 27333 if (IsFiniteNonNegativeNumber(bytesWritten) === false) { 27334 throw new RangeError('bytesWritten must be a finite'); 27335 } 27336 assert(controller._pendingPullIntos.length > 0); 27337 ReadableByteStreamControllerRespondInternal(controller, bytesWritten); 27338 } 27339 function ReadableByteStreamControllerRespondWithNewView(controller, view) { 27340 assert(controller._pendingPullIntos.length > 0); 27341 var firstDescriptor = controller._pendingPullIntos[0]; 27342 if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) { 27343 throw new RangeError('The region specified by view does not match byobRequest'); 27344 } 27345 if (firstDescriptor.byteLength !== view.byteLength) { 27346 throw new RangeError('The buffer of view has different capacity than byobRequest'); 27347 } 27348 firstDescriptor.buffer = view.buffer; 27349 ReadableByteStreamControllerRespondInternal(controller, view.byteLength); 27350 } 27351 function streamBrandCheckException(name) { 27352 return new TypeError('ReadableStream.prototype.' + name + ' can only be used on a ReadableStream'); 27353 } 27354 function readerLockException(name) { 27355 return new TypeError('Cannot ' + name + ' a stream using a released reader'); 27356 } 27357 function defaultReaderBrandCheckException(name) { 27358 return new TypeError('ReadableStreamDefaultReader.prototype.' + name + ' can only be used on a ReadableStreamDefaultReader'); 27359 } 27360 function defaultReaderClosedPromiseInitialize(reader) { 27361 reader._closedPromise = new Promise(function (resolve, reject) { 27362 reader._closedPromise_resolve = resolve; 27363 reader._closedPromise_reject = reject; 27364 }); 27365 } 27366 function defaultReaderClosedPromiseInitializeAsRejected(reader, reason) { 27367 reader._closedPromise = Promise.reject(reason); 27368 reader._closedPromise_resolve = undefined; 27369 reader._closedPromise_reject = undefined; 27370 } 27371 function defaultReaderClosedPromiseInitializeAsResolved(reader) { 27372 reader._closedPromise = Promise.resolve(undefined); 27373 reader._closedPromise_resolve = undefined; 27374 reader._closedPromise_reject = undefined; 27375 } 27376 function defaultReaderClosedPromiseReject(reader, reason) { 27377 assert(reader._closedPromise_resolve !== undefined); 27378 assert(reader._closedPromise_reject !== undefined); 27379 reader._closedPromise_reject(reason); 27380 reader._closedPromise_resolve = undefined; 27381 reader._closedPromise_reject = undefined; 27382 } 27383 function defaultReaderClosedPromiseResetToRejected(reader, reason) { 27384 assert(reader._closedPromise_resolve === undefined); 27385 assert(reader._closedPromise_reject === undefined); 27386 reader._closedPromise = Promise.reject(reason); 27387 } 27388 function defaultReaderClosedPromiseResolve(reader) { 27389 assert(reader._closedPromise_resolve !== undefined); 27390 assert(reader._closedPromise_reject !== undefined); 27391 reader._closedPromise_resolve(undefined); 27392 reader._closedPromise_resolve = undefined; 27393 reader._closedPromise_reject = undefined; 27394 } 27395 function byobReaderBrandCheckException(name) { 27396 return new TypeError('ReadableStreamBYOBReader.prototype.' + name + ' can only be used on a ReadableStreamBYOBReader'); 27397 } 27398 function defaultControllerBrandCheckException(name) { 27399 return new TypeError('ReadableStreamDefaultController.prototype.' + name + ' can only be used on a ReadableStreamDefaultController'); 27400 } 27401 function byobRequestBrandCheckException(name) { 27402 return new TypeError('ReadableStreamBYOBRequest.prototype.' + name + ' can only be used on a ReadableStreamBYOBRequest'); 27403 } 27404 function byteStreamControllerBrandCheckException(name) { 27405 return new TypeError('ReadableByteStreamController.prototype.' + name + ' can only be used on a ReadableByteStreamController'); 27406 } 27407 function ifIsObjectAndHasAPromiseIsHandledInternalSlotSetPromiseIsHandledToTrue(promise) { 27408 try { 27409 Promise.prototype.then.call(promise, undefined, function () {}); 27410 } catch (e) {} 27411 } 27412}, function (module, exports, __w_pdfjs_require__) { 27413 "use strict"; 27414 27415 var transformStream = __w_pdfjs_require__(6); 27416 var readableStream = __w_pdfjs_require__(4); 27417 var writableStream = __w_pdfjs_require__(2); 27418 exports.TransformStream = transformStream.TransformStream; 27419 exports.ReadableStream = readableStream.ReadableStream; 27420 exports.IsReadableStreamDisturbed = readableStream.IsReadableStreamDisturbed; 27421 exports.ReadableStreamDefaultControllerClose = readableStream.ReadableStreamDefaultControllerClose; 27422 exports.ReadableStreamDefaultControllerEnqueue = readableStream.ReadableStreamDefaultControllerEnqueue; 27423 exports.ReadableStreamDefaultControllerError = readableStream.ReadableStreamDefaultControllerError; 27424 exports.ReadableStreamDefaultControllerGetDesiredSize = readableStream.ReadableStreamDefaultControllerGetDesiredSize; 27425 exports.AcquireWritableStreamDefaultWriter = writableStream.AcquireWritableStreamDefaultWriter; 27426 exports.IsWritableStream = writableStream.IsWritableStream; 27427 exports.IsWritableStreamLocked = writableStream.IsWritableStreamLocked; 27428 exports.WritableStream = writableStream.WritableStream; 27429 exports.WritableStreamAbort = writableStream.WritableStreamAbort; 27430 exports.WritableStreamDefaultControllerError = writableStream.WritableStreamDefaultControllerError; 27431 exports.WritableStreamDefaultWriterCloseWithErrorPropagation = writableStream.WritableStreamDefaultWriterCloseWithErrorPropagation; 27432 exports.WritableStreamDefaultWriterRelease = writableStream.WritableStreamDefaultWriterRelease; 27433 exports.WritableStreamDefaultWriterWrite = writableStream.WritableStreamDefaultWriterWrite; 27434}, function (module, exports, __w_pdfjs_require__) { 27435 "use strict"; 27436 27437 var _createClass = function () { 27438 function defineProperties(target, props) { 27439 for (var i = 0; i < props.length; i++) { 27440 var descriptor = props[i]; 27441 descriptor.enumerable = descriptor.enumerable || false; 27442 descriptor.configurable = true; 27443 if ("value" in descriptor) descriptor.writable = true; 27444 Object.defineProperty(target, descriptor.key, descriptor); 27445 } 27446 } 27447 return function (Constructor, protoProps, staticProps) { 27448 if (protoProps) defineProperties(Constructor.prototype, protoProps); 27449 if (staticProps) defineProperties(Constructor, staticProps); 27450 return Constructor; 27451 }; 27452 }(); 27453 function _classCallCheck(instance, Constructor) { 27454 if (!(instance instanceof Constructor)) { 27455 throw new TypeError("Cannot call a class as a function"); 27456 } 27457 } 27458 var _require = __w_pdfjs_require__(1), 27459 assert = _require.assert; 27460 var _require2 = __w_pdfjs_require__(0), 27461 InvokeOrNoop = _require2.InvokeOrNoop, 27462 PromiseInvokeOrPerformFallback = _require2.PromiseInvokeOrPerformFallback, 27463 PromiseInvokeOrNoop = _require2.PromiseInvokeOrNoop, 27464 typeIsObject = _require2.typeIsObject; 27465 var _require3 = __w_pdfjs_require__(4), 27466 ReadableStream = _require3.ReadableStream, 27467 ReadableStreamDefaultControllerClose = _require3.ReadableStreamDefaultControllerClose, 27468 ReadableStreamDefaultControllerEnqueue = _require3.ReadableStreamDefaultControllerEnqueue, 27469 ReadableStreamDefaultControllerError = _require3.ReadableStreamDefaultControllerError, 27470 ReadableStreamDefaultControllerGetDesiredSize = _require3.ReadableStreamDefaultControllerGetDesiredSize; 27471 var _require4 = __w_pdfjs_require__(2), 27472 WritableStream = _require4.WritableStream, 27473 WritableStreamDefaultControllerError = _require4.WritableStreamDefaultControllerError; 27474 function TransformStreamCloseReadable(transformStream) { 27475 if (transformStream._errored === true) { 27476 throw new TypeError('TransformStream is already errored'); 27477 } 27478 if (transformStream._readableClosed === true) { 27479 throw new TypeError('Readable side is already closed'); 27480 } 27481 TransformStreamCloseReadableInternal(transformStream); 27482 } 27483 function TransformStreamEnqueueToReadable(transformStream, chunk) { 27484 if (transformStream._errored === true) { 27485 throw new TypeError('TransformStream is already errored'); 27486 } 27487 if (transformStream._readableClosed === true) { 27488 throw new TypeError('Readable side is already closed'); 27489 } 27490 var controller = transformStream._readableController; 27491 try { 27492 ReadableStreamDefaultControllerEnqueue(controller, chunk); 27493 } catch (e) { 27494 transformStream._readableClosed = true; 27495 TransformStreamErrorIfNeeded(transformStream, e); 27496 throw transformStream._storedError; 27497 } 27498 var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller); 27499 var maybeBackpressure = desiredSize <= 0;
27500 if (maybeBackpressure === true && transformStream._backpressure === false) { 27501 TransformStreamSetBackpressure(transformStream, true); 27502 } 27503 } 27504 function TransformStreamError(transformStream, e) { 27505 if (transformStream._errored === true) { 27506 throw new TypeError('TransformStream is already errored'); 27507 } 27508 TransformStreamErrorInternal(transformStream, e); 27509 } 27510 function TransformStreamCloseReadableInternal(transformStream) { 27511 assert(transformStream._errored === false); 27512 assert(transformStream._readableClosed === false); 27513 try { 27514 ReadableStreamDefaultControllerClose(transformStream._readableController); 27515 } catch (e) { 27516 assert(false); 27517 } 27518 transformStream._readableClosed = true; 27519 } 27520 function TransformStreamErrorIfNeeded(transformStream, e) { 27521 if (transformStream._errored === false) { 27522 TransformStreamErrorInternal(transformStream, e); 27523 } 27524 } 27525 function TransformStreamErrorInternal(transformStream, e) { 27526 assert(transformStream._errored === false); 27527 transformStream._errored = true; 27528 transformStream._storedError = e; 27529 if (transformStream._writableDone === false) { 27530 WritableStreamDefaultControllerError(transformStream._writableController, e); 27531 } 27532 if (transformStream._readableClosed === false) { 27533 ReadableStreamDefaultControllerError(transformStream._readableController, e); 27534 } 27535 } 27536 function TransformStreamReadableReadyPromise(transformStream) { 27537 assert(transformStream._backpressureChangePromise !== undefined, '_backpressureChangePromise should have been initialized'); 27538 if (transformStream._backpressure === false) { 27539 return Promise.resolve(); 27540 } 27541 assert(transformStream._backpressure === true, '_backpressure should have been initialized'); 27542 return transformStream._backpressureChangePromise; 27543 } 27544 function TransformStreamSetBackpressure(transformStream, backpressure) { 27545 assert(transformStream._backpressure !== backpressure, 'TransformStreamSetBackpressure() should be called only when backpressure is changed'); 27546 if (transformStream._backpressureChangePromise !== undefined) { 27547 transformStream._backpressureChangePromise_resolve(backpressure); 27548 } 27549 transformStream._backpressureChangePromise = new Promise(function (resolve) { 27550 transformStream._backpressureChangePromise_resolve = resolve; 27551 }); 27552 transformStream._backpressureChangePromise.then(function (resolution) { 27553 assert(resolution !== backpressure, '_backpressureChangePromise should be fulfilled only when backpressure is changed'); 27554 }); 27555 transformStream._backpressure = backpressure; 27556 } 27557 function TransformStreamDefaultTransform(chunk, transformStreamController) { 27558 var transformStream = transformStreamController._controlledTransformStream; 27559 TransformStreamEnqueueToReadable(transformStream, chunk); 27560 return Promise.resolve(); 27561 } 27562 function TransformStreamTransform(transformStream, chunk) { 27563 assert(transformStream._errored === false); 27564 assert(transformStream._transforming === false); 27565 assert(transformStream._backpressure === false); 27566 transformStream._transforming = true; 27567 var transformer = transformStream._transformer; 27568 var controller = transformStream._transformStreamController; 27569 var transformPromise = PromiseInvokeOrPerformFallback(transformer, 'transform', [chunk, controller], TransformStreamDefaultTransform, [chunk, controller]); 27570 return transformPromise.then(function () { 27571 transformStream._transforming = false; 27572 return TransformStreamReadableReadyPromise(transformStream); 27573 }, function (e) { 27574 TransformStreamErrorIfNeeded(transformStream, e); 27575 return Promise.reject(e); 27576 }); 27577 } 27578 function IsTransformStreamDefaultController(x) { 27579 if (!typeIsObject(x)) { 27580 return false; 27581 } 27582 if (!Object.prototype.hasOwnProperty.call(x, '_controlledTransformStream')) { 27583 return false; 27584 } 27585 return true; 27586 } 27587 function IsTransformStream(x) { 27588 if (!typeIsObject(x)) { 27589 return false; 27590 } 27591 if (!Object.prototype.hasOwnProperty.call(x, '_transformStreamController')) { 27592 return false; 27593 } 27594 return true; 27595 } 27596 var TransformStreamSink = function () { 27597 function TransformStreamSink(transformStream, startPromise) { 27598 _classCallCheck(this, TransformStreamSink); 27599 this._transformStream = transformStream; 27600 this._startPromise = startPromise; 27601 } 27602 _createClass(TransformStreamSink, [{ 27603 key: 'start', 27604 value: function start(c) { 27605 var transformStream = this._transformStream; 27606 transformStream._writableController = c; 27607 return this._startPromise.then(function () { 27608 return TransformStreamReadableReadyPromise(transformStream); 27609 }); 27610 } 27611 }, { 27612 key: 'write', 27613 value: function write(chunk) { 27614 var transformStream = this._transformStream; 27615 return TransformStreamTransform(transformStream, chunk); 27616 } 27617 }, { 27618 key: 'abort', 27619 value: function abort() { 27620 var transformStream = this._transformStream; 27621 transformStream._writableDone = true; 27622 TransformStreamErrorInternal(transformStream, new TypeError('Writable side aborted')); 27623 } 27624 }, { 27625 key: 'close', 27626 value: function close() { 27627 var transformStream = this._transformStream; 27628 assert(transformStream._transforming === false); 27629 transformStream._writableDone = true; 27630 var flushPromise = PromiseInvokeOrNoop(transformStream._transformer, 'flush', [transformStream._transformStreamController]); 27631 return flushPromise.then(function () { 27632 if (transformStream._errored === true) { 27633 return Promise.reject(transformStream._storedError); 27634 } 27635 if (transformStream._readableClosed === false) { 27636 TransformStreamCloseReadableInternal(transformStream); 27637 } 27638 return Promise.resolve(); 27639 }).catch(function (r) { 27640 TransformStreamErrorIfNeeded(transformStream, r); 27641 return Promise.reject(transformStream._storedError); 27642 }); 27643 } 27644 }]); 27645 return TransformStreamSink; 27646 }(); 27647 var TransformStreamSource = function () { 27648 function TransformStreamSource(transformStream, startPromise) { 27649 _classCallCheck(this, TransformStreamSource); 27650 this._transformStream = transformStream; 27651 this._startPromise = startPromise; 27652 } 27653 _createClass(TransformStreamSource, [{ 27654 key: 'start', 27655 value: function start(c) { 27656 var transformStream = this._transformStream; 27657 transformStream._readableController = c; 27658 return this._startPromise.then(function () { 27659 assert(transformStream._backpressureChangePromise !== undefined, '_backpressureChangePromise should have been initialized'); 27660 if (transformStream._backpressure === true) { 27661 return Promise.resolve(); 27662 } 27663 assert(transformStream._backpressure === false, '_backpressure should have been initialized'); 27664 return transformStream._backpressureChangePromise; 27665 }); 27666 } 27667 }, { 27668 key: 'pull', 27669 value: function pull() { 27670 var transformStream = this._transformStream; 27671 assert(transformStream._backpressure === true, 'pull() should be never called while _backpressure is false'); 27672 assert(transformStream._backpressureChangePromise !== undefined, '_backpressureChangePromise should have been initialized'); 27673 TransformStreamSetBackpressure(transformStream, false); 27674 return transformStream._backpressureChangePromise; 27675 } 27676 }, { 27677 key: 'cancel', 27678 value: function cancel() { 27679 var transformStream = this._transformStream; 27680 transformStream._readableClosed = true; 27681 TransformStreamErrorInternal(transformStream, new TypeError('Readable side canceled')); 27682 } 27683 }]); 27684 return TransformStreamSource; 27685 }(); 27686 var TransformStreamDefaultController = function () { 27687 function TransformStreamDefaultController(transformStream) { 27688 _classCallCheck(this, TransformStreamDefaultController); 27689 if (IsTransformStream(transformStream) === false) { 27690 throw new TypeError('TransformStreamDefaultController can only be ' + 'constructed with a TransformStream instance'); 27691 } 27692 if (transformStream._transformStreamController !== undefined) { 27693 throw new TypeError('TransformStreamDefaultController instances can ' + 'only be created by the TransformStream constructor'); 27694 } 27695 this._controlledTransformStream = transformStream; 27696 } 27697 _createClass(TransformStreamDefaultController, [{ 27698 key: 'enqueue',
27699 value: function enqueue(chunk) { 27700 if (IsTransformStreamDefaultController(this) === false) { 27701 throw defaultControllerBrandCheckException('enqueue'); 27702 } 27703 TransformStreamEnqueueToReadable(this._controlledTransformStream, chunk); 27704 } 27705 }, { 27706 key: 'close', 27707 value: function close() { 27708 if (IsTransformStreamDefaultController(this) === false) { 27709 throw defaultControllerBrandCheckException('close'); 27710 } 27711 TransformStreamCloseReadable(this._controlledTransformStream); 27712 } 27713 }, { 27714 key: 'error', 27715 value: function error(reason) { 27716 if (IsTransformStreamDefaultController(this) === false) { 27717 throw defaultControllerBrandCheckException('error'); 27718 } 27719 TransformStreamError(this._controlledTransformStream, reason); 27720 } 27721 }, { 27722 key: 'desiredSize', 27723 get: function get() { 27724 if (IsTransformStreamDefaultController(this) === false) { 27725 throw defaultControllerBrandCheckException('desiredSize'); 27726 } 27727 var transformStream = this._controlledTransformStream; 27728 var readableController = transformStream._readableController; 27729 return ReadableStreamDefaultControllerGetDesiredSize(readableController); 27730 } 27731 }]); 27732 return TransformStreamDefaultController; 27733 }(); 27734 var TransformStream = function () { 27735 function TransformStream() { 27736 var transformer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 27737 _classCallCheck(this, TransformStream); 27738 this._transformer = transformer; 27739 var readableStrategy = transformer.readableStrategy, 27740 writableStrategy = transformer.writableStrategy; 27741 this._transforming = false; 27742 this._errored = false; 27743 this._storedError = undefined; 27744 this._writableController = undefined; 27745 this._readableController = undefined; 27746 this._transformStreamController = undefined; 27747 this._writableDone = false; 27748 this._readableClosed = false; 27749 this._backpressure = undefined; 27750 this._backpressureChangePromise = undefined; 27751 this._backpressureChangePromise_resolve = undefined; 27752 this._transformStreamController = new TransformStreamDefaultController(this); 27753 var startPromise_resolve = void 0; 27754 var startPromise = new Promise(function (resolve) { 27755 startPromise_resolve = resolve; 27756 }); 27757 var source = new TransformStreamSource(this, startPromise); 27758 this._readable = new ReadableStream(source, readableStrategy); 27759 var sink = new TransformStreamSink(this, startPromise); 27760 this._writable = new WritableStream(sink, writableStrategy); 27761 assert(this._writableController !== undefined); 27762 assert(this._readableController !== undefined); 27763 var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(this._readableController); 27764 TransformStreamSetBackpressure(this, desiredSize <= 0); 27765 var transformStream = this; 27766 var startResult = InvokeOrNoop(transformer, 'start', [transformStream._transformStreamController]); 27767 startPromise_resolve(startResult); 27768 startPromise.catch(function (e) { 27769 if (transformStream._errored === false) { 27770 transformStream._errored = true; 27771 transformStream._storedError = e; 27772 } 27773 }); 27774 } 27775 _createClass(TransformStream, [{ 27776 key: 'readable', 27777 get: function get() { 27778 if (IsTransformStream(this) === false) { 27779 throw streamBrandCheckException('readable'); 27780 } 27781 return this._readable; 27782 } 27783 }, { 27784 key: 'writable', 27785 get: function get() { 27786 if (IsTransformStream(this) === false) { 27787 throw streamBrandCheckException('writable'); 27788 } 27789 return this._writable; 27790 } 27791 }]); 27792 return TransformStream; 27793 }(); 27794 module.exports = { TransformStream: TransformStream }; 27795 function defaultControllerBrandCheckException(name) { 27796 return new TypeError('TransformStreamDefaultController.prototype.' + name + ' can only be used on a TransformStreamDefaultController'); 27797 } 27798 function streamBrandCheckException(name) { 27799 return new TypeError('TransformStream.prototype.' + name + ' can only be used on a TransformStream'); 27800 } 27801}, function (module, exports, __w_pdfjs_require__) { 27802 module.exports = __w_pdfjs_require__(5); 27803}])); 27804 27805/***/ }), 27806/* 126 */ 27807/***/ (function(module, exports, __w_pdfjs_require__) { 27808 27809"use strict"; 27810 27811 27812Object.defineProperty(exports, "__esModule", { 27813 value: true 27814}); 27815exports.NetworkPdfManager = exports.LocalPdfManager = undefined; 27816 27817var _util = __w_pdfjs_require__(0); 27818 27819var _chunked_stream = __w_pdfjs_require__(63); 27820 27821var _document = __w_pdfjs_require__(127); 27822 27823var _stream = __w_pdfjs_require__(2); 27824 27825var BasePdfManager = function BasePdfManagerClosure() { 27826 function BasePdfManager() { 27827 (0, _util.unreachable)('Cannot initialize BaseManagerManager'); 27828 } 27829 BasePdfManager.prototype = { 27830 get docId() { 27831 return this._docId; 27832 }, 27833 get password() { 27834 return this._password; 27835 }, 27836 get docBaseUrl() { 27837 var docBaseUrl = null; 27838 if (this._docBaseUrl) { 27839 var absoluteUrl = (0, _util.createValidAbsoluteUrl)(this._docBaseUrl); 27840 if (absoluteUrl) { 27841 docBaseUrl = absoluteUrl.href; 27842 } else { 27843 (0, _util.warn)('Invalid absolute docBaseUrl: "' + this._docBaseUrl + '".'); 27844 } 27845 } 27846 return (0, _util.shadow)(this, 'docBaseUrl', docBaseUrl); 27847 }, 27848 onLoadedStream: function BasePdfManager_onLoadedStream() { 27849 throw new _util.NotImplementedException(); 27850 }, 27851 ensureDoc: function BasePdfManager_ensureDoc(prop, args) { 27852 return this.ensure(this.pdfDocument, prop, args); 27853 }, 27854 ensureXRef: function BasePdfManager_ensureXRef(prop, args) { 27855 return this.ensure(this.pdfDocument.xref, prop, args); 27856 }, 27857 ensureCatalog: function BasePdfManager_ensureCatalog(prop, args) { 27858 return this.ensure(this.pdfDocument.catalog, prop, args); 27859 }, 27860 getPage: function BasePdfManager_getPage(pageIndex) { 27861 return this.pdfDocument.getPage(pageIndex); 27862 }, 27863 cleanup: function BasePdfManager_cleanup() { 27864 return this.pdfDocument.cleanup(); 27865 }, 27866 ensure: function BasePdfManager_ensure(obj, prop, args) { 27867 return new _util.NotImplementedException(); 27868 }, 27869 requestRange: function BasePdfManager_requestRange(begin, end) { 27870 return new _util.NotImplementedException(); 27871 }, 27872 requestLoadedStream: function BasePdfManager_requestLoadedStream() { 27873 return new _util.NotImplementedException(); 27874 }, 27875 sendProgressiveData: function BasePdfManager_sendProgressiveData(chunk) { 27876 return new _util.NotImplementedException(); 27877 }, 27878 updatePassword: function BasePdfManager_updatePassword(password) { 27879 this._password = password; 27880 }, 27881 terminate: function BasePdfManager_terminate() { 27882 return new _util.NotImplementedException(); 27883 } 27884 }; 27885 return BasePdfManager; 27886}();
27887var LocalPdfManager = function LocalPdfManagerClosure() { 27888 function LocalPdfManager(docId, data, password, evaluatorOptions, docBaseUrl) { 27889 this._docId = docId; 27890 this._password = password; 27891 this._docBaseUrl = docBaseUrl; 27892 this.evaluatorOptions = evaluatorOptions; 27893 var stream = new _stream.Stream(data); 27894 this.pdfDocument = new _document.PDFDocument(this, stream); 27895 this._loadedStreamCapability = (0, _util.createPromiseCapability)(); 27896 this._loadedStreamCapability.resolve(stream); 27897 } 27898 _util.Util.inherit(LocalPdfManager, BasePdfManager, { 27899 ensure: function LocalPdfManager_ensure(obj, prop, args) { 27900 return new Promise(function (resolve, reject) { 27901 try { 27902 var value = obj[prop]; 27903 var result; 27904 if (typeof value === 'function') { 27905 result = value.apply(obj, args); 27906 } else { 27907 result = value; 27908 } 27909 resolve(result); 27910 } catch (e) { 27911 reject(e); 27912 } 27913 }); 27914 }, 27915 requestRange: function LocalPdfManager_requestRange(begin, end) { 27916 return Promise.resolve(); 27917 }, 27918 requestLoadedStream: function LocalPdfManager_requestLoadedStream() {}, 27919 onLoadedStream: function LocalPdfManager_onLoadedStream() { 27920 return this._loadedStreamCapability.promise; 27921 }, 27922 terminate: function LocalPdfManager_terminate() {} 27923 }); 27924 return LocalPdfManager; 27925}(); 27926var NetworkPdfManager = function NetworkPdfManagerClosure() { 27927 function NetworkPdfManager(docId, pdfNetworkStream, args, evaluatorOptions, docBaseUrl) { 27928 this._docId = docId; 27929 this._password = args.password; 27930 this._docBaseUrl = docBaseUrl; 27931 this.msgHandler = args.msgHandler; 27932 this.evaluatorOptions = evaluatorOptions; 27933 var params = { 27934 msgHandler: args.msgHandler, 27935 url: args.url, 27936 length: args.length, 27937 disableAutoFetch: args.disableAutoFetch, 27938 rangeChunkSize: args.rangeChunkSize 27939 }; 27940 this.streamManager = new _chunked_stream.ChunkedStreamManager(pdfNetworkStream, params); 27941 this.pdfDocument = new _document.PDFDocument(this, this.streamManager.getStream()); 27942 } 27943 _util.Util.inherit(NetworkPdfManager, BasePdfManager, { 27944 ensure: function NetworkPdfManager_ensure(obj, prop, args) { 27945 var pdfManager = this; 27946 return new Promise(function (resolve, reject) { 27947 function ensureHelper() { 27948 try { 27949 var result; 27950 var value = obj[prop]; 27951 if (typeof value === 'function') { 27952 result = value.apply(obj, args); 27953 } else { 27954 result = value; 27955 } 27956 resolve(result); 27957 } catch (e) { 27958 if (!(e instanceof _util.MissingDataException)) { 27959 reject(e); 27960 return; 27961 } 27962 pdfManager.streamManager.requestRange(e.begin, e.end).then(ensureHelper, reject); 27963 } 27964 } 27965 ensureHelper(); 27966 }); 27967 }, 27968 requestRange: function NetworkPdfManager_requestRange(begin, end) { 27969 return this.streamManager.requestRange(begin, end); 27970 }, 27971 requestLoadedStream: function NetworkPdfManager_requestLoadedStream() { 27972 this.streamManager.requestAllChunks(); 27973 }, 27974 sendProgressiveData: function NetworkPdfManager_sendProgressiveData(chunk) { 27975 this.streamManager.onReceiveData({ chunk: chunk }); 27976 }, 27977 onLoadedStream: function NetworkPdfManager_onLoadedStream() { 27978 return this.streamManager.onLoadedStream(); 27979 }, 27980 terminate: function NetworkPdfManager_terminate() { 27981 this.streamManager.abort(); 27982 } 27983 }); 27984 return NetworkPdfManager; 27985}(); 27986exports.LocalPdfManager = LocalPdfManager; 27987exports.NetworkPdfManager = NetworkPdfManager; 27988 27989/***/ }), 27990/* 127 */ 27991/***/ (function(module, exports, __w_pdfjs_require__) { 27992 27993"use strict"; 27994 27995 27996Object.defineProperty(exports, "__esModule", { 27997 value: true 27998}); 27999exports.PDFDocument = exports.Page = undefined; 28000 28001var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); }
28001 else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 28002 28003var _obj = __w_pdfjs_require__(64); 28004 28005var _primitives = __w_pdfjs_require__(1); 28006 28007var _util = __w_pdfjs_require__(0); 28008 28009var _stream = __w_pdfjs_require__(2); 28010 28011var _annotation = __w_pdfjs_require__(134); 28012 28013var _crypto = __w_pdfjs_require__(67); 28014 28015var _parser = __w_pdfjs_require__(26); 28016 28017var _operator_list = __w_pdfjs_require__(42); 28018 28019var _evaluator = __w_pdfjs_require__(135); 28020 28021var _function = __w_pdfjs_require__(71); 28022 28023var Page = function PageClosure() { 28024 var DEFAULT_USER_UNIT = 1.0; 28025 var LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; 28026 function isAnnotationRenderable(annotation, intent) { 28027 return intent === 'display' && annotation.viewable || intent === 'print' && annotation.printable; 28028 } 28029 function Page(_ref) { 28030 var pdfManager = _ref.pdfManager, 28031 xref = _ref.xref, 28032 pageIndex = _ref.pageIndex, 28033 pageDict = _ref.pageDict, 28034 ref = _ref.ref, 28035 fontCache = _ref.fontCache, 28036 builtInCMapCache = _ref.builtInCMapCache, 28037 pdfFunctionFactory = _ref.pdfFunctionFactory; 28038 28039 this.pdfManager = pdfManager; 28040 this.pageIndex = pageIndex; 28041 this.pageDict = pageDict; 28042 this.xref = xref; 28043 this.ref = ref; 28044 this.fontCache = fontCache; 28045 this.builtInCMapCache = builtInCMapCache; 28046 this.pdfFunctionFactory = pdfFunctionFactory; 28047 this.evaluatorOptions = pdfManager.evaluatorOptions; 28048 this.resourcesPromise = null; 28049 var uniquePrefix = 'p' + this.pageIndex + '_'; 28050 var idCounters = { obj: 0 }; 28051 this.idFactory = { 28052 createObjId: function createObjId() { 28053 return uniquePrefix + ++idCounters.obj; 28054 } 28055 }; 28056 } 28057 Page.prototype = { 28058 getPageProp: function Page_getPageProp(key) { 28059 return this.pageDict.get(key); 28060 }, 28061 getInheritedPageProp: function Page_getInheritedPageProp(key, getArray) { 28062 var dict = this.pageDict, 28063 valueArray = null, 28064 loopCount = 0; 28065 var MAX_LOOP_COUNT = 100; 28066 getArray = getArray || false; 28067 while (dict) { 28068 var value = getArray ? dict.getArray(key) : dict.get(key); 28069 if (value !== undefined) { 28070 if (!valueArray) { 28071 valueArray = []; 28072 } 28073 valueArray.push(value); 28074 } 28075 if (++loopCount > MAX_LOOP_COUNT) { 28076 (0, _util.warn)('getInheritedPageProp: maximum loop count exceeded for ' + key); 28077 return valueArray ? valueArray[0] : undefined; 28078 } 28079 dict = dict.get('Parent'); 28080 } 28081 if (!valueArray) { 28082 return undefined; 28083 } 28084 if (valueArray.length === 1 || !(0, _primitives.isDict)(valueArray[0])) { 28085 return valueArray[0]; 28086 } 28087 return _primitives.Dict.merge(this.xref, valueArray); 28088 }, 28089 get content() { 28090 return this.getPageProp('Contents'); 28091 }, 28092 get resources() { 28093 return (0, _util.shadow)(this, 'resources', this.getInheritedPageProp('Resources') || _primitives.Dict.empty); 28094 }, 28095 get mediaBox() { 28096 var mediaBox = this.getInheritedPageProp('MediaBox', true); 28097 if (!Array.isArray(mediaBox) || mediaBox.length !== 4) { 28098 return (0, _util.shadow)(this, 'mediaBox', LETTER_SIZE_MEDIABOX); 28099 } 28100 return (0, _util.shadow)(this, 'mediaBox', mediaBox); 28101 }, 28102 get cropBox() { 28103 var cropBox = this.getInheritedPageProp('CropBox', true); 28104 if (!Array.isArray(cropBox) || cropBox.length !== 4) { 28105 return (0, _util.shadow)(this, 'cropBox', this.mediaBox); 28106 } 28107 return (0, _util.shadow)(this, 'cropBox', cropBox); 28108 }, 28109 get userUnit() { 28110 var obj = this.getPageProp('UserUnit'); 28111 if (!(0, _util.isNum)(obj) || obj <= 0) { 28112 obj = DEFAULT_USER_UNIT; 28113 } 28114 return (0, _util.shadow)(this, 'userUnit', obj); 28115 }, 28116 get view() { 28117 var mediaBox = this.mediaBox, 28118 cropBox = this.cropBox; 28119 if (mediaBox === cropBox) { 28120 return (0, _util.shadow)(this, 'view', mediaBox); 28121 } 28122 var intersection = _util.Util.intersect(cropBox, mediaBox); 28123 return (0, _util.shadow)(this, 'view', intersection || mediaBox); 28124 }, 28125 get rotate() { 28126 var rotate = this.getInheritedPageProp('Rotate') || 0; 28127 if (rotate % 90 !== 0) { 28128 rotate = 0; 28129 } else if (rotate >= 360) { 28130 rotate = rotate % 360; 28131 } else if (rotate < 0) { 28132 rotate = (rotate % 360 + 360) % 360; 28133 } 28134 return (0, _util.shadow)(this, 'rotate', rotate); 28135 }, 28136 getContentStream: function Page_getContentStream() { 28137 var content = this.content; 28138 var stream; 28139 if (Array.isArray(content)) { 28140 var xref = this.xref; 28141 var i, 28142 n = content.length; 28143 var streams = []; 28144 for (i = 0; i < n; ++i) { 28145 streams.push(xref.fetchIfRef(content[i])); 28146 } 28147 stream = new _stream.StreamsSequenceStream(streams); 28148 } else if ((0, _primitives.isStream)(content)) { 28149 stream = content; 28150 } else { 28151 stream = new _stream.NullStream(); 28152 } 28153 return stream; 28154 }, 28155 loadResources: function Page_loadResources(keys) { 28156 var _this = this; 28157 28158 if (!this.resourcesPromise) { 28159 this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); 28160 } 28161 return this.resourcesPromise.then(function () { 28162 var objectLoader = new _obj.ObjectLoader(_this.resources, keys, _this.xref); 28163 return objectLoader.load(); 28164 }); 28165 }, 28166 getOperatorList: function getOperatorList(_ref2) { 28167 var _this2 = this; 28168 28169 var handler = _ref2.handler, 28170 task = _ref2.task, 28171 intent = _ref2.intent, 28172 renderInteractiveForms = _ref2.renderInteractiveForms; 28173 28174 var contentStreamPromise = this.pdfManager.ensure(this, 'getContentStream'); 28175 var resourcesPromise = this.loadResources(['ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font']); 28176 var partialEvaluator = new _evaluator.PartialEvaluator({ 28177 pdfManager: this.pdfManager, 28178 xref: this.xref, 28179 handler: handler, 28180 pageIndex: this.pageIndex, 28181 idFactory: this.idFactory, 28182 fontCache: this.fontCache, 28183 builtInCMapCache: this.builtInCMapCache, 28184 options: this.evaluatorOptions, 28185 pdfFunctionFactory: this.pdfFunctionFactory 28186 }); 28187 var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); 28188 var pageListPromise = dataPromises.then(function (_ref3) { 28189 var _ref4 = _slicedToArray(_ref3, 1), 28190 contentStream = _ref4[0]; 28191 28192 var opList = new _operator_list.OperatorList(intent, handler, _this2.pageIndex); 28193 handler.send('StartRenderPage', { 28194 transparency: partialEvaluator.hasBlendModes(_this2.resources), 28195 pageIndex: _this2.pageIndex, 28196 intent: intent 28197 }); 28198 return partialEvaluator.getOperatorList({ 28199 stream: contentStream, 28200 task: task, 28201 resources: _this2.resources, 28202 operatorList: opList 28203 }).then(function () { 28204 return opList; 28205 }); 28206 });
vendor: 3,533 bytes, lines 28207-28298
28207 var annotationsPromise = this.pdfManager.ensure(this, 'annotations'); 28208 return Promise.all([pageListPromise, annotationsPromise]).then(function (_ref5) { 28209 var _ref6 = _slicedToArray(_ref5, 2), 28210 pageOpList = _ref6[0], 28211 annotations = _ref6[1]; 28212 28213 if (annotations.length === 0) { 28214 pageOpList.flush(true); 28215 return pageOpList; 28216 } 28217 var i, 28218 ii, 28219 opListPromises = []; 28220 for (i = 0, ii = annotations.length; i < ii; i++) { 28221 if (isAnnotationRenderable(annotations[i], intent)) { 28222 opListPromises.push(annotations[i].getOperatorList(partialEvaluator, task, renderInteractiveForms)); 28223 } 28224 } 28225 return Promise.all(opListPromises).then(function (opLists) { 28226 pageOpList.addOp(_util.OPS.beginAnnotations, []); 28227 for (i = 0, ii = opLists.length; i < ii; i++) { 28228 pageOpList.addOpList(opLists[i]); 28229 } 28230 pageOpList.addOp(_util.OPS.endAnnotations, []); 28231 pageOpList.flush(true); 28232 return pageOpList; 28233 }); 28234 }); 28235 }, 28236 extractTextContent: function extractTextContent(_ref7) { 28237 var _this3 = this; 28238 28239 var handler = _ref7.handler, 28240 task = _ref7.task, 28241 normalizeWhitespace = _ref7.normalizeWhitespace, 28242 sink = _ref7.sink, 28243 combineTextItems = _ref7.combineTextItems; 28244 28245 var contentStreamPromise = this.pdfManager.ensure(this, 'getContentStream'); 28246 var resourcesPromise = this.loadResources(['ExtGState', 'XObject', 'Font']); 28247 var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); 28248 return dataPromises.then(function (_ref8) { 28249 var _ref9 = _slicedToArray(_ref8, 1), 28250 contentStream = _ref9[0]; 28251 28252 var partialEvaluator = new _evaluator.PartialEvaluator({ 28253 pdfManager: _this3.pdfManager, 28254 xref: _this3.xref, 28255 handler: handler, 28256 pageIndex: _this3.pageIndex, 28257 idFactory: _this3.idFactory, 28258 fontCache: _this3.fontCache, 28259 builtInCMapCache: _this3.builtInCMapCache, 28260 options: _this3.evaluatorOptions, 28261 pdfFunctionFactory: _this3.pdfFunctionFactory 28262 }); 28263 return partialEvaluator.getTextContent({ 28264 stream: contentStream, 28265 task: task, 28266 resources: _this3.resources, 28267 normalizeWhitespace: normalizeWhitespace, 28268 combineTextItems: combineTextItems, 28269 sink: sink 28270 }); 28271 }); 28272 }, 28273 28274 getAnnotationsData: function Page_getAnnotationsData(intent) { 28275 var annotations = this.annotations; 28276 var annotationsData = []; 28277 for (var i = 0, n = annotations.length; i < n; ++i) { 28278 if (!intent || isAnnotationRenderable(annotations[i], intent)) { 28279 annotationsData.push(annotations[i].data); 28280 } 28281 } 28282 return annotationsData; 28283 }, 28284 get annotations() { 28285 var annotations = []; 28286 var annotationRefs = this.getInheritedPageProp('Annots') || []; 28287 for (var i = 0, n = annotationRefs.length; i < n; ++i) { 28288 var annotationRef = annotationRefs[i]; 28289 var annotation = _annotation.AnnotationFactory.create(this.xref, annotationRef, this.pdfManager, this.idFactory); 28290 if (annotation) { 28291 annotations.push(annotation); 28292 } 28293 } 28294 return (0, _util.shadow)(this, 'annotations', annotations); 28295 } 28296 }; 28297 return Page; 28298}();
28299var PDFDocument = function PDFDocumentClosure() { 28300 var FINGERPRINT_FIRST_BYTES = 1024; 28301 var EMPTY_FINGERPRINT = '\x00\x00\x00\x00\x00\x00\x00' + '\x00\x00\x00\x00\x00\x00\x00\x00\x00'; 28302 function PDFDocument(pdfManager, arg) { 28303 var stream; 28304 if ((0, _primitives.isStream)(arg)) { 28305 stream = arg; 28306 } else if ((0, _util.isArrayBuffer)(arg)) { 28307 stream = new _stream.Stream(arg); 28308 } else { 28309 throw new Error('PDFDocument: Unknown argument type'); 28310 } 28311 if (stream.length <= 0) { 28312 throw new Error('PDFDocument: stream must have data'); 28313 } 28314 this.pdfManager = pdfManager; 28315 this.stream = stream; 28316 this.xref = new _obj.XRef(stream, pdfManager); 28317 var evaluatorOptions = pdfManager.evaluatorOptions; 28318 this.pdfFunctionFactory = new _function.PDFFunctionFactory({ 28319 xref: this.xref, 28320 isEvalSupported: evaluatorOptions.isEvalSupported 28321 }); 28322 } 28323 function find(stream, needle, limit, backwards) { 28324 var pos = stream.pos; 28325 var end = stream.end; 28326 var strBuf = []; 28327 if (pos + limit > end) { 28328 limit = end - pos; 28329 } 28330 for (var n = 0; n < limit; ++n) { 28331 strBuf.push(String.fromCharCode(stream.getByte())); 28332 } 28333 var str = strBuf.join(''); 28334 stream.pos = pos; 28335 var index = backwards ? str.lastIndexOf(needle) : str.indexOf(needle); 28336 if (index === -1) { 28337 return false; 28338 } 28339 stream.pos += index; 28340 return true; 28341 } 28342 var DocumentInfoValidators = { 28343 get entries() { 28344 return (0, _util.shadow)(this, 'entries', { 28345 Title: _util.isString, 28346 Author: _util.isString, 28347 Subject: _util.isString, 28348 Keywords: _util.isString, 28349 Creator: _util.isString, 28350 Producer: _util.isString, 28351 CreationDate: _util.isString, 28352 ModDate: _util.isString, 28353 Trapped: _primitives.isName 28354 }); 28355 } 28356 }; 28357 PDFDocument.prototype = { 28358 parse: function PDFDocument_parse(recoveryMode) { 28359 this.setup(recoveryMode); 28360 var version = this.catalog.catDict.get('Version'); 28361 if ((0, _primitives.isName)(version)) { 28362 this.pdfFormatVersion = version.name; 28363 } 28364 try { 28365 this.acroForm = this.catalog.catDict.get('AcroForm'); 28366 if (this.acroForm) { 28367 this.xfa = this.acroForm.get('XFA'); 28368 var fields = this.acroForm.get('Fields'); 28369 if ((!fields || !Array.isArray(fields) || fields.length === 0) && !this.xfa) { 28370 this.acroForm = null; 28371 } 28372 } 28373 } catch (ex) { 28374 if (ex instanceof _util.MissingDataException) { 28375 throw ex; 28376 } 28377 (0, _util.info)('Something wrong with AcroForm entry'); 28378 this.acroForm = null; 28379 } 28380 }, 28381 get linearization() { 28382 var linearization = null; 28383 if (this.stream.length) { 28384 try { 28385 linearization = _parser.Linearization.create(this.stream); 28386 } catch (err) { 28387 if (err instanceof _util.MissingDataException) { 28388 throw err; 28389 } 28390 (0, _util.info)(err); 28391 } 28392 } 28393 return (0, _util.shadow)(this, 'linearization', linearization); 28394 }, 28395 get startXRef() { 28396 var stream = this.stream; 28397 var startXRef = 0; 28398 var linearization = this.linearization; 28399 if (linearization) { 28400 stream.reset(); 28401 if (find(stream, 'endobj', 1024)) { 28402 startXRef = stream.pos + 6; 28403 } 28404 } else { 28405 var step = 1024; 28406 var found = false, 28407 pos = stream.end; 28408 while (!found && pos > 0) { 28409 pos -= step - 'startxref'.length; 28410 if (pos < 0) { 28411 pos = 0; 28412 } 28413 stream.pos = pos; 28414 found = find(stream, 'startxref', step, true); 28415 } 28416 if (found) { 28417 stream.skip(9); 28418 var ch; 28419 do { 28420 ch = stream.getByte(); 28421 } while ((0, _util.isSpace)(ch)); 28422 var str = ''; 28423 while (ch >= 0x20 && ch <= 0x39) { 28424 str += String.fromCharCode(ch); 28425 ch = stream.getByte(); 28426 } 28427 startXRef = parseInt(str, 10); 28428 if (isNaN(startXRef)) { 28429 startXRef = 0; 28430 } 28431 } 28432 } 28433 return (0, _util.shadow)(this, 'startXRef', startXRef); 28434 }, 28435 get mainXRefEntriesOffset() { 28436 var mainXRefEntriesOffset = 0; 28437 var linearization = this.linearization; 28438 if (linearization) { 28439 mainXRefEntriesOffset = linearization.mainXRefEntriesOffset; 28440 } 28441 return (0, _util.shadow)(this, 'mainXRefEntriesOffset', mainXRefEntriesOffset); 28442 }, 28443 checkHeader: function PDFDocument_checkHeader() { 28444 var stream = this.stream; 28445 stream.reset(); 28446 if (find(stream, '%PDF-', 1024)) { 28447 stream.moveStart(); 28448 var MAX_VERSION_LENGTH = 12; 28449 var version = '', 28450 ch; 28451 while ((ch = stream.getByte()) > 0x20) { 28452 if (version.length >= MAX_VERSION_LENGTH) { 28453 break; 28454 } 28455 version += String.fromCharCode(ch); 28456 } 28457 if (!this.pdfFormatVersion) { 28458 this.pdfFormatVersion = version.substring(5); 28459 } 28460 return; 28461 } 28462 }, 28463 parseStartXRef: function PDFDocument_parseStartXRef() { 28464 var startXRef = this.startXRef; 28465 this.xref.setStartXRef(startXRef); 28466 }, 28467 setup: function PDFDocument_setup(recoveryMode) { 28468 var _this4 = this; 28469 28470 this.xref.parse(recoveryMode); 28471 var pageFactory = { 28472 createPage: function createPage(pageIndex, dict, ref, fontCache, builtInCMapCache) { 28473 return new Page({ 28474 pdfManager: _this4.pdfManager, 28475 xref: _this4.xref, 28476 pageIndex: pageIndex, 28477 pageDict: dict, 28478 ref: ref, 28479 fontCache: fontCache, 28480 builtInCMapCache: builtInCMapCache, 28481 pdfFunctionFactory: _this4.pdfFunctionFactory 28482 }); 28483 } 28484 }; 28485 this.catalog = new _obj.Catalog(this.pdfManager, this.xref, pageFactory); 28486 }, 28487 get numPages() { 28488 var linearization = this.linearization; 28489 var num = linearization ? linearization.numPages : this.catalog.numPages; 28490 return (0, _util.shadow)(this, 'numPages', num); 28491 }, 28492 get documentInfo() { 28493 var docInfo = { 28494 PDFFormatVersion: this.pdfFormatVersion, 28495 IsAcroFormPresent: !!this.acroForm, 28496 IsXFAPresent: !!this.xfa 28497 }; 28498 var infoDict;
28499 try { 28500 infoDict = this.xref.trailer.get('Info'); 28501 } catch (err) { 28502 if (err instanceof _util.MissingDataException) { 28503 throw err; 28504 } 28505 (0, _util.info)('The document information dictionary is invalid.'); 28506 } 28507 if (infoDict) { 28508 var validEntries = DocumentInfoValidators.entries; 28509 for (var key in validEntries) { 28510 if (infoDict.has(key)) { 28511 var value = infoDict.get(key); 28512 if (validEntries[key](value)) { 28513 docInfo[key] = typeof value !== 'string' ? value : (0, _util.stringToPDFString)(value); 28514 } else { 28515 (0, _util.info)('Bad value in document info for "' + key + '"'); 28516 } 28517 } 28518 } 28519 } 28520 return (0, _util.shadow)(this, 'documentInfo', docInfo); 28521 }, 28522 get fingerprint() { 28523 var xref = this.xref, 28524 hash, 28525 fileID = ''; 28526 var idArray = xref.trailer.get('ID'); 28527 if (Array.isArray(idArray) && idArray[0] && (0, _util.isString)(idArray[0]) && idArray[0] !== EMPTY_FINGERPRINT) { 28528 hash = (0, _util.stringToBytes)(idArray[0]); 28529 } else { 28530 if (this.stream.ensureRange) { 28531 this.stream.ensureRange(0, Math.min(FINGERPRINT_FIRST_BYTES, this.stream.end)); 28532 } 28533 hash = (0, _crypto.calculateMD5)(this.stream.bytes.subarray(0, FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES); 28534 } 28535 for (var i = 0, n = hash.length; i < n; i++) { 28536 var hex = hash[i].toString(16); 28537 fileID += hex.length === 1 ? '0' + hex : hex; 28538 } 28539 return (0, _util.shadow)(this, 'fingerprint', fileID); 28540 }, 28541 getPage: function PDFDocument_getPage(pageIndex) { 28542 return this.catalog.getPage(pageIndex); 28543 }, 28544 cleanup: function PDFDocument_cleanup() { 28545 return this.catalog.cleanup(); 28546 } 28547 }; 28548 return PDFDocument; 28549}(); 28550exports.Page = Page; 28551exports.PDFDocument = PDFDocument; 28552 28553/***/ }), 28554/* 128 */ 28555/***/ (function(module, exports, __w_pdfjs_require__) { 28556 28557"use strict"; 28558 28559 28560Object.defineProperty(exports, "__esModule", { 28561 value: true 28562}); 28563exports.CCITTFaxStream = undefined; 28564 28565var _primitives = __w_pdfjs_require__(1); 28566 28567var _ccitt = __w_pdfjs_require__(129); 28568 28569var _stream = __w_pdfjs_require__(2); 28570 28571var CCITTFaxStream = function CCITTFaxStreamClosure() { 28572 function CCITTFaxStream(str, maybeLength, params) { 28573 this.str = str; 28574 this.dict = str.dict; 28575 if (!(0, _primitives.isDict)(params)) { 28576 params = _primitives.Dict.empty; 28577 } 28578 var source = { 28579 next: function next() { 28580 return str.getByte(); 28581 } 28582 }; 28583 this.ccittFaxDecoder = new _ccitt.CCITTFaxDecoder(source, { 28584 K: params.get('K'), 28585 EndOfLine: params.get('EndOfLine'), 28586 EncodedByteAlign: params.get('EncodedByteAlign'), 28587 Columns: params.get('Columns'), 28588 Rows: params.get('Rows'), 28589 EndOfBlock: params.get('EndOfBlock'), 28590 BlackIs1: params.get('BlackIs1') 28591 }); 28592 _stream.DecodeStream.call(this, maybeLength); 28593 } 28594 CCITTFaxStream.prototype = Object.create(_stream.DecodeStream.prototype); 28595 CCITTFaxStream.prototype.readBlock = function () { 28596 while (!this.eof) { 28597 var c = this.ccittFaxDecoder.readNextChar(); 28598 if (c === -1) { 28599 this.eof = true; 28600 return; 28601 } 28602 this.ensureBuffer(this.bufferLength + 1); 28603 this.buffer[this.bufferLength++] = c; 28604 } 28605 }; 28606 return CCITTFaxStream; 28607}(); 28608exports.CCITTFaxStream = CCITTFaxStream; 28609 28610/***/ }), 28611/* 129 */ 28612/***/ (function(module, exports, __w_pdfjs_require__) { 28613 28614"use strict"; 28615 28616 28617Object.defineProperty(exports, "__esModule", { 28618 value: true 28619}); 28620exports.CCITTFaxDecoder = undefined; 28621 28622var _util = __w_pdfjs_require__(0); 28623 28624var CCITTFaxDecoder = function CCITTFaxDecoder() { 28625 var ccittEOL = -2; 28626 var ccittEOF = -1; 28627 var twoDimPass = 0; 28628 var twoDimHoriz = 1; 28629 var twoDimVert0 = 2; 28630 var twoDimVertR1 = 3; 28631 var twoDimVertL1 = 4; 28632 var twoDimVertR2 = 5; 28633 var twoDimVertL2 = 6; 28634 var twoDimVertR3 = 7; 28635 var twoDimVertL3 = 8;
28636 var twoDimTable = [[-1, -1], [-1, -1], [7, twoDimVertL3], [7, twoDimVertR3], [6, twoDimVertL2], [6, twoDimVertL2], [6, twoDimVertR2], [6, twoDimVertR2], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0]]; 28637 var whiteTable1 = [[-1, -1], [12, ccittEOL], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [12, 1984], [12, 2048], [12, 2112], [12, 2176], [12, 2240], [12, 2304], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [12, 2368], [12, 2432], [12, 2496], [12, 2560]]; 28638 var whiteTable2 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [8, 29], [8, 29], [8, 30], [8, 30], [8, 45], [8, 45], [8, 46], [8, 46], [7, 22], [7, 22], [7, 22], [7, 22], [7, 23], [7, 23], [7, 23], [7, 23], [8, 47], [8, 47], [8, 48], [8, 48], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [7, 20], [7, 20], [7, 20], [7, 20], [8, 33], [8, 33], [8, 34], [8, 34], [8, 35], [8, 35], [8, 36], [8, 36], [8, 37], [8, 37], [8, 38], [8, 38], [7, 19], [7, 19], [7, 19], [7, 19], [8, 31], [8, 31], [8, 32], [8, 32], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [8, 53], [8, 53], [8, 54], [8, 54], [7, 26], [7, 26], [7, 26], [7, 26], [8, 39], [8, 39], [8, 40], [8, 40], [8, 41], [8, 41], [8, 42], [8, 42], [8, 43], [8, 43], [8, 44], [8, 44], [7, 21], [7, 21], [7, 21], [7, 21], [7, 28], [7, 28], [7, 28], [7, 28], [8, 61], [8, 61], [8, 62], [8, 62], [8, 63], [8, 63], [8, 0], [8, 0], [8, 320], [8, 320], [8, 384], [8, 384], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [7, 27], [7, 27], [7, 27], [7, 27], [8, 59], [8, 59], [8, 60], [8, 60], [9, 1472], [9, 1536], [9, 1600], [9, 1728], [7, 18], [7, 18], [7, 18], [7, 18], [7, 24], [7, 24], [7, 24], [7, 24], [8, 49], [8, 49], [8, 50], [8, 50], [8, 51], [8, 51], [8, 52], [8, 52], [7, 25], [7, 25], [7, 25], [7, 25], [8, 55], [8, 55], [8, 56], [8, 56], [8, 57], [8, 57], [8, 58], [8, 58], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [8, 448], [8, 448], [8, 512], [8, 512], [9, 704], [9, 768], [8, 640], [8, 640], [8, 576], [8, 576], [9, 832], [9, 896], [9, 960], [9, 1024], [9, 1088], [9, 1152], [9, 1216], [9, 1280], [9, 1344], [9, 1408], [7, 256], [7, 256], [7, 256], [7, 256], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7]];
vendor: 5,307 bytes, lines 28639-28688
28639 var blackTable1 = [[-1, -1], [-1, -1], [12, ccittEOL], [12, ccittEOL], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [11, 1792], [11, 1792], [12, 1984], [12, 1984], [12, 2048], [12, 2048], [12, 2112], [12, 2112], [12, 2176], [12, 2176], [12, 2240], [12, 2240], [12, 2304], [12, 2304], [11, 1856], [11, 1856], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [11, 1920], [11, 1920], [12, 2368], [12, 2368], [12, 2432], [12, 2432], [12, 2496], [12, 2496], [12, 2560], [12, 2560], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [12, 52], [12, 52], [13, 640], [13, 704], [13, 768], [13, 832], [12, 55], [12, 55], [12, 56], [12, 56], [13, 1280], [13, 1344], [13, 1408], [13, 1472], [12, 59], [12, 59], [12, 60], [12, 60], [13, 1536], [13, 1600], [11, 24], [11, 24], [11, 24], [11, 24], [11, 25], [11, 25], [11, 25], [11, 25], [13, 1664], [13, 1728], [12, 320], [12, 320], [12, 384], [12, 384], [12, 448], [12, 448], [13, 512], [13, 576], [12, 53], [12, 53], [12, 54], [12, 54], [13, 896], [13, 960], [13, 1024], [13, 1088], [13, 1152], [13, 1216], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64]]; 28640 var blackTable2 = [[8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [11, 23], [11, 23], [12, 50], [12, 51], [12, 44], [12, 45], [12, 46], [12, 47], [12, 57], [12, 58], [12, 61], [12, 256], [10, 16], [10, 16], [10, 16], [10, 16], [10, 17], [10, 17], [10, 17], [10, 17], [12, 48], [12, 49], [12, 62], [12, 63], [12, 30], [12, 31], [12, 32], [12, 33], [12, 40], [12, 41], [11, 22], [11, 22], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [12, 128], [12, 192], [12, 26], [12, 27], [12, 28], [12, 29], [11, 19], [11, 19], [11, 20], [11, 20], [12, 34], [12, 35], [12, 36], [12, 37], [12, 38], [12, 39], [11, 21], [11, 21], [12, 42], [12, 43], [10, 0], [10, 0], [10, 0], [10, 0], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12]]; 28641 var blackTable3 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [6, 9], [6, 8], [5, 7], [5, 7], [4, 6], [4, 6], [4, 6], [4, 6], [4, 5], [4, 5], [4, 5], [4, 5], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2]]; 28642 function CCITTFaxDecoder(source) { 28643 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 28644 28645 if (!source || typeof source.next !== 'function') { 28646 throw new Error('CCITTFaxDecoder - invalid "source" parameter.'); 28647 } 28648 this.source = source; 28649 this.eof = false; 28650 this.encoding = options['K'] || 0; 28651 this.eoline = options['EndOfLine'] || false; 28652 this.byteAlign = options['EncodedByteAlign'] || false; 28653 this.columns = options['Columns'] || 1728; 28654 this.rows = options['Rows'] || 0; 28655 var eoblock = options['EndOfBlock']; 28656 if (eoblock === null || eoblock === undefined) { 28657 eoblock = true; 28658 } 28659 this.eoblock = eoblock; 28660 this.black = options['BlackIs1'] || false; 28661 this.codingLine = new Uint32Array(this.columns + 1); 28662 this.refLine = new Uint32Array(this.columns + 2); 28663 this.codingLine[0] = this.columns; 28664 this.codingPos = 0; 28665 this.row = 0; 28666 this.nextLine2D = this.encoding < 0; 28667 this.inputBits = 0; 28668 this.inputBuf = 0; 28669 this.outputBits = 0; 28670 this.rowsDone = false; 28671 var code1 = void 0; 28672 while ((code1 = this._lookBits(12)) === 0) { 28673 this._eatBits(1); 28674 } 28675 if (code1 === 1) { 28676 this._eatBits(12); 28677 } 28678 if (this.encoding > 0) { 28679 this.nextLine2D = !this._lookBits(1); 28680 this._eatBits(1); 28681 } 28682 } 28683 CCITTFaxDecoder.prototype = { 28684 readNextChar: function readNextChar() { 28685 if (this.eof) { 28686 return -1; 28687 } 28688 var refLine = this.refLine;
vendor: 4,079 bytes, lines 28689-28792
28689 var codingLine = this.codingLine; 28690 var columns = this.columns; 28691 var refPos = void 0, 28692 blackPixels = void 0, 28693 bits = void 0, 28694 i = void 0; 28695 if (this.outputBits === 0) { 28696 if (this.rowsDone) { 28697 this.eof = true; 28698 } 28699 if (this.eof) { 28700 return -1; 28701 } 28702 this.err = false; 28703 var code1 = void 0, 28704 code2 = void 0, 28705 code3 = void 0; 28706 if (this.nextLine2D) { 28707 for (i = 0; codingLine[i] < columns; ++i) { 28708 refLine[i] = codingLine[i]; 28709 } 28710 refLine[i++] = columns; 28711 refLine[i] = columns; 28712 codingLine[0] = 0; 28713 this.codingPos = 0; 28714 refPos = 0; 28715 blackPixels = 0; 28716 while (codingLine[this.codingPos] < columns) { 28717 code1 = this._getTwoDimCode(); 28718 switch (code1) { 28719 case twoDimPass: 28720 this._addPixels(refLine[refPos + 1], blackPixels); 28721 if (refLine[refPos + 1] < columns) { 28722 refPos += 2; 28723 } 28724 break; 28725 case twoDimHoriz: 28726 code1 = code2 = 0; 28727 if (blackPixels) { 28728 do { 28729 code1 += code3 = this._getBlackCode(); 28730 } while (code3 >= 64); 28731 do { 28732 code2 += code3 = this._getWhiteCode(); 28733 } while (code3 >= 64); 28734 } else { 28735 do { 28736 code1 += code3 = this._getWhiteCode(); 28737 } while (code3 >= 64); 28738 do { 28739 code2 += code3 = this._getBlackCode(); 28740 } while (code3 >= 64); 28741 } 28742 this._addPixels(codingLine[this.codingPos] + code1, blackPixels); 28743 if (codingLine[this.codingPos] < columns) { 28744 this._addPixels(codingLine[this.codingPos] + code2, blackPixels ^ 1); 28745 } 28746 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 28747 refPos += 2; 28748 } 28749 break; 28750 case twoDimVertR3: 28751 this._addPixels(refLine[refPos] + 3, blackPixels); 28752 blackPixels ^= 1; 28753 if (codingLine[this.codingPos] < columns) { 28754 ++refPos; 28755 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 28756 refPos += 2; 28757 } 28758 } 28759 break; 28760 case twoDimVertR2: 28761 this._addPixels(refLine[refPos] + 2, blackPixels); 28762 blackPixels ^= 1; 28763 if (codingLine[this.codingPos] < columns) { 28764 ++refPos; 28765 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 28766 refPos += 2; 28767 } 28768 } 28769 break; 28770 case twoDimVertR1: 28771 this._addPixels(refLine[refPos] + 1, blackPixels); 28772 blackPixels ^= 1; 28773 if (codingLine[this.codingPos] < columns) { 28774 ++refPos; 28775 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 28776 refPos += 2; 28777 } 28778 } 28779 break; 28780 case twoDimVert0: 28781 this._addPixels(refLine[refPos], blackPixels); 28782 blackPixels ^= 1; 28783 if (codingLine[this.codingPos] < columns) { 28784 ++refPos; 28785 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 28786 refPos += 2; 28787 } 28788 } 28789 break; 28790 case twoDimVertL3: 28791 this._addPixelsNeg(refLine[refPos] - 3, blackPixels); 28792 blackPixels ^= 1;
vendor: 11,110 bytes, lines 28793-29150
28793 if (codingLine[this.codingPos] < columns) { 28794 if (refPos > 0) { 28795 --refPos; 28796 } else { 28797 ++refPos; 28798 } 28799 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 28800 refPos += 2; 28801 } 28802 } 28803 break; 28804 case twoDimVertL2: 28805 this._addPixelsNeg(refLine[refPos] - 2, blackPixels); 28806 blackPixels ^= 1; 28807 if (codingLine[this.codingPos] < columns) { 28808 if (refPos > 0) { 28809 --refPos; 28810 } else { 28811 ++refPos; 28812 } 28813 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 28814 refPos += 2; 28815 } 28816 } 28817 break; 28818 case twoDimVertL1: 28819 this._addPixelsNeg(refLine[refPos] - 1, blackPixels); 28820 blackPixels ^= 1; 28821 if (codingLine[this.codingPos] < columns) { 28822 if (refPos > 0) { 28823 --refPos; 28824 } else { 28825 ++refPos; 28826 } 28827 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 28828 refPos += 2; 28829 } 28830 } 28831 break; 28832 case ccittEOF: 28833 this._addPixels(columns, 0); 28834 this.eof = true; 28835 break; 28836 default: 28837 (0, _util.info)('bad 2d code'); 28838 this._addPixels(columns, 0); 28839 this.err = true; 28840 } 28841 } 28842 } else { 28843 codingLine[0] = 0; 28844 this.codingPos = 0; 28845 blackPixels = 0; 28846 while (codingLine[this.codingPos] < columns) { 28847 code1 = 0; 28848 if (blackPixels) { 28849 do { 28850 code1 += code3 = this._getBlackCode(); 28851 } while (code3 >= 64); 28852 } else { 28853 do { 28854 code1 += code3 = this._getWhiteCode(); 28855 } while (code3 >= 64); 28856 } 28857 this._addPixels(codingLine[this.codingPos] + code1, blackPixels); 28858 blackPixels ^= 1; 28859 } 28860 } 28861 var gotEOL = false; 28862 if (this.byteAlign) { 28863 this.inputBits &= ~7; 28864 } 28865 if (!this.eoblock && this.row === this.rows - 1) { 28866 this.rowsDone = true; 28867 } else { 28868 code1 = this._lookBits(12); 28869 if (this.eoline) { 28870 while (code1 !== ccittEOF && code1 !== 1) { 28871 this._eatBits(1); 28872 code1 = this._lookBits(12); 28873 } 28874 } else { 28875 while (code1 === 0) { 28876 this._eatBits(1); 28877 code1 = this._lookBits(12); 28878 } 28879 } 28880 if (code1 === 1) { 28881 this._eatBits(12); 28882 gotEOL = true; 28883 } else if (code1 === ccittEOF) { 28884 this.eof = true; 28885 } 28886 } 28887 if (!this.eof && this.encoding > 0 && !this.rowsDone) { 28888 this.nextLine2D = !this._lookBits(1); 28889 this._eatBits(1); 28890 } 28891 if (this.eoblock && gotEOL && this.byteAlign) { 28892 code1 = this._lookBits(12); 28893 if (code1 === 1) { 28894 this._eatBits(12); 28895 if (this.encoding > 0) { 28896 this._lookBits(1); 28897 this._eatBits(1); 28898 } 28899 if (this.encoding >= 0) { 28900 for (i = 0; i < 4; ++i) { 28901 code1 = this._lookBits(12); 28902 if (code1 !== 1) { 28903 (0, _util.info)('bad rtc code: ' + code1); 28904 } 28905 this._eatBits(12); 28906 if (this.encoding > 0) { 28907 this._lookBits(1); 28908 this._eatBits(1); 28909 } 28910 } 28911 } 28912 this.eof = true; 28913 } 28914 } else if (this.err && this.eoline) { 28915 while (true) { 28916 code1 = this._lookBits(13); 28917 if (code1 === ccittEOF) { 28918 this.eof = true; 28919 return -1; 28920 } 28921 if (code1 >> 1 === 1) { 28922 break; 28923 } 28924 this._eatBits(1); 28925 } 28926 this._eatBits(12); 28927 if (this.encoding > 0) { 28928 this._eatBits(1); 28929 this.nextLine2D = !(code1 & 1); 28930 } 28931 } 28932 if (codingLine[0] > 0) { 28933 this.outputBits = codingLine[this.codingPos = 0]; 28934 } else { 28935 this.outputBits = codingLine[this.codingPos = 1]; 28936 } 28937 this.row++; 28938 } 28939 var c = void 0; 28940 if (this.outputBits >= 8) { 28941 c = this.codingPos & 1 ? 0 : 0xFF; 28942 this.outputBits -= 8; 28943 if (this.outputBits === 0 && codingLine[this.codingPos] < columns) { 28944 this.codingPos++; 28945 this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; 28946 } 28947 } else { 28948 bits = 8; 28949 c = 0; 28950 do { 28951 if (this.outputBits > bits) { 28952 c <<= bits; 28953 if (!(this.codingPos & 1)) { 28954 c |= 0xFF >> 8 - bits; 28955 } 28956 this.outputBits -= bits; 28957 bits = 0; 28958 } else { 28959 c <<= this.outputBits; 28960 if (!(this.codingPos & 1)) { 28961 c |= 0xFF >> 8 - this.outputBits; 28962 } 28963 bits -= this.outputBits; 28964 this.outputBits = 0; 28965 if (codingLine[this.codingPos] < columns) { 28966 this.codingPos++; 28967 this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; 28968 } else if (bits > 0) { 28969 c <<= bits; 28970 bits = 0; 28971 } 28972 } 28973 } while (bits); 28974 } 28975 if (this.black) { 28976 c ^= 0xFF; 28977 } 28978 return c; 28979 }, 28980 _addPixels: function _addPixels(a1, blackPixels) { 28981 var codingLine = this.codingLine; 28982 var codingPos = this.codingPos; 28983 if (a1 > codingLine[codingPos]) { 28984 if (a1 > this.columns) { 28985 (0, _util.info)('row is wrong length'); 28986 this.err = true; 28987 a1 = this.columns; 28988 } 28989 if (codingPos & 1 ^ blackPixels) { 28990 ++codingPos; 28991 } 28992 codingLine[codingPos] = a1; 28993 } 28994 this.codingPos = codingPos; 28995 }, 28996 _addPixelsNeg: function _addPixelsNeg(a1, blackPixels) { 28997 var codingLine = this.codingLine; 28998 var codingPos = this.codingPos; 28999 if (a1 > codingLine[codingPos]) { 29000 if (a1 > this.columns) { 29001 (0, _util.info)('row is wrong length'); 29002 this.err = true; 29003 a1 = this.columns; 29004 } 29005 if (codingPos & 1 ^ blackPixels) { 29006 ++codingPos; 29007 } 29008 codingLine[codingPos] = a1; 29009 } else if (a1 < codingLine[codingPos]) { 29010 if (a1 < 0) { 29011 (0, _util.info)('invalid code'); 29012 this.err = true; 29013 a1 = 0; 29014 } 29015 while (codingPos > 0 && a1 < codingLine[codingPos - 1]) { 29016 --codingPos; 29017 } 29018 codingLine[codingPos] = a1; 29019 } 29020 this.codingPos = codingPos; 29021 }, 29022 _findTableCode: function _findTableCode(start, end, table, limit) { 29023 var limitValue = limit || 0; 29024 for (var i = start; i <= end; ++i) { 29025 var code = this._lookBits(i); 29026 if (code === ccittEOF) { 29027 return [true, 1, false]; 29028 } 29029 if (i < end) { 29030 code <<= end - i; 29031 } 29032 if (!limitValue || code >= limitValue) { 29033 var p = table[code - limitValue]; 29034 if (p[0] === i) { 29035 this._eatBits(i); 29036 return [true, p[1], true]; 29037 } 29038 } 29039 } 29040 return [false, 0, false]; 29041 }, 29042 _getTwoDimCode: function _getTwoDimCode() { 29043 var code = 0; 29044 var p = void 0; 29045 if (this.eoblock) { 29046 code = this._lookBits(7); 29047 p = twoDimTable[code]; 29048 if (p && p[0] > 0) { 29049 this._eatBits(p[0]); 29050 return p[1]; 29051 } 29052 } else { 29053 var result = this._findTableCode(1, 7, twoDimTable); 29054 if (result[0] && result[2]) { 29055 return result[1]; 29056 } 29057 } 29058 (0, _util.info)('Bad two dim code'); 29059 return ccittEOF; 29060 }, 29061 _getWhiteCode: function _getWhiteCode() { 29062 var code = 0; 29063 var p = void 0; 29064 if (this.eoblock) { 29065 code = this._lookBits(12); 29066 if (code === ccittEOF) { 29067 return 1; 29068 } 29069 if (code >> 5 === 0) { 29070 p = whiteTable1[code]; 29071 } else { 29072 p = whiteTable2[code >> 3]; 29073 } 29074 if (p[0] > 0) { 29075 this._eatBits(p[0]); 29076 return p[1]; 29077 } 29078 } else { 29079 var result = this._findTableCode(1, 9, whiteTable2); 29080 if (result[0]) { 29081 return result[1]; 29082 } 29083 result = this._findTableCode(11, 12, whiteTable1); 29084 if (result[0]) { 29085 return result[1]; 29086 } 29087 } 29088 (0, _util.info)('bad white code'); 29089 this._eatBits(1); 29090 return 1; 29091 }, 29092 _getBlackCode: function _getBlackCode() { 29093 var code = void 0, 29094 p = void 0; 29095 if (this.eoblock) { 29096 code = this._lookBits(13); 29097 if (code === ccittEOF) { 29098 return 1; 29099 } 29100 if (code >> 7 === 0) { 29101 p = blackTable1[code]; 29102 } else if (code >> 9 === 0 && code >> 7 !== 0) { 29103 p = blackTable2[(code >> 1) - 64]; 29104 } else { 29105 p = blackTable3[code >> 7]; 29106 } 29107 if (p[0] > 0) { 29108 this._eatBits(p[0]); 29109 return p[1]; 29110 } 29111 } else { 29112 var result = this._findTableCode(2, 6, blackTable3); 29113 if (result[0]) { 29114 return result[1]; 29115 } 29116 result = this._findTableCode(7, 12, blackTable2, 64); 29117 if (result[0]) { 29118 return result[1]; 29119 } 29120 result = this._findTableCode(10, 13, blackTable1); 29121 if (result[0]) { 29122 return result[1]; 29123 } 29124 } 29125 (0, _util.info)('bad black code'); 29126 this._eatBits(1); 29127 return 1; 29128 }, 29129 _lookBits: function _lookBits(n) { 29130 var c = void 0; 29131 while (this.inputBits < n) { 29132 if ((c = this.source.next()) === -1) { 29133 if (this.inputBits === 0) { 29134 return ccittEOF; 29135 } 29136 return this.inputBuf << n - this.inputBits & 0xFFFF >> 16 - n; 29137 } 29138 this.inputBuf = this.inputBuf << 8 | c; 29139 this.inputBits += 8; 29140 } 29141 return this.inputBuf >> this.inputBits - n & 0xFFFF >> 16 - n; 29142 }, 29143 _eatBits: function _eatBits(n) { 29144 if ((this.inputBits -= n) < 0) { 29145 this.inputBits = 0; 29146 } 29147 } 29148 }; 29149 return CCITTFaxDecoder; 29150}();
vendor: 9,065 bytes, lines 29151-29538
29151exports.CCITTFaxDecoder = CCITTFaxDecoder; 29152 29153/***/ }), 29154/* 130 */ 29155/***/ (function(module, exports, __w_pdfjs_require__) { 29156 29157"use strict"; 29158 29159 29160Object.defineProperty(exports, "__esModule", { 29161 value: true 29162}); 29163exports.Jbig2Stream = undefined; 29164 29165var _primitives = __w_pdfjs_require__(1); 29166 29167var _stream = __w_pdfjs_require__(2); 29168 29169var _jbig = __w_pdfjs_require__(131); 29170 29171var _util = __w_pdfjs_require__(0); 29172 29173var Jbig2Stream = function Jbig2StreamClosure() { 29174 function Jbig2Stream(stream, maybeLength, dict, params) { 29175 this.stream = stream; 29176 this.maybeLength = maybeLength; 29177 this.dict = dict; 29178 this.params = params; 29179 _stream.DecodeStream.call(this, maybeLength); 29180 } 29181 Jbig2Stream.prototype = Object.create(_stream.DecodeStream.prototype); 29182 Object.defineProperty(Jbig2Stream.prototype, 'bytes', { 29183 get: function get() { 29184 return (0, _util.shadow)(this, 'bytes', this.stream.getBytes(this.maybeLength)); 29185 }, 29186 29187 configurable: true 29188 }); 29189 Jbig2Stream.prototype.ensureBuffer = function (requested) {}; 29190 Jbig2Stream.prototype.readBlock = function () { 29191 if (this.eof) { 29192 return; 29193 } 29194 var jbig2Image = new _jbig.Jbig2Image(); 29195 var chunks = []; 29196 if ((0, _primitives.isDict)(this.params)) { 29197 var globalsStream = this.params.get('JBIG2Globals'); 29198 if ((0, _primitives.isStream)(globalsStream)) { 29199 var globals = globalsStream.getBytes(); 29200 chunks.push({ 29201 data: globals, 29202 start: 0, 29203 end: globals.length 29204 }); 29205 } 29206 } 29207 chunks.push({ 29208 data: this.bytes, 29209 start: 0, 29210 end: this.bytes.length 29211 }); 29212 var data = jbig2Image.parseChunks(chunks); 29213 var dataLength = data.length; 29214 for (var i = 0; i < dataLength; i++) { 29215 data[i] ^= 0xFF; 29216 } 29217 this.buffer = data; 29218 this.bufferLength = dataLength; 29219 this.eof = true; 29220 }; 29221 return Jbig2Stream; 29222}(); 29223exports.Jbig2Stream = Jbig2Stream; 29224 29225/***/ }), 29226/* 131 */ 29227/***/ (function(module, exports, __w_pdfjs_require__) { 29228 29229"use strict"; 29230 29231 29232Object.defineProperty(exports, "__esModule", { 29233 value: true 29234}); 29235exports.Jbig2Image = undefined; 29236 29237var _util = __w_pdfjs_require__(0); 29238 29239var _arithmetic_decoder = __w_pdfjs_require__(65); 29240 29241var Jbig2Error = function Jbig2ErrorClosure() { 29242 function Jbig2Error(msg) { 29243 this.message = 'JBIG2 error: ' + msg; 29244 } 29245 Jbig2Error.prototype = new Error(); 29246 Jbig2Error.prototype.name = 'Jbig2Error'; 29247 Jbig2Error.constructor = Jbig2Error; 29248 return Jbig2Error; 29249}(); 29250var Jbig2Image = function Jbig2ImageClosure() { 29251 function ContextCache() {} 29252 ContextCache.prototype = { 29253 getContexts: function getContexts(id) { 29254 if (id in this) { 29255 return this[id]; 29256 } 29257 return this[id] = new Int8Array(1 << 16); 29258 } 29259 }; 29260 function DecodingContext(data, start, end) { 29261 this.data = data; 29262 this.start = start; 29263 this.end = end; 29264 } 29265 DecodingContext.prototype = { 29266 get decoder() { 29267 var decoder = new _arithmetic_decoder.ArithmeticDecoder(this.data, this.start, this.end); 29268 return (0, _util.shadow)(this, 'decoder', decoder); 29269 }, 29270 get contextCache() { 29271 var cache = new ContextCache(); 29272 return (0, _util.shadow)(this, 'contextCache', cache); 29273 } 29274 }; 29275 function decodeInteger(contextCache, procedure, decoder) { 29276 var contexts = contextCache.getContexts(procedure); 29277 var prev = 1; 29278 function readBits(length) { 29279 var v = 0; 29280 for (var i = 0; i < length; i++) { 29281 var bit = decoder.readBit(contexts, prev); 29282 prev = prev < 256 ? prev << 1 | bit : (prev << 1 | bit) & 511 | 256; 29283 v = v << 1 | bit; 29284 } 29285 return v >>> 0; 29286 } 29287 var sign = readBits(1); 29288 var value = readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(32) + 4436 : readBits(12) + 340 : readBits(8) + 84 : readBits(6) + 20 : readBits(4) + 4 : readBits(2); 29289 return sign === 0 ? value : value > 0 ? -value : null; 29290 } 29291 function decodeIAID(contextCache, decoder, codeLength) { 29292 var contexts = contextCache.getContexts('IAID'); 29293 var prev = 1; 29294 for (var i = 0; i < codeLength; i++) { 29295 var bit = decoder.readBit(contexts, prev); 29296 prev = prev << 1 | bit; 29297 } 29298 if (codeLength < 31) { 29299 return prev & (1 << codeLength) - 1; 29300 } 29301 return prev & 0x7FFFFFFF; 29302 } 29303 var SegmentTypes = ['SymbolDictionary', null, null, null, 'IntermediateTextRegion', null, 'ImmediateTextRegion', 'ImmediateLosslessTextRegion', null, null, null, null, null, null, null, null, 'PatternDictionary', null, null, null, 'IntermediateHalftoneRegion', null, 'ImmediateHalftoneRegion', 'ImmediateLosslessHalftoneRegion', null, null, null, null, null, null, null, null, null, null, null, null, 'IntermediateGenericRegion', null, 'ImmediateGenericRegion', 'ImmediateLosslessGenericRegion', 'IntermediateGenericRefinementRegion', null, 'ImmediateGenericRefinementRegion', 'ImmediateLosslessGenericRefinementRegion', null, null, null, null, 'PageInformation', 'EndOfPage', 'EndOfStripe', 'EndOfFile', 'Profiles', 'Tables', null, null, null, null, null, null, null, null, 'Extension']; 29304 var CodingTemplates = [[{ 29305 x: -1, 29306 y: -2 29307 }, { 29308 x: 0, 29309 y: -2 29310 }, { 29311 x: 1, 29312 y: -2 29313 }, { 29314 x: -2, 29315 y: -1 29316 }, { 29317 x: -1, 29318 y: -1 29319 }, { 29320 x: 0, 29321 y: -1 29322 }, { 29323 x: 1, 29324 y: -1 29325 }, { 29326 x: 2, 29327 y: -1 29328 }, { 29329 x: -4, 29330 y: 0 29331 }, { 29332 x: -3, 29333 y: 0 29334 }, { 29335 x: -2, 29336 y: 0 29337 }, { 29338 x: -1, 29339 y: 0 29340 }], [{ 29341 x: -1, 29342 y: -2 29343 }, { 29344 x: 0, 29345 y: -2 29346 }, { 29347 x: 1, 29348 y: -2 29349 }, { 29350 x: 2, 29351 y: -2 29352 }, { 29353 x: -2, 29354 y: -1 29355 }, { 29356 x: -1, 29357 y: -1 29358 }, { 29359 x: 0, 29360 y: -1 29361 }, { 29362 x: 1, 29363 y: -1 29364 }, { 29365 x: 2, 29366 y: -1 29367 }, { 29368 x: -3, 29369 y: 0 29370 }, { 29371 x: -2, 29372 y: 0 29373 }, { 29374 x: -1, 29375 y: 0 29376 }], [{ 29377 x: -1, 29378 y: -2 29379 }, { 29380 x: 0, 29381 y: -2 29382 }, { 29383 x: 1, 29384 y: -2 29385 }, { 29386 x: -2, 29387 y: -1 29388 }, { 29389 x: -1, 29390 y: -1 29391 }, { 29392 x: 0, 29393 y: -1 29394 }, { 29395 x: 1, 29396 y: -1 29397 }, { 29398 x: -2, 29399 y: 0 29400 }, { 29401 x: -1, 29402 y: 0 29403 }], [{ 29404 x: -3, 29405 y: -1 29406 }, { 29407 x: -2, 29408 y: -1 29409 }, { 29410 x: -1, 29411 y: -1 29412 }, { 29413 x: 0, 29414 y: -1 29415 }, { 29416 x: 1, 29417 y: -1 29418 }, { 29419 x: -4, 29420 y: 0 29421 }, { 29422 x: -3, 29423 y: 0 29424 }, { 29425 x: -2, 29426 y: 0 29427 }, { 29428 x: -1, 29429 y: 0 29430 }]]; 29431 var RefinementTemplates = [{ 29432 coding: [{ 29433 x: 0, 29434 y: -1 29435 }, { 29436 x: 1, 29437 y: -1 29438 }, { 29439 x: -1, 29440 y: 0 29441 }], 29442 reference: [{ 29443 x: 0, 29444 y: -1 29445 }, { 29446 x: 1, 29447 y: -1 29448 }, { 29449 x: -1, 29450 y: 0 29451 }, { 29452 x: 0, 29453 y: 0 29454 }, { 29455 x: 1, 29456 y: 0 29457 }, { 29458 x: -1, 29459 y: 1 29460 }, { 29461 x: 0, 29462 y: 1 29463 }, { 29464 x: 1, 29465 y: 1 29466 }] 29467 }, { 29468 coding: [{ 29469 x: -1, 29470 y: -1 29471 }, { 29472 x: 0, 29473 y: -1 29474 }, { 29475 x: 1, 29476 y: -1 29477 }, { 29478 x: -1, 29479 y: 0 29480 }], 29481 reference: [{ 29482 x: 0, 29483 y: -1 29484 }, { 29485 x: -1, 29486 y: 0 29487 }, { 29488 x: 0, 29489 y: 0 29490 }, { 29491 x: 1, 29492 y: 0 29493 }, { 29494 x: 0, 29495 y: 1 29496 }, { 29497 x: 1, 29498 y: 1 29499 }] 29500 }]; 29501 var ReusedContexts = [0x9B25, 0x0795, 0x00E5, 0x0195]; 29502 var RefinementReusedContexts = [0x0020, 0x0008]; 29503 function decodeBitmapTemplate0(width, height, decodingContext) { 29504 var decoder = decodingContext.decoder; 29505 var contexts = decodingContext.contextCache.getContexts('GB'); 29506 var contextLabel, 29507 i, 29508 j, 29509 pixel, 29510 row, 29511 row1, 29512 row2, 29513 bitmap = []; 29514 var OLD_PIXEL_MASK = 0x7BF7; 29515 for (i = 0; i < height; i++) { 29516 row = bitmap[i] = new Uint8Array(width); 29517 row1 = i < 1 ? row : bitmap[i - 1]; 29518 row2 = i < 2 ? row : bitmap[i - 2]; 29519 contextLabel = row2[0] << 13 | row2[1] << 12 | row2[2] << 11 | row1[0] << 7 | row1[1] << 6 | row1[2] << 5 | row1[3] << 4; 29520 for (j = 0; j < width; j++) { 29521 row[j] = pixel = decoder.readBit(contexts, contextLabel); 29522 contextLabel = (contextLabel & OLD_PIXEL_MASK) << 1 | (j + 3 < width ? row2[j + 3] << 11 : 0) | (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel; 29523 } 29524 } 29525 return bitmap; 29526 } 29527 function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at, decodingContext) { 29528 if (mmr) { 29529 throw new Jbig2Error('MMR encoding is not supported'); 29530 } 29531 if (templateIndex === 0 && !skip && !prediction && at.length === 4 && at[0].x === 3 && at[0].y === -1 && at[1].x === -3 && at[1].y === -1 && at[2].x === 2 && at[2].y === -2 && at[3].x === -2 && at[3].y === -2) { 29532 return decodeBitmapTemplate0(width, height, decodingContext); 29533 } 29534 var useskip = !!skip; 29535 var template = CodingTemplates[templateIndex].concat(at); 29536 template.sort(function (a, b) { 29537 return a.y - b.y || a.x - b.x; 29538 });
vendor: 9,676 bytes, lines 29539-29783
29539 var templateLength = template.length; 29540 var templateX = new Int8Array(templateLength); 29541 var templateY = new Int8Array(templateLength); 29542 var changingTemplateEntries = []; 29543 var reuseMask = 0, 29544 minX = 0, 29545 maxX = 0, 29546 minY = 0; 29547 var c, k; 29548 for (k = 0; k < templateLength; k++) { 29549 templateX[k] = template[k].x; 29550 templateY[k] = template[k].y; 29551 minX = Math.min(minX, template[k].x); 29552 maxX = Math.max(maxX, template[k].x); 29553 minY = Math.min(minY, template[k].y); 29554 if (k < templateLength - 1 && template[k].y === template[k + 1].y && template[k].x === template[k + 1].x - 1) { 29555 reuseMask |= 1 << templateLength - 1 - k; 29556 } else { 29557 changingTemplateEntries.push(k); 29558 } 29559 } 29560 var changingEntriesLength = changingTemplateEntries.length; 29561 var changingTemplateX = new Int8Array(changingEntriesLength); 29562 var changingTemplateY = new Int8Array(changingEntriesLength); 29563 var changingTemplateBit = new Uint16Array(changingEntriesLength); 29564 for (c = 0; c < changingEntriesLength; c++) { 29565 k = changingTemplateEntries[c]; 29566 changingTemplateX[c] = template[k].x; 29567 changingTemplateY[c] = template[k].y; 29568 changingTemplateBit[c] = 1 << templateLength - 1 - k; 29569 } 29570 var sbb_left = -minX; 29571 var sbb_top = -minY; 29572 var sbb_right = width - maxX; 29573 var pseudoPixelContext = ReusedContexts[templateIndex]; 29574 var row = new Uint8Array(width); 29575 var bitmap = []; 29576 var decoder = decodingContext.decoder; 29577 var contexts = decodingContext.contextCache.getContexts('GB'); 29578 var ltp = 0, 29579 j, 29580 i0, 29581 j0, 29582 contextLabel = 0, 29583 bit, 29584 shift; 29585 for (var i = 0; i < height; i++) { 29586 if (prediction) { 29587 var sltp = decoder.readBit(contexts, pseudoPixelContext); 29588 ltp ^= sltp; 29589 if (ltp) { 29590 bitmap.push(row); 29591 continue; 29592 } 29593 } 29594 row = new Uint8Array(row); 29595 bitmap.push(row); 29596 for (j = 0; j < width; j++) { 29597 if (useskip && skip[i][j]) { 29598 row[j] = 0; 29599 continue; 29600 } 29601 if (j >= sbb_left && j < sbb_right && i >= sbb_top) { 29602 contextLabel = contextLabel << 1 & reuseMask; 29603 for (k = 0; k < changingEntriesLength; k++) { 29604 i0 = i + changingTemplateY[k]; 29605 j0 = j + changingTemplateX[k]; 29606 bit = bitmap[i0][j0]; 29607 if (bit) { 29608 bit = changingTemplateBit[k]; 29609 contextLabel |= bit; 29610 } 29611 } 29612 } else { 29613 contextLabel = 0; 29614 shift = templateLength - 1; 29615 for (k = 0; k < templateLength; k++, shift--) { 29616 j0 = j + templateX[k]; 29617 if (j0 >= 0 && j0 < width) { 29618 i0 = i + templateY[k]; 29619 if (i0 >= 0) { 29620 bit = bitmap[i0][j0]; 29621 if (bit) { 29622 contextLabel |= bit << shift; 29623 } 29624 } 29625 } 29626 } 29627 } 29628 var pixel = decoder.readBit(contexts, contextLabel); 29629 row[j] = pixel; 29630 } 29631 } 29632 return bitmap; 29633 } 29634 function decodeRefinement(width, height, templateIndex, referenceBitmap, offsetX, offsetY, prediction, at, decodingContext) { 29635 var codingTemplate = RefinementTemplates[templateIndex].coding; 29636 if (templateIndex === 0) { 29637 codingTemplate = codingTemplate.concat([at[0]]); 29638 } 29639 var codingTemplateLength = codingTemplate.length; 29640 var codingTemplateX = new Int32Array(codingTemplateLength); 29641 var codingTemplateY = new Int32Array(codingTemplateLength); 29642 var k; 29643 for (k = 0; k < codingTemplateLength; k++) { 29644 codingTemplateX[k] = codingTemplate[k].x; 29645 codingTemplateY[k] = codingTemplate[k].y; 29646 } 29647 var referenceTemplate = RefinementTemplates[templateIndex].reference; 29648 if (templateIndex === 0) { 29649 referenceTemplate = referenceTemplate.concat([at[1]]); 29650 } 29651 var referenceTemplateLength = referenceTemplate.length; 29652 var referenceTemplateX = new Int32Array(referenceTemplateLength); 29653 var referenceTemplateY = new Int32Array(referenceTemplateLength); 29654 for (k = 0; k < referenceTemplateLength; k++) { 29655 referenceTemplateX[k] = referenceTemplate[k].x; 29656 referenceTemplateY[k] = referenceTemplate[k].y; 29657 } 29658 var referenceWidth = referenceBitmap[0].length; 29659 var referenceHeight = referenceBitmap.length; 29660 var pseudoPixelContext = RefinementReusedContexts[templateIndex]; 29661 var bitmap = []; 29662 var decoder = decodingContext.decoder; 29663 var contexts = decodingContext.contextCache.getContexts('GR'); 29664 var ltp = 0; 29665 for (var i = 0; i < height; i++) { 29666 if (prediction) { 29667 var sltp = decoder.readBit(contexts, pseudoPixelContext); 29668 ltp ^= sltp; 29669 if (ltp) { 29670 throw new Jbig2Error('prediction is not supported'); 29671 } 29672 } 29673 var row = new Uint8Array(width); 29674 bitmap.push(row); 29675 for (var j = 0; j < width; j++) { 29676 var i0, j0; 29677 var contextLabel = 0; 29678 for (k = 0; k < codingTemplateLength; k++) { 29679 i0 = i + codingTemplateY[k]; 29680 j0 = j + codingTemplateX[k]; 29681 if (i0 < 0 || j0 < 0 || j0 >= width) { 29682 contextLabel <<= 1; 29683 } else { 29684 contextLabel = contextLabel << 1 | bitmap[i0][j0]; 29685 } 29686 } 29687 for (k = 0; k < referenceTemplateLength; k++) { 29688 i0 = i + referenceTemplateY[k] - offsetY; 29689 j0 = j + referenceTemplateX[k] - offsetX; 29690 if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || j0 >= referenceWidth) { 29691 contextLabel <<= 1; 29692 } else { 29693 contextLabel = contextLabel << 1 | referenceBitmap[i0][j0]; 29694 } 29695 } 29696 var pixel = decoder.readBit(contexts, contextLabel); 29697 row[j] = pixel; 29698 } 29699 } 29700 return bitmap; 29701 } 29702 function decodeSymbolDictionary(huffman, refinement, symbols, numberOfNewSymbols, numberOfExportedSymbols, huffmanTables, templateIndex, at, refinementTemplateIndex, refinementAt, decodingContext) { 29703 if (huffman) { 29704 throw new Jbig2Error('huffman is not supported'); 29705 } 29706 var newSymbols = []; 29707 var currentHeight = 0; 29708 var symbolCodeLength = (0, _util.log2)(symbols.length + numberOfNewSymbols); 29709 var decoder = decodingContext.decoder; 29710 var contextCache = decodingContext.contextCache; 29711 while (newSymbols.length < numberOfNewSymbols) { 29712 var deltaHeight = decodeInteger(contextCache, 'IADH', decoder); 29713 currentHeight += deltaHeight; 29714 var currentWidth = 0; 29715 while (true) { 29716 var deltaWidth = decodeInteger(contextCache, 'IADW', decoder); 29717 if (deltaWidth === null) { 29718 break; 29719 } 29720 currentWidth += deltaWidth; 29721 var bitmap; 29722 if (refinement) { 29723 var numberOfInstances = decodeInteger(contextCache, 'IAAI', decoder); 29724 if (numberOfInstances > 1) { 29725 bitmap = decodeTextRegion(huffman, refinement, currentWidth, currentHeight, 0, numberOfInstances, 1, symbols.concat(newSymbols), symbolCodeLength, 0, 0, 1, 0, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext); 29726 } else { 29727 var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); 29728 var rdx = decodeInteger(contextCache, 'IARDX', decoder); 29729 var rdy = decodeInteger(contextCache, 'IARDY', decoder); 29730 var symbol = symbolId < symbols.length ? symbols[symbolId] : newSymbols[symbolId - symbols.length]; 29731 bitmap = decodeRefinement(currentWidth, currentHeight, refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt, decodingContext); 29732 } 29733 } else { 29734 bitmap = decodeBitmap(false, currentWidth, currentHeight, templateIndex, false, null, at, decodingContext); 29735 } 29736 newSymbols.push(bitmap); 29737 } 29738 } 29739 var exportedSymbols = []; 29740 var flags = [], 29741 currentFlag = false; 29742 var totalSymbolsLength = symbols.length + numberOfNewSymbols; 29743 while (flags.length < totalSymbolsLength) { 29744 var runLength = decodeInteger(contextCache, 'IAEX', decoder); 29745 while (runLength--) { 29746 flags.push(currentFlag); 29747 } 29748 currentFlag = !currentFlag; 29749 } 29750 for (var i = 0, ii = symbols.length; i < ii; i++) { 29751 if (flags[i]) { 29752 exportedSymbols.push(symbols[i]); 29753 } 29754 } 29755 for (var j = 0; j < numberOfNewSymbols; i++, j++) { 29756 if (flags[i]) { 29757 exportedSymbols.push(newSymbols[j]); 29758 } 29759 } 29760 return exportedSymbols; 29761 } 29762 function decodeTextRegion(huffman, refinement, width, height, defaultPixelValue, numberOfSymbolInstances, stripSize, inputSymbols, symbolCodeLength, transposed, dsOffset, referenceCorner, combinationOperator, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext) { 29763 if (huffman) { 29764 throw new Jbig2Error('huffman is not supported'); 29765 } 29766 var bitmap = []; 29767 var i, row; 29768 for (i = 0; i < height; i++) { 29769 row = new Uint8Array(width); 29770 if (defaultPixelValue) { 29771 for (var j = 0; j < width; j++) { 29772 row[j] = defaultPixelValue; 29773 } 29774 } 29775 bitmap.push(row); 29776 } 29777 var decoder = decodingContext.decoder; 29778 var contextCache = decodingContext.contextCache; 29779 var stripT = -decodeInteger(contextCache, 'IADT', decoder); 29780 var firstS = 0; 29781 i = 0; 29782 while (i < numberOfSymbolInstances) { 29783 var deltaT = decodeInteger(contextCache, 'IADT', decoder);
vendor: 27,739 bytes, lines 29784-30458
29784 stripT += deltaT; 29785 var deltaFirstS = decodeInteger(contextCache, 'IAFS', decoder); 29786 firstS += deltaFirstS; 29787 var currentS = firstS; 29788 do { 29789 var currentT = stripSize === 1 ? 0 : decodeInteger(contextCache, 'IAIT', decoder); 29790 var t = stripSize * stripT + currentT; 29791 var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); 29792 var applyRefinement = refinement && decodeInteger(contextCache, 'IARI', decoder); 29793 var symbolBitmap = inputSymbols[symbolId]; 29794 var symbolWidth = symbolBitmap[0].length; 29795 var symbolHeight = symbolBitmap.length; 29796 if (applyRefinement) { 29797 var rdw = decodeInteger(contextCache, 'IARDW', decoder); 29798 var rdh = decodeInteger(contextCache, 'IARDH', decoder); 29799 var rdx = decodeInteger(contextCache, 'IARDX', decoder); 29800 var rdy = decodeInteger(contextCache, 'IARDY', decoder); 29801 symbolWidth += rdw; 29802 symbolHeight += rdh; 29803 symbolBitmap = decodeRefinement(symbolWidth, symbolHeight, refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx, (rdh >> 1) + rdy, false, refinementAt, decodingContext); 29804 } 29805 var offsetT = t - (referenceCorner & 1 ? 0 : symbolHeight - 1); 29806 var offsetS = currentS - (referenceCorner & 2 ? symbolWidth - 1 : 0); 29807 var s2, t2, symbolRow; 29808 if (transposed) { 29809 for (s2 = 0; s2 < symbolHeight; s2++) { 29810 row = bitmap[offsetS + s2]; 29811 if (!row) { 29812 continue; 29813 } 29814 symbolRow = symbolBitmap[s2]; 29815 var maxWidth = Math.min(width - offsetT, symbolWidth); 29816 switch (combinationOperator) { 29817 case 0: 29818 for (t2 = 0; t2 < maxWidth; t2++) { 29819 row[offsetT + t2] |= symbolRow[t2]; 29820 } 29821 break; 29822 case 2: 29823 for (t2 = 0; t2 < maxWidth; t2++) { 29824 row[offsetT + t2] ^= symbolRow[t2]; 29825 } 29826 break; 29827 default: 29828 throw new Jbig2Error('operator ' + combinationOperator + ' is not supported'); 29829 } 29830 } 29831 currentS += symbolHeight - 1; 29832 } else { 29833 for (t2 = 0; t2 < symbolHeight; t2++) { 29834 row = bitmap[offsetT + t2]; 29835 if (!row) { 29836 continue; 29837 } 29838 symbolRow = symbolBitmap[t2]; 29839 switch (combinationOperator) { 29840 case 0: 29841 for (s2 = 0; s2 < symbolWidth; s2++) { 29842 row[offsetS + s2] |= symbolRow[s2]; 29843 } 29844 break; 29845 case 2: 29846 for (s2 = 0; s2 < symbolWidth; s2++) { 29847 row[offsetS + s2] ^= symbolRow[s2]; 29848 } 29849 break; 29850 default: 29851 throw new Jbig2Error('operator ' + combinationOperator + ' is not supported'); 29852 } 29853 } 29854 currentS += symbolWidth - 1; 29855 } 29856 i++; 29857 var deltaS = decodeInteger(contextCache, 'IADS', decoder); 29858 if (deltaS === null) { 29859 break; 29860 } 29861 currentS += deltaS + dsOffset; 29862 } while (true); 29863 } 29864 return bitmap; 29865 } 29866 function decodePatternDictionary(mmr, patternWidth, patternHeight, maxPatternIndex, template, decodingContext) { 29867 var at = []; 29868 at.push({ 29869 x: -patternWidth, 29870 y: 0 29871 }); 29872 if (template === 0) { 29873 at.push({ 29874 x: -3, 29875 y: -1 29876 }); 29877 at.push({ 29878 x: 2, 29879 y: -2 29880 }); 29881 at.push({ 29882 x: -2, 29883 y: -2 29884 }); 29885 } 29886 var collectiveWidth = (maxPatternIndex + 1) * patternWidth; 29887 var collectiveBitmap = decodeBitmap(mmr, collectiveWidth, patternHeight, template, false, null, at, decodingContext); 29888 var patterns = [], 29889 i = 0, 29890 patternBitmap = void 0, 29891 xMin = void 0, 29892 xMax = void 0, 29893 y = void 0; 29894 while (i <= maxPatternIndex) { 29895 patternBitmap = []; 29896 xMin = patternWidth * i; 29897 xMax = xMin + patternWidth; 29898 for (y = 0; y < patternHeight; y++) { 29899 patternBitmap.push(collectiveBitmap[y].subarray(xMin, xMax)); 29900 } 29901 patterns.push(patternBitmap); 29902 i++; 29903 } 29904 return patterns; 29905 } 29906 function decodeHalftoneRegion(mmr, patterns, template, regionWidth, regionHeight, defaultPixelValue, enableSkip, combinationOperator, gridWidth, gridHeight, gridOffsetX, gridOffsetY, gridVectorX, gridVectorY, decodingContext) { 29907 var skip = null; 29908 if (enableSkip) { 29909 throw new Jbig2Error('skip is not supported'); 29910 } 29911 if (combinationOperator !== 0) { 29912 throw new Jbig2Error('operator ' + combinationOperator + ' is not supported in halftone region'); 29913 } 29914 var regionBitmap = []; 29915 var i = void 0, 29916 j = void 0, 29917 row = void 0; 29918 for (i = 0; i < regionHeight; i++) { 29919 row = new Uint8Array(regionWidth); 29920 if (defaultPixelValue) { 29921 for (j = 0; j < regionWidth; j++) { 29922 row[j] = defaultPixelValue; 29923 } 29924 } 29925 regionBitmap.push(row); 29926 } 29927 var numberOfPatterns = patterns.length; 29928 var pattern0 = patterns[0]; 29929 var patternWidth = pattern0[0].length, 29930 patternHeight = pattern0.length; 29931 var bitsPerValue = (0, _util.log2)(numberOfPatterns); 29932 var at = []; 29933 at.push({ 29934 x: template <= 1 ? 3 : 2, 29935 y: -1 29936 }); 29937 if (template === 0) { 29938 at.push({ 29939 x: -3, 29940 y: -1 29941 }); 29942 at.push({ 29943 x: 2, 29944 y: -2 29945 }); 29946 at.push({ 29947 x: -2, 29948 y: -2 29949 }); 29950 } 29951 var grayScaleBitPlanes = []; 29952 for (i = bitsPerValue - 1; i >= 0; i--) { 29953 grayScaleBitPlanes[i] = decodeBitmap(mmr, gridWidth, gridHeight, template, false, skip, at, decodingContext); 29954 } 29955 var mg = void 0, 29956 ng = void 0, 29957 bit = void 0, 29958 patternIndex = void 0, 29959 patternBitmap = void 0, 29960 x = void 0, 29961 y = void 0, 29962 patternRow = void 0, 29963 regionRow = void 0; 29964 for (mg = 0; mg < gridHeight; mg++) { 29965 for (ng = 0; ng < gridWidth; ng++) { 29966 bit = 0; 29967 patternIndex = 0; 29968 for (j = bitsPerValue - 1; j >= 0; j--) { 29969 bit = grayScaleBitPlanes[j][mg][ng] ^ bit; 29970 patternIndex |= bit << j; 29971 } 29972 patternBitmap = patterns[patternIndex]; 29973 x = gridOffsetX + mg * gridVectorY + ng * gridVectorX >> 8; 29974 y = gridOffsetY + mg * gridVectorX - ng * gridVectorY >> 8; 29975 if (x >= 0 && x + patternWidth <= regionWidth && y >= 0 && y + patternHeight <= regionHeight) { 29976 for (i = 0; i < patternHeight; i++) { 29977 regionRow = regionBitmap[y + i]; 29978 patternRow = patternBitmap[i]; 29979 for (j = 0; j < patternWidth; j++) { 29980 regionRow[x + j] |= patternRow[j]; 29981 } 29982 } 29983 } else { 29984 var regionX = void 0, 29985 regionY = void 0; 29986 for (i = 0; i < patternHeight; i++) { 29987 regionY = y + i; 29988 if (regionY < 0 || regionY >= regionHeight) { 29989 continue; 29990 } 29991 regionRow = regionBitmap[regionY]; 29992 patternRow = patternBitmap[i]; 29993 for (j = 0; j < patternWidth; j++) { 29994 regionX = x + j; 29995 if (regionX >= 0 && regionX < regionWidth) { 29996 regionRow[regionX] |= patternRow[j]; 29997 } 29998 } 29999 } 30000 } 30001 } 30002 } 30003 return regionBitmap; 30004 } 30005 function readSegmentHeader(data, start) { 30006 var segmentHeader = {}; 30007 segmentHeader.number = (0, _util.readUint32)(data, start); 30008 var flags = data[start + 4]; 30009 var segmentType = flags & 0x3F; 30010 if (!SegmentTypes[segmentType]) { 30011 throw new Jbig2Error('invalid segment type: ' + segmentType); 30012 } 30013 segmentHeader.type = segmentType; 30014 segmentHeader.typeName = SegmentTypes[segmentType]; 30015 segmentHeader.deferredNonRetain = !!(flags & 0x80); 30016 var pageAssociationFieldSize = !!(flags & 0x40); 30017 var referredFlags = data[start + 5]; 30018 var referredToCount = referredFlags >> 5 & 7; 30019 var retainBits = [referredFlags & 31]; 30020 var position = start + 6; 30021 if (referredFlags === 7) { 30022 referredToCount = (0, _util.readUint32)(data, position - 1) & 0x1FFFFFFF; 30023 position += 3; 30024 var bytes = referredToCount + 7 >> 3; 30025 retainBits[0] = data[position++]; 30026 while (--bytes > 0) { 30027 retainBits.push(data[position++]); 30028 } 30029 } else if (referredFlags === 5 || referredFlags === 6) { 30030 throw new Jbig2Error('invalid referred-to flags'); 30031 } 30032 segmentHeader.retainBits = retainBits; 30033 var referredToSegmentNumberSize = segmentHeader.number <= 256 ? 1 : segmentHeader.number <= 65536 ? 2 : 4; 30034 var referredTo = []; 30035 var i, ii; 30036 for (i = 0; i < referredToCount; i++) { 30037 var number = referredToSegmentNumberSize === 1 ? data[position] : referredToSegmentNumberSize === 2 ? (0, _util.readUint16)(data, position) : (0, _util.readUint32)(data, position); 30038 referredTo.push(number); 30039 position += referredToSegmentNumberSize; 30040 } 30041 segmentHeader.referredTo = referredTo; 30042 if (!pageAssociationFieldSize) { 30043 segmentHeader.pageAssociation = data[position++]; 30044 } else { 30045 segmentHeader.pageAssociation = (0, _util.readUint32)(data, position); 30046 position += 4; 30047 } 30048 segmentHeader.length = (0, _util.readUint32)(data, position); 30049 position += 4; 30050 if (segmentHeader.length === 0xFFFFFFFF) { 30051 if (segmentType === 38) { 30052 var genericRegionInfo = readRegionSegmentInformation(data, position); 30053 var genericRegionSegmentFlags = data[position + RegionSegmentInformationFieldLength]; 30054 var genericRegionMmr = !!(genericRegionSegmentFlags & 1); 30055 var searchPatternLength = 6; 30056 var searchPattern = new Uint8Array(searchPatternLength); 30057 if (!genericRegionMmr) { 30058 searchPattern[0] = 0xFF; 30059 searchPattern[1] = 0xAC; 30060 } 30061 searchPattern[2] = genericRegionInfo.height >>> 24 & 0xFF; 30062 searchPattern[3] = genericRegionInfo.height >> 16 & 0xFF; 30063 searchPattern[4] = genericRegionInfo.height >> 8 & 0xFF; 30064 searchPattern[5] = genericRegionInfo.height & 0xFF; 30065 for (i = position, ii = data.length; i < ii; i++) { 30066 var j = 0; 30067 while (j < searchPatternLength && searchPattern[j] === data[i + j]) { 30068 j++; 30069 } 30070 if (j === searchPatternLength) { 30071 segmentHeader.length = i + searchPatternLength; 30072 break; 30073 } 30074 } 30075 if (segmentHeader.length === 0xFFFFFFFF) { 30076 throw new Jbig2Error('segment end was not found'); 30077 } 30078 } else { 30079 throw new Jbig2Error('invalid unknown segment length'); 30080 } 30081 } 30082 segmentHeader.headerEnd = position; 30083 return segmentHeader; 30084 } 30085 function readSegments(header, data, start, end) { 30086 var segments = []; 30087 var position = start; 30088 while (position < end) { 30089 var segmentHeader = readSegmentHeader(data, position); 30090 position = segmentHeader.headerEnd; 30091 var segment = { 30092 header: segmentHeader, 30093 data: data 30094 }; 30095 if (!header.randomAccess) { 30096 segment.start = position; 30097 position += segmentHeader.length; 30098 segment.end = position; 30099 } 30100 segments.push(segment); 30101 if (segmentHeader.type === 51) { 30102 break; 30103 } 30104 } 30105 if (header.randomAccess) { 30106 for (var i = 0, ii = segments.length; i < ii; i++) { 30107 segments[i].start = position; 30108 position += segments[i].header.length; 30109 segments[i].end = position; 30110 } 30111 } 30112 return segments; 30113 } 30114 function readRegionSegmentInformation(data, start) { 30115 return { 30116 width: (0, _util.readUint32)(data, start), 30117 height: (0, _util.readUint32)(data, start + 4), 30118 x: (0, _util.readUint32)(data, start + 8), 30119 y: (0, _util.readUint32)(data, start + 12), 30120 combinationOperator: data[start + 16] & 7 30121 }; 30122 } 30123 var RegionSegmentInformationFieldLength = 17; 30124 function processSegment(segment, visitor) { 30125 var header = segment.header; 30126 var data = segment.data, 30127 position = segment.start, 30128 end = segment.end; 30129 var args, at, i, atLength; 30130 switch (header.type) { 30131 case 0: 30132 var dictionary = {}; 30133 var dictionaryFlags = (0, _util.readUint16)(data, position); 30134 dictionary.huffman = !!(dictionaryFlags & 1); 30135 dictionary.refinement = !!(dictionaryFlags & 2); 30136 dictionary.huffmanDHSelector = dictionaryFlags >> 2 & 3; 30137 dictionary.huffmanDWSelector = dictionaryFlags >> 4 & 3; 30138 dictionary.bitmapSizeSelector = dictionaryFlags >> 6 & 1; 30139 dictionary.aggregationInstancesSelector = dictionaryFlags >> 7 & 1; 30140 dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256); 30141 dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512); 30142 dictionary.template = dictionaryFlags >> 10 & 3; 30143 dictionary.refinementTemplate = dictionaryFlags >> 12 & 1; 30144 position += 2; 30145 if (!dictionary.huffman) { 30146 atLength = dictionary.template === 0 ? 4 : 1; 30147 at = []; 30148 for (i = 0; i < atLength; i++) { 30149 at.push({ 30150 x: (0, _util.readInt8)(data, position), 30151 y: (0, _util.readInt8)(data, position + 1) 30152 }); 30153 position += 2; 30154 } 30155 dictionary.at = at; 30156 } 30157 if (dictionary.refinement && !dictionary.refinementTemplate) { 30158 at = []; 30159 for (i = 0; i < 2; i++) { 30160 at.push({ 30161 x: (0, _util.readInt8)(data, position), 30162 y: (0, _util.readInt8)(data, position + 1) 30163 }); 30164 position += 2; 30165 } 30166 dictionary.refinementAt = at; 30167 } 30168 dictionary.numberOfExportedSymbols = (0, _util.readUint32)(data, position); 30169 position += 4; 30170 dictionary.numberOfNewSymbols = (0, _util.readUint32)(data, position); 30171 position += 4; 30172 args = [dictionary, header.number, header.referredTo, data, position, end]; 30173 break; 30174 case 6: 30175 case 7: 30176 var textRegion = {}; 30177 textRegion.info = readRegionSegmentInformation(data, position); 30178 position += RegionSegmentInformationFieldLength; 30179 var textRegionSegmentFlags = (0, _util.readUint16)(data, position); 30180 position += 2; 30181 textRegion.huffman = !!(textRegionSegmentFlags & 1); 30182 textRegion.refinement = !!(textRegionSegmentFlags & 2); 30183 textRegion.stripSize = 1 << (textRegionSegmentFlags >> 2 & 3); 30184 textRegion.referenceCorner = textRegionSegmentFlags >> 4 & 3; 30185 textRegion.transposed = !!(textRegionSegmentFlags & 64); 30186 textRegion.combinationOperator = textRegionSegmentFlags >> 7 & 3; 30187 textRegion.defaultPixelValue = textRegionSegmentFlags >> 9 & 1; 30188 textRegion.dsOffset = textRegionSegmentFlags << 17 >> 27; 30189 textRegion.refinementTemplate = textRegionSegmentFlags >> 15 & 1; 30190 if (textRegion.huffman) { 30191 var textRegionHuffmanFlags = (0, _util.readUint16)(data, position); 30192 position += 2; 30193 textRegion.huffmanFS = textRegionHuffmanFlags & 3; 30194 textRegion.huffmanDS = textRegionHuffmanFlags >> 2 & 3; 30195 textRegion.huffmanDT = textRegionHuffmanFlags >> 4 & 3; 30196 textRegion.huffmanRefinementDW = textRegionHuffmanFlags >> 6 & 3; 30197 textRegion.huffmanRefinementDH = textRegionHuffmanFlags >> 8 & 3; 30198 textRegion.huffmanRefinementDX = textRegionHuffmanFlags >> 10 & 3; 30199 textRegion.huffmanRefinementDY = textRegionHuffmanFlags >> 12 & 3; 30200 textRegion.huffmanRefinementSizeSelector = !!(textRegionHuffmanFlags & 14); 30201 } 30202 if (textRegion.refinement && !textRegion.refinementTemplate) { 30203 at = []; 30204 for (i = 0; i < 2; i++) { 30205 at.push({ 30206 x: (0, _util.readInt8)(data, position), 30207 y: (0, _util.readInt8)(data, position + 1) 30208 }); 30209 position += 2; 30210 } 30211 textRegion.refinementAt = at; 30212 } 30213 textRegion.numberOfSymbolInstances = (0, _util.readUint32)(data, position); 30214 position += 4; 30215 if (textRegion.huffman) { 30216 throw new Jbig2Error('huffman is not supported'); 30217 } 30218 args = [textRegion, header.referredTo, data, position, end]; 30219 break; 30220 case 16: 30221 var patternDictionary = {}; 30222 var patternDictionaryFlags = data[position++]; 30223 patternDictionary.mmr = !!(patternDictionaryFlags & 1); 30224 patternDictionary.template = patternDictionaryFlags >> 1 & 3; 30225 patternDictionary.patternWidth = data[position++]; 30226 patternDictionary.patternHeight = data[position++]; 30227 patternDictionary.maxPatternIndex = (0, _util.readUint32)(data, position); 30228 position += 4; 30229 args = [patternDictionary, header.number, data, position, end]; 30230 break; 30231 case 22: 30232 case 23: 30233 var halftoneRegion = {}; 30234 halftoneRegion.info = readRegionSegmentInformation(data, position); 30235 position += RegionSegmentInformationFieldLength; 30236 var halftoneRegionFlags = data[position++]; 30237 halftoneRegion.mmr = !!(halftoneRegionFlags & 1); 30238 halftoneRegion.template = halftoneRegionFlags >> 1 & 3; 30239 halftoneRegion.enableSkip = !!(halftoneRegionFlags & 8); 30240 halftoneRegion.combinationOperator = halftoneRegionFlags >> 4 & 7; 30241 halftoneRegion.defaultPixelValue = halftoneRegionFlags >> 7 & 1; 30242 halftoneRegion.gridWidth = (0, _util.readUint32)(data, position); 30243 position += 4; 30244 halftoneRegion.gridHeight = (0, _util.readUint32)(data, position); 30245 position += 4; 30246 halftoneRegion.gridOffsetX = (0, _util.readUint32)(data, position) & 0xFFFFFFFF; 30247 position += 4; 30248 halftoneRegion.gridOffsetY = (0, _util.readUint32)(data, position) & 0xFFFFFFFF; 30249 position += 4; 30250 halftoneRegion.gridVectorX = (0, _util.readUint16)(data, position); 30251 position += 2; 30252 halftoneRegion.gridVectorY = (0, _util.readUint16)(data, position); 30253 position += 2; 30254 args = [halftoneRegion, header.referredTo, data, position, end]; 30255 break; 30256 case 38: 30257 case 39: 30258 var genericRegion = {}; 30259 genericRegion.info = readRegionSegmentInformation(data, position); 30260 position += RegionSegmentInformationFieldLength; 30261 var genericRegionSegmentFlags = data[position++]; 30262 genericRegion.mmr = !!(genericRegionSegmentFlags & 1); 30263 genericRegion.template = genericRegionSegmentFlags >> 1 & 3; 30264 genericRegion.prediction = !!(genericRegionSegmentFlags & 8); 30265 if (!genericRegion.mmr) { 30266 atLength = genericRegion.template === 0 ? 4 : 1; 30267 at = []; 30268 for (i = 0; i < atLength; i++) { 30269 at.push({ 30270 x: (0, _util.readInt8)(data, position), 30271 y: (0, _util.readInt8)(data, position + 1) 30272 }); 30273 position += 2; 30274 } 30275 genericRegion.at = at; 30276 } 30277 args = [genericRegion, data, position, end]; 30278 break; 30279 case 48: 30280 var pageInfo = { 30281 width: (0, _util.readUint32)(data, position), 30282 height: (0, _util.readUint32)(data, position + 4), 30283 resolutionX: (0, _util.readUint32)(data, position + 8), 30284 resolutionY: (0, _util.readUint32)(data, position + 12) 30285 }; 30286 if (pageInfo.height === 0xFFFFFFFF) { 30287 delete pageInfo.height; 30288 } 30289 var pageSegmentFlags = data[position + 16]; 30290 (0, _util.readUint16)(data, position + 17); 30291 pageInfo.lossless = !!(pageSegmentFlags & 1); 30292 pageInfo.refinement = !!(pageSegmentFlags & 2); 30293 pageInfo.defaultPixelValue = pageSegmentFlags >> 2 & 1; 30294 pageInfo.combinationOperator = pageSegmentFlags >> 3 & 3; 30295 pageInfo.requiresBuffer = !!(pageSegmentFlags & 32); 30296 pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64); 30297 args = [pageInfo]; 30298 break; 30299 case 49: 30300 break; 30301 case 50: 30302 break; 30303 case 51: 30304 break; 30305 case 62: 30306 break; 30307 default: 30308 throw new Jbig2Error('segment type ' + header.typeName + '(' + header.type + ')' + ' is not implemented'); 30309 } 30310 var callbackName = 'on' + header.typeName; 30311 if (callbackName in visitor) { 30312 visitor[callbackName].apply(visitor, args); 30313 } 30314 } 30315 function processSegments(segments, visitor) { 30316 for (var i = 0, ii = segments.length; i < ii; i++) { 30317 processSegment(segments[i], visitor); 30318 } 30319 } 30320 function parseJbig2Chunks(chunks) { 30321 var visitor = new SimpleSegmentVisitor(); 30322 for (var i = 0, ii = chunks.length; i < ii; i++) { 30323 var chunk = chunks[i]; 30324 var segments = readSegments({}, chunk.data, chunk.start, chunk.end); 30325 processSegments(segments, visitor); 30326 } 30327 return visitor.buffer; 30328 } 30329 function SimpleSegmentVisitor() {} 30330 SimpleSegmentVisitor.prototype = { 30331 onPageInformation: function SimpleSegmentVisitor_onPageInformation(info) { 30332 this.currentPageInfo = info; 30333 var rowSize = info.width + 7 >> 3; 30334 var buffer = new Uint8ClampedArray(rowSize * info.height); 30335 if (info.defaultPixelValue) { 30336 for (var i = 0, ii = buffer.length; i < ii; i++) { 30337 buffer[i] = 0xFF; 30338 } 30339 } 30340 this.buffer = buffer; 30341 }, 30342 drawBitmap: function SimpleSegmentVisitor_drawBitmap(regionInfo, bitmap) { 30343 var pageInfo = this.currentPageInfo; 30344 var width = regionInfo.width, 30345 height = regionInfo.height; 30346 var rowSize = pageInfo.width + 7 >> 3; 30347 var combinationOperator = pageInfo.combinationOperatorOverride ? regionInfo.combinationOperator : pageInfo.combinationOperator; 30348 var buffer = this.buffer; 30349 var mask0 = 128 >> (regionInfo.x & 7); 30350 var offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3); 30351 var i, j, mask, offset; 30352 switch (combinationOperator) { 30353 case 0: 30354 for (i = 0; i < height; i++) { 30355 mask = mask0; 30356 offset = offset0; 30357 for (j = 0; j < width; j++) { 30358 if (bitmap[i][j]) { 30359 buffer[offset] |= mask; 30360 } 30361 mask >>= 1; 30362 if (!mask) { 30363 mask = 128; 30364 offset++; 30365 } 30366 } 30367 offset0 += rowSize; 30368 } 30369 break; 30370 case 2: 30371 for (i = 0; i < height; i++) { 30372 mask = mask0; 30373 offset = offset0; 30374 for (j = 0; j < width; j++) { 30375 if (bitmap[i][j]) { 30376 buffer[offset] ^= mask; 30377 } 30378 mask >>= 1; 30379 if (!mask) { 30380 mask = 128; 30381 offset++; 30382 } 30383 } 30384 offset0 += rowSize; 30385 } 30386 break; 30387 default: 30388 throw new Jbig2Error('operator ' + combinationOperator + ' is not supported'); 30389 } 30390 }, 30391 onImmediateGenericRegion: function SimpleSegmentVisitor_onImmediateGenericRegion(region, data, start, end) { 30392 var regionInfo = region.info; 30393 var decodingContext = new DecodingContext(data, start, end); 30394 var bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height, region.template, region.prediction, null, region.at, decodingContext); 30395 this.drawBitmap(regionInfo, bitmap); 30396 }, 30397 onImmediateLosslessGenericRegion: function SimpleSegmentVisitor_onImmediateLosslessGenericRegion() { 30398 this.onImmediateGenericRegion.apply(this, arguments); 30399 }, 30400 onSymbolDictionary: function SimpleSegmentVisitor_onSymbolDictionary(dictionary, currentSegment, referredSegments, data, start, end) { 30401 var huffmanTables; 30402 if (dictionary.huffman) { 30403 throw new Jbig2Error('huffman is not supported'); 30404 } 30405 var symbols = this.symbols; 30406 if (!symbols) { 30407 this.symbols = symbols = {}; 30408 } 30409 var inputSymbols = []; 30410 for (var i = 0, ii = referredSegments.length; i < ii; i++) { 30411 inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); 30412 } 30413 var decodingContext = new DecodingContext(data, start, end); 30414 symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman, dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols, dictionary.numberOfExportedSymbols, huffmanTables, dictionary.template, dictionary.at, dictionary.refinementTemplate, dictionary.refinementAt, decodingContext); 30415 }, 30416 onImmediateTextRegion: function SimpleSegmentVisitor_onImmediateTextRegion(region, referredSegments, data, start, end) { 30417 var regionInfo = region.info; 30418 var huffmanTables; 30419 var symbols = this.symbols; 30420 var inputSymbols = []; 30421 for (var i = 0, ii = referredSegments.length; i < ii; i++) { 30422 inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); 30423 } 30424 var symbolCodeLength = (0, _util.log2)(inputSymbols.length); 30425 var decodingContext = new DecodingContext(data, start, end); 30426 var bitmap = decodeTextRegion(region.huffman, region.refinement, regionInfo.width, regionInfo.height, region.defaultPixelValue, region.numberOfSymbolInstances, region.stripSize, inputSymbols, symbolCodeLength, region.transposed, region.dsOffset, region.referenceCorner, region.combinationOperator, huffmanTables, region.refinementTemplate, region.refinementAt, decodingContext); 30427 this.drawBitmap(regionInfo, bitmap); 30428 }, 30429 onImmediateLosslessTextRegion: function SimpleSegmentVisitor_onImmediateLosslessTextRegion() { 30430 this.onImmediateTextRegion.apply(this, arguments); 30431 }, 30432 onPatternDictionary: function onPatternDictionary(dictionary, currentSegment, data, start, end) { 30433 var patterns = this.patterns; 30434 if (!patterns) { 30435 this.patterns = patterns = {}; 30436 } 30437 var decodingContext = new DecodingContext(data, start, end); 30438 patterns[currentSegment] = decodePatternDictionary(dictionary.mmr, dictionary.patternWidth, dictionary.patternHeight, dictionary.maxPatternIndex, dictionary.template, decodingContext); 30439 }, 30440 onImmediateHalftoneRegion: function onImmediateHalftoneRegion(region, referredSegments, data, start, end) { 30441 var patterns = this.patterns[referredSegments[0]]; 30442 var regionInfo = region.info; 30443 var decodingContext = new DecodingContext(data, start, end); 30444 var bitmap = decodeHalftoneRegion(region.mmr, patterns, region.template, regionInfo.width, regionInfo.height, region.defaultPixelValue, region.enableSkip, region.combinationOperator, region.gridWidth, region.gridHeight, region.gridOffsetX, region.gridOffsetY, region.gridVectorX, region.gridVectorY, decodingContext); 30445 this.drawBitmap(regionInfo, bitmap); 30446 }, 30447 onImmediateLosslessHalftoneRegion: function onImmediateLosslessHalftoneRegion() { 30448 this.onImmediateHalftoneRegion.apply(this, arguments); 30449 } 30450 }; 30451 function Jbig2Image() {} 30452 Jbig2Image.prototype = { 30453 parseChunks: function Jbig2Image_parseChunks(chunks) { 30454 return parseJbig2Chunks(chunks); 30455 } 30456 }; 30457 return Jbig2Image; 30458}();
30459exports.Jbig2Image = Jbig2Image; 30460 30461/***/ }), 30462/* 132 */ 30463/***/ (function(module, exports, __w_pdfjs_require__) { 30464 30465"use strict"; 30466 30467 30468Object.defineProperty(exports, "__esModule", { 30469 value: true 30470}); 30471exports.JpegImage = undefined; 30472 30473var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 30474 30475var _util = __w_pdfjs_require__(0); 30476 30477var JpegError = function JpegErrorClosure() { 30478 function JpegError(msg) { 30479 this.message = 'JPEG error: ' + msg; 30480 } 30481 JpegError.prototype = new Error(); 30482 JpegError.prototype.name = 'JpegError'; 30483 JpegError.constructor = JpegError; 30484 return JpegError; 30485}(); 30486var JpegImage = function JpegImageClosure() { 30487 var dctZigZag = new Uint8Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]); 30488 var dctCos1 = 4017; 30489 var dctSin1 = 799; 30490 var dctCos3 = 3406; 30491 var dctSin3 = 2276; 30492 var dctCos6 = 1567; 30493 var dctSin6 = 3784; 30494 var dctSqrt2 = 5793; 30495 var dctSqrt1d2 = 2896; 30496 function JpegImage() { 30497 this.decodeTransform = null; 30498 this.colorTransform = -1; 30499 } 30500 function buildHuffmanTable(codeLengths, values) { 30501 var k = 0, 30502 code = [], 30503 i, 30504 j, 30505 length = 16; 30506 while (length > 0 && !codeLengths[length - 1]) { 30507 length--; 30508 } 30509 code.push({ 30510 children: [], 30511 index: 0 30512 }); 30513 var p = code[0], 30514 q; 30515 for (i = 0; i < length; i++) { 30516 for (j = 0; j < codeLengths[i]; j++) { 30517 p = code.pop();
vendor: 6,744 bytes, lines 30518-30736
30518 p.children[p.index] = values[k]; 30519 while (p.index > 0) { 30520 p = code.pop(); 30521 } 30522 p.index++; 30523 code.push(p); 30524 while (code.length <= i) { 30525 code.push(q = { 30526 children: [], 30527 index: 0 30528 }); 30529 p.children[p.index] = q.children; 30530 p = q; 30531 } 30532 k++; 30533 } 30534 if (i + 1 < length) { 30535 code.push(q = { 30536 children: [], 30537 index: 0 30538 }); 30539 p.children[p.index] = q.children; 30540 p = q; 30541 } 30542 } 30543 return code[0].children; 30544 } 30545 function getBlockBufferOffset(component, row, col) { 30546 return 64 * ((component.blocksPerLine + 1) * row + col); 30547 } 30548 function decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive) { 30549 var mcusPerLine = frame.mcusPerLine; 30550 var progressive = frame.progressive; 30551 var startOffset = offset, 30552 bitsData = 0, 30553 bitsCount = 0; 30554 function readBit() { 30555 if (bitsCount > 0) { 30556 bitsCount--; 30557 return bitsData >> bitsCount & 1; 30558 } 30559 bitsData = data[offset++]; 30560 if (bitsData === 0xFF) { 30561 var nextByte = data[offset++]; 30562 if (nextByte) { 30563 throw new JpegError('unexpected marker ' + (bitsData << 8 | nextByte).toString(16)); 30564 } 30565 } 30566 bitsCount = 7; 30567 return bitsData >>> 7; 30568 } 30569 function decodeHuffman(tree) { 30570 var node = tree; 30571 while (true) { 30572 node = node[readBit()]; 30573 if (typeof node === 'number') { 30574 return node; 30575 } 30576 if ((typeof node === 'undefined' ? 'undefined' : _typeof(node)) !== 'object') { 30577 throw new JpegError('invalid huffman sequence'); 30578 } 30579 } 30580 } 30581 function receive(length) { 30582 var n = 0; 30583 while (length > 0) { 30584 n = n << 1 | readBit(); 30585 length--; 30586 } 30587 return n; 30588 } 30589 function receiveAndExtend(length) { 30590 if (length === 1) { 30591 return readBit() === 1 ? 1 : -1; 30592 } 30593 var n = receive(length); 30594 if (n >= 1 << length - 1) { 30595 return n; 30596 } 30597 return n + (-1 << length) + 1; 30598 } 30599 function decodeBaseline(component, offset) { 30600 var t = decodeHuffman(component.huffmanTableDC); 30601 var diff = t === 0 ? 0 : receiveAndExtend(t); 30602 component.blockData[offset] = component.pred += diff; 30603 var k = 1; 30604 while (k < 64) { 30605 var rs = decodeHuffman(component.huffmanTableAC); 30606 var s = rs & 15, 30607 r = rs >> 4; 30608 if (s === 0) { 30609 if (r < 15) { 30610 break; 30611 } 30612 k += 16; 30613 continue; 30614 } 30615 k += r; 30616 var z = dctZigZag[k]; 30617 component.blockData[offset + z] = receiveAndExtend(s); 30618 k++; 30619 } 30620 } 30621 function decodeDCFirst(component, offset) { 30622 var t = decodeHuffman(component.huffmanTableDC); 30623 var diff = t === 0 ? 0 : receiveAndExtend(t) << successive; 30624 component.blockData[offset] = component.pred += diff; 30625 } 30626 function decodeDCSuccessive(component, offset) { 30627 component.blockData[offset] |= readBit() << successive; 30628 } 30629 var eobrun = 0; 30630 function decodeACFirst(component, offset) { 30631 if (eobrun > 0) { 30632 eobrun--; 30633 return; 30634 } 30635 var k = spectralStart, 30636 e = spectralEnd; 30637 while (k <= e) { 30638 var rs = decodeHuffman(component.huffmanTableAC); 30639 var s = rs & 15, 30640 r = rs >> 4; 30641 if (s === 0) { 30642 if (r < 15) { 30643 eobrun = receive(r) + (1 << r) - 1; 30644 break; 30645 } 30646 k += 16; 30647 continue; 30648 } 30649 k += r; 30650 var z = dctZigZag[k]; 30651 component.blockData[offset + z] = receiveAndExtend(s) * (1 << successive); 30652 k++; 30653 } 30654 } 30655 var successiveACState = 0, 30656 successiveACNextValue; 30657 function decodeACSuccessive(component, offset) { 30658 var k = spectralStart; 30659 var e = spectralEnd; 30660 var r = 0; 30661 var s; 30662 var rs; 30663 while (k <= e) { 30664 var offsetZ = offset + dctZigZag[k]; 30665 var sign = component.blockData[offsetZ] < 0 ? -1 : 1; 30666 switch (successiveACState) { 30667 case 0: 30668 rs = decodeHuffman(component.huffmanTableAC); 30669 s = rs & 15; 30670 r = rs >> 4; 30671 if (s === 0) { 30672 if (r < 15) { 30673 eobrun = receive(r) + (1 << r); 30674 successiveACState = 4; 30675 } else { 30676 r = 16; 30677 successiveACState = 1; 30678 } 30679 } else { 30680 if (s !== 1) { 30681 throw new JpegError('invalid ACn encoding'); 30682 } 30683 successiveACNextValue = receiveAndExtend(s); 30684 successiveACState = r ? 2 : 3; 30685 } 30686 continue; 30687 case 1: 30688 case 2: 30689 if (component.blockData[offsetZ]) { 30690 component.blockData[offsetZ] += sign * (readBit() << successive); 30691 } else { 30692 r--; 30693 if (r === 0) { 30694 successiveACState = successiveACState === 2 ? 3 : 0; 30695 } 30696 } 30697 break; 30698 case 3: 30699 if (component.blockData[offsetZ]) { 30700 component.blockData[offsetZ] += sign * (readBit() << successive); 30701 } else { 30702 component.blockData[offsetZ] = successiveACNextValue << successive; 30703 successiveACState = 0; 30704 } 30705 break; 30706 case 4: 30707 if (component.blockData[offsetZ]) { 30708 component.blockData[offsetZ] += sign * (readBit() << successive); 30709 } 30710 break; 30711 } 30712 k++; 30713 } 30714 if (successiveACState === 4) { 30715 eobrun--; 30716 if (eobrun === 0) { 30717 successiveACState = 0; 30718 } 30719 } 30720 } 30721 function decodeMcu(component, decode, mcu, row, col) { 30722 var mcuRow = mcu / mcusPerLine | 0; 30723 var mcuCol = mcu % mcusPerLine; 30724 var blockRow = mcuRow * component.v + row; 30725 var blockCol = mcuCol * component.h + col; 30726 var offset = getBlockBufferOffset(component, blockRow, blockCol); 30727 decode(component, offset); 30728 } 30729 function decodeBlock(component, decode, mcu) { 30730 var blockRow = mcu / component.blocksPerLine | 0; 30731 var blockCol = mcu % component.blocksPerLine; 30732 var offset = getBlockBufferOffset(component, blockRow, blockCol); 30733 decode(component, offset); 30734 } 30735 var componentsLength = components.length; 30736 var component, i, j, k, n;
30737 var decodeFn; 30738 if (progressive) { 30739 if (spectralStart === 0) { 30740 decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive; 30741 } else { 30742 decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive; 30743 } 30744 } else { 30745 decodeFn = decodeBaseline; 30746 } 30747 var mcu = 0, 30748 fileMarker; 30749 var mcuExpected; 30750 if (componentsLength === 1) { 30751 mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn; 30752 } else { 30753 mcuExpected = mcusPerLine * frame.mcusPerColumn; 30754 } 30755 var h, v; 30756 while (mcu < mcuExpected) { 30757 var mcuToRead = resetInterval ? Math.min(mcuExpected - mcu, resetInterval) : mcuExpected; 30758 for (i = 0; i < componentsLength; i++) { 30759 components[i].pred = 0; 30760 } 30761 eobrun = 0; 30762 if (componentsLength === 1) { 30763 component = components[0]; 30764 for (n = 0; n < mcuToRead; n++) { 30765 decodeBlock(component, decodeFn, mcu); 30766 mcu++; 30767 } 30768 } else { 30769 for (n = 0; n < mcuToRead; n++) { 30770 for (i = 0; i < componentsLength; i++) { 30771 component = components[i]; 30772 h = component.h; 30773 v = component.v; 30774 for (j = 0; j < v; j++) { 30775 for (k = 0; k < h; k++) { 30776 decodeMcu(component, decodeFn, mcu, j, k); 30777 } 30778 } 30779 } 30780 mcu++; 30781 } 30782 } 30783 bitsCount = 0; 30784 fileMarker = findNextFileMarker(data, offset); 30785 if (fileMarker && fileMarker.invalid) { 30786 (0, _util.warn)('decodeScan - unexpected MCU data, next marker is: ' + fileMarker.invalid); 30787 offset = fileMarker.offset; 30788 } 30789 var marker = fileMarker && fileMarker.marker; 30790 if (!marker || marker <= 0xFF00) { 30791 throw new JpegError('marker was not found'); 30792 } 30793 if (marker >= 0xFFD0 && marker <= 0xFFD7) { 30794 offset += 2; 30795 } else { 30796 break; 30797 } 30798 } 30799 fileMarker = findNextFileMarker(data, offset); 30800 if (fileMarker && fileMarker.invalid) { 30801 (0, _util.warn)('decodeScan - unexpected Scan data, next marker is: ' + fileMarker.invalid); 30802 offset = fileMarker.offset; 30803 } 30804 return offset - startOffset; 30805 } 30806 function quantizeAndInverse(component, blockBufferOffset, p) { 30807 var qt = component.quantizationTable, 30808 blockData = component.blockData; 30809 var v0, v1, v2, v3, v4, v5, v6, v7; 30810 var p0, p1, p2, p3, p4, p5, p6, p7; 30811 var t; 30812 if (!qt) { 30813 throw new JpegError('missing required Quantization Table.'); 30814 } 30815 for (var row = 0; row < 64; row += 8) { 30816 p0 = blockData[blockBufferOffset + row]; 30817 p1 = blockData[blockBufferOffset + row + 1]; 30818 p2 = blockData[blockBufferOffset + row + 2]; 30819 p3 = blockData[blockBufferOffset + row + 3]; 30820 p4 = blockData[blockBufferOffset + row + 4]; 30821 p5 = blockData[blockBufferOffset + row + 5]; 30822 p6 = blockData[blockBufferOffset + row + 6]; 30823 p7 = blockData[blockBufferOffset + row + 7]; 30824 p0 *= qt[row]; 30825 if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { 30826 t = dctSqrt2 * p0 + 512 >> 10; 30827 p[row] = t; 30828 p[row + 1] = t; 30829 p[row + 2] = t; 30830 p[row + 3] = t; 30831 p[row + 4] = t; 30832 p[row + 5] = t; 30833 p[row + 6] = t; 30834 p[row + 7] = t; 30835 continue; 30836 } 30837 p1 *= qt[row + 1]; 30838 p2 *= qt[row + 2]; 30839 p3 *= qt[row + 3]; 30840 p4 *= qt[row + 4]; 30841 p5 *= qt[row + 5]; 30842 p6 *= qt[row + 6]; 30843 p7 *= qt[row + 7]; 30844 v0 = dctSqrt2 * p0 + 128 >> 8; 30845 v1 = dctSqrt2 * p4 + 128 >> 8; 30846 v2 = p2; 30847 v3 = p6; 30848 v4 = dctSqrt1d2 * (p1 - p7) + 128 >> 8; 30849 v7 = dctSqrt1d2 * (p1 + p7) + 128 >> 8; 30850 v5 = p3 << 4; 30851 v6 = p5 << 4; 30852 v0 = v0 + v1 + 1 >> 1; 30853 v1 = v0 - v1; 30854 t = v2 * dctSin6 + v3 * dctCos6 + 128 >> 8; 30855 v2 = v2 * dctCos6 - v3 * dctSin6 + 128 >> 8; 30856 v3 = t; 30857 v4 = v4 + v6 + 1 >> 1; 30858 v6 = v4 - v6; 30859 v7 = v7 + v5 + 1 >> 1; 30860 v5 = v7 - v5; 30861 v0 = v0 + v3 + 1 >> 1;
vendor: 2,073 bytes, lines 30862-30923
30862 v3 = v0 - v3; 30863 v1 = v1 + v2 + 1 >> 1; 30864 v2 = v1 - v2; 30865 t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12; 30866 v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; 30867 v7 = t; 30868 t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; 30869 v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; 30870 v6 = t; 30871 p[row] = v0 + v7; 30872 p[row + 7] = v0 - v7; 30873 p[row + 1] = v1 + v6; 30874 p[row + 6] = v1 - v6; 30875 p[row + 2] = v2 + v5; 30876 p[row + 5] = v2 - v5; 30877 p[row + 3] = v3 + v4; 30878 p[row + 4] = v3 - v4; 30879 } 30880 for (var col = 0; col < 8; ++col) { 30881 p0 = p[col]; 30882 p1 = p[col + 8]; 30883 p2 = p[col + 16]; 30884 p3 = p[col + 24]; 30885 p4 = p[col + 32]; 30886 p5 = p[col + 40]; 30887 p6 = p[col + 48]; 30888 p7 = p[col + 56]; 30889 if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { 30890 t = dctSqrt2 * p0 + 8192 >> 14; 30891 t = t < -2040 ? 0 : t >= 2024 ? 255 : t + 2056 >> 4; 30892 blockData[blockBufferOffset + col] = t; 30893 blockData[blockBufferOffset + col + 8] = t; 30894 blockData[blockBufferOffset + col + 16] = t; 30895 blockData[blockBufferOffset + col + 24] = t; 30896 blockData[blockBufferOffset + col + 32] = t; 30897 blockData[blockBufferOffset + col + 40] = t; 30898 blockData[blockBufferOffset + col + 48] = t; 30899 blockData[blockBufferOffset + col + 56] = t; 30900 continue; 30901 } 30902 v0 = dctSqrt2 * p0 + 2048 >> 12; 30903 v1 = dctSqrt2 * p4 + 2048 >> 12; 30904 v2 = p2; 30905 v3 = p6; 30906 v4 = dctSqrt1d2 * (p1 - p7) + 2048 >> 12; 30907 v7 = dctSqrt1d2 * (p1 + p7) + 2048 >> 12; 30908 v5 = p3; 30909 v6 = p5; 30910 v0 = (v0 + v1 + 1 >> 1) + 4112; 30911 v1 = v0 - v1; 30912 t = v2 * dctSin6 + v3 * dctCos6 + 2048 >> 12; 30913 v2 = v2 * dctCos6 - v3 * dctSin6 + 2048 >> 12; 30914 v3 = t; 30915 v4 = v4 + v6 + 1 >> 1; 30916 v6 = v4 - v6; 30917 v7 = v7 + v5 + 1 >> 1; 30918 v5 = v7 - v5; 30919 v0 = v0 + v3 + 1 >> 1; 30920 v3 = v0 - v3; 30921 v1 = v1 + v2 + 1 >> 1; 30922 v2 = v1 - v2; 30923 t = v4 * dctSin3 + v7 * dctCos3 + 2048 >>
vendor: 5,818 bytes, lines 30923-31076
30923 12; 30924 v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; 30925 v7 = t; 30926 t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; 30927 v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; 30928 v6 = t; 30929 p0 = v0 + v7; 30930 p7 = v0 - v7; 30931 p1 = v1 + v6; 30932 p6 = v1 - v6; 30933 p2 = v2 + v5; 30934 p5 = v2 - v5; 30935 p3 = v3 + v4; 30936 p4 = v3 - v4; 30937 p0 = p0 < 16 ? 0 : p0 >= 4080 ? 255 : p0 >> 4; 30938 p1 = p1 < 16 ? 0 : p1 >= 4080 ? 255 : p1 >> 4; 30939 p2 = p2 < 16 ? 0 : p2 >= 4080 ? 255 : p2 >> 4; 30940 p3 = p3 < 16 ? 0 : p3 >= 4080 ? 255 : p3 >> 4; 30941 p4 = p4 < 16 ? 0 : p4 >= 4080 ? 255 : p4 >> 4; 30942 p5 = p5 < 16 ? 0 : p5 >= 4080 ? 255 : p5 >> 4; 30943 p6 = p6 < 16 ? 0 : p6 >= 4080 ? 255 : p6 >> 4; 30944 p7 = p7 < 16 ? 0 : p7 >= 4080 ? 255 : p7 >> 4; 30945 blockData[blockBufferOffset + col] = p0; 30946 blockData[blockBufferOffset + col + 8] = p1; 30947 blockData[blockBufferOffset + col + 16] = p2; 30948 blockData[blockBufferOffset + col + 24] = p3; 30949 blockData[blockBufferOffset + col + 32] = p4; 30950 blockData[blockBufferOffset + col + 40] = p5; 30951 blockData[blockBufferOffset + col + 48] = p6; 30952 blockData[blockBufferOffset + col + 56] = p7; 30953 } 30954 } 30955 function buildComponentData(frame, component) { 30956 var blocksPerLine = component.blocksPerLine; 30957 var blocksPerColumn = component.blocksPerColumn; 30958 var computationBuffer = new Int16Array(64); 30959 for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) { 30960 for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) { 30961 var offset = getBlockBufferOffset(component, blockRow, blockCol); 30962 quantizeAndInverse(component, offset, computationBuffer); 30963 } 30964 } 30965 return component.blockData; 30966 } 30967 function findNextFileMarker(data, currentPos, startPos) { 30968 function peekUint16(pos) { 30969 return data[pos] << 8 | data[pos + 1]; 30970 } 30971 var maxPos = data.length - 1; 30972 var newPos = startPos < currentPos ? startPos : currentPos; 30973 if (currentPos >= maxPos) { 30974 return null; 30975 } 30976 var currentMarker = peekUint16(currentPos); 30977 if (currentMarker >= 0xFFC0 && currentMarker <= 0xFFFE) { 30978 return { 30979 invalid: null, 30980 marker: currentMarker, 30981 offset: currentPos 30982 }; 30983 } 30984 var newMarker = peekUint16(newPos); 30985 while (!(newMarker >= 0xFFC0 && newMarker <= 0xFFFE)) { 30986 if (++newPos >= maxPos) { 30987 return null; 30988 } 30989 newMarker = peekUint16(newPos); 30990 } 30991 return { 30992 invalid: currentMarker.toString(16), 30993 marker: newMarker, 30994 offset: newPos 30995 }; 30996 } 30997 JpegImage.prototype = { 30998 parse: function parse(data) { 30999 function readUint16() { 31000 var value = data[offset] << 8 | data[offset + 1]; 31001 offset += 2; 31002 return value; 31003 } 31004 function readDataBlock() { 31005 var length = readUint16(); 31006 var endOffset = offset + length - 2; 31007 var fileMarker = findNextFileMarker(data, endOffset, offset); 31008 if (fileMarker && fileMarker.invalid) { 31009 (0, _util.warn)('readDataBlock - incorrect length, next marker is: ' + fileMarker.invalid); 31010 endOffset = fileMarker.offset; 31011 } 31012 var array = data.subarray(offset, endOffset); 31013 offset += array.length; 31014 return array; 31015 } 31016 function prepareComponents(frame) { 31017 var mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH); 31018 var mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV); 31019 for (var i = 0; i < frame.components.length; i++) { 31020 component = frame.components[i]; 31021 var blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * component.h / frame.maxH); 31022 var blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * component.v / frame.maxV); 31023 var blocksPerLineForMcu = mcusPerLine * component.h; 31024 var blocksPerColumnForMcu = mcusPerColumn * component.v; 31025 var blocksBufferSize = 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1); 31026 component.blockData = new Int16Array(blocksBufferSize); 31027 component.blocksPerLine = blocksPerLine; 31028 component.blocksPerColumn = blocksPerColumn; 31029 } 31030 frame.mcusPerLine = mcusPerLine; 31031 frame.mcusPerColumn = mcusPerColumn; 31032 } 31033 var offset = 0; 31034 var jfif = null; 31035 var adobe = null; 31036 var frame, resetInterval; 31037 var quantizationTables = []; 31038 var huffmanTablesAC = [], 31039 huffmanTablesDC = []; 31040 var fileMarker = readUint16(); 31041 if (fileMarker !== 0xFFD8) { 31042 throw new JpegError('SOI not found'); 31043 } 31044 fileMarker = readUint16(); 31045 while (fileMarker !== 0xFFD9) { 31046 var i, j, l; 31047 switch (fileMarker) { 31048 case 0xFFE0: 31049 case 0xFFE1: 31050 case 0xFFE2: 31051 case 0xFFE3: 31052 case 0xFFE4: 31053 case 0xFFE5: 31054 case 0xFFE6: 31055 case 0xFFE7: 31056 case 0xFFE8: 31057 case 0xFFE9: 31058 case 0xFFEA: 31059 case 0xFFEB: 31060 case 0xFFEC: 31061 case 0xFFED: 31062 case 0xFFEE: 31063 case 0xFFEF: 31064 case 0xFFFE: 31065 var appData = readDataBlock(); 31066 if (fileMarker === 0xFFE0) { 31067 if (appData[0] === 0x4A && appData[1] === 0x46 && appData[2] === 0x49 && appData[3] === 0x46 && appData[4] === 0) { 31068 jfif = { 31069 version: { 31070 major: appData[5], 31071 minor: appData[6] 31072 }, 31073 densityUnits: appData[7], 31074 xDensity: appData[8] << 8 | appData[9], 31075 yDensity: appData[10] << 8 | appData[11], 31076 thumbWidth: appData[12],
31077 thumbHeight: appData[13], 31078 thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13]) 31079 }; 31080 } 31081 } 31082 if (fileMarker === 0xFFEE) { 31083 if (appData[0] === 0x41 && appData[1] === 0x64 && appData[2] === 0x6F && appData[3] === 0x62 && appData[4] === 0x65) { 31084 adobe = { 31085 version: appData[5] << 8 | appData[6], 31086 flags0: appData[7] << 8 | appData[8], 31087 flags1: appData[9] << 8 | appData[10], 31088 transformCode: appData[11] 31089 }; 31090 } 31091 } 31092 break; 31093 case 0xFFDB: 31094 var quantizationTablesLength = readUint16(); 31095 var quantizationTablesEnd = quantizationTablesLength + offset - 2; 31096 var z; 31097 while (offset < quantizationTablesEnd) { 31098 var quantizationTableSpec = data[offset++]; 31099 var tableData = new Uint16Array(64); 31100 if (quantizationTableSpec >> 4 === 0) { 31101 for (j = 0; j < 64; j++) { 31102 z = dctZigZag[j]; 31103 tableData[z] = data[offset++]; 31104 } 31105 } else if (quantizationTableSpec >> 4 === 1) { 31106 for (j = 0; j < 64; j++) { 31107 z = dctZigZag[j]; 31108 tableData[z] = readUint16(); 31109 } 31110 } else { 31111 throw new JpegError('DQT - invalid table spec'); 31112 } 31113 quantizationTables[quantizationTableSpec & 15] = tableData; 31114 } 31115 break; 31116 case 0xFFC0: 31117 case 0xFFC1: 31118 case 0xFFC2: 31119 if (frame) { 31120 throw new JpegError('Only single frame JPEGs supported'); 31121 } 31122 readUint16(); 31123 frame = {}; 31124 frame.extended = fileMarker === 0xFFC1; 31125 frame.progressive = fileMarker === 0xFFC2; 31126 frame.precision = data[offset++]; 31127 frame.scanLines = readUint16(); 31128 frame.samplesPerLine = readUint16(); 31129 frame.components = []; 31130 frame.componentIds = {}; 31131 var componentsCount = data[offset++], 31132 componentId; 31133 var maxH = 0, 31134 maxV = 0; 31135 for (i = 0; i < componentsCount; i++) { 31136 componentId = data[offset]; 31137 var h = data[offset + 1] >> 4; 31138 var v = data[offset + 1] & 15; 31139 if (maxH < h) { 31140 maxH = h; 31141 } 31142 if (maxV < v) { 31143 maxV = v; 31144 } 31145 var qId = data[offset + 2]; 31146 l = frame.components.push({ 31147 h: h, 31148 v: v, 31149 quantizationId: qId, 31150 quantizationTable: null 31151 }); 31152 frame.componentIds[componentId] = l - 1; 31153 offset += 3; 31154 } 31155 frame.maxH = maxH; 31156 frame.maxV = maxV; 31157 prepareComponents(frame); 31158 break; 31159 case 0xFFC4: 31160 var huffmanLength = readUint16(); 31161 for (i = 2; i < huffmanLength;) { 31162 var huffmanTableSpec = data[offset++]; 31163 var codeLengths = new Uint8Array(16); 31164 var codeLengthSum = 0; 31165 for (j = 0; j < 16; j++, offset++) { 31166 codeLengthSum += codeLengths[j] = data[offset]; 31167 } 31168 var huffmanValues = new Uint8Array(codeLengthSum); 31169 for (j = 0; j < codeLengthSum; j++, offset++) { 31170 huffmanValues[j] = data[offset]; 31171 } 31172 i += 17 + codeLengthSum; 31173 (huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = buildHuffmanTable(codeLengths, huffmanValues); 31174 } 31175 break; 31176 case 0xFFDD: 31177 readUint16(); 31178 resetInterval = readUint16(); 31179 break;
vendor: 4,514 bytes, lines 31180-31297
31180 case 0xFFDA: 31181 readUint16(); 31182 var selectorsCount = data[offset++]; 31183 var components = [], 31184 component; 31185 for (i = 0; i < selectorsCount; i++) { 31186 var componentIndex = frame.componentIds[data[offset++]]; 31187 component = frame.components[componentIndex]; 31188 var tableSpec = data[offset++]; 31189 component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; 31190 component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; 31191 components.push(component); 31192 } 31193 var spectralStart = data[offset++]; 31194 var spectralEnd = data[offset++]; 31195 var successiveApproximation = data[offset++]; 31196 var processed = decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successiveApproximation >> 4, successiveApproximation & 15); 31197 offset += processed; 31198 break; 31199 case 0xFFFF: 31200 if (data[offset] !== 0xFF) { 31201 offset--; 31202 } 31203 break; 31204 default: 31205 if (data[offset - 3] === 0xFF && data[offset - 2] >= 0xC0 && data[offset - 2] <= 0xFE) { 31206 offset -= 3; 31207 break; 31208 } 31209 throw new JpegError('unknown marker ' + fileMarker.toString(16)); 31210 } 31211 fileMarker = readUint16(); 31212 } 31213 this.width = frame.samplesPerLine; 31214 this.height = frame.scanLines; 31215 this.jfif = jfif; 31216 this.adobe = adobe; 31217 this.components = []; 31218 for (i = 0; i < frame.components.length; i++) { 31219 component = frame.components[i]; 31220 var quantizationTable = quantizationTables[component.quantizationId]; 31221 if (quantizationTable) { 31222 component.quantizationTable = quantizationTable; 31223 } 31224 this.components.push({ 31225 output: buildComponentData(frame, component), 31226 scaleX: component.h / frame.maxH, 31227 scaleY: component.v / frame.maxV, 31228 blocksPerLine: component.blocksPerLine, 31229 blocksPerColumn: component.blocksPerColumn 31230 }); 31231 } 31232 this.numComponents = this.components.length; 31233 }, 31234 _getLinearizedBlockData: function getLinearizedBlockData(width, height) { 31235 var scaleX = this.width / width, 31236 scaleY = this.height / height; 31237 var component, componentScaleX, componentScaleY, blocksPerScanline; 31238 var x, y, i, j, k; 31239 var index; 31240 var offset = 0; 31241 var output; 31242 var numComponents = this.components.length; 31243 var dataLength = width * height * numComponents; 31244 var data = new Uint8ClampedArray(dataLength); 31245 var xScaleBlockOffset = new Uint32Array(width); 31246 var mask3LSB = 0xfffffff8; 31247 for (i = 0; i < numComponents; i++) { 31248 component = this.components[i]; 31249 componentScaleX = component.scaleX * scaleX; 31250 componentScaleY = component.scaleY * scaleY; 31251 offset = i; 31252 output = component.output; 31253 blocksPerScanline = component.blocksPerLine + 1 << 3; 31254 for (x = 0; x < width; x++) { 31255 j = 0 | x * componentScaleX; 31256 xScaleBlockOffset[x] = (j & mask3LSB) << 3 | j & 7; 31257 } 31258 for (y = 0; y < height; y++) { 31259 j = 0 | y * componentScaleY; 31260 index = blocksPerScanline * (j & mask3LSB) | (j & 7) << 3; 31261 for (x = 0; x < width; x++) { 31262 data[offset] = output[index + xScaleBlockOffset[x]]; 31263 offset += numComponents; 31264 } 31265 } 31266 } 31267 var transform = this.decodeTransform; 31268 if (transform) { 31269 for (i = 0; i < dataLength;) { 31270 for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) { 31271 data[i] = (data[i] * transform[k] >> 8) + transform[k + 1]; 31272 } 31273 } 31274 } 31275 return data; 31276 }, 31277 _isColorConversionNeeded: function _isColorConversionNeeded() { 31278 if (this.adobe) { 31279 return !!this.adobe.transformCode; 31280 } 31281 if (this.numComponents === 3) { 31282 if (this.colorTransform === 0) { 31283 return false; 31284 } 31285 return true; 31286 } 31287 if (this.colorTransform === 1) { 31288 return true; 31289 } 31290 return false; 31291 }, 31292 31293 _convertYccToRgb: function convertYccToRgb(data) { 31294 var Y, Cb, Cr; 31295 for (var i = 0, length = data.length; i < length; i += 3) { 31296 Y = data[i]; 31297 Cb = data[i + 1];
vendor: 4,912 bytes, lines 31298-31378
31298 Cr = data[i + 2]; 31299 data[i] = Y - 179.456 + 1.402 * Cr; 31300 data[i + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr; 31301 data[i + 2] = Y - 226.816 + 1.772 * Cb; 31302 } 31303 return data; 31304 }, 31305 _convertYcckToRgb: function convertYcckToRgb(data) { 31306 var Y, Cb, Cr, k; 31307 var offset = 0; 31308 for (var i = 0, length = data.length; i < length; i += 4) { 31309 Y = data[i]; 31310 Cb = data[i + 1]; 31311 Cr = data[i + 2]; 31312 k = data[i + 3]; 31313 data[offset++] = -122.67195406894 + Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - 0.154362151871126) + Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - 0.00477271405408747 * k + 1.53380253221734) + Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + 0.48357088451265) + k * (-0.000336197177618394 * k + 0.484791561490776); 31314 data[offset++] = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665); 31315 data[offset++] = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407); 31316 } 31317 return data; 31318 }, 31319 _convertYcckToCmyk: function convertYcckToCmyk(data) { 31320 var Y, Cb, Cr; 31321 for (var i = 0, length = data.length; i < length; i += 4) { 31322 Y = data[i]; 31323 Cb = data[i + 1]; 31324 Cr = data[i + 2]; 31325 data[i] = 434.456 - Y - 1.402 * Cr; 31326 data[i + 1] = 119.541 - Y + 0.344 * Cb + 0.714 * Cr; 31327 data[i + 2] = 481.816 - Y - 1.772 * Cb; 31328 } 31329 return data; 31330 }, 31331 _convertCmykToRgb: function convertCmykToRgb(data) { 31332 var c, m, y, k; 31333 var offset = 0; 31334 var scale = 1 / 255; 31335 for (var i = 0, length = data.length; i < length; i += 4) { 31336 c = data[i] * scale; 31337 m = data[i + 1] * scale; 31338 y = data[i + 2] * scale; 31339 k = data[i + 3] * scale; 31340 data[offset++] = 255 + c * (-4.387332384609988 * c + 54.48615194189176 * m + 18.82290502165302 * y + 212.25662451639585 * k - 285.2331026137004) + m * (1.7149763477362134 * m - 5.6096736904047315 * y - 17.873870861415444 * k - 5.497006427196366) + y * (-2.5217340131683033 * y - 21.248923337353073 * k + 17.5119270841813) - k * (21.86122147463605 * k + 189.48180835922747); 31341 data[offset++] = 255 + c * (8.841041422036149 * c + 60.118027045597366 * m + 6.871425592049007 * y + 31.159100130055922 * k - 79.2970844816548) + m * (-15.310361306967817 * m + 17.575251261109482 * y + 131.35250912493976 * k - 190.9453302588951) + y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) - k * (20.737325471181034 * k + 187.80453709719578); 31342 data[offset++] = 255 + c * (0.8842522430003296 * c + 8.078677503112928 * m + 30.89978309703729 * y - 0.23883238689178934 * k - 14.183576799673286) + m * (10.49593273432072 * m + 63.02378494754052 * y + 50.606957656360734 * k - 112.23884253719248) + y * (0.03296041114873217 * y + 115.60384449646641 * k - 193.58209356861505) - k * (22.33816807309886 * k + 180.12613974708367); 31343 } 31344 return data; 31345 }, 31346 getData: function getData(width, height, forceRGBoutput) { 31347 if (this.numComponents > 4) { 31348 throw new JpegError('Unsupported color mode'); 31349 } 31350 var data = this._getLinearizedBlockData(width, height); 31351 if (this.numComponents === 1 && forceRGBoutput) { 31352 var dataLength = data.length; 31353 var rgbData = new Uint8ClampedArray(dataLength * 3); 31354 var offset = 0; 31355 for (var i = 0; i < dataLength; i++) { 31356 var grayColor = data[i]; 31357 rgbData[offset++] = grayColor; 31358 rgbData[offset++] = grayColor; 31359 rgbData[offset++] = grayColor; 31360 } 31361 return rgbData; 31362 } else if (this.numComponents === 3 && this._isColorConversionNeeded()) { 31363 return this._convertYccToRgb(data); 31364 } else if (this.numComponents === 4) { 31365 if (this._isColorConversionNeeded()) { 31366 if (forceRGBoutput) { 31367 return this._convertYcckToRgb(data); 31368 } 31369 return this._convertYcckToCmyk(data); 31370 } else if (forceRGBoutput) { 31371 return this._convertCmykToRgb(data); 31372 } 31373 } 31374 return data; 31375 } 31376 }; 31377 return JpegImage; 31378}();
31379exports.JpegImage = JpegImage; 31380 31381/***/ }), 31382/* 133 */ 31383/***/ (function(module, exports, __w_pdfjs_require__) { 31384 31385"use strict"; 31386 31387 31388Object.defineProperty(exports, "__esModule", { 31389 value: true 31390}); 31391exports.JpxStream = undefined; 31392 31393var _stream = __w_pdfjs_require__(2); 31394 31395var _jpx = __w_pdfjs_require__(66); 31396 31397var _util = __w_pdfjs_require__(0); 31398 31399var JpxStream = function JpxStreamClosure() { 31400 function JpxStream(stream, maybeLength, dict, params) { 31401 this.stream = stream; 31402 this.maybeLength = maybeLength; 31403 this.dict = dict; 31404 this.params = params; 31405 _stream.DecodeStream.call(this, maybeLength); 31406 } 31407 JpxStream.prototype = Object.create(_stream.DecodeStream.prototype); 31408 Object.defineProperty(JpxStream.prototype, 'bytes', { 31409 get: function JpxStream_bytes() { 31410 return (0, _util.shadow)(this, 'bytes', this.stream.getBytes(this.maybeLength)); 31411 }, 31412 configurable: true 31413 }); 31414 JpxStream.prototype.ensureBuffer = function (requested) {}; 31415 JpxStream.prototype.readBlock = function () { 31416 if (this.eof) { 31417 return; 31418 } 31419 var jpxImage = new _jpx.JpxImage(); 31420 jpxImage.parse(this.bytes); 31421 var width = jpxImage.width; 31422 var height = jpxImage.height; 31423 var componentsCount = jpxImage.componentsCount; 31424 var tileCount = jpxImage.tiles.length; 31425 if (tileCount === 1) { 31426 this.buffer = jpxImage.tiles[0].items; 31427 } else { 31428 var data = new Uint8ClampedArray(width * height * componentsCount); 31429 for (var k = 0; k < tileCount; k++) { 31430 var tileComponents = jpxImage.tiles[k]; 31431 var tileWidth = tileComponents.width; 31432 var tileHeight = tileComponents.height; 31433 var tileLeft = tileComponents.left; 31434 var tileTop = tileComponents.top; 31435 var src = tileComponents.items; 31436 var srcPosition = 0; 31437 var dataPosition = (width * tileTop + tileLeft) * componentsCount; 31438 var imgRowSize = width * componentsCount; 31439 var tileRowSize = tileWidth * componentsCount; 31440 for (var j = 0; j < tileHeight; j++) { 31441 var rowBytes = src.subarray(srcPosition, srcPosition + tileRowSize); 31442 data.set(rowBytes, dataPosition); 31443 srcPosition += tileRowSize; 31444 dataPosition += imgRowSize; 31445 } 31446 } 31447 this.buffer = data; 31448 } 31449 this.bufferLength = this.buffer.length; 31450 this.eof = true; 31451 }; 31452 return JpxStream; 31453}(); 31454exports.JpxStream = JpxStream; 31455 31456/***/ }), 31457/* 134 */ 31458/***/ (function(module, exports, __w_pdfjs_require__) { 31459 31460"use strict"; 31461 31462 31463Object.defineProperty(exports, "__esModule", { 31464 value: true 31465}); 31466exports.AnnotationFactory = exports.AnnotationBorderStyle = exports.Annotation = undefined; 31467 31468var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; 31469 31470var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 31471 31472var _util = __w_pdfjs_require__(0); 31473 31474var _obj = __w_pdfjs_require__(64); 31475 31476var _primitives = __w_pdfjs_require__(1); 31477 31478var _colorspace = __w_pdfjs_require__(20); 31479 31480var _operator_list = __w_pdfjs_require__(42); 31481 31482var _stream = __w_pdfjs_require__(2); 31483 31484function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 31485 31486function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { c
31486onstructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 31487 31488function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 31489 31490var AnnotationFactory = function () { 31491 function AnnotationFactory() { 31492 _classCallCheck(this, AnnotationFactory); 31493 } 31494 31495 _createClass(AnnotationFactory, null, [{ 31496 key: 'create', 31497 value: function create(xref, ref, pdfManager, idFactory) { 31498 var dict = xref.fetchIfRef(ref); 31499 if (!(0, _primitives.isDict)(dict)) { 31500 return; 31501 } 31502 var id = (0, _primitives.isRef)(ref) ? ref.toString() : 'annot_' + idFactory.createObjId(); 31503 var subtype = dict.get('Subtype'); 31504 subtype = (0, _primitives.isName)(subtype) ? subtype.name : null; 31505 var parameters = { 31506 xref: xref, 31507 dict: dict, 31508 ref: (0, _primitives.isRef)(ref) ? ref : null, 31509 subtype: subtype, 31510 id: id, 31511 pdfManager: pdfManager 31512 }; 31513 switch (subtype) { 31514 case 'Link': 31515 return new LinkAnnotation(parameters); 31516 case 'Text': 31517 return new TextAnnotation(parameters); 31518 case 'Widget': 31519 var fieldType = _util.Util.getInheritableProperty(dict, 'FT'); 31520 fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null; 31521 switch (fieldType) { 31522 case 'Tx': 31523 return new TextWidgetAnnotation(parameters); 31524 case 'Btn': 31525 return new ButtonWidgetAnnotation(parameters); 31526 case 'Ch': 31527 return new ChoiceWidgetAnnotation(parameters); 31528 } 31529 (0, _util.warn)('Unimplemented widget field type "' + fieldType + '", ' + 'falling back to base field type.'); 31530 return new WidgetAnnotation(parameters); 31531 case 'Popup': 31532 return new PopupAnnotation(parameters); 31533 case 'Line': 31534 return new LineAnnotation(parameters); 31535 case 'Square': 31536 return new SquareAnnotation(parameters); 31537 case 'Circle': 31538 return new CircleAnnotation(parameters); 31539 case 'PolyLine': 31540 return new PolylineAnnotation(parameters); 31541 case 'Polygon': 31542 return new PolygonAnnotation(parameters); 31543 case 'Highlight': 31544 return new HighlightAnnotation(parameters); 31545 case 'Underline': 31546 return new UnderlineAnnotation(parameters); 31547 case 'Squiggly': 31548 return new SquigglyAnnotation(parameters); 31549 case 'StrikeOut': 31550 return new StrikeOutAnnotation(parameters); 31551 case 'Stamp': 31552 return new StampAnnotation(parameters); 31553 case 'FileAttachment': 31554 return new FileAttachmentAnnotation(parameters); 31555 default: 31556 if (!subtype) { 31557 (0, _util.warn)('Annotation is missing the required /Subtype.'); 31558 } else { 31559 (0, _util.warn)('Unimplemented annotation type "' + subtype + '", ' + 'falling back to base annotation.'); 31560 } 31561 return new Annotation(parameters); 31562 } 31563 } 31564 }]); 31565 31566 return AnnotationFactory; 31567}(); 31568 31569function getTransformMatrix(rect, bbox, matrix) { 31570 var bounds = _util.Util.getAxialAlignedBoundingBox(bbox, matrix); 31571 var minX = bounds[0]; 31572 var minY = bounds[1]; 31573 var maxX = bounds[2]; 31574 var maxY = bounds[3]; 31575 if (minX === maxX || minY === maxY) { 31576 return [1, 0, 0, 1, rect[0], rect[1]]; 31577 } 31578 var xRatio = (rect[2] - rect[0]) / (maxX - minX); 31579 var yRatio = (rect[3] - rect[1]) / (maxY - minY); 31580 return [xRatio, 0, 0, yRatio, rect[0] - minX * xRatio, rect[1] - minY * yRatio]; 31581} 31582 31583var Annotation = function () { 31584 function Annotation(params) { 31585 _classCallCheck(this, Annotation); 31586 31587 var dict = params.dict; 31588 this.setFlags(dict.get('F')); 31589 this.setRectangle(dict.getArray('Rect')); 31590 this.setColor(dict.getArray('C')); 31591 this.setBorderStyle(dict); 31592 this.setAppearance(dict); 31593 this.data = { 31594 annotationFlags: this.flags, 31595 borderStyle: this.borderStyle, 31596 color: this.color, 31597 hasAppearance: !!this.appearance, 31598 id: params.id, 31599 rect: this.rectangle, 31600 subtype: params.subtype 31601 }; 31602 } 31603 31604 _createClass(Annotation, [{ 31605 key: '_hasFlag',
31606 value: function _hasFlag(flags, flag) { 31607 return !!(flags & flag); 31608 } 31609 }, { 31610 key: '_isViewable', 31611 value: function _isViewable(flags) { 31612 return !this._hasFlag(flags, _util.AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, _util.AnnotationFlag.HIDDEN) && !this._hasFlag(flags, _util.AnnotationFlag.NOVIEW); 31613 } 31614 }, { 31615 key: '_isPrintable', 31616 value: function _isPrintable(flags) { 31617 return this._hasFlag(flags, _util.AnnotationFlag.PRINT) && !this._hasFlag(flags, _util.AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, _util.AnnotationFlag.HIDDEN); 31618 } 31619 }, { 31620 key: 'setFlags', 31621 value: function setFlags(flags) { 31622 this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0; 31623 } 31624 }, { 31625 key: 'hasFlag', 31626 value: function hasFlag(flag) { 31627 return this._hasFlag(this.flags, flag); 31628 } 31629 }, { 31630 key: 'setRectangle', 31631 value: function setRectangle(rectangle) { 31632 if (Array.isArray(rectangle) && rectangle.length === 4) { 31633 this.rectangle = _util.Util.normalizeRect(rectangle); 31634 } else { 31635 this.rectangle = [0, 0, 0, 0]; 31636 } 31637 } 31638 }, { 31639 key: 'setColor', 31640 value: function setColor(color) { 31641 var rgbColor = new Uint8Array(3); 31642 if (!Array.isArray(color)) { 31643 this.color = rgbColor; 31644 return; 31645 } 31646 switch (color.length) { 31647 case 0: 31648 this.color = null; 31649 break; 31650 case 1: 31651 _colorspace.ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0); 31652 this.color = rgbColor; 31653 break; 31654 case 3: 31655 _colorspace.ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0); 31656 this.color = rgbColor; 31657 break; 31658 case 4: 31659 _colorspace.ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0); 31660 this.color = rgbColor; 31661 break; 31662 default: 31663 this.color = rgbColor; 31664 break; 31665 } 31666 } 31667 }, { 31668 key: 'setBorderStyle', 31669 value: function setBorderStyle(borderStyle) { 31670 this.borderStyle = new AnnotationBorderStyle(); 31671 if (!(0, _primitives.isDict)(borderStyle)) { 31672 return; 31673 } 31674 if (borderStyle.has('BS')) { 31675 var dict = borderStyle.get('BS'); 31676 var dictType = dict.get('Type'); 31677 if (!dictType || (0, _primitives.isName)(dictType, 'Border')) { 31678 this.borderStyle.setWidth(dict.get('W')); 31679 this.borderStyle.setStyle(dict.get('S')); 31680 this.borderStyle.setDashArray(dict.getArray('D')); 31681 } 31682 } else if (borderStyle.has('Border')) { 31683 var array = borderStyle.getArray('Border'); 31684 if (Array.isArray(array) && array.length >= 3) { 31685 this.borderStyle.setHorizontalCornerRadius(array[0]); 31686 this.borderStyle.setVerticalCornerRadius(array[1]); 31687 this.borderStyle.setWidth(array[2]); 31688 if (array.length === 4) { 31689 this.borderStyle.setDashArray(array[3]); 31690 } 31691 } 31692 } else { 31693 this.borderStyle.setWidth(0); 31694 } 31695 } 31696 }, { 31697 key: 'setAppearance', 31698 value: function setAppearance(dict) { 31699 this.appearance = null; 31700 var appearanceStates = dict.get('AP'); 31701 if (!(0, _primitives.isDict)(appearanceStates)) { 31702 return; 31703 } 31704 var normalAppearanceState = appearanceStates.get('N'); 31705 if ((0, _primitives.isStream)(normalAppearanceState)) { 31706 this.appearance = normalAppearanceState; 31707 return; 31708 } 31709 if (!(0, _primitives.isDict)(normalAppearanceState)) { 31710 return; 31711 } 31712 var as = dict.get('AS'); 31713 if (!(0, _primitives.isName)(as) || !normalAppearanceState.has(as.name)) { 31714 return; 31715 } 31716 this.appearance = normalAppearanceState.get(as.name); 31717 } 31718 }, { 31719 key: '_preparePopup', 31720 value: function _preparePopup(dict) { 31721 if (!dict.has('C')) { 31722 this.data.color = null; 31723 } 31724 this.data.hasPopup = dict.has('Popup'); 31725 this.data.title = (0, _util.stringToPDFString)(dict.get('T') || ''); 31726 this.data.contents = (0, _util.stringToPDFString)(dict.get('Contents') || ''); 31727 } 31728 }, { 31729 key: 'loadResources', 31730 value: function loadResources(keys) { 31731 return this.appearance.dict.getAsync('Resources').then(function (resources) { 31732 if (!resources) { 31733 return; 31734 } 31735 var objectLoader = new _obj.ObjectLoader(resources, keys, resources.xref); 31736 return objectLoader.load().then(function () { 31737 return resources; 31738 }); 31739 }); 31740 } 31741 }, { 31742 key: 'getOperatorList', 31743 value: function getOperatorList(evaluator, task, renderForms) { 31744 var _this = this; 31745 31746 if (!this.appearance) { 31747 return Promise.resolve(new _operator_list.OperatorList()); 31748 } 31749 var data = this.data; 31750 var appearanceDict = this.appearance.dict; 31751 var resourcesPromise = this.loadResources(['ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font']); 31752 var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1]; 31753 var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0, 0]; 31754 var transform = getTransformMatrix(data.rect, bbox, matrix); 31755 return resourcesPromise.then(function (resources) { 31756 var opList = new _operator_list.OperatorList(); 31757 opList.addOp(_util.OPS.beginAnnotation, [data.rect, transform, matrix]); 31758 return evaluator.getOperatorList({ 31759 stream: _this.appearance, 31760 task: task, 31761 resources: resources, 31762 operatorList: opList 31763 }).then(function () { 31764 opList.addOp(_util.OPS.endAnnotation, []); 31765 _this.appearance.reset(); 31766 return opList; 31767 }); 31768 }); 31769 } 31770 }, { 31771 key: 'viewable', 31772 get: function get() { 31773 if (this.flags === 0) { 31774 return true; 31775 } 31776 return this._isViewable(this.flags); 31777 } 31778 }, { 31779 key: 'printable', 31780 get: function get() { 31781 if (this.flags === 0) { 31782 return false; 31783 } 31784 return this._isPrintable(this.flags); 31785 } 31786 }]); 31787 31788 return Annotation; 31789}(); 31790 31791var AnnotationBorderStyle = function () { 31792 function AnnotationBorderStyle() { 31793 _classCallCheck(this, AnnotationBorderStyle); 31794 31795 this.width = 1; 31796 this.style = _util.AnnotationBorderStyleType.SOLID; 31797 this.dashArray = [3]; 31798 this.horizontalCornerRadius = 0; 31799 this.verticalCornerRadius = 0; 31800 } 31801 31802 _createClass(AnnotationBorderStyle, [{ 31803 key: 'setWidth', 31804 value: function setWidth(width) { 31805 if (Number.isInteger(width)) { 31806 this.width = width; 31807 } 31808 } 31809 }, { 31810 key: 'setStyle', 31811 value: function setStyle(style) { 31812 if (!style) { 31813 return; 31814 } 31815 switch (style.name) { 31816 case 'S': 31817 this.style = _util.AnnotationBorderStyleType.SOLID; 31818 break; 31819 case 'D': 31820 this.style = _util.AnnotationBorderStyleType.DASHED; 31821 break; 31822 case 'B': 31823 this.style = _util.AnnotationBorderStyleType.BEVELED; 31824 break; 31825 case 'I': 31826 this.style = _util.AnnotationBorderStyleType.INSET; 31827 break; 31828 case 'U': 31829 this.style = _util.AnnotationBorderStyleType.UNDERLINE; 31830 break; 31831 default: 31832 break; 31833 } 31834 } 31835 }, { 31836 key: 'setDashArray', 31837 value: function setDashArray(dashArray) { 31838 if (Array.isArray(dashArray) && dashArray.length > 0) { 31839 var isValid = true; 31840 var allZeros = true; 31841 for (var i = 0, len = dashArray.length; i < len; i++) { 31842 var element = dashArray[i];
31843 var validNumber = +element >= 0; 31844 if (!validNumber) { 31845 isValid = false; 31846 break; 31847 } else if (element > 0) { 31848 allZeros = false; 31849 } 31850 } 31851 if (isValid && !allZeros) { 31852 this.dashArray = dashArray; 31853 } else { 31854 this.width = 0; 31855 } 31856 } else if (dashArray) { 31857 this.width = 0; 31858 } 31859 } 31860 }, { 31861 key: 'setHorizontalCornerRadius', 31862 value: function setHorizontalCornerRadius(radius) { 31863 if (Number.isInteger(radius)) { 31864 this.horizontalCornerRadius = radius; 31865 } 31866 } 31867 }, { 31868 key: 'setVerticalCornerRadius', 31869 value: function setVerticalCornerRadius(radius) { 31870 if (Number.isInteger(radius)) { 31871 this.verticalCornerRadius = radius; 31872 } 31873 } 31874 }]); 31875 31876 return AnnotationBorderStyle; 31877}(); 31878 31879var WidgetAnnotation = function (_Annotation) { 31880 _inherits(WidgetAnnotation, _Annotation); 31881 31882 function WidgetAnnotation(params) { 31883 _classCallCheck(this, WidgetAnnotation); 31884 31885 var _this2 = _possibleConstructorReturn(this, (WidgetAnnotation.__proto__ || Object.getPrototypeOf(WidgetAnnotation)).call(this, params)); 31886 31887 var dict = params.dict; 31888 var data = _this2.data; 31889 data.annotationType = _util.AnnotationType.WIDGET; 31890 data.fieldName = _this2._constructFieldName(dict); 31891 data.fieldValue = _util.Util.getInheritableProperty(dict, 'V', true); 31892 data.alternativeText = (0, _util.stringToPDFString)(dict.get('TU') || ''); 31893 data.defaultAppearance = _util.Util.getInheritableProperty(dict, 'DA') || ''; 31894 var fieldType = _util.Util.getInheritableProperty(dict, 'FT'); 31895 data.fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null; 31896 _this2.fieldResources = _util.Util.getInheritableProperty(dict, 'DR') || _primitives.Dict.empty; 31897 data.fieldFlags = _util.Util.getInheritableProperty(dict, 'Ff'); 31898 if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) { 31899 data.fieldFlags = 0; 31900 } 31901 data.readOnly = _this2.hasFieldFlag(_util.AnnotationFieldFlag.READONLY); 31902 if (data.fieldType === 'Sig') { 31903 _this2.setFlags(_util.AnnotationFlag.HIDDEN); 31904 } 31905 return _this2; 31906 } 31907 31908 _createClass(WidgetAnnotation, [{ 31909 key: '_constructFieldName', 31910 value: function _constructFieldName(dict) { 31911 if (!dict.has('T') && !dict.has('Parent')) { 31912 (0, _util.warn)('Unknown field name, falling back to empty field name.'); 31913 return ''; 31914 } 31915 if (!dict.has('Parent')) { 31916 return (0, _util.stringToPDFString)(dict.get('T')); 31917 } 31918 var fieldName = []; 31919 if (dict.has('T')) { 31920 fieldName.unshift((0, _util.stringToPDFString)(dict.get('T'))); 31921 } 31922 var loopDict = dict; 31923 while (loopDict.has('Parent')) { 31924 loopDict = loopDict.get('Parent'); 31925 if (!(0, _primitives.isDict)(loopDict)) { 31926 break; 31927 } 31928 if (loopDict.has('T')) { 31929 fieldName.unshift((0, _util.stringToPDFString)(loopDict.get('T'))); 31930 } 31931 } 31932 return fieldName.join('.'); 31933 } 31934 }, { 31935 key: 'hasFieldFlag', 31936 value: function hasFieldFlag(flag) { 31937 return !!(this.data.fieldFlags & flag); 31938 } 31939 }, { 31940 key: 'getOperatorList', 31941 value: function getOperatorList(evaluator, task, renderForms) { 31942 if (renderForms) { 31943 return Promise.resolve(new _operator_list.OperatorList()); 31944 } 31945 return _get(WidgetAnnotation.prototype.__proto__ || Object.getPrototypeOf(WidgetAnnotation.prototype), 'getOperatorList', this).call(this, evaluator, task, renderForms); 31946 } 31947 }]); 31948 31949 return WidgetAnnotation; 31950}(Annotation); 31951 31952var TextWidgetAnnotation = function (_WidgetAnnotation) { 31953 _inherits(TextWidgetAnnotation, _WidgetAnnotation); 31954 31955 function TextWidgetAnnotation(params) { 31956 _classCallCheck(this, TextWidgetAnnotation); 31957 31958 var _this3 = _possibleConstructorReturn(this, (TextWidgetAnnotation.__proto__ || Object.getPrototypeOf(TextWidgetAnnotation)).call(this, params)); 31959 31960 _this3.data.fieldValue = (0, _util.stringToPDFString)(_this3.data.fieldValue || ''); 31961 var alignment = _util.Util.getInheritableProperty(params.dict, 'Q'); 31962 if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) { 31963 alignment = null; 31964 } 31965 _this3.data.textAlignment = alignment; 31966 var maximumLength = _util.Util.getInheritableProperty(params.dict, 'MaxLen'); 31967 if (!Number.isInteger(maximumLength) || maximumLength < 0) { 31968 maximumLength = null; 31969 } 31970 _this3.data.maxLen = maximumLength; 31971 _this3.data.multiLine = _this3.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE); 31972 _this3.data.comb = _this3.hasFieldFlag(_util.AnnotationFieldFlag.COMB) && !_this3.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE) && !_this3.hasFieldFlag(_util.AnnotationFieldFlag.PASSWORD) && !_this3.hasFieldFlag(_util.AnnotationFieldFlag.FILESELECT) && _this3.data.maxLen !== null; 31973 return _this3; 31974 } 31975 31976 _createClass(TextWidgetAnnotation, [{ 31977 key: 'getOperatorList', 31978 value: function getOperatorList(evaluator, task, renderForms) { 31979 if (renderForms || this.appearance) { 31980 return _get(TextWidgetAnnotation.prototype.__proto__ || Object.getPrototypeOf(TextWidgetAnnotation.prototype), 'getOperatorList', this).call(this, evaluator, task, renderForms); 31981 } 31982 var operatorList = new _operator_list.OperatorList(); 31983 if (!this.data.defaultAppearance) { 31984 return Promise.resolve(operatorList); 31985 } 31986 var stream = new _stream.Stream((0, _util.stringToBytes)(this.data.defaultAppearance)); 31987 return evaluator.getOperatorList({ 31988 stream: stream, 31989 task: task, 31990 resources: this.fieldResources, 31991 operatorList: operatorList 31992 }).then(function () { 31993 return operatorList; 31994 }); 31995 } 31996 }]); 31997 31998 return TextWidgetAnnotation; 31999}(WidgetAnnotation); 32000 32001var ButtonWidgetAnnotation = function (_WidgetAnnotation2) { 32002 _inherits(ButtonWidgetAnnotation, _WidgetAnnotation2); 32003 32004 function ButtonWidgetAnnotation(params) { 32005 _classCallCheck(this, ButtonWidgetAnnotation); 32006 32007 var _this4 = _possibleConstructorReturn(this, (ButtonWidgetAnnotation.__proto__ || Object.getPrototypeOf(ButtonWidgetAnnotation)).call(this, params)); 32008 32009 _this4.data.checkBox = !_this4.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); 32010 _this4.data.radioButton = _this4.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); 32011 _this4.data.pushButton = _this4.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); 32012 if (_this4.data.checkBox) { 32013 _this4._processCheckBox(); 32014 } else if (_this4.data.radioButton) { 32015 _this4._processRadioButton(params); 32016 } else if (_this4.data.pushButton) { 32017 _this4._processPushButton(params); 32018 } else { 32019 (0, _util.warn)('Invalid field flags for button widget annotation'); 32020 } 32021 return _this4; 32022 } 32023 32024 _createClass(ButtonWidgetAnnotation, [{ 32025 key: '_processCheckBox', 32026 value: function _processCheckBox() { 32027 if (!(0, _primitives.isName)(this.data.fieldValue)) { 32028 return; 32029 } 32030 this.data.fieldValue = this.data.fieldValue.name; 32031 } 32032 }, { 32033 key: '_processRadioButton', 32034 value: function _processRadioButton(params) { 32035 this.data.fieldValue = this.data.buttonValue = null; 32036 var fieldParent = params.dict.get('Parent'); 32037 if ((0, _primitives.isDict)(fieldParent) && fieldParent.has('V')) { 32038 var fieldParentValue = fieldParent.get('V'); 32039 if ((0, _primitives.isName)(fieldParentValue)) { 32040 this.data.fieldValue = fieldParentValue.name; 32041 } 32042 } 32043 var appearanceStates = params.dict.get('AP'); 32044 if (!(0, _primitives.isDict)(appearanceStates)) { 32045 return; 32046 } 32047 var normalAppearanceState = appearanceStates.get('N'); 32048 if (!(0, _primitives.isDict)(normalAppearanceState)) { 32049 return; 32050 } 32051 var keys = normalAppearanceState.getKeys(); 32052 for (var i = 0, ii = keys.length; i < ii; i++) { 32053 if (keys[i] !== 'Off') { 32054 this.data.buttonValue = keys[i]; 32055 break; 32056 } 32057 } 32058 } 32059 }, { 32060 key: '_processPushButton', 32061 value: function _processPushButton(params) { 32062 if (!params.dict.has('A')) { 32063 (0, _util.warn)('Push buttons without action dictionaries are not supported'); 32064 return; 32065 } 32066 _obj.Catalog.parseDestDictionary({ 32067 destDict: params.dict, 32068 resultObj: this.data, 32069 docBaseUrl: params.pdfManager.docBaseUrl 32070 }); 32071 } 32072 }]); 32073 32074 return ButtonWidgetAnnotation; 32075}(WidgetAnnotation); 32076 32077var ChoiceWidgetAnnotation = function (_WidgetAnnotation3) { 32078 _inherits(ChoiceWidgetAnnotation, _WidgetAnnotation3); 32079 32080 function ChoiceWidgetAnnotation(params) { 32081 _classCallCheck(this, ChoiceWidgetAnnotation); 32082 32083 var _this5 = _possibleConstructorReturn(this, (ChoiceWidgetAnnotation.__proto__ || Object.getPrototypeOf(ChoiceWidgetAnnotation)).call(this, params)); 32084 32085 _this5.data.options = []; 32086 var options = _util.Util.getInheritableProperty(params.dict, 'Opt'); 32087 if (Array.isArray(options)) { 32088 var xref = params.xref; 32089 for (var i = 0, ii = options.length; i < ii; i++) { 32090 var option = xref.fetchIfRef(options[i]); 32091 var isOptionArray = Array.isArray(option); 32092 _this5.data.options[i] = { 32093 exportValue: isOptionArray ? xref.fetchIfRef(option[0]) : option, 32094 displayValue: (0, _util.stringToPDFString)(isOptionArray ? xref.fetchIfRef(option[1]) : option) 32095 }; 32096 } 32097 } 32098 if (!Array.isArray(_this5.data.fieldValue)) { 32099 _this5.data.fieldValue = [_this5.data.fieldValue]; 32100 } 32101 _this5.data.combo = _this5.hasFieldFlag(_util.AnnotationFieldFlag.COMBO); 32102 _this5.data.multiSelect = _this5.hasFieldFlag(_util.AnnotationFieldFlag.MULTISELECT); 32103 return _this5; 32104 } 32105 32106 return ChoiceWidgetAnnotation; 32107}(WidgetAnnotation); 32108 32109var TextAnnotation = function (_Annotation2) { 32110 _inherits(TextAnnotation, _Annotation2); 32111 32112 function TextAnnotation(parameters) { 32113 _classCallCheck(this, TextAnnotation); 32114
32115 var DEFAULT_ICON_SIZE = 22; 32116 32117 var _this6 = _possibleConstructorReturn(this, (TextAnnotation.__proto__ || Object.getPrototypeOf(TextAnnotation)).call(this, parameters)); 32118 32119 _this6.data.annotationType = _util.AnnotationType.TEXT; 32120 if (_this6.data.hasAppearance) { 32121 _this6.data.name = 'NoIcon'; 32122 } else { 32123 _this6.data.rect[1] = _this6.data.rect[3] - DEFAULT_ICON_SIZE; 32124 _this6.data.rect[2] = _this6.data.rect[0] + DEFAULT_ICON_SIZE; 32125 _this6.data.name = parameters.dict.has('Name') ? parameters.dict.get('Name').name : 'Note'; 32126 } 32127 _this6._preparePopup(parameters.dict); 32128 return _this6; 32129 } 32130 32131 return TextAnnotation; 32132}(Annotation); 32133 32134var LinkAnnotation = function (_Annotation3) { 32135 _inherits(LinkAnnotation, _Annotation3); 32136 32137 function LinkAnnotation(params) { 32138 _classCallCheck(this, LinkAnnotation); 32139 32140 var _this7 = _possibleConstructorReturn(this, (LinkAnnotation.__proto__ || Object.getPrototypeOf(LinkAnnotation)).call(this, params)); 32141 32142 _this7.data.annotationType = _util.AnnotationType.LINK; 32143 _obj.Catalog.parseDestDictionary({ 32144 destDict: params.dict, 32145 resultObj: _this7.data, 32146 docBaseUrl: params.pdfManager.docBaseUrl 32147 }); 32148 return _this7; 32149 } 32150 32151 return LinkAnnotation; 32152}(Annotation); 32153 32154var PopupAnnotation = function (_Annotation4) { 32155 _inherits(PopupAnnotation, _Annotation4); 32156 32157 function PopupAnnotation(parameters) { 32158 _classCallCheck(this, PopupAnnotation); 32159 32160 var _this8 = _possibleConstructorReturn(this, (PopupAnnotation.__proto__ || Object.getPrototypeOf(PopupAnnotation)).call(this, parameters)); 32161 32162 _this8.data.annotationType = _util.AnnotationType.POPUP; 32163 var dict = parameters.dict; 32164 var parentItem = dict.get('Parent'); 32165 if (!parentItem) { 32166 (0, _util.warn)('Popup annotation has a missing or invalid parent annotation.'); 32167 return _possibleConstructorReturn(_this8); 32168 } 32169 var parentSubtype = parentItem.get('Subtype'); 32170 _this8.data.parentType = (0, _primitives.isName)(parentSubtype) ? parentSubtype.name : null; 32171 _this8.data.parentId = dict.getRaw('Parent').toString(); 32172 _this8.data.title = (0, _util.stringToPDFString)(parentItem.get('T') || ''); 32173 _this8.data.contents = (0, _util.stringToPDFString)(parentItem.get('Contents') || ''); 32174 if (!parentItem.has('C')) { 32175 _this8.data.color = null; 32176 } else { 32177 _this8.setColor(parentItem.getArray('C')); 32178 _this8.data.color = _this8.color; 32179 } 32180 if (!_this8.viewable) { 32181 var parentFlags = parentItem.get('F'); 32182 if (_this8._isViewable(parentFlags)) { 32183 _this8.setFlags(parentFlags); 32184 } 32185 } 32186 return _this8; 32187 } 32188 32189 return PopupAnnotation; 32190}(Annotation); 32191 32192var LineAnnotation = function (_Annotation5) { 32193 _inherits(LineAnnotation, _Annotation5); 32194 32195 function LineAnnotation(parameters) { 32196 _classCallCheck(this, LineAnnotation); 32197 32198 var _this9 = _possibleConstructorReturn(this, (LineAnnotation.__proto__ || Object.getPrototypeOf(LineAnnotation)).call(this, parameters)); 32199 32200 _this9.data.annotationType = _util.AnnotationType.LINE; 32201 var dict = parameters.dict; 32202 _this9.data.lineCoordinates = _util.Util.normalizeRect(dict.getArray('L')); 32203 _this9._preparePopup(dict); 32204 return _this9; 32205 } 32206 32207 return LineAnnotation; 32208}(Annotation); 32209 32210var SquareAnnotation = function (_Annotation6) { 32211 _inherits(SquareAnnotation, _Annotation6); 32212 32213 function SquareAnnotation(parameters) { 32214 _classCallCheck(this, SquareAnnotation); 32215 32216 var _this10 = _possibleConstructorReturn(this, (SquareAnnotation.__proto__ || Object.getPrototypeOf(SquareAnnotation)).call(this, parameters)); 32217 32218 _this10.data.annotationType = _util.AnnotationType.SQUARE; 32219 _this10._preparePopup(parameters.dict); 32220 return _this10; 32221 } 32222 32223 return SquareAnnotation; 32224}(Annotation); 32225 32226var CircleAnnotation = function (_Annotation7) { 32227 _inherits(CircleAnnotation, _Annotation7); 32228 32229 function CircleAnnotation(parameters) { 32230 _classCallCheck(this, CircleAnnotation); 32231 32232 var _this11 = _possibleConstructorReturn(this, (CircleAnnotation.__proto__ || Object.getPrototypeOf(CircleAnnotation)).call(this, parameters)); 32233 32234 _this11.data.annotationType = _util.AnnotationType.CIRCLE; 32235 _this11._preparePopup(parameters.dict); 32236 return _this11; 32237 } 32238 32239 return CircleAnnotation; 32240}(Annotation); 32241 32242var PolylineAnnotation = function (_Annotation8) { 32243 _inherits(PolylineAnnotation, _Annotation8); 32244 32245 function PolylineAnnotation(parameters) { 32246 _classCallCheck(this, PolylineAnnotation); 32247 32248 var _this12 = _possibleConstructorReturn(this, (PolylineAnnotation.__proto__ || Object.getPrototypeOf(PolylineAnnotation)).call(this, parameters)); 32249 32250 _this12.data.annotationType = _util.AnnotationType.POLYLINE; 32251 var dict = parameters.dict; 32252 var rawVertices = dict.getArray('Vertices'); 32253 _this12.data.vertices = []; 32254 for (var i = 0, ii = rawVertices.length; i < ii; i += 2) { 32255 _this12.data.vertices.push({ 32256 x: rawVertices[i], 32257 y: rawVertices[i + 1] 32258 }); 32259 } 32260 _this12._preparePopup(dict); 32261 return _this12; 32262 } 32263 32264 return PolylineAnnotation; 32265}(Annotation); 32266 32267var PolygonAnnotation = function (_PolylineAnnotation) { 32268 _inherits(PolygonAnnotation, _PolylineAnnotation); 32269 32270 function PolygonAnnotation(parameters) { 32271 _classCallCheck(this, PolygonAnnotation); 32272 32273 var _this13 = _possibleConstructorReturn(this, (PolygonAnnotation.__proto__ || Object.getPrototypeOf(PolygonAnnotation)).call(this, parameters)); 32274 32275 _this13.data.annotationType = _util.AnnotationType.POLYGON; 32276 return _this13; 32277 } 32278 32279 return PolygonAnnotation; 32280}(PolylineAnnotation); 32281 32282var HighlightAnnotation = function (_Annotation9) { 32283 _inherits(HighlightAnnotation, _Annotation9); 32284 32285 function HighlightAnnotation(parameters) { 32286 _classCallCheck(this, HighlightAnnotation); 32287 32288 var _this14 = _possibleConstructorReturn(this, (HighlightAnnotation.__proto__ || Object.getPrototypeOf(HighlightAnnotation)).call(this, parameters)); 32289 32290 _this14.data.annotationType = _util.AnnotationType.HIGHLIGHT; 32291 _this14._preparePopup(parameters.dict); 32292 return _this14; 32293 } 32294 32295 return HighlightAnnotation; 32296}(Annotation); 32297 32298var UnderlineAnnotation = function (_Annotation10) { 32299 _inherits(UnderlineAnnotation, _Annotation10); 32300 32301 function UnderlineAnnotation(parameters) { 32302 _classCallCheck(this, UnderlineAnnotation); 32303 32304 var _this15 = _possibleConstructorReturn(this, (UnderlineAnnotation.__proto__ || Object.getPrototypeOf(UnderlineAnnotation)).call(this, parameters)); 32305 32306 _this15.data.annotationType = _util.AnnotationType.UNDERLINE; 32307 _this15._preparePopup(parameters.dict); 32308 return _this15; 32309 } 32310 32311 return UnderlineAnnotation; 32312}(Annotation); 32313 32314var SquigglyAnnotation = function (_Annotation11) { 32315 _inherits(SquigglyAnnotation, _Annotation11); 32316 32317 function SquigglyAnnotation(parameters) { 32318 _classCallCheck(this, SquigglyAnnotation); 32319 32320 var _this16 = _possibleConstructorReturn(this, (SquigglyAnnotation.__proto__ || Object.getPrototypeOf(SquigglyAnnotation)).call(this, parameters)); 32321 32322 _this16.data.annotationType = _util.AnnotationType.SQUIGGLY; 32323 _this16._preparePopup(parameters.dict); 32324 return _this16; 32325 } 32326 32327 return SquigglyAnnotation; 32328}(Annotation); 32329 32330var StrikeOutAnnotation = function (_Annotation12) { 32331 _inherits(StrikeOutAnnotation, _Annotation12); 32332 32333 function StrikeOutAnnotation(parameters) { 32334 _classCallCheck(this, StrikeOutAnnotation); 32335 32336 var _this17 = _possibleConstructorReturn(this, (StrikeOutAnnotation.__proto__ || Object.getPrototypeOf(StrikeOutAnnotation)).call(this, parameters)); 32337 32338 _this17.data.annotationType = _util.AnnotationType.STRIKEOUT; 32339 _this17._preparePopup(parameters.dict); 32340 return _this17; 32341 } 32342 32343 return StrikeOutAnnotation; 32344}(Annotation); 32345 32346var StampAnnotation = function (_Annotation13) { 32347 _inherits(StampAnnotation, _Annotation13); 32348 32349 function StampAnnotation(parameters) { 32350 _classCallCheck(this, StampAnnotation); 32351 32352 var _this18 = _possibleConstructorReturn(this, (StampAnnotation.__proto__ || Object.getPrototypeOf(StampAnnotation)).call(this, parameters)); 32353 32354 _this18.data.annotationType = _util.AnnotationType.STAMP; 32355 _this18._preparePopup(parameters.dict); 32356 return _this18; 32357 } 32358 32359 return StampAnnotation; 32360}(Annotation); 32361 32362var FileAttachmentAnnotation = function (_Annotation14) { 32363 _inherits(FileAttachmentAnnotation, _Annotation14); 32364 32365 function FileAttachmentAnnotation(parameters) { 32366 _classCallCheck(this, FileAttachmentAnnotation); 32367 32368 var _this19 = _possibleConstructorReturn(this, (FileAttachmentAnnotation.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotation)).call(this, parameters)); 32369 32370 var file = new _obj.FileSpec(parameters.dict.get('FS'), parameters.xref); 32371 _this19.data.annotationType = _util.AnnotationType.FILEATTACHMENT; 32372 _this19.data.file = file.serializable; 32373 _this19._preparePopup(parameters.dict); 32374 return _this19; 32375 } 32376 32377 return FileAttachmentAnnotation; 32378}(Annotation); 32379 32380exports.Annotation = Annotation; 32381exports.AnnotationBorderStyle = AnnotationBorderStyle; 32382exports.AnnotationFactory = AnnotationFactory;
vendor: 4,192 bytes, lines 32383-32507
32383 32384/***/ }), 32385/* 135 */ 32386/***/ (function(module, exports, __w_pdfjs_require__) { 32387 32388"use strict"; 32389 32390 32391Object.defineProperty(exports, "__esModule", { 32392 value: true 32393}); 32394exports.PartialEvaluator = undefined; 32395 32396var _util = __w_pdfjs_require__(0); 32397 32398var _cmap = __w_pdfjs_require__(136); 32399 32400var _stream = __w_pdfjs_require__(2); 32401 32402var _primitives = __w_pdfjs_require__(1); 32403 32404var _fonts = __w_pdfjs_require__(137); 32405 32406var _encodings = __w_pdfjs_require__(21); 32407 32408var _unicode = __w_pdfjs_require__(70); 32409 32410var _standard_fonts = __w_pdfjs_require__(69); 32411 32412var _pattern = __w_pdfjs_require__(141); 32413 32414var _parser = __w_pdfjs_require__(26); 32415 32416var _bidi = __w_pdfjs_require__(142); 32417 32418var _colorspace = __w_pdfjs_require__(20); 32419 32420var _glyphlist = __w_pdfjs_require__(43); 32421 32422var _metrics = __w_pdfjs_require__(143); 32423 32424var _function = __w_pdfjs_require__(71); 32425 32426var _jpeg_stream = __w_pdfjs_require__(41); 32427 32428var _murmurhash = __w_pdfjs_require__(145); 32429 32430var _operator_list = __w_pdfjs_require__(42); 32431 32432var _image = __w_pdfjs_require__(146); 32433 32434var PartialEvaluator = function PartialEvaluatorClosure() { 32435 var DefaultPartialEvaluatorOptions = { 32436 forceDataSchema: false, 32437 maxImageSize: -1, 32438 disableFontFace: false, 32439 nativeImageDecoderSupport: _util.NativeImageDecoding.DECODE, 32440 ignoreErrors: false, 32441 isEvalSupported: true 32442 }; 32443 function NativeImageDecoder(_ref) { 32444 var xref = _ref.xref, 32445 resources = _ref.resources, 32446 handler = _ref.handler, 32447 _ref$forceDataSchema = _ref.forceDataSchema, 32448 forceDataSchema = _ref$forceDataSchema === undefined ? false : _ref$forceDataSchema, 32449 pdfFunctionFactory = _ref.pdfFunctionFactory; 32450 32451 this.xref = xref; 32452 this.resources = resources; 32453 this.handler = handler; 32454 this.forceDataSchema = forceDataSchema; 32455 this.pdfFunctionFactory = pdfFunctionFactory; 32456 } 32457 NativeImageDecoder.prototype = { 32458 canDecode: function canDecode(image) { 32459 return image instanceof _jpeg_stream.JpegStream && NativeImageDecoder.isDecodable(image, this.xref, this.resources, this.pdfFunctionFactory); 32460 }, 32461 decode: function decode(image) { 32462 var dict = image.dict; 32463 var colorSpace = dict.get('ColorSpace', 'CS'); 32464 colorSpace = _colorspace.ColorSpace.parse(colorSpace, this.xref, this.resources, this.pdfFunctionFactory); 32465 var numComps = colorSpace.numComps; 32466 var decodePromise = this.handler.sendWithPromise('JpegDecode', [image.getIR(this.forceDataSchema), numComps]); 32467 return decodePromise.then(function (message) { 32468 var data = message.data; 32469 return new _stream.Stream(data, 0, data.length, image.dict); 32470 }); 32471 } 32472 }; 32473 NativeImageDecoder.isSupported = function (image, xref, res, pdfFunctionFactory) { 32474 var dict = image.dict; 32475 if (dict.has('DecodeParms') || dict.has('DP')) { 32476 return false; 32477 } 32478 var cs = _colorspace.ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res, pdfFunctionFactory); 32479 return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') && cs.isDefaultDecode(dict.getArray('Decode', 'D')); 32480 }; 32481 NativeImageDecoder.isDecodable = function (image, xref, res, pdfFunctionFactory) { 32482 var dict = image.dict; 32483 if (dict.has('DecodeParms') || dict.has('DP')) { 32484 return false; 32485 } 32486 var cs = _colorspace.ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res, pdfFunctionFactory); 32487 return (cs.numComps === 1 || cs.numComps === 3) && cs.isDefaultDecode(dict.getArray('Decode', 'D')); 32488 }; 32489 function PartialEvaluator(_ref2) { 32490 var _this = this; 32491 32492 var pdfManager = _ref2.pdfManager, 32493 xref = _ref2.xref, 32494 handler = _ref2.handler, 32495 pageIndex = _ref2.pageIndex, 32496 idFactory = _ref2.idFactory, 32497 fontCache = _ref2.fontCache, 32498 builtInCMapCache = _ref2.builtInCMapCache, 32499 _ref2$options = _ref2.options, 32500 options = _ref2$options === undefined ? null : _ref2$options, 32501 pdfFunctionFactory = _ref2.pdfFunctionFactory; 32502 32503 this.pdfManager = pdfManager; 32504 this.xref = xref; 32505 this.handler = handler; 32506 this.pageIndex = pageIndex; 32507 this.idFactory = idFactory;
32508 this.fontCache = fontCache; 32509 this.builtInCMapCache = builtInCMapCache; 32510 this.options = options || DefaultPartialEvaluatorOptions; 32511 this.pdfFunctionFactory = pdfFunctionFactory; 32512 this.fetchBuiltInCMap = function (name) { 32513 var cachedCMap = _this.builtInCMapCache[name]; 32514 if (cachedCMap) { 32515 return Promise.resolve(cachedCMap); 32516 } 32517 return _this.handler.sendWithPromise('FetchBuiltInCMap', { name: name }).then(function (data) { 32518 if (data.compressionType !== _util.CMapCompressionType.NONE) { 32519 _this.builtInCMapCache[name] = data; 32520 } 32521 return data; 32522 }); 32523 }; 32524 } 32525 var TIME_SLOT_DURATION_MS = 20; 32526 var CHECK_TIME_EVERY = 100; 32527 function TimeSlotManager() { 32528 this.reset(); 32529 } 32530 TimeSlotManager.prototype = { 32531 check: function TimeSlotManager_check() { 32532 if (++this.checked < CHECK_TIME_EVERY) { 32533 return false; 32534 } 32535 this.checked = 0; 32536 return this.endTime <= Date.now(); 32537 }, 32538 reset: function TimeSlotManager_reset() { 32539 this.endTime = Date.now() + TIME_SLOT_DURATION_MS; 32540 this.checked = 0; 32541 } 32542 }; 32543 function normalizeBlendMode(value) { 32544 if (!(0, _primitives.isName)(value)) { 32545 return 'source-over'; 32546 } 32547 switch (value.name) { 32548 case 'Normal': 32549 case 'Compatible': 32550 return 'source-over'; 32551 case 'Multiply': 32552 return 'multiply'; 32553 case 'Screen': 32554 return 'screen'; 32555 case 'Overlay': 32556 return 'overlay'; 32557 case 'Darken': 32558 return 'darken'; 32559 case 'Lighten': 32560 return 'lighten'; 32561 case 'ColorDodge': 32562 return 'color-dodge'; 32563 case 'ColorBurn': 32564 return 'color-burn'; 32565 case 'HardLight': 32566 return 'hard-light'; 32567 case 'SoftLight': 32568 return 'soft-light'; 32569 case 'Difference': 32570 return 'difference'; 32571 case 'Exclusion': 32572 return 'exclusion'; 32573 case 'Hue': 32574 return 'hue'; 32575 case 'Saturation': 32576 return 'saturation'; 32577 case 'Color': 32578 return 'color'; 32579 case 'Luminosity': 32580 return 'luminosity'; 32581 } 32582 (0, _util.warn)('Unsupported blend mode: ' + value.name); 32583 return 'source-over'; 32584 } 32585 var deferred = Promise.resolve(); 32586 var TILING_PATTERN = 1, 32587 SHADING_PATTERN = 2; 32588 PartialEvaluator.prototype = { 32589 clone: function clone() { 32590 var newOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DefaultPartialEvaluatorOptions; 32591 32592 var newEvaluator = Object.create(this); 32593 newEvaluator.options = newOptions; 32594 return newEvaluator; 32595 }, 32596 32597 hasBlendModes: function PartialEvaluator_hasBlendModes(resources) { 32598 if (!(0, _primitives.isDict)(resources)) { 32599 return false; 32600 } 32601 var processed = Object.create(null); 32602 if (resources.objId) { 32603 processed[resources.objId] = true; 32604 } 32605 var nodes = [resources], 32606 xref = this.xref; 32607 while (nodes.length) { 32608 var key, i, ii; 32609 var node = nodes.shift(); 32610 var graphicStates = node.get('ExtGState'); 32611 if ((0, _primitives.isDict)(graphicStates)) { 32612 var graphicStatesKeys = graphicStates.getKeys(); 32613 for (i = 0, ii = graphicStatesKeys.length; i < ii; i++) { 32614 key = graphicStatesKeys[i]; 32615 var graphicState = graphicStates.get(key); 32616 var bm = graphicState.get('BM'); 32617 if ((0, _primitives.isName)(bm) && bm.name !== 'Normal') { 32618 return true; 32619 } 32620 } 32621 } 32622 var xObjects = node.get('XObject'); 32623 if (!(0, _primitives.isDict)(xObjects)) { 32624 continue; 32625 } 32626 var xObjectsKeys = xObjects.getKeys(); 32627 for (i = 0, ii = xObjectsKeys.length; i < ii; i++) { 32628 key = xObjectsKeys[i]; 32629 var xObject = xObjects.getRaw(key); 32630 if ((0, _primitives.isRef)(xObject)) { 32631 if (processed[xObject.toString()]) { 32632 continue; 32633 } 32634 xObject = xref.fetch(xObject); 32635 } 32636 if (!(0, _primitives.isStream)(xObject)) { 32637 continue; 32638 } 32639 if (xObject.dict.objId) { 32640 if (processed[xObject.dict.objId]) { 32641 continue; 32642 } 32643 processed[xObject.dict.objId] = true; 32644 } 32645 var xResources = xObject.dict.get('Resources'); 32646 if ((0, _primitives.isDict)(xResources) && (!xResources.objId || !processed[xResources.objId])) { 32647 nodes.push(xResources); 32648 if (xResources.objId) { 32649 processed[xResources.objId] = true; 32650 } 32651 } 32652 } 32653 } 32654 return false; 32655 }, 32656 buildFormXObject: function PartialEvaluator_buildFormXObject(resources, xobj, smask, operatorList, task, initialState) { 32657 var dict = xobj.dict; 32658 var matrix = dict.getArray('Matrix'); 32659 var bbox = dict.getArray('BBox'); 32660 var group = dict.get('Group'); 32661 if (group) { 32662 var groupOptions = { 32663 matrix: matrix, 32664 bbox: bbox, 32665 smask: smask, 32666 isolated: false, 32667 knockout: false 32668 }; 32669 var groupSubtype = group.get('S'); 32670 var colorSpace = null; 32671 if ((0, _primitives.isName)(groupSubtype, 'Transparency')) { 32672 groupOptions.isolated = group.get('I') || false; 32673 groupOptions.knockout = group.get('K') || false; 32674 if (group.has('CS')) { 32675 colorSpace = _colorspace.ColorSpace.parse(group.get('CS'), this.xref, resources, this.pdfFunctionFactory); 32676 } 32677 } 32678 if (smask && smask.backdrop) { 32679 colorSpace = colorSpace || _colorspace.ColorSpace.singletons.rgb; 32680 smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); 32681 } 32682 operatorList.addOp(_util.OPS.beginGroup, [groupOptions]); 32683 } 32684 operatorList.addOp(_util.OPS.paintFormXObjectBegin, [matrix, bbox]); 32685 return this.getOperatorList({ 32686 stream: xobj, 32687 task: task, 32688 resources: dict.get('Resources') || resources, 32689 operatorList: operatorList, 32690 initialState: initialState 32691 }).then(function () { 32692 operatorList.addOp(_util.OPS.paintFormXObjectEnd, []); 32693 if (group) { 32694 operatorList.addOp(_util.OPS.endGroup, [groupOptions]); 32695 } 32696 }); 32697 }, 32698 buildPaintImageXObject: function PartialEvaluator_buildPaintImageXObject(resources, image, inline, operatorList, cacheKey, imageCache) { 32699 var _this2 = this; 32700 32701 var dict = image.dict; 32702 var w = dict.get('Width', 'W'); 32703 var h = dict.get('Height', 'H'); 32704 if (!(w && (0, _util.isNum)(w)) || !(h && (0, _util.isNum)(h))) { 32705 (0, _util.warn)('Image dimensions are missing, or not numbers.'); 32706 return; 32707 } 32708 var maxImageSize = this.options.maxImageSize; 32709 if (maxImageSize !== -1 && w * h > maxImageSize) { 32710 (0, _util.warn)('Image exceeded maximum allowed size and was removed.'); 32711 return; 32712 } 32713 var imageMask = dict.get('ImageMask', 'IM') || false; 32714 var imgData, args; 32715 if (imageMask) { 32716 var width = dict.get('Width', 'W'); 32717 var height = dict.get('Height', 'H'); 32718 var bitStrideLength = width + 7 >> 3; 32719 var imgArray = image.getBytes(bitStrideLength * height); 32720 var decode = dict.getArray('Decode', 'D'); 32721 imgData = _image.PDFImage.createMask({ 32722 imgArray: imgArray, 32723 width: width, 32724 height: height,
vendor: 4,527 bytes, lines 32725-32827
32725 imageIsFromDecodeStream: image instanceof _stream.DecodeStream, 32726 inverseDecode: !!decode && decode[0] > 0 32727 }); 32728 imgData.cached = true; 32729 args = [imgData]; 32730 operatorList.addOp(_util.OPS.paintImageMaskXObject, args); 32731 if (cacheKey) { 32732 imageCache[cacheKey] = { 32733 fn: _util.OPS.paintImageMaskXObject, 32734 args: args 32735 }; 32736 } 32737 return; 32738 } 32739 var softMask = dict.get('SMask', 'SM') || false; 32740 var mask = dict.get('Mask') || false; 32741 var SMALL_IMAGE_DIMENSIONS = 200; 32742 if (inline && !softMask && !mask && !(image instanceof _jpeg_stream.JpegStream) && w + h < SMALL_IMAGE_DIMENSIONS) { 32743 var imageObj = new _image.PDFImage({ 32744 xref: this.xref, 32745 res: resources, 32746 image: image, 32747 isInline: inline, 32748 pdfFunctionFactory: this.pdfFunctionFactory 32749 }); 32750 imgData = imageObj.createImageData(true); 32751 operatorList.addOp(_util.OPS.paintInlineImageXObject, [imgData]); 32752 return; 32753 } 32754 var nativeImageDecoderSupport = this.options.nativeImageDecoderSupport; 32755 var objId = 'img_' + this.idFactory.createObjId(); 32756 operatorList.addDependency(objId); 32757 args = [objId, w, h]; 32758 if (nativeImageDecoderSupport !== _util.NativeImageDecoding.NONE && !softMask && !mask && image instanceof _jpeg_stream.JpegStream && NativeImageDecoder.isSupported(image, this.xref, resources, this.pdfFunctionFactory)) { 32759 operatorList.addOp(_util.OPS.paintJpegXObject, args); 32760 this.handler.send('obj', [objId, this.pageIndex, 'JpegStream', image.getIR(this.options.forceDataSchema)]); 32761 if (cacheKey) { 32762 imageCache[cacheKey] = { 32763 fn: _util.OPS.paintJpegXObject, 32764 args: args 32765 }; 32766 } 32767 return; 32768 } 32769 var nativeImageDecoder = null; 32770 if (nativeImageDecoderSupport === _util.NativeImageDecoding.DECODE && (image instanceof _jpeg_stream.JpegStream || mask instanceof _jpeg_stream.JpegStream || softMask instanceof _jpeg_stream.JpegStream)) { 32771 nativeImageDecoder = new NativeImageDecoder({ 32772 xref: this.xref, 32773 resources: resources, 32774 handler: this.handler, 32775 forceDataSchema: this.options.forceDataSchema, 32776 pdfFunctionFactory: this.pdfFunctionFactory 32777 }); 32778 } 32779 _image.PDFImage.buildImage({ 32780 handler: this.handler, 32781 xref: this.xref, 32782 res: resources, 32783 image: image, 32784 isInline: inline, 32785 nativeDecoder: nativeImageDecoder, 32786 pdfFunctionFactory: this.pdfFunctionFactory 32787 }).then(function (imageObj) { 32788 var imgData = imageObj.createImageData(false); 32789 _this2.handler.send('obj', [objId, _this2.pageIndex, 'Image', imgData], [imgData.data.buffer]); 32790 }).catch(function (reason) { 32791 (0, _util.warn)('Unable to decode image: ' + reason); 32792 _this2.handler.send('obj', [objId, _this2.pageIndex, 'Image', null]); 32793 }); 32794 operatorList.addOp(_util.OPS.paintImageXObject, args); 32795 if (cacheKey) { 32796 imageCache[cacheKey] = { 32797 fn: _util.OPS.paintImageXObject, 32798 args: args 32799 }; 32800 } 32801 }, 32802 handleSMask: function PartialEvaluator_handleSmask(smask, resources, operatorList, task, stateManager) { 32803 var smaskContent = smask.get('G'); 32804 var smaskOptions = { 32805 subtype: smask.get('S').name, 32806 backdrop: smask.get('BC') 32807 }; 32808 var transferObj = smask.get('TR'); 32809 if ((0, _function.isPDFFunction)(transferObj)) { 32810 var transferFn = this.pdfFunctionFactory.create(transferObj); 32811 var transferMap = new Uint8Array(256); 32812 var tmp = new Float32Array(1); 32813 for (var i = 0; i < 256; i++) { 32814 tmp[0] = i / 255; 32815 transferFn(tmp, 0, tmp, 0); 32816 transferMap[i] = tmp[0] * 255 | 0; 32817 } 32818 smaskOptions.transferMap = transferMap; 32819 } 32820 return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone()); 32821 }, 32822 handleTilingType: function handleTilingType(fn, args, resources, pattern, patternDict, operatorList, task) { 32823 var _this3 = this; 32824 32825 var tilingOpList = new _operator_list.OperatorList(); 32826 var resourcesArray = [patternDict.get('Resources'), resources]; 32827 var patternResources = _primitives.Dict.merge(this.xref, resourcesArray);
32828 return this.getOperatorList({ 32829 stream: pattern, 32830 task: task, 32831 resources: patternResources, 32832 operatorList: tilingOpList 32833 }).then(function () { 32834 return (0, _pattern.getTilingPatternIR)({ 32835 fnArray: tilingOpList.fnArray, 32836 argsArray: tilingOpList.argsArray 32837 }, patternDict, args); 32838 }).then(function (tilingPatternIR) { 32839 operatorList.addDependencies(tilingOpList.dependencies); 32840 operatorList.addOp(fn, tilingPatternIR); 32841 }, function (reason) { 32842 if (_this3.options.ignoreErrors) { 32843 _this3.handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.unknown }); 32844 (0, _util.warn)('handleTilingType - ignoring pattern: "' + reason + '".'); 32845 return; 32846 } 32847 throw reason; 32848 }); 32849 }, 32850 32851 handleSetFont: function PartialEvaluator_handleSetFont(resources, fontArgs, fontRef, operatorList, task, state) { 32852 var _this4 = this; 32853 32854 var fontName; 32855 if (fontArgs) { 32856 fontArgs = fontArgs.slice(); 32857 fontName = fontArgs[0].name; 32858 } 32859 return this.loadFont(fontName, fontRef, resources).then(function (translated) { 32860 if (!translated.font.isType3Font) { 32861 return translated; 32862 } 32863 return translated.loadType3Data(_this4, resources, operatorList, task).then(function () { 32864 return translated; 32865 }).catch(function (reason) { 32866 _this4.handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.font }); 32867 return new TranslatedFont('g_font_error', new _fonts.ErrorFont('Type3 font load error: ' + reason), translated.font); 32868 }); 32869 }).then(function (translated) { 32870 state.font = translated.font; 32871 translated.send(_this4.handler); 32872 return translated.loadedName; 32873 }); 32874 },
32875 handleText: function PartialEvaluator_handleText(chars, state) { 32876 var _this5 = this; 32877 32878 var font = state.font; 32879 var glyphs = font.charsToGlyphs(chars); 32880 var isAddToPathSet = !!(state.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG); 32881 if (font.data && (isAddToPathSet || this.options.disableFontFace || state.fillColorSpace.name === 'Pattern')) { 32882 var buildPath = function buildPath(fontChar) { 32883 if (!font.renderer.hasBuiltPath(fontChar)) { 32884 var path = font.renderer.getPathJs(fontChar); 32885 _this5.handler.send('commonobj', [font.loadedName + '_path_' + fontChar, 'FontPath', path]); 32886 } 32887 }; 32888 for (var i = 0, ii = glyphs.length; i < ii; i++) { 32889 var glyph = glyphs[i]; 32890 buildPath(glyph.fontChar); 32891 var accent = glyph.accent; 32892 if (accent && accent.fontChar) { 32893 buildPath(accent.fontChar); 32894 } 32895 } 32896 } 32897 return glyphs; 32898 }, 32899 setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, stateManager) { 32900 var _this6 = this; 32901 32902 var gStateObj = []; 32903 var gStateKeys = gState.getKeys(); 32904 var promise = Promise.resolve(); 32905 32906 var _loop = function _loop() { 32907 var key = gStateKeys[i]; 32908 var value = gState.get(key); 32909 switch (key) { 32910 case 'Type': 32911 break; 32912 case 'LW': 32913 case 'LC': 32914 case 'LJ': 32915 case 'ML': 32916 case 'D': 32917 case 'RI': 32918 case 'FL': 32919 case 'CA': 32920 case 'ca': 32921 gStateObj.push([key, value]); 32922 break; 32923 case 'Font': 32924 promise = promise.then(function () { 32925 return _this6.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) { 32926 operatorList.addDependency(loadedName); 32927 gStateObj.push([key, [loadedName, value[1]]]); 32928 }); 32929 }); 32930 break; 32931 case 'BM': 32932 gStateObj.push([key, normalizeBlendMode(value)]); 32933 break; 32934 case 'SMask': 32935 if ((0, _primitives.isName)(value, 'None')) { 32936 gStateObj.push([key, false]); 32937 break; 32938 } 32939 if ((0, _primitives.isDict)(value)) { 32940 promise = promise.then(function () { 32941 return _this6.handleSMask(value, resources, operatorList, task, stateManager); 32942 }); 32943 gStateObj.push([key, true]); 32944 } else { 32945 (0, _util.warn)('Unsupported SMask type'); 32946 } 32947 break; 32948 case 'OP': 32949 case 'op': 32950 case 'OPM': 32951 case 'BG': 32952 case 'BG2': 32953 case 'UCR': 32954 case 'UCR2': 32955 case 'TR': 32956 case 'TR2': 32957 case 'HT': 32958 case 'SM': 32959 case 'SA': 32960 case 'AIS': 32961 case 'TK': 32962 (0, _util.info)('graphic state operator ' + key); 32963 break; 32964 default: 32965 (0, _util.info)('Unknown graphic state operator ' + key); 32966 break; 32967 } 32968 }; 32969 32970 for (var i = 0, ii = gStateKeys.length; i < ii; i++) { 32971 _loop();
32972 } 32973 return promise.then(function () { 32974 if (gStateObj.length > 0) { 32975 operatorList.addOp(_util.OPS.setGState, [gStateObj]); 32976 } 32977 }); 32978 }, 32979 loadFont: function PartialEvaluator_loadFont(fontName, font, resources) { 32980 var _this7 = this; 32981 32982 function errorFont() { 32983 return Promise.resolve(new TranslatedFont('g_font_error', new _fonts.ErrorFont('Font ' + fontName + ' is not available'), font)); 32984 } 32985 var fontRef, 32986 xref = this.xref; 32987 if (font) { 32988 if (!(0, _primitives.isRef)(font)) { 32989 throw new Error('The "font" object should be a reference.'); 32990 } 32991 fontRef = font; 32992 } else { 32993 var fontRes = resources.get('Font'); 32994 if (fontRes) { 32995 fontRef = fontRes.getRaw(fontName); 32996 } else { 32997 (0, _util.warn)('fontRes not available'); 32998 return errorFont(); 32999 } 33000 } 33001 if (!fontRef) { 33002 (0, _util.warn)('fontRef not available'); 33003 return errorFont(); 33004 } 33005 if (this.fontCache.has(fontRef)) { 33006 return this.fontCache.get(fontRef); 33007 } 33008 font = xref.fetchIfRef(fontRef); 33009 if (!(0, _primitives.isDict)(font)) { 33010 return errorFont(); 33011 } 33012 if (font.translated) { 33013 return font.translated; 33014 } 33015 var fontCapability = (0, _util.createPromiseCapability)(); 33016 var preEvaluatedFont = this.preEvaluateFont(font); 33017 var descriptor = preEvaluatedFont.descriptor; 33018 var fontRefIsRef = (0, _primitives.isRef)(fontRef), 33019 fontID; 33020 if (fontRefIsRef) { 33021 fontID = fontRef.toString(); 33022 } 33023 if ((0, _primitives.isDict)(descriptor)) { 33024 if (!descriptor.fontAliases) { 33025 descriptor.fontAliases = Object.create(null); 33026 } 33027 var fontAliases = descriptor.fontAliases; 33028 var hash = preEvaluatedFont.hash; 33029 if (fontAliases[hash]) { 33030 var aliasFontRef = fontAliases[hash].aliasRef; 33031 if (fontRefIsRef && aliasFontRef && this.fontCache.has(ali
33031asFontRef)) { 33032 this.fontCache.putAlias(fontRef, aliasFontRef); 33033 return this.fontCache.get(fontRef); 33034 } 33035 } else { 33036 fontAliases[hash] = { fontID: _fonts.Font.getFontID() }; 33037 } 33038 if (fontRefIsRef) { 33039 fontAliases[hash].aliasRef = fontRef; 33040 } 33041 fontID = fontAliases[hash].fontID; 33042 } 33043 if (fontRefIsRef) { 33044 this.fontCache.put(fontRef, fontCapability.promise); 33045 } else { 33046 if (!fontID) { 33047 fontID = this.idFactory.createObjId(); 33048 } 33049 this.fontCache.put('id_' + fontID, fontCapability.promise); 33050 } 33051 (0, _util.assert)(fontID, 'The "fontID" must be defined.'); 33052 font.loadedName = 'g_' + this.pdfManager.docId + '_f' + fontID; 33053 font.translated = fontCapability.promise; 33054 var translatedPromise; 33055 try { 33056 translatedPromise = this.translateFont(preEvaluatedFont); 33057 } catch (e) { 33058 translatedPromise = Promise.reject(e); 33059 } 33060 translatedPromise.then(function (translatedFont) { 33061 if (translatedFont.fontType !== undefined) { 33062 var xrefFontStats = xref.stats.fontTypes; 33063 xrefFontStats[translatedFont.fontType] = true; 33064 } 33065 fontCapability.resolve(new TranslatedFont(font.loadedName, translatedFont, font)); 33066 }).catch(function (reason) { 33067 _this7.handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.font }); 33068 try { 33069 var descriptor = preEvaluatedFont.descriptor; 33070 var fontFile3 = descriptor && descriptor.get('FontFile3'); 33071 var subtype = fontFile3 && fontFile3.get('Subtype'); 33072 var fontType = (0, _fonts.getFontType)(preEvaluatedFont.type, subtype && subtype.name); 33073 var xrefFontStats = xref.stats.fontTypes; 33074 xrefFontStats[fontType] = true; 33075 } catch (ex) {} 33076 fontCapability.resolve(new TranslatedFont(font.loadedName, new _fonts.ErrorFont(reason instanceof Error ? reason.message : reason), font)); 33077 }); 33078 return fontCapability.promise; 33079 }, 33080 buildPath: function PartialEvaluator_buildPath(operatorList, fn, args) { 33081 var lastIndex = operatorList.length - 1; 33082 if (!args) { 33083 args = []; 33084 } 33085 if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== _util.OPS.constructPath) { 33086 operatorList.addOp(_util.OPS.constructPath, [[fn], args]); 33087 } else { 33088 var opArgs = operatorList.argsArray[lastIndex]; 33089 opArgs[0].push(fn); 33090 Array.prototype.push.apply(opArgs[1], args); 33091 } 33092 }, 33093 handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, cs, patterns, resources, task) { 33094 var patternName = args[args.length - 1]; 33095 var pattern; 33096 if ((0, _primitives.isName)(patternName) && (pattern = patterns.get(patternName.name))) { 33097 var dict = (0, _primitives.isStream)(pattern) ? pattern.dict : pattern; 33098 var typeNum = dict.get('PatternType'); 33099 if (typeNum === TILING_PATTERN) { 33100 var color = cs.base ? cs.base.getRgb(args, 0) : null; 33101 return this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task); 33102 } else if (typeNum === SHADING_PATTERN) { 33103 var shading = dict.get('Shading'); 33104 var matrix = dict.getArray('Matrix'); 33105 pattern = _pattern.Pattern.parseShading(shading, matrix, this.xref, resources, this.handler, this.pdfFunctionFactory); 33106 operatorList.addOp(fn, pattern.getIR()); 33107 return Promise.resolve(); 33108 } 33109 return Promise.reject(new Error('Unknown PatternType: ' + typeNum)); 33110 } 33111 operatorList.addOp(fn, args); 33112 return Promise.resolve(); 33113 }, 33114 getOperatorList: function getOperatorList(_ref3) { 33115 var _this8 = this; 33116 33117 var stream = _ref3.stream, 33118 task = _ref3.task, 33119 resources = _ref3.resources, 33120 operatorList = _ref3.operatorList, 33121 _ref3$initialState = _ref3.initialState, 33122 initialState = _ref3$initialState === undefined ? null : _ref3$initialState; 33123 33124 resources = resources || _primitives.Dict.empty; 33125 initialState = initialState || new EvalState(); 33126 if (!operatorList) { 33127 throw new Error('getOperatorList: missing "operatorList" parameter'); 33128 } 33129 var self = this; 33130 var xref = this.xref; 33131 var imageCache = Object.create(null); 33132 var xobjs = resources.get('XObject') || _primitives.Dict.empty; 33133 var patterns = resources.get('Pattern') || _primitives.Dict.empty; 33134 var stateManager = new StateManager(initialState); 33135 var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); 33136 var timeSlotManager = new TimeSlotManager(); 33137 function closePendingRestoreOPS(argument) { 33138 for (var i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { 33139 operatorList.addOp(_util.OPS.restore, []); 33140 } 33141 } 33142 return new Promise(function promiseBody(resolve, reject) { 33143 var next = function next(promise) { 33144 promise.then(function () { 33145 try { 33146 promiseBody(resolve, reject); 33147 } catch (ex) { 33148 reject(ex); 33149 } 33150 }, reject); 33151 }; 33152 task.ensureNotTerminated(); 33153 timeSlotManager.reset(); 33154 var stop, 33155 operation = {}, 33156 i, 33157 ii, 33158 cs; 33159 while (!(stop = timeSlotManager.check())) { 33160 operation.args = null; 33161 if (!preprocessor.read(operation)) { 33162 break; 33163 } 33164 var args = operation.args; 33165 var fn = operation.fn; 33166 switch (fn | 0) { 33167 case _util.OPS.paintXObject: 33168 var name = args[0].name; 33169 if (name && imageCache[name] !== undefined) { 33170 operatorList.addOp(imageCache[name].fn, imageCache[name].args); 33171 args = null; 33172 continue; 33173 } 33174 next(new Promise(function (resolveXObject, rejectXObject) { 33175 if (!name) { 33176 throw new _util.FormatError('XObject must be referred to by name.'); 33177 } 33178 var xobj = xobjs.get(name); 33179 if (!xobj) { 33180 operatorList.addOp(fn, args); 33181 resolveXObject(); 33182 return; 33183 } 33184 if (!(0, _primitives.isStream)(xobj)) { 33185 throw new _util.FormatError('XObject should be a stream'); 33186 } 33187 var type = xobj.dict.get('Subtype'); 33188 if (!(0, _primitives.isName)(type)) { 33189 throw new _util.FormatError('XObject should have a Name subtype'); 33190 } 33191 if (type.name === 'Form') { 33192 stateManager.save(); 33193 self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone()).then(function () {
vendor: 13,126 bytes, lines 33194-33486
33194 stateManager.restore(); 33195 resolveXObject(); 33196 }, rejectXObject); 33197 return; 33198 } else if (type.name === 'Image') { 33199 self.buildPaintImageXObject(resources, xobj, false, operatorList, name, imageCache); 33200 } else if (type.name === 'PS') { 33201 (0, _util.info)('Ignored XObject subtype PS'); 33202 } else { 33203 throw new _util.FormatError('Unhandled XObject subtype ' + type.name); 33204 } 33205 resolveXObject(); 33206 }).catch(function (reason) { 33207 if (self.options.ignoreErrors) { 33208 self.handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.unknown }); 33209 (0, _util.warn)('getOperatorList - ignoring XObject: "' + reason + '".'); 33210 return; 33211 } 33212 throw reason; 33213 })); 33214 return; 33215 case _util.OPS.setFont: 33216 var fontSize = args[1]; 33217 next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state).then(function (loadedName) { 33218 operatorList.addDependency(loadedName); 33219 operatorList.addOp(_util.OPS.setFont, [loadedName, fontSize]); 33220 })); 33221 return; 33222 case _util.OPS.endInlineImage: 33223 var cacheKey = args[0].cacheKey; 33224 if (cacheKey) { 33225 var cacheEntry = imageCache[cacheKey]; 33226 if (cacheEntry !== undefined) { 33227 operatorList.addOp(cacheEntry.fn, cacheEntry.args); 33228 args = null; 33229 continue; 33230 } 33231 } 33232 self.buildPaintImageXObject(resources, args[0], true, operatorList, cacheKey, imageCache); 33233 args = null; 33234 continue; 33235 case _util.OPS.showText: 33236 args[0] = self.handleText(args[0], stateManager.state); 33237 break; 33238 case _util.OPS.showSpacedText: 33239 var arr = args[0]; 33240 var combinedGlyphs = []; 33241 var arrLength = arr.length; 33242 var state = stateManager.state; 33243 for (i = 0; i < arrLength; ++i) { 33244 var arrItem = arr[i]; 33245 if ((0, _util.isString)(arrItem)) { 33246 Array.prototype.push.apply(combinedGlyphs, self.handleText(arrItem, state)); 33247 } else if ((0, _util.isNum)(arrItem)) { 33248 combinedGlyphs.push(arrItem); 33249 } 33250 } 33251 args[0] = combinedGlyphs; 33252 fn = _util.OPS.showText; 33253 break; 33254 case _util.OPS.nextLineShowText: 33255 operatorList.addOp(_util.OPS.nextLine); 33256 args[0] = self.handleText(args[0], stateManager.state); 33257 fn = _util.OPS.showText; 33258 break; 33259 case _util.OPS.nextLineSetSpacingShowText: 33260 operatorList.addOp(_util.OPS.nextLine); 33261 operatorList.addOp(_util.OPS.setWordSpacing, [args.shift()]); 33262 operatorList.addOp(_util.OPS.setCharSpacing, [args.shift()]); 33263 args[0] = self.handleText(args[0], stateManager.state); 33264 fn = _util.OPS.showText; 33265 break; 33266 case _util.OPS.setTextRenderingMode: 33267 stateManager.state.textRenderingMode = args[0]; 33268 break; 33269 case _util.OPS.setFillColorSpace: 33270 stateManager.state.fillColorSpace = _colorspace.ColorSpace.parse(args[0], xref, resources, self.pdfFunctionFactory); 33271 continue; 33272 case _util.OPS.setStrokeColorSpace: 33273 stateManager.state.strokeColorSpace = _colorspace.ColorSpace.parse(args[0], xref, resources, self.pdfFunctionFactory); 33274 continue; 33275 case _util.OPS.setFillColor: 33276 cs = stateManager.state.fillColorSpace; 33277 args = cs.getRgb(args, 0); 33278 fn = _util.OPS.setFillRGBColor; 33279 break; 33280 case _util.OPS.setStrokeColor: 33281 cs = stateManager.state.strokeColorSpace; 33282 args = cs.getRgb(args, 0); 33283 fn = _util.OPS.setStrokeRGBColor; 33284 break; 33285 case _util.OPS.setFillGray: 33286 stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.gray; 33287 args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); 33288 fn = _util.OPS.setFillRGBColor; 33289 break; 33290 case _util.OPS.setStrokeGray: 33291 stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.gray; 33292 args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); 33293 fn = _util.OPS.setStrokeRGBColor; 33294 break; 33295 case _util.OPS.setFillCMYKColor: 33296 stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.cmyk; 33297 args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); 33298 fn = _util.OPS.setFillRGBColor; 33299 break; 33300 case _util.OPS.setStrokeCMYKColor: 33301 stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.cmyk; 33302 args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); 33303 fn = _util.OPS.setStrokeRGBColor; 33304 break; 33305 case _util.OPS.setFillRGBColor: 33306 stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.rgb; 33307 args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); 33308 break; 33309 case _util.OPS.setStrokeRGBColor: 33310 stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.rgb; 33311 args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); 33312 break; 33313 case _util.OPS.setFillColorN: 33314 cs = stateManager.state.fillColorSpace; 33315 if (cs.name === 'Pattern') { 33316 next(self.handleColorN(operatorList, _util.OPS.setFillColorN, args, cs, patterns, resources, task)); 33317 return; 33318 } 33319 args = cs.getRgb(args, 0); 33320 fn = _util.OPS.setFillRGBColor; 33321 break; 33322 case _util.OPS.setStrokeColorN: 33323 cs = stateManager.state.strokeColorSpace; 33324 if (cs.name === 'Pattern') { 33325 next(self.handleColorN(operatorList, _util.OPS.setStrokeColorN, args, cs, patterns, resources, task)); 33326 return; 33327 } 33328 args = cs.getRgb(args, 0); 33329 fn = _util.OPS.setStrokeRGBColor; 33330 break; 33331 case _util.OPS.shadingFill: 33332 var shadingRes = resources.get('Shading'); 33333 if (!shadingRes) { 33334 throw new _util.FormatError('No shading resource found'); 33335 } 33336 var shading = shadingRes.get(args[0].name); 33337 if (!shading) { 33338 throw new _util.FormatError('No shading object found'); 33339 } 33340 var shadingFill = _pattern.Pattern.parseShading(shading, null, xref, resources, self.handler, self.pdfFunctionFactory); 33341 var patternIR = shadingFill.getIR(); 33342 args = [patternIR]; 33343 fn = _util.OPS.shadingFill; 33344 break; 33345 case _util.OPS.setGState: 33346 var dictName = args[0]; 33347 var extGState = resources.get('ExtGState'); 33348 if (!(0, _primitives.isDict)(extGState) || !extGState.has(dictName.name)) { 33349 break; 33350 } 33351 var gState = extGState.get(dictName.name); 33352 next(self.setGState(resources, gState, operatorList, task, stateManager)); 33353 return; 33354 case _util.OPS.moveTo: 33355 case _util.OPS.lineTo: 33356 case _util.OPS.curveTo: 33357 case _util.OPS.curveTo2: 33358 case _util.OPS.curveTo3: 33359 case _util.OPS.closePath: 33360 self.buildPath(operatorList, fn, args); 33361 continue; 33362 case _util.OPS.rectangle: 33363 self.buildPath(operatorList, fn, args); 33364 continue; 33365 case _util.OPS.markPoint: 33366 case _util.OPS.markPointProps: 33367 case _util.OPS.beginMarkedContent: 33368 case _util.OPS.beginMarkedContentProps: 33369 case _util.OPS.endMarkedContent: 33370 case _util.OPS.beginCompat: 33371 case _util.OPS.endCompat: 33372 continue; 33373 default: 33374 if (args !== null) { 33375 for (i = 0, ii = args.length; i < ii; i++) { 33376 if (args[i] instanceof _primitives.Dict) { 33377 break; 33378 } 33379 } 33380 if (i < ii) { 33381 (0, _util.warn)('getOperatorList - ignoring operator: ' + fn); 33382 continue; 33383 } 33384 } 33385 } 33386 operatorList.addOp(fn, args); 33387 } 33388 if (stop) { 33389 next(deferred); 33390 return; 33391 } 33392 closePendingRestoreOPS(); 33393 resolve(); 33394 }).catch(function (reason) { 33395 if (_this8.options.ignoreErrors) { 33396 _this8.handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.unknown }); 33397 (0, _util.warn)('getOperatorList - ignoring errors during task: ' + task.name); 33398 closePendingRestoreOPS(); 33399 return; 33400 } 33401 throw reason; 33402 }); 33403 }, 33404 getTextContent: function getTextContent(_ref4) { 33405 var _this9 = this; 33406 33407 var stream = _ref4.stream, 33408 task = _ref4.task, 33409 resources = _ref4.resources, 33410 _ref4$stateManager = _ref4.stateManager, 33411 stateManager = _ref4$stateManager === undefined ? null : _ref4$stateManager, 33412 _ref4$normalizeWhites = _ref4.normalizeWhitespace, 33413 normalizeWhitespace = _ref4$normalizeWhites === undefined ? false : _ref4$normalizeWhites, 33414 _ref4$combineTextItem = _ref4.combineTextItems, 33415 combineTextItems = _ref4$combineTextItem === undefined ? false : _ref4$combineTextItem, 33416 sink = _ref4.sink, 33417 _ref4$seenStyles = _ref4.seenStyles, 33418 seenStyles = _ref4$seenStyles === undefined ? Object.create(null) : _ref4$seenStyles; 33419 33420 resources = resources || _primitives.Dict.empty; 33421 stateManager = stateManager || new StateManager(new TextState()); 33422 var WhitespaceRegexp = /\s/g; 33423 var textContent = { 33424 items: [], 33425 styles: Object.create(null) 33426 }; 33427 var textContentItem = { 33428 initialized: false, 33429 str: [], 33430 width: 0, 33431 height: 0, 33432 vertical: false, 33433 lastAdvanceWidth: 0, 33434 lastAdvanceHeight: 0, 33435 textAdvanceScale: 0, 33436 spaceWidth: 0, 33437 fakeSpaceMin: Infinity, 33438 fakeMultiSpaceMin: Infinity, 33439 fakeMultiSpaceMax: -0, 33440 textRunBreakAllowed: false, 33441 transform: null, 33442 fontName: null 33443 }; 33444 var SPACE_FACTOR = 0.3; 33445 var MULTI_SPACE_FACTOR = 1.5; 33446 var MULTI_SPACE_FACTOR_MAX = 4; 33447 var self = this; 33448 var xref = this.xref; 33449 var xobjs = null; 33450 var skipEmptyXObjs = Object.create(null); 33451 var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); 33452 var textState; 33453 function ensureTextContentItem() { 33454 if (textContentItem.initialized) { 33455 return textContentItem; 33456 } 33457 var font = textState.font; 33458 if (!(font.loadedName in seenStyles)) { 33459 seenStyles[font.loadedName] = true; 33460 textContent.styles[font.loadedName] = { 33461 fontFamily: font.fallbackName, 33462 ascent: font.ascent, 33463 descent: font.descent, 33464 vertical: font.vertical 33465 }; 33466 } 33467 textContentItem.fontName = font.loadedName; 33468 var tsm = [textState.fontSize * textState.textHScale, 0, 0, textState.fontSize, 0, textState.textRise]; 33469 if (font.isType3Font && textState.fontMatrix !== _util.FONT_IDENTITY_MATRIX && textState.fontSize === 1) { 33470 var glyphHeight = font.bbox[3] - font.bbox[1]; 33471 if (glyphHeight > 0) { 33472 glyphHeight = glyphHeight * textState.fontMatrix[3]; 33473 tsm[3] *= glyphHeight; 33474 } 33475 } 33476 var trm = _util.Util.transform(textState.ctm, _util.Util.transform(textState.textMatrix, tsm)); 33477 textContentItem.transform = trm; 33478 if (!font.vertical) { 33479 textContentItem.width = 0; 33480 textContentItem.height = Math.sqrt(trm[2] * trm[2] + trm[3] * trm[3]); 33481 textContentItem.vertical = false; 33482 } else { 33483 textContentItem.width = Math.sqrt(trm[0] * trm[0] + trm[1] * trm[1]); 33484 textContentItem.height = 0; 33485 textContentItem.vertical = true; 33486 }
33487 var a = textState.textLineMatrix[0]; 33488 var b = textState.textLineMatrix[1]; 33489 var scaleLineX = Math.sqrt(a * a + b * b); 33490 a = textState.ctm[0]; 33491 b = textState.ctm[1]; 33492 var scaleCtmX = Math.sqrt(a * a + b * b); 33493 textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; 33494 textContentItem.lastAdvanceWidth = 0; 33495 textContentItem.lastAdvanceHeight = 0; 33496 var spaceWidth = font.spaceWidth / 1000 * textState.fontSize; 33497 if (spaceWidth) { 33498 textContentItem.spaceWidth = spaceWidth; 33499 textContentItem.fakeSpaceMin = spaceWidth * SPACE_FACTOR; 33500 textContentItem.fakeMultiSpaceMin = spaceWidth * MULTI_SPACE_FACTOR; 33501 textContentItem.fakeMultiSpaceMax = spaceWidth * MULTI_SPACE_FACTOR_MAX; 33502 textContentItem.textRunBreakAllowed = !font.isMonospace; 33503 } else { 33504 textContentItem.spaceWidth = 0; 33505 textContentItem.fakeSpaceMin = Infinity; 33506 textContentItem.fakeMultiSpaceMin = Infinity; 33507 textContentItem.fakeMultiSpaceMax = 0; 33508 textContentItem.textRunBreakAllowed = false; 33509 } 33510 textContentItem.initialized = true; 33511 return textContentItem; 33512 } 33513 function replaceWhitespace(str) { 33514 var i = 0, 33515 ii = str.length, 33516 code; 33517 while (i < ii && (code = str.charCodeAt(i)) >= 0x20 && code <= 0x7F) { 33518 i++; 33519 } 33520 return i < ii ? str.replace(WhitespaceRegexp, ' ') : str; 33521 } 33522 function runBidiTransform(textChunk) { 33523 var str = textChunk.str.join(''); 33524 var bidiResult = (0, _bidi.bidi)(str, -1, textChunk.vertical); 33525 return { 33526 str: normalizeWhitespace ? replaceWhitespace(bidiResult.str) : bidiResult.str, 33527 dir: bidiResult.dir, 33528 width: textChunk.width, 33529 height: textChunk.height, 33530 transform: textChunk.transform, 33531 fontName: textChunk.fontName 33532 }; 33533 } 33534 function handleSetFont(fontName, fontRef) { 33535 return self.loadFont(fontName, fontRef, resources).then(function (translated) { 33536 textState.font = translated.font; 33537 textState.fontMatrix = translated.font.fontMatrix || _util.FONT_IDENTITY_MATRIX; 33538 }); 33539 } 33540 function buildTextContentItem(chars) { 33541 var font = textState.font; 33542 var textChunk = ensureTextContentItem(); 33543 var width = 0; 33544 var height = 0; 33545 var glyphs = font.charsToGlyphs(chars); 33546 for (var i = 0; i < glyphs.length; i++) { 33547 var glyph = glyphs[i]; 33548 var glyphWidth = null; 33549 if (font.vertical && glyph.vmetric) { 33550 glyphWidth = glyph.vmetric[0]; 33551 } else { 33552 glyphWidth = glyph.width; 33553 } 33554 var glyphUnicode = glyph.unicode; 33555 var NormalizedUnicodes = (0, _unicode.getNormalizedUnicodes)(); 33556 if (NormalizedUnicodes[glyphUnicode] !== undefined) { 33557 glyphUnicode = NormalizedUnicodes[glyphUnicode]; 33558 } 33559 glyphUnicode = (0, _unicode.reverseIfRtl)(glyphUnicode); 33560 var charSpacing = textState.charSpacing; 33561 if (glyph.isSpace) { 33562 var wordSpacing = textState.wordSpacing; 33563 charSpacing += wordSpacing; 33564 if (wordSpacing > 0) { 33565 addFakeSpaces(wordSpacing, textChunk.str); 33566 } 33567 } 33568 var tx = 0; 33569 var ty = 0; 33570 if (!font.vertical) { 33571 var w0 = glyphWidth * textState.fontMatrix[0]; 33572 tx = (w0 * textState.fontSize + charSpacing) * textState.textHScale; 33573 width += tx; 33574 } else { 33575 var w1 = glyphWidth * textState.fontMatrix[0]; 33576 ty = w1 * textState.fontSize + charSpacing; 33577 height += ty; 33578 } 33579 textState.translateTextMatrix(tx, ty); 33580 textChunk.str.push(glyphUnicode); 33581 } 33582 if (!font.vertical) { 33583 textChunk.lastAdvanceWidth = width; 33584 textChunk.width += width; 33585 } else { 33586 textChunk.lastAdvanceHeight = height; 33587 textChunk.height += Math.abs(height); 33588 } 33589 return textChunk; 33590 } 33591 function addFakeSpaces(width, strBuf) { 33592 if (width < textContentItem.fakeSpaceMin) { 33593 return; 33594 } 33595 if (width < textContentItem.fakeMultiSpaceMin) { 33596 strBuf.push(' '); 33597 return; 33598 } 33599 var fakeSpaces = Math.round(width / textContentItem.spaceWi
vendor: 3,559 bytes, lines 33599-33685
33599dth); 33600 while (fakeSpaces-- > 0) { 33601 strBuf.push(' '); 33602 } 33603 } 33604 function flushTextContentItem() { 33605 if (!textContentItem.initialized) { 33606 return; 33607 } 33608 textContentItem.width *= textContentItem.textAdvanceScale; 33609 textContentItem.height *= textContentItem.textAdvanceScale; 33610 textContent.items.push(runBidiTransform(textContentItem)); 33611 textContentItem.initialized = false; 33612 textContentItem.str.length = 0; 33613 } 33614 function enqueueChunk() { 33615 var length = textContent.items.length; 33616 if (length > 0) { 33617 sink.enqueue(textContent, length); 33618 textContent.items = []; 33619 textContent.styles = Object.create(null); 33620 } 33621 } 33622 var timeSlotManager = new TimeSlotManager(); 33623 return new Promise(function promiseBody(resolve, reject) { 33624 var next = function next(promise) { 33625 enqueueChunk(); 33626 Promise.all([promise, sink.ready]).then(function () { 33627 try { 33628 promiseBody(resolve, reject); 33629 } catch (ex) { 33630 reject(ex); 33631 } 33632 }, reject); 33633 }; 33634 task.ensureNotTerminated(); 33635 timeSlotManager.reset(); 33636 var stop, 33637 operation = {}, 33638 args = []; 33639 while (!(stop = timeSlotManager.check())) { 33640 args.length = 0; 33641 operation.args = args; 33642 if (!preprocessor.read(operation)) { 33643 break; 33644 } 33645 textState = stateManager.state; 33646 var fn = operation.fn; 33647 args = operation.args; 33648 var advance, diff; 33649 switch (fn | 0) { 33650 case _util.OPS.setFont: 33651 var fontNameArg = args[0].name, 33652 fontSizeArg = args[1]; 33653 if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) { 33654 break; 33655 } 33656 flushTextContentItem(); 33657 textState.fontName = fontNameArg; 33658 textState.fontSize = fontSizeArg; 33659 next(handleSetFont(fontNameArg, null)); 33660 return; 33661 case _util.OPS.setTextRise: 33662 flushTextContentItem(); 33663 textState.textRise = args[0]; 33664 break; 33665 case _util.OPS.setHScale: 33666 flushTextContentItem(); 33667 textState.textHScale = args[0] / 100; 33668 break; 33669 case _util.OPS.setLeading: 33670 flushTextContentItem(); 33671 textState.leading = args[0]; 33672 break; 33673 case _util.OPS.moveText: 33674 var isSameTextLine = !textState.font ? false : (textState.font.vertical ? args[0] : args[1]) === 0; 33675 advance = args[0] - args[1]; 33676 if (combineTextItems && isSameTextLine && textContentItem.initialized && advance > 0 && advance <= textContentItem.fakeMultiSpaceMax) { 33677 textState.translateTextLineMatrix(args[0], args[1]); 33678 textContentItem.width += args[0] - textContentItem.lastAdvanceWidth; 33679 textContentItem.height += args[1] - textContentItem.lastAdvanceHeight; 33680 diff = args[0] - textContentItem.lastAdvanceWidth - (args[1] - textContentItem.lastAdvanceHeight); 33681 addFakeSpaces(diff, textContentItem.str); 33682 break; 33683 } 33684 flushTextContentItem(); 33685 textState.translateTextLineMatrix(args[0], args[1]);
vendor: 1,981 bytes, lines 33686-33720
33686 textState.textMatrix = textState.textLineMatrix.slice(); 33687 break; 33688 case _util.OPS.setLeadingMoveText: 33689 flushTextContentItem(); 33690 textState.leading = -args[1]; 33691 textState.translateTextLineMatrix(args[0], args[1]); 33692 textState.textMatrix = textState.textLineMatrix.slice(); 33693 break; 33694 case _util.OPS.nextLine: 33695 flushTextContentItem(); 33696 textState.carriageReturn(); 33697 break; 33698 case _util.OPS.setTextMatrix: 33699 advance = textState.calcTextLineMatrixAdvance(args[0], args[1], args[2], args[3], args[4], args[5]); 33700 if (combineTextItems && advance !== null && textContentItem.initialized && advance.value > 0 && advance.value <= textContentItem.fakeMultiSpaceMax) { 33701 textState.translateTextLineMatrix(advance.width, advance.height); 33702 textContentItem.width += advance.width - textContentItem.lastAdvanceWidth; 33703 textContentItem.height += advance.height - textContentItem.lastAdvanceHeight; 33704 diff = advance.width - textContentItem.lastAdvanceWidth - (advance.height - textContentItem.lastAdvanceHeight); 33705 addFakeSpaces(diff, textContentItem.str); 33706 break; 33707 } 33708 flushTextContentItem(); 33709 textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); 33710 textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); 33711 break; 33712 case _util.OPS.setCharSpacing: 33713 textState.charSpacing = args[0]; 33714 break; 33715 case _util.OPS.setWordSpacing: 33716 textState.wordSpacing = args[0]; 33717 break; 33718 case _util.OPS.beginText: 33719 flushTextContentItem(); 33720 textState.textMatrix = _util.IDENTITY_MATRIX.slice();
33721 textState.textLineMatrix = _util.IDENTITY_MATRIX.slice(); 33722 break; 33723 case _util.OPS.showSpacedText: 33724 var items = args[0]; 33725 var offset; 33726 for (var j = 0, jj = items.length; j < jj; j++) { 33727 if (typeof items[j] === 'string') { 33728 buildTextContentItem(items[j]); 33729 } else if ((0, _util.isNum)(items[j])) { 33730 ensureTextContentItem(); 33731 advance = items[j] * textState.fontSize / 1000; 33732 var breakTextRun = false; 33733 if (textState.font.vertical) { 33734 offset = advance; 33735 textState.translateTextMatrix(0, offset); 33736 breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; 33737 if (!breakTextRun) { 33738 textContentItem.height += offset; 33739 } 33740 } else { 33741 advance = -advance; 33742 offset = advance * textState.textHScale; 33743 textState.translateTextMatrix(offset, 0); 33744 breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; 33745 if (!breakTextRun) { 33746 textContentItem.width += offset; 33747 } 33748 } 33749 if (breakTextRun) { 33750 flushTextContentItem(); 33751 } else if (advance > 0) { 33752 addFakeSpaces(advance, textContentItem.str); 33753 } 33754 } 33755 } 33756 break; 33757 case _util.OPS.showText: 33758 buildTextContentItem(args[0]); 33759 break; 33760 case _util.OPS.nextLineShowText: 33761 flushTextContentItem(); 33762 textState.carriageReturn(); 33763 buildTextContentItem(args[0]); 33764 break; 33765 case _util.OPS.nextLineSetSpacingShowText: 33766 flushTextContentItem(); 33767 textState.wordSpacing = args[0]; 33768 textState.charSpacing = args[1]; 33769 textState.carriageReturn(); 33770 buildTextContentItem(args[2]); 33771 break; 33772 case _util.OPS.paintXObject: 33773 flushTextContentItem(); 33774 if (!xobjs) { 33775 xobjs = resources.get('XObject') || _primitives.Dict.empty; 33776 } 33777 var name = args[0].name; 33778 if (name && skipEmptyXObjs[name] !== undefined) { 33779 break; 33780 } 33781 next(new Promise(function (resolveXObject, rejectXObject) { 33782 if (!name) { 33783 throw new _util.FormatError('XObject must be referred to by name.'); 33784 } 33785 var xobj = xobjs.get(name); 33786 if (!xobj) { 33787 resolveXObject(); 33788 return; 33789 } 33790 if (!(0, _primitives.isStream)(xobj)) { 33791 throw new _util.FormatError('XObject should be a stream'); 33792 } 33793 var type = xobj.dict.get('Subtype'); 33794 if (!(0, _primitives.isName)(type)) { 33795 throw new _util.FormatError('XObject should have a Name subtype'); 33796 } 33797 if (type.name !== 'Form') { 33798 skipEmptyXObjs[name] = true; 33799 resolveXObject(); 33800 return; 33801 } 33802 var currentState = stateManager.state.clone(); 33803 var xObjStateManager = new StateManager(currentState); 33804 var matrix = xobj.dict.getArray('Matrix'); 33805 if (Array.isArray(matrix) && matrix.length === 6) { 33806 xObjStateManager.transform(matrix); 33807 } 33808 enqueueChunk(); 33809 var sinkWrapper = { 33810 enqueueInvoked: false, 33811 enqueue: function enqueue(chunk, size) { 33812 this.enqueueInvoked = true; 33813 sink.enqueue(chunk, size); 33814 }, 33815 33816 get desiredSize() { 33817 return sink.desiredSize; 33818 }, 33819 get ready() { 33820 return sink.ready; 33821 } 33822 }; 33823 self.getTextContent({ 33824 stream: xobj, 33825 task: task, 33826 resources: xobj.dict.get('Resources') || resources, 33827 stateManager: xObjStateManager, 33828 normalizeWhitespace: normalizeWhitespace, 33829 combineTextItems: combineTextItems, 33830 sink: sinkWrapper, 33831 seenStyles: seenStyles 33832 }).then(function () { 33833 if (!sinkWrapper.enqueueInvoked) { 33834 skipEmptyXObjs[name] = true; 33835 } 33836 resolveXObject(); 33837 }, rejectXObject); 33838 }).catch(function (reason) { 33839 if (reason instanceof _util.AbortException) { 33840 return; 33841 } 33842 if (self.options.ignoreErrors) { 33843 (0, _util.warn)('getTextContent - ignoring XObject: "' + reason + '".'); 33844 return; 33845 } 33846 throw reason; 33847 })); 33848 return; 33849 case _util.OPS.setGState: 33850 flushTextContentItem(); 33851 var dictName = args[0]; 33852 var extGState = resources.get('ExtGState'); 33853 if (!(0, _primitives.isDict)(extGState) || !(0, _primitives.isName)(dictName)) { 33854 break; 33855 } 33856 var gState = extGState.get(dictName.name); 33857 if (!(0, _primitives.isDict)(gState)) { 33858 break; 33859 } 33860 var gStateFont = gState.get('Font'); 33861 if (gStateFont) { 33862 textState.fontName = null; 33863 textState.fontSize = gStateFont[1]; 33864 next(handleSetFont(null, gStateFont[0])); 33865 return; 33866 } 33867 break; 33868 } 33869 if (textContent.items.length >= sink.desiredSize) { 33870 stop = true; 33871 break; 33872 } 33873 } 33874 if (stop) { 33875 next(deferred); 33876 return; 33877 } 33878 flushTextContentItem(); 33879 enqueueChunk(); 33880 resolve(); 33881 }).catch(function (reason) { 33882 if (reason instanceof _util.AbortException) { 33883 return; 33884 } 33885 if (_this9.options.ignoreErrors) { 33886 (0, _util.warn)('getTextContent - ignoring errors during task: ' + task.name); 33887 flushTextContentItem(); 33888 enqueueChunk(); 33889 return; 33890 } 33891 throw reason; 33892 }); 33893 }, 33894 33895 extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, properties) { 33896 var _this10 = this; 33897 33898 var xref = this.xref; 33899 var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode'); 33900 var toUnicodePromise = toUnicode ? this.readToUnicode(toUnicode) : Promise.resolve(undefined); 33901 if (properties.composite) { 33902 var cidSystemInfo = dict.get('CIDSystemInfo'); 33903 if ((0, _primitives.isDict)(cidSystemInfo)) { 33904 properties.cidSystemInfo = { 33905 registry: cidSystemInfo.get('Registry'), 33906 ordering: cidSystemInfo.get('Ordering'), 33907 supplement: cidSystemInfo.get('Supplement') 33908 }; 33909 } 33910 var cidToGidMap = dict.get('CIDToGIDMap'); 33911 if ((0, _primitives.isStream)(cidToGidMap)) { 33912 properties.cidToGidMap = this.readCidToGidMap(cidToGidMap); 33913 } 33914 } 33915 var differences = []; 33916 var baseEncodingName = null; 33917 var encoding; 33918 if (dict.has('Encoding')) { 33919 encoding = dict.get('Encoding'); 33920 if ((0, _primitives.isDict)(encoding)) { 33921 baseEncodingName = encoding.get('BaseEncoding'); 33922 baseEncodingName = (0, _primitives.isName)(baseEncodingName) ? baseEncodingName.name : null; 33923 if (encoding.has('Differences')) { 33924 var diffEncoding = encoding.get('Differences'); 33925 var index = 0; 33926 for (var j = 0, jj = diffEncoding.length; j < jj; j++) { 33927 var data = xref.fetchIfRef(diffEncoding[j]); 33928 if ((0, _util.isNum)(data)) { 33929 index = data; 33930 } else if ((0, _primitives.isName)(data)) { 33931 differences[index++] = data.name; 33932 } else { 33933 throw new _util.FormatError('Invalid entry in \'Differences\' array: ' + data); 33934 } 33935 } 33936 } 33937 } else if ((0, _primitives.isName)(encoding)) { 33938 baseEncodingName = encoding.name; 33939 } else { 33940 throw new _util.FormatError('Encoding is not a Name nor a Dict'); 33941 } 33942 if (baseEncodingName !== 'MacRomanEncoding' && baseEncodingName !== 'MacExpertEncoding' && baseEncodingName !== 'WinAnsiEncoding') { 33943 baseEncodingName = null; 33944 } 33945 } 33946 if (baseEncodingName) { 33947 properties.defaultEncoding = (0, _encodings.getEncoding)(baseEncodingName).slice(); 33948 } else { 33949 var isSymbolicFont = !!(properties.flags & _fonts.FontFlags.Symbolic); 33950 var isNonsymbolicFont = !!(properties.flags & _fonts.FontFlags.Nonsymbolic); 33951 encoding = _encodings.StandardEncoding; 33952 if (properties.type === 'TrueType' && !isNonsymbolicFont) { 33953 encoding = _encodings.WinAnsiEncoding; 33954 } 33955 if (isSymbolicFont) { 33956 encoding = _encodings.MacRomanEncoding; 33957 if (!properties.file) { 33958 if (/Symbol/i.test(properties.name)) { 33959 encoding = _encodings.SymbolSetEncoding; 33960 } else if (/Dingbats/i.test(properties.name)) { 33961 encoding = _encodings.ZapfDingbatsEncoding; 33962 } 33963 } 33964 } 33965 properties.defaultEncoding = encoding; 33966 } 33967 properties.differences = differences; 33968 properties.baseEncodingName = baseEncodingName; 33969 properties.hasEncoding = !!baseEncodingName || differences.length > 0;
33970 properties.dict = dict; 33971 return toUnicodePromise.then(function (toUnicode) { 33972 properties.toUnicode = toUnicode; 33973 return _this10.buildToUnicode(properties); 33974 }).then(function (toUnicode) { 33975 properties.toUnicode = toUnicode; 33976 return properties; 33977 }); 33978 }, 33979 _buildSimpleFontToUnicode: function _buildSimpleFontToUnicode(properties) { 33980 (0, _util.assert)(!properties.composite, 'Must be a simple font.'); 33981 var toUnicode = [], 33982 charcode = void 0, 33983 glyphName = void 0; 33984 var encoding = properties.defaultEncoding.slice(); 33985 var baseEncodingName = properties.baseEncodingName; 33986 var differences = properties.differences; 33987 for (charcode in differences) { 33988 glyphName = differences[charcode]; 33989 if (glyphName === '.notdef') { 33990 continue; 33991 } 33992 encoding[charcode] = glyphName; 33993 } 33994 var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 33995 for (charcode in encoding) { 33996 glyphName = encoding[charcode]; 33997 if (glyphName === '') { 33998 continue; 33999 } else if (glyphsUnicodeMap[glyphName] === undefined) { 34000 var code = 0; 34001 switch (glyphName[0]) { 34002 case 'G': 34003 if (glyphName.length === 3) { 34004 code = parseInt(glyphName.substr(1), 16); 34005 } 34006 break; 34007 case 'g': 34008 if (glyphName.length === 5) { 34009 code = parseInt(glyphName.substr(1), 16); 34010 } 34011 break; 34012 case 'C': 34013 case 'c': 34014 if (glyphName.length >= 3) { 34015 code = +glyphName.substr(1); 34016 } 34017 break; 34018 default: 34019 var unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap); 34020 if (unicode !== -1) { 34021 code = unicode; 34022 } 34023 } 34024 if (code) { 34025 if (baseEncodingName && code === +charcode) { 34026 var baseEncoding = (0, _encodings.getEncoding)(baseEncodingName); 34027 if (baseEncoding && (glyphName = baseEncoding[charcode])) { 34028 toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); 34029 continue; 34030 } 34031 } 34032 toUnicode[charcode] = String.fromCharCode(code); 34033 } 34034 continue; 34035 } 34036 toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); 34037 } 34038 return new _fonts.ToUnicodeMap(toUnicode); 34039 }, 34040 buildToUnicode: function buildToUnicode(properties) { 34041 properties.hasIncludedToUnicodeMap = !!properties.toUnicode && properties.toUnicode.length > 0; 34042 if (properties.hasIncludedToUnicodeMap) { 34043 if (!properties.composite && properties.hasEncoding) { 34044 properties.fallbackToUnicode = this._buildSimpleFontToUnicode(properties); 34045 } 34046 return Promise.resolve(properties.toUnicode); 34047 } 34048 if (!properties.composite) { 34049 return Promise.resolve(this._buildSimpleFontToUnicode(properties)); 34050 } 34051 if (properties.composite && (properties.cMap.builtInCMap && !(properties.cMap instanceof _cmap.IdentityCMap) || properties.cidSystemInfo.registry === 'Adobe' && (properties.cidSystemInfo.ordering === 'GB1' || properties.cidSystemInfo.ordering === 'CNS1' || properties.cidSystemInfo.ordering === 'Japan1' || properties.cidSystemInfo.ordering === 'Korea1'))) { 34052 var registry = properties.cidSystemInfo.registry; 34053 var ordering = properties.cidSystemInfo.ordering; 34054 var ucs2CMapName = _primitives.Name.get(registry + '-' + ordering + '-UCS2'); 34055 return _cmap.CMapFactory.create({ 34056 encoding: ucs2CMapName, 34057 fetchBuiltInCMap: this.fetchBuiltInCMap, 34058 useCMap: null 34059 }).then(function (ucs2CMap) { 34060 var cMap = properties.cMap; 34061 var toUnicode = []; 34062 cMap.forEach(function (charcode, cid) { 34063 if (cid > 0xffff) { 34064 throw new _util.FormatError('Max size of CID is 65,535'); 34065 } 34066 var ucs2 = ucs2CMap.lookup(cid); 34067 if (ucs2) { 34068 toUnicode[charcode] = String.fromCharCode((ucs2.charCodeAt(0) << 8) + ucs2.charCodeAt(1)); 34069 } 34070 }); 34071 return new _fonts.ToUnicodeMap(toUnicode); 34072 }); 34073 } 34074 return Promise.resolve(new _fonts.IdentityToUnicodeMap(properties.firstChar, properties.lastChar)); 34075 }, 34076 34077 readToUnicode: function PartialEvaluator_readToUnicode(toUnicode) { 34078 var cmapObj = toUnicode; 34079 if ((0, _primitives.isName)(cmapObj)) { 34080 return _cmap.CMapFactory.create({ 34081 encoding: cmapObj, 34082 fetchBuiltInCMap: this.fetchBuiltInCMap, 34083 useCMap: null 34084 }).then(function (cmap) { 34085 if (cmap instanceof _cmap.IdentityCMap) { 34086 return new _fonts.IdentityToUnicodeMap(0, 0xFFFF); 34087 } 34088 return new _fonts.ToUnicodeMap(cmap.getMap()); 34089 }); 34090 } else if ((0, _primitives.isStream)(cmapObj)) { 34091 return _cmap.CMapFactory.create({ 34092 encoding: cmapObj, 34093 fetchBuiltInCMap: this.fetchBuiltInCMap, 34094 useCMap: null 34095 }).then(function (cmap) { 34096 if (cmap instanceof _cmap.IdentityCMap) { 34097 return new _fonts.IdentityToUnicodeMap(0, 0xFFFF); 34098 } 34099 var map = new Array(cmap.length);
34100 cmap.forEach(function (charCode, token) { 34101 var str = []; 34102 for (var k = 0; k < token.length; k += 2) { 34103 var w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); 34104 if ((w1 & 0xF800) !== 0xD800) { 34105 str.push(w1); 34106 continue; 34107 } 34108 k += 2; 34109 var w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); 34110 str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); 34111 } 34112 map[charCode] = String.fromCharCode.apply(String, str); 34113 }); 34114 return new _fonts.ToUnicodeMap(map); 34115 }); 34116 } 34117 return Promise.resolve(null); 34118 }, 34119 readCidToGidMap: function PartialEvaluator_readCidToGidMap(cidToGidStream) { 34120 var glyphsData = cidToGidStream.getBytes(); 34121 var result = []; 34122 for (var j = 0, jj = glyphsData.length; j < jj; j++) { 34123 var glyphID = glyphsData[j++] << 8 | glyphsData[j]; 34124 if (glyphID === 0) { 34125 continue; 34126 } 34127 var code = j >> 1; 34128 result[code] = glyphID; 34129 } 34130 return result; 34131 }, 34132 extractWidths: function PartialEvaluator_extractWidths(dict, descriptor, properties) { 34133 var xref = this.xref; 34134 var glyphsWidths = []; 34135 var defaultWidth = 0; 34136 var glyphsVMetrics = []; 34137 var defaultVMetrics; 34138 var i, ii, j, jj, start, code, widths; 34139 if (properties.composite) { 34140 defaultWidth = dict.has('DW') ? dict.get('DW') : 1000; 34141 widths = dict.get('W'); 34142 if (widths) { 34143 for (i = 0, ii = widths.length; i < ii; i++) { 34144 start = xref.fetchIfRef(widths[i++]); 34145 code = xref.fetchIfRef(widths[i]); 34146 if (Array.isArray(code)) { 34147 for (j = 0, jj = code.length; j < jj; j++) { 34148 glyphsWidths[start++] = xref.fetchIfRef(code[j]); 34149 } 34150 } else { 34151 var width = xref.fetchIfRef(widths[++i]); 34152 for (j = start; j <= code; j++) { 34153 glyphsWidths[j] = width; 34154 } 34155 } 34156 } 34157 } 34158 if (properties.vertical) { 34159 var vmetrics = dict.getArray('DW2') || [880, -1000]; 34160 defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; 34161 vmetrics = dict.get('W2'); 34162 if (vmetrics) { 34163 for (i = 0, ii = vmetrics.length; i < ii; i++) { 34164 start = xref.fetchIfRef(vmetrics[i++]); 34165 code = xref.fetchIfRef(vmetrics[i]); 34166 if (Array.isArray(code)) { 34167 for (j = 0, jj = code.length; j < jj; j++) { 34168 glyphsVMetrics[start++] = [xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j])]; 34169 } 34170 } else { 34171 var vmetric = [xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i])]; 34172 for (j = start; j <= code; j++) { 34173 glyphsVMetrics[j] = vmetric; 34174 } 34175 } 34176 } 34177 } 34178 } 34179 } else { 34180 var firstChar = properties.firstChar; 34181 widths = dict.get('Widths'); 34182 if (widths) { 34183 j = firstChar; 34184 for (i = 0, ii = widths.length; i < ii; i++) { 34185 glyphsWidths[j++] = xref.fetchIfRef(widths[i]); 34186 } 34187 defaultWidth = parseFloat(descriptor.get('MissingWidth')) || 0; 34188 } else { 34189 var baseFontName = dict.get('BaseFont'); 34190 if ((0, _primitives.isName)(baseFontName)) { 34191 var metrics = this.getBaseFontMetrics(baseFontName.name); 34192 glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties); 34193 defaultWidth = metrics.defaultWidth; 34194 } 34195 } 34196 } 34197 var isMonospace = true; 34198 var firstWidth = defaultWidth; 34199 for (var glyph in glyphsWidths) { 34200 var glyphWidth = glyphsWidths[glyph]; 34201 if (!glyphWidth) { 34202 continue; 34203 } 34204 if (!firstWidth) { 34205 firstWidth = glyphWidth; 34206 continue; 34207 } 34208 if (firstWidth !== glyphWidth) { 34209 isMonospace = false; 34210 break; 34211 } 34212 } 34213 if (isMonospace) { 34214 properties.flags |= _fonts.FontFlags.FixedPitch; 34215 } 34216 properties.defaultWidth = defaultWidth; 34217 properties.widths = glyphsWidths; 34218 properties.defaultVMetrics = defaultVMetrics; 34219 properties.vmetrics = glyphsVMetrics; 34220 }, 34221 isSerifFont: function PartialEvaluator_isSerifFont(baseFontName) { 34222 var fontNameWoStyle = baseFontName.split('-')[0]; 34223 return fontNameWoStyle in (0, _standard_fonts.getSerifFonts)() || fontNameWoStyle.search(/serif/gi) !== -1; 34224 }, 34225 getBaseFontMetrics: function PartialEvaluator_getBaseFontMetrics(name) { 34226 var defaultWidth = 0; 34227 var widths = []; 34228 var monospace = false; 34229 var stdFontMap = (0, _standard_fonts.getStdFontMap)(); 34230 var lookupName = stdFontMap[name] || name; 34231 var Metrics = (0, _metrics.getMetrics)();
34232 if (!(lookupName in Metrics)) { 34233 if (this.isSerifFont(name)) { 34234 lookupName = 'Times-Roman'; 34235 } else { 34236 lookupName = 'Helvetica'; 34237 } 34238 } 34239 var glyphWidths = Metrics[lookupName]; 34240 if ((0, _util.isNum)(glyphWidths)) { 34241 defaultWidth = glyphWidths; 34242 monospace = true; 34243 } else { 34244 widths = glyphWidths(); 34245 } 34246 return { 34247 defaultWidth: defaultWidth, 34248 monospace: monospace, 34249 widths: widths 34250 }; 34251 }, 34252 buildCharCodeToWidth: function PartialEvaluator_bulildCharCodeToWidth(widthsByGlyphName, properties) { 34253 var widths = Object.create(null); 34254 var differences = properties.differences; 34255 var encoding = properties.defaultEncoding; 34256 for (var charCode = 0; charCode < 256; charCode++) { 34257 if (charCode in differences && widthsByGlyphName[differences[charCode]]) { 34258 widths[charCode] = widthsByGlyphName[differences[charCode]]; 34259 continue; 34260 } 34261 if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { 34262 widths[charCode] = widthsByGlyphName[encoding[charCode]]; 34263 continue; 34264 } 34265 } 34266 return widths; 34267 }, 34268 preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict) { 34269 var baseDict = dict; 34270 var type = dict.get('Subtype'); 34271 if (!(0, _primitives.isName)(type)) { 34272 throw new _util.FormatError('invalid font Subtype'); 34273 } 34274 var composite = false; 34275 var uint8array; 34276 if (type.name === 'Type0') { 34277 var df = dict.get('DescendantFonts'); 34278 if (!df) { 34279 throw new _util.FormatError('Descendant fonts are not specified'); 34280 } 34281 dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df; 34282 type = dict.get('Subtype'); 34283 if (!(0, _primitives.isName)(type)) { 34284 throw new _util.FormatError('invalid font Subtype'); 34285 } 34286 composite = true; 34287 } 34288 var descriptor = dict.get('FontDescriptor'); 34289 if (descriptor) { 34290 var hash = new _murmurhash.MurmurHash3_64(); 34291 var encoding = baseDict.getRaw('Encoding'); 34292 if ((0, _primitives.isName)(encoding)) { 34293 hash.update(encoding.name); 34294 } else if ((0, _primitives.isRef)(encoding)) { 34295 hash.update(encoding.toString()); 34296 } else if ((0, _primitives.isDict)(encoding)) { 34297 var keys = encoding.getKeys(); 34298 for (var i = 0, ii = keys.length; i < ii; i++) { 34299 var entry = encoding.getRaw(keys[i]); 34300 if ((0, _primitives.isName)(entry)) { 34301 hash.update(entry.name); 34302 } else if ((0, _primitives.isRef)(entry)) { 34303 hash.update(entry.toString()); 34304 } else if (Array.isArray(entry)) { 34305 var diffLength = entry.length, 34306 diffBuf = new Array(diffLength); 34307 for (var j = 0; j < diffLength; j++) { 34308 var diffEntry = entry[j]; 34309 if ((0, _primitives.isName)(diffEntry)) { 34310 diffBuf[j] = diffEntry.name; 34311 } else if ((0, _util.isNum)(diffEntry) || (0, _primitives.isRef)(diffEntry)) { 34312 diffBuf[j] = diffEntry.toString(); 34313 } 34314 } 34315 hash.update(diffBuf.join()); 34316 } 34317 } 34318 } 34319 var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode'); 34320 if ((0, _primitives.isStream)(toUnicode)) { 34321 var stream = toUnicode.str || toUnicode; 34322 uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start); 34323 hash.update(uint8array); 34324 } else if ((0, _primitives.isName)(toUnicode)) { 34325 hash.update(toUnicode.name); 34326 } 34327 var widths = dict.get('Widths') || baseDict.get('Widths'); 34328 if (widths) { 34329 uint8array = new Uint8Array(new Uint32Array(widths).buffer); 34330 hash.update(uint8array); 34331 } 34332 } 34333 return { 34334 descriptor: descriptor, 34335 dict: dict, 34336 baseDict: baseDict, 34337 composite: composite,
34338 type: type.name, 34339 hash: hash ? hash.hexdigest() : '' 34340 }; 34341 }, 34342 translateFont: function PartialEvaluator_translateFont(preEvaluatedFont) { 34343 var _this11 = this; 34344 34345 var baseDict = preEvaluatedFont.baseDict; 34346 var dict = preEvaluatedFont.dict; 34347 var composite = preEvaluatedFont.composite; 34348 var descriptor = preEvaluatedFont.descriptor; 34349 var type = preEvaluatedFont.type; 34350 var maxCharIndex = composite ? 0xFFFF : 0xFF; 34351 var properties; 34352 if (!descriptor) { 34353 if (type === 'Type3') { 34354 descriptor = new _primitives.Dict(null); 34355 descriptor.set('FontName', _primitives.Name.get(type)); 34356 descriptor.set('FontBBox', dict.getArray('FontBBox')); 34357 } else { 34358 var baseFontName = dict.get('BaseFont'); 34359 if (!(0, _primitives.isName)(baseFontName)) { 34360 throw new _util.FormatError('Base font is not specified'); 34361 } 34362 baseFontName = baseFontName.name.replace(/[,_]/g, '-'); 34363 var metrics = this.getBaseFontMetrics(baseFontName); 34364 var fontNameWoStyle = baseFontName.split('-')[0]; 34365 var flags = (this.isSerifFont(fontNameWoStyle) ? _fonts.FontFlags.Serif : 0) | (metrics.monospace ? _fonts.FontFlags.FixedPitch : 0) | ((0, _standard_fonts.getSymbolsFonts)()[fontNameWoStyle] ? _fonts.FontFlags.Symbolic : _fonts.FontFlags.Nonsymbolic); 34366 properties = { 34367 type: type, 34368 name: baseFontName, 34369 widths: metrics.widths, 34370 defaultWidth: metrics.defaultWidth, 34371 flags: flags, 34372 firstChar: 0, 34373 lastChar: maxCharIndex 34374 }; 34375 return this.extractDataStructures(dict, dict, properties).then(function (properties) { 34376 properties.widths = _this11.buildCharCodeToWidth(metrics.widths, properties); 34377 return new _fonts.Font(baseFontName, null, properties); 34378 }); 34379 } 34380 } 34381 var firstChar = dict.get('FirstChar') || 0; 34382 var lastChar = dict.get('LastChar') || maxCharIndex; 34383 var fontName = descriptor.get('FontName'); 34384 var baseFont = dict.get('BaseFont'); 34385 if ((0, _util.isString)(fontName)) { 34386 fontName = _primitives.Name.get(fontName); 34387 } 34388 if ((0, _util.isString)(baseFont)) { 34389 baseFont = _primitives.Name.get(baseFont); 34390 } 34391 if (type !== 'Type3') { 34392 var fontNameStr = fontName && fontName.name; 34393 var baseFontStr = baseFont && baseFont.name; 34394 if (fontNameStr !== baseFontStr) { 34395 (0, _util.info)('The FontDescriptor\'s FontName is "' + fontNameStr + '" but should be the same as the Font\'s BaseFont "' + baseFontStr + '"'); 34396 if (fontNameStr && baseFontStr && baseFontStr.indexOf(fontNameStr) === 0) { 34397 fontName = baseFont; 34398 } 34399 } 34400 } 34401 fontName = fontName || baseFont; 34402 if (!(0, _primitives.isName)(fontName)) { 34403 throw new _util.FormatError('invalid font name'); 34404 } 34405 var fontFile = descriptor.get('FontFile', 'FontFile2', 'FontFile3'); 34406 if (fontFile) { 34407 if (fontFile.dict) { 34408 var subtype = fontFile.dict.get('Subtype'); 34409 if (subtype) { 34410 subtype = subtype.name; 34411 } 34412 var length1 = fontFile.dict.get('Length1'); 34413 var length2 = fontFile.dict.get('Length2'); 34414 var length3 = fontFile.dict.get('Length3'); 34415 } 34416 } 34417 properties = { 34418 type: type, 34419 name: fontName.name, 34420 subtype: subtype, 34421 file: fontFile, 34422 length1: length1, 34423 length2: length2, 34424 length3: length3, 34425 loadedName: baseDict.loadedName, 34426 composite: composite, 34427 wideChars: composite, 34428 fixedPitch: false, 34429 fontMatrix: dict.getArray('FontMatrix') || _util.FONT_IDENTITY_MATRIX, 34430 firstChar: firstChar || 0, 34431 lastChar: lastChar || maxCharIndex, 34432 bbox: descriptor.getArray('FontBBox'), 34433 ascent: descriptor.get('Ascent'), 34434 descent: descriptor.get('Descent'), 34435 xHeight: descriptor.get('XHeight'), 34436 capHeight: descriptor.get('CapHeight'), 34437 flags: descriptor.get('Flags'), 34438 italicAngle: descriptor.get('ItalicAngle'), 34439 isType3Font: false 34440 }; 34441 var cMapPromise; 34442 if (composite) { 34443 var cidEncoding = baseDict.get('Encoding'); 34444 if ((0, _primitives.isName)(cidEncoding)) { 34445 properties.cidEncoding = cidEncoding.name; 34446 } 34447 cMapPromise = _cmap.CMapFactory.create({ 34448 encoding: cidEncoding, 34449 fetchBuiltInCMap: this.fetchBuiltInCMap, 34450 useCMap: null 34451 }).then(function (cMap) { 34452 properties.cMap = cMap; 34453 properties.vertical = properties.cMap.vertical; 34454 }); 34455 } else { 34456 cMapPromise = Promise.resolve(undefined); 34457 } 34458 return cMapPromise.then(function () { 34459 return _this11.extractDataStructures(dict, baseDict, properties); 34460 }).then(function (properties) { 34461 _this11.extractWidths(dict, descriptor, properties); 34462 if (type === 'Type3') { 34463 properties.isType3Font = true; 34464 } 34465 return new _fonts.Font(fontName.name, fontFile, properties); 34466 }); 34467 } 34468 }; 34469 return PartialEvaluator; 34470}();
34471var TranslatedFont = function TranslatedFontClosure() { 34472 function TranslatedFont(loadedName, font, dict) { 34473 this.loadedName = loadedName; 34474 this.font = font; 34475 this.dict = dict; 34476 this.type3Loaded = null; 34477 this.sent = false; 34478 } 34479 TranslatedFont.prototype = { 34480 send: function send(handler) { 34481 if (this.sent) { 34482 return; 34483 } 34484 var fontData = this.font.exportData(); 34485 handler.send('commonobj', [this.loadedName, 'Font', fontData]); 34486 this.sent = true; 34487 }, 34488 loadType3Data: function loadType3Data(evaluator, resources, parentOperatorList, task) { 34489 if (!this.font.isType3Font) { 34490 throw new Error('Must be a Type3 font.'); 34491 } 34492 if (this.type3Loaded) { 34493 return this.type3Loaded; 34494 } 34495 var type3Options = Object.create(evaluator.options); 34496 type3Options.ignoreErrors = false; 34497 var type3Evaluator = evaluator.clone(type3Options); 34498 var translatedFont = this.font; 34499 var loadCharProcsPromise = Promise.resolve(); 34500 var charProcs = this.dict.get('CharProcs'); 34501 var fontResources = this.dict.get('Resources') || resources; 34502 var charProcKeys = charProcs.getKeys(); 34503 var charProcOperatorList = Object.create(null); 34504 34505 var _loop2 = function _loop2() { 34506 var key = charProcKeys[i]; 34507 loadCharProcsPromise = loadCharProcsPromise.then(function () { 34508 var glyphStream = charProcs.get(key); 34509 var operatorList = new _operator_list.OperatorList(); 34510 return type3Evaluator.getOperatorList({ 34511 stream: glyphStream, 34512 task: task, 34513 resources: fontResources, 34514 operatorList: operatorList 34515 }).then(function () { 34516 charProcOperatorList[key] = operatorList.getIR(); 34517 parentOperatorList.addDependencies(operatorList.dependencies); 34518 }).catch(function (reason) { 34519 (0, _util.warn)('Type3 font resource "' + key + '" is not available.'); 34520 var operatorList = new _operator_list.OperatorList(); 34521 charProcOperatorList[key] = operatorList.getIR(); 34522 }); 34523 }); 34524 }; 34525 34526 for (var i = 0, n = charProcKeys.length; i < n; ++i) { 34527 _loop2(); 34528 } 34529 this.type3Loaded = loadCharProcsPromise.then(function () { 34530 translatedFont.charProcOperatorList = charProcOperatorList; 34531 }); 34532 return this.type3Loaded; 34533 } 34534 }; 34535 return TranslatedFont; 34536}(); 34537var StateManager = function StateManagerClosure() { 34538 function StateManager(initialState) { 34539 this.state = initialState; 34540 this.stateStack = []; 34541 } 34542 StateManager.prototype = { 34543 save: function save() { 34544 var old = this.state; 34545 this.stateStack.push(this.state); 34546 this.state = old.clone(); 34547 }, 34548 restore: function restore() { 34549 var prev = this.stateStack.pop(); 34550 if (prev) { 34551 this.state = prev; 34552 } 34553 }, 34554 transform: function transform(args) { 34555 this.state.ctm = _util.Util.transform(this.state.ctm, args); 34556 } 34557 }; 34558 return StateManager; 34559}(); 34560var TextState = function TextStateClosure() { 34561 function TextState() { 34562 this.ctm = new Float32Array(_util.IDENTITY_MATRIX); 34563 this.fontName = null; 34564 this.fontSize = 0; 34565 this.font = null; 34566 this.fontMatrix = _util.FONT_IDENTITY_MATRIX; 34567 this.textMatrix = _util.IDENTITY_MATRIX.slice();
34568 this.textLineMatrix = _util.IDENTITY_MATRIX.slice(); 34569 this.charSpacing = 0; 34570 this.wordSpacing = 0; 34571 this.leading = 0; 34572 this.textHScale = 1; 34573 this.textRise = 0; 34574 } 34575 TextState.prototype = { 34576 setTextMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { 34577 var m = this.textMatrix; 34578 m[0] = a; 34579 m[1] = b; 34580 m[2] = c; 34581 m[3] = d; 34582 m[4] = e; 34583 m[5] = f; 34584 }, 34585 setTextLineMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { 34586 var m = this.textLineMatrix; 34587 m[0] = a; 34588 m[1] = b; 34589 m[2] = c; 34590 m[3] = d; 34591 m[4] = e; 34592 m[5] = f; 34593 }, 34594 translateTextMatrix: function TextState_translateTextMatrix(x, y) { 34595 var m = this.textMatrix; 34596 m[4] = m[0] * x + m[2] * y + m[4]; 34597 m[5] = m[1] * x + m[3] * y + m[5]; 34598 }, 34599 translateTextLineMatrix: function TextState_translateTextMatrix(x, y) { 34600 var m = this.textLineMatrix; 34601 m[4] = m[0] * x + m[2] * y + m[4]; 34602 m[5] = m[1] * x + m[3] * y + m[5]; 34603 },
34604 calcTextLineMatrixAdvance: function TextState_calcTextLineMatrixAdvance(a, b, c, d, e, f) { 34605 var font = this.font; 34606 if (!font) { 34607 return null; 34608 } 34609 var m = this.textLineMatrix; 34610 if (!(a === m[0] && b === m[1] && c === m[2] && d === m[3])) { 34611 return null; 34612 } 34613 var txDiff = e - m[4], 34614 tyDiff = f - m[5]; 34615 if (font.vertical && txDiff !== 0 || !font.vertical && tyDiff !== 0) { 34616 return null; 34617 } 34618 var tx, 34619 ty, 34620 denominator = a * d - b * c; 34621 if (font.vertical) { 34622 tx = -tyDiff * c / denominator; 34623 ty = tyDiff * a / denominator; 34624 } else { 34625 tx = txDiff * d / denominator; 34626 ty = -txDiff * b / denominator; 34627 } 34628 return { 34629 width: tx, 34630 height: ty, 34631 value: font.vertical ? ty : tx 34632 }; 34633 }, 34634 calcRenderMatrix: function TextState_calcRendeMatrix(ctm) { 34635 var tsm = [this.fontSize * this.textHScale, 0, 0, this.fontSize, 0, this.textRise]; 34636 return _util.Util.transform(ctm, _util.Util.transform(this.textMatrix, tsm)); 34637 }, 34638 carriageReturn: function TextState_carriageReturn() { 34639 this.translateTextLineMatrix(0, -this.leading);
vendor: 6,213 bytes, lines 34640-34918
34640 this.textMatrix = this.textLineMatrix.slice(); 34641 }, 34642 clone: function TextState_clone() { 34643 var clone = Object.create(this); 34644 clone.textMatrix = this.textMatrix.slice(); 34645 clone.textLineMatrix = this.textLineMatrix.slice(); 34646 clone.fontMatrix = this.fontMatrix.slice(); 34647 return clone; 34648 } 34649 }; 34650 return TextState; 34651}(); 34652var EvalState = function EvalStateClosure() { 34653 function EvalState() { 34654 this.ctm = new Float32Array(_util.IDENTITY_MATRIX); 34655 this.font = null; 34656 this.textRenderingMode = _util.TextRenderingMode.FILL; 34657 this.fillColorSpace = _colorspace.ColorSpace.singletons.gray; 34658 this.strokeColorSpace = _colorspace.ColorSpace.singletons.gray; 34659 } 34660 EvalState.prototype = { 34661 clone: function CanvasExtraState_clone() { 34662 return Object.create(this); 34663 } 34664 }; 34665 return EvalState; 34666}(); 34667var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() { 34668 var getOPMap = (0, _util.getLookupTableFactory)(function (t) { 34669 t['w'] = { 34670 id: _util.OPS.setLineWidth, 34671 numArgs: 1, 34672 variableArgs: false 34673 }; 34674 t['J'] = { 34675 id: _util.OPS.setLineCap, 34676 numArgs: 1, 34677 variableArgs: false 34678 }; 34679 t['j'] = { 34680 id: _util.OPS.setLineJoin, 34681 numArgs: 1, 34682 variableArgs: false 34683 }; 34684 t['M'] = { 34685 id: _util.OPS.setMiterLimit, 34686 numArgs: 1, 34687 variableArgs: false 34688 }; 34689 t['d'] = { 34690 id: _util.OPS.setDash, 34691 numArgs: 2, 34692 variableArgs: false 34693 }; 34694 t['ri'] = { 34695 id: _util.OPS.setRenderingIntent, 34696 numArgs: 1, 34697 variableArgs: false 34698 }; 34699 t['i'] = { 34700 id: _util.OPS.setFlatness, 34701 numArgs: 1, 34702 variableArgs: false 34703 }; 34704 t['gs'] = { 34705 id: _util.OPS.setGState, 34706 numArgs: 1, 34707 variableArgs: false 34708 }; 34709 t['q'] = { 34710 id: _util.OPS.save, 34711 numArgs: 0, 34712 variableArgs: false 34713 }; 34714 t['Q'] = { 34715 id: _util.OPS.restore, 34716 numArgs: 0, 34717 variableArgs: false 34718 }; 34719 t['cm'] = { 34720 id: _util.OPS.transform, 34721 numArgs: 6, 34722 variableArgs: false 34723 }; 34724 t['m'] = { 34725 id: _util.OPS.moveTo, 34726 numArgs: 2, 34727 variableArgs: false 34728 }; 34729 t['l'] = { 34730 id: _util.OPS.lineTo, 34731 numArgs: 2, 34732 variableArgs: false 34733 }; 34734 t['c'] = { 34735 id: _util.OPS.curveTo, 34736 numArgs: 6, 34737 variableArgs: false 34738 }; 34739 t['v'] = { 34740 id: _util.OPS.curveTo2, 34741 numArgs: 4, 34742 variableArgs: false 34743 }; 34744 t['y'] = { 34745 id: _util.OPS.curveTo3, 34746 numArgs: 4, 34747 variableArgs: false 34748 }; 34749 t['h'] = { 34750 id: _util.OPS.closePath, 34751 numArgs: 0, 34752 variableArgs: false 34753 }; 34754 t['re'] = { 34755 id: _util.OPS.rectangle, 34756 numArgs: 4, 34757 variableArgs: false 34758 }; 34759 t['S'] = { 34760 id: _util.OPS.stroke, 34761 numArgs: 0, 34762 variableArgs: false 34763 }; 34764 t['s'] = { 34765 id: _util.OPS.closeStroke, 34766 numArgs: 0, 34767 variableArgs: false 34768 }; 34769 t['f'] = { 34770 id: _util.OPS.fill, 34771 numArgs: 0, 34772 variableArgs: false 34773 }; 34774 t['F'] = { 34775 id: _util.OPS.fill, 34776 numArgs: 0, 34777 variableArgs: false 34778 }; 34779 t['f*'] = { 34780 id: _util.OPS.eoFill, 34781 numArgs: 0, 34782 variableArgs: false 34783 }; 34784 t['B'] = { 34785 id: _util.OPS.fillStroke, 34786 numArgs: 0, 34787 variableArgs: false 34788 }; 34789 t['B*'] = { 34790 id: _util.OPS.eoFillStroke, 34791 numArgs: 0, 34792 variableArgs: false 34793 }; 34794 t['b'] = { 34795 id: _util.OPS.closeFillStroke, 34796 numArgs: 0, 34797 variableArgs: false 34798 }; 34799 t['b*'] = { 34800 id: _util.OPS.closeEOFillStroke, 34801 numArgs: 0, 34802 variableArgs: false 34803 }; 34804 t['n'] = { 34805 id: _util.OPS.endPath, 34806 numArgs: 0, 34807 variableArgs: false 34808 }; 34809 t['W'] = { 34810 id: _util.OPS.clip, 34811 numArgs: 0, 34812 variableArgs: false 34813 }; 34814 t['W*'] = { 34815 id: _util.OPS.eoClip, 34816 numArgs: 0, 34817 variableArgs: false 34818 }; 34819 t['BT'] = { 34820 id: _util.OPS.beginText, 34821 numArgs: 0, 34822 variableArgs: false 34823 }; 34824 t['ET'] = { 34825 id: _util.OPS.endText, 34826 numArgs: 0, 34827 variableArgs: false 34828 }; 34829 t['Tc'] = { 34830 id: _util.OPS.setCharSpacing, 34831 numArgs: 1, 34832 variableArgs: false 34833 }; 34834 t['Tw'] = { 34835 id: _util.OPS.setWordSpacing, 34836 numArgs: 1, 34837 variableArgs: false 34838 }; 34839 t['Tz'] = { 34840 id: _util.OPS.setHScale, 34841 numArgs: 1, 34842 variableArgs: false 34843 }; 34844 t['TL'] = { 34845 id: _util.OPS.setLeading, 34846 numArgs: 1, 34847 variableArgs: false 34848 }; 34849 t['Tf'] = { 34850 id: _util.OPS.setFont, 34851 numArgs: 2, 34852 variableArgs: false 34853 }; 34854 t['Tr'] = { 34855 id: _util.OPS.setTextRenderingMode, 34856 numArgs: 1, 34857 variableArgs: false 34858 }; 34859 t['Ts'] = { 34860 id: _util.OPS.setTextRise, 34861 numArgs: 1, 34862 variableArgs: false 34863 }; 34864 t['Td'] = { 34865 id: _util.OPS.moveText, 34866 numArgs: 2, 34867 variableArgs: false 34868 }; 34869 t['TD'] = { 34870 id: _util.OPS.setLeadingMoveText, 34871 numArgs: 2, 34872 variableArgs: false 34873 }; 34874 t['Tm'] = { 34875 id: _util.OPS.setTextMatrix, 34876 numArgs: 6, 34877 variableArgs: false 34878 }; 34879 t['T*'] = { 34880 id: _util.OPS.nextLine, 34881 numArgs: 0, 34882 variableArgs: false 34883 }; 34884 t['Tj'] = { 34885 id: _util.OPS.showText, 34886 numArgs: 1, 34887 variableArgs: false 34888 }; 34889 t['TJ'] = { 34890 id: _util.OPS.showSpacedText, 34891 numArgs: 1, 34892 variableArgs: false 34893 }; 34894 t['\''] = { 34895 id: _util.OPS.nextLineShowText, 34896 numArgs: 1, 34897 variableArgs: false 34898 }; 34899 t['"'] = { 34900 id: _util.OPS.nextLineSetSpacingShowText, 34901 numArgs: 3, 34902 variableArgs: false 34903 }; 34904 t['d0'] = { 34905 id: _util.OPS.setCharWidth, 34906 numArgs: 2, 34907 variableArgs: false 34908 }; 34909 t['d1'] = { 34910 id: _util.OPS.setCharWidthAndBounds, 34911 numArgs: 6, 34912 variableArgs: false 34913 }; 34914 t['CS'] = { 34915 id: _util.OPS.setStrokeColorSpace, 34916 numArgs: 1, 34917 variableArgs: false 34918 };
34919 t['cs'] = { 34920 id: _util.OPS.setFillColorSpace, 34921 numArgs: 1, 34922 variableArgs: false 34923 }; 34924 t['SC'] = { 34925 id: _util.OPS.setStrokeColor, 34926 numArgs: 4, 34927 variableArgs: true 34928 }; 34929 t['SCN'] = { 34930 id: _util.OPS.setStrokeColorN, 34931 numArgs: 33, 34932 variableArgs: true 34933 }; 34934 t['sc'] = { 34935 id: _util.OPS.setFillColor, 34936 numArgs: 4, 34937 variableArgs: true 34938 }; 34939 t['scn'] = { 34940 id: _util.OPS.setFillColorN, 34941 numArgs: 33, 34942 variableArgs: true 34943 }; 34944 t['G'] = { 34945 id: _util.OPS.setStrokeGray, 34946 numArgs: 1, 34947 variableArgs: false 34948 }; 34949 t['g'] = { 34950 id: _util.OPS.setFillGray, 34951 numArgs: 1, 34952 variableArgs: false 34953 }; 34954 t['RG'] = { 34955 id: _util.OPS.setStrokeRGBColor, 34956 numArgs: 3, 34957 variableArgs: false 34958 }; 34959 t['rg'] = { 34960 id: _util.OPS.setFillRGBColor, 34961 numArgs: 3, 34962 variableArgs: false 34963 }; 34964 t['K'] = { 34965 id: _util.OPS.setStrokeCMYKColor, 34966 numArgs: 4, 34967 variableArgs: false 34968 }; 34969 t['k'] = { 34970 id: _util.OPS.setFillCMYKColor, 34971 numArgs: 4, 34972 variableArgs: false 34973 }; 34974 t['sh'] = { 34975 id: _util.OPS.shadingFill, 34976 numArgs: 1, 34977 variableArgs: false 34978 }; 34979 t['BI'] = { 34980 id: _util.OPS.beginInlineImage, 34981 numArgs: 0, 34982 variableArgs: false 34983 }; 34984 t['ID'] = { 34985 id: _util.OPS.beginImageData, 34986 numArgs: 0, 34987 variableArgs: false 34988 }; 34989 t['EI'] = { 34990 id: _util.OPS.endInlineImage, 34991 numArgs: 1, 34992 variableArgs: false 34993 }; 34994 t['Do'] = { 34995 id: _util.OPS.paintXObject, 34996 numArgs: 1, 34997 variableArgs: false 34998 }; 34999 t['MP'] = { 35000 id: _util.OPS.markPoint, 35001 numArgs: 1, 35002 variableArgs: false 35003 }; 35004 t['DP'] = { 35005 id: _util.OPS.markPointProps, 35006 numArgs: 2, 35007 variableArgs: false 35008 }; 35009 t['BMC'] = { 35010 id: _util.OPS.beginMarkedContent, 35011 numArgs: 1, 35012 variableArgs: false 35013 }; 35014 t['BDC'] = { 35015 id: _util.OPS.beginMarkedContentProps, 35016 numArgs: 2, 35017 variableArgs: false 35018 }; 35019 t['EMC'] = { 35020 id: _util.OPS.endMarkedContent, 35021 numArgs: 0, 35022 variableArgs: false 35023 }; 35024 t['BX'] = { 35025 id: _util.OPS.beginCompat, 35026 numArgs: 0, 35027 variableArgs: false 35028 }; 35029 t['EX'] = { 35030 id: _util.OPS.endCompat, 35031 numArgs: 0, 35032 variableArgs: false 35033 }; 35034 t['BM'] = null; 35035 t['BD'] = null; 35036 t['true'] = null; 35037 t['fa'] = null; 35038 t['fal'] = null; 35039 t['fals'] = null; 35040 t['false'] = null; 35041 t['nu'] = null; 35042 t['nul'] = null; 35043 t['null'] = null; 35044 }); 35045 function EvaluatorPreprocessor(stream, xref, stateManager) { 35046 this.opMap = getOPMap(); 35047 this.parser = new _parser.Parser(new _parser.Lexer(stream, this.opMap), false, xref); 35048 this.stateManager = stateManager; 35049 this.nonProcessedArgs = []; 35050 } 35051 EvaluatorPreprocessor.prototype = { 35052 get savedStatesDepth() { 35053 return this.stateManager.stateStack.length; 35054 }, 35055 read: function EvaluatorPreprocessor_read(operation) { 35056 var args = operation.args; 35057 while (true) { 35058 var obj = this.parser.getObj(); 35059 if ((0, _primitives.isCmd)(obj)) { 35060 var cmd = obj.cmd; 35061 var opSpec = this.opMap[cmd]; 35062 if (!opSpec) { 35063 (0, _util.warn)('Unknown command "' + cmd + '"'); 35064 continue; 35065 } 35066 var fn = opSpec.id; 35067 var numArgs = opSpec.numArgs; 35068 var argsLength = args !== null ? args.length : 0; 35069 if (!opSpec.variableArgs) { 35070 if (argsLength !== numArgs) { 35071 var nonProcessedArgs = this.nonProcessedArgs; 35072 while (argsLength > numArgs) { 35073 nonProcessedArgs.push(args.shift()); 35074 argsLength--; 35075 } 35076 while (argsLength < numArgs && nonProcessedArgs.length !== 0) { 35077 if (args === null) { 35078 args = []; 35079 } 35080 args.unshift(nonProcessedArgs.pop()); 35081 argsLength++; 35082 } 35083 } 35084 if (argsLength < numArgs) { 35085 (0, _util.warn)('Skipping command ' + fn + ': expected ' + numArgs + ' args, but received ' + argsLength + ' args.'); 35086 if (args !== null) { 35087 args.length = 0; 35088 } 35089 continue; 35090 } 35091 } else if (argsLength > numArgs) { 35092 (0, _util.info)('Command ' + fn + ': expected [0,' + numArgs + '] args, but received ' + argsLength + ' args.'); 35093 } 35094 this.preprocessCommand(fn, args); 35095 operation.fn = fn; 35096 operation.args = args; 35097 return true; 35098 } 35099 if ((0, _primitives.isEOF)(obj)) { 35100 return false; 35101 } 35102 if (obj !== null) { 35103 if (args === null) { 35104 args = []; 35105 } 35106 args.push(obj); 35107 if (args.length > 33) { 35108 throw new _util.FormatError('Too many arguments'); 35109 } 35110 } 35111 } 35112 }, 35113 preprocessCommand: function EvaluatorPreprocessor_preprocessCommand(fn, args) { 35114 switch (fn | 0) { 35115 case _util.OPS.save: 35116 this.stateManager.save(); 35117 break; 35118 case _util.OPS.restore:
35119 this.stateManager.restore(); 35120 break; 35121 case _util.OPS.transform: 35122 this.stateManager.transform(args); 35123 break; 35124 } 35125 } 35126 }; 35127 return EvaluatorPreprocessor; 35128}(); 35129exports.PartialEvaluator = PartialEvaluator; 35130 35131/***/ }), 35132/* 136 */ 35133/***/ (function(module, exports, __w_pdfjs_require__) { 35134 35135"use strict"; 35136 35137 35138Object.defineProperty(exports, "__esModule", { 35139 value: true 35140}); 35141exports.CMapFactory = exports.IdentityCMap = exports.CMap = undefined; 35142 35143var _util = __w_pdfjs_require__(0); 35144 35145var _primitives = __w_pdfjs_require__(1); 35146 35147var _parser = __w_pdfjs_require__(26); 35148 35149var _stream = __w_pdfjs_require__(2); 35150 35151var BUILT_IN_CMAPS = ['Adobe-GB1-UCS2', 'Adobe-CNS1-UCS2', 'Adobe-Japan1-UCS2', 'Adobe-Korea1-UCS2', '78-EUC-H', '78-EUC-V', '78-H', '78-RKSJ-H', '78-RKSJ-V', '78-V', '78ms-RKSJ-H', '78ms-RKSJ-V', '83pv-RKSJ-H', '90ms-RKSJ-H', '90ms-RKSJ-V', '90msp-RKSJ-H', '90msp-RKSJ-V', '90pv-RKSJ-H', '90pv-RKSJ-V', 'Add-H', 'Add-RKSJ-H', 'Add-RKSJ-V', 'Add-V', 'Adobe-CNS1-0', 'Adobe-CNS1-1', 'Adobe-CNS1-2', 'Adobe-CNS1-3', 'Adobe-CNS1-4', 'Adobe-CNS1-5', 'Adobe-CNS1-6', 'Adobe-GB1-0', 'Adobe-GB1-1', 'Adobe-GB1-2', 'Adobe-GB1-3', 'Adobe-GB1-4', 'Adobe-GB1-5', 'Adobe-Japan1-0', 'Adobe-Japan1-1', 'Adobe-Japan1-2', 'Adobe-Japan1-3', 'Adobe-Japan1-4', 'Adobe-Japan1-5', 'Adobe-Japan1-6', 'Adobe-Korea1-0', 'Adobe-Korea1-1', 'Adobe-Korea1-2', 'B5-H', 'B5-V', 'B5pc-H', 'B5pc-V', 'CNS-EUC-H', 'CNS-EUC-V', 'CNS1-H', 'CNS1-V', 'CNS2-H', 'CNS2-V', 'ETHK-B5-H', 'ETHK-B5-V', 'ETen-B5-H', 'ETen-B5-V', 'ETenms-B5-H', 'ETenms-B5-V', 'EUC-H', 'EUC-V', 'Ext-H', 'Ext-RKSJ-H', 'Ext-RKSJ-V', 'Ext-V', 'GB-EUC-H', 'GB-EUC-V', 'GB-H', 'GB-V', 'GBK-EUC-H', 'GBK-EUC-V', 'GBK2K-H', 'GBK2K-V', 'GBKp-EUC-H', 'GBKp-EUC-V', 'GBT-EUC-H', 'GBT-EUC-V', 'GBT-H', 'GBT-V', 'GBTpc-EUC-H', 'GBTpc-EUC-V', 'GBpc-EUC-H', 'GBpc-EUC-V', 'H', 'HKdla-B5-H', 'HKdla-B5-V', 'HKdlb-B5-H', 'HKdlb-B5-V', 'HKgccs-B5-H', 'HKgccs-B5-V', 'HKm314-B5-H', 'HKm314-B5-V', 'HKm471-B5-H', 'HKm471-B5-V', 'HKscs-B5-H', 'HKscs-B5-V', 'Hankaku', 'Hiragana', 'KSC-EUC-H', 'KSC-EUC-V', 'KSC-H', 'KSC-Johab-H', 'KSC-Johab-V', 'KSC-V', 'KSCms-UHC-H', 'KSCms-UHC-HW-H', 'KSCms-UHC-HW-V', 'KSCms-UHC-V', 'KSCpc-EUC-H', 'KSCpc-EUC-V', 'Katakana', 'NWP-H', 'NWP-V', 'RKSJ-H', 'RKSJ-V', 'Roman', 'UniCNS-UCS2-H', 'UniCNS-UCS2-V', 'UniCNS-UTF16-H', 'UniCNS-UTF16-V', 'UniCNS-UTF32-H', 'UniCNS-UTF32-V', 'UniCNS-UTF8-H', 'UniCNS-UTF8-V', 'UniGB-UCS2-H', 'UniGB-UCS2-V', 'UniGB-UTF16-H', 'UniGB-UTF16-V', 'UniGB-UTF32-H', 'UniGB-UTF32-V', 'UniGB-UTF8-H', 'UniGB-UTF8-V', 'UniJIS-UCS2-H', 'UniJIS-UCS2-HW-H', 'UniJIS-UCS2-HW-V', 'UniJIS-UCS2-V', 'UniJIS-UTF16-H', 'UniJIS-UTF16-V', 'UniJIS-UTF32-H', 'UniJIS-UTF32-V', 'UniJIS-UTF8-H', 'UniJIS-UTF8-V', 'UniJIS2004-UTF16-H', 'UniJIS2004-UTF16-V', 'UniJIS2004-UTF32-H', 'UniJIS2004-UTF32-V', 'UniJIS2004-UTF8-H', 'UniJIS2004-UTF8-V', 'UniJISPro-UCS2-HW-V', 'UniJISPro-UCS2-V', 'UniJISPro-UTF8-V', 'UniJISX0213-UTF32-H', 'UniJISX0213-UTF32-V', 'UniJISX02132004-UTF32-H', 'UniJISX02132004-UTF32-V', 'UniKS-UCS2-H', 'UniKS-UCS2-V', 'UniKS-UTF16-H', 'UniKS-UTF16-V', 'UniKS-UTF32-H', 'UniKS-UTF32-V', 'UniKS-UTF8-H', 'UniKS-UTF8-V', 'V', 'WP-Symbol']; 35152var CMap = function CMapClosure() { 35153 function CMap(builtInCMap) { 35154 this.codespaceRanges = [[], [], [], []]; 35155 this.numCodespaceRanges = 0; 35156 this._map = []; 35157 this.name = ''; 35158 this.vertical = false; 35159 this.useCMap = null; 35160 this.builtInCMap = builtInCMap; 35161 } 35162 CMap.prototype = { 35163 addCodespaceRange: function addCodespaceRange(n, low, high) { 35164 this.codespaceRanges[n - 1].push(low, high); 35165 this.numCodespaceRanges++; 35166 }, 35167 mapCidRange: function mapCidRange(low, high, dstLow) { 35168 while (low <= high) { 35169 this._map[low++] = dstLow++; 35170 } 35171 }, 35172 mapBfRange: function mapBfRange(low, high, dstLow) { 35173 var lastByte = dstLow.length - 1; 35174 while (low <= high) { 35175 this._map[low++] = dstLow; 35176 dstLow = dstLow.substr(0, lastByte) + String.fromCharCode(dstLow.charCodeAt(lastByte) + 1); 35177 } 35178 }, 35179 mapBfRangeToArray: function mapBfRangeToArray(low, high, array) { 35180 var i = 0, 35181 ii = array.length; 35182 while (low <= high && i < ii) { 35183 this._map[low] = array[i++]; 35184 ++low; 35185 } 35186 }, 35187 mapOne: function mapOne(src, dst) { 35188 this._map[src] = dst; 35189 }, 35190 lookup: function lookup(code) { 35191 return this._map[code]; 35192 }, 35193 contains: function contains(code) { 35194 return this._map[code] !== undefined; 35195 },
35196 forEach: function forEach(callback) { 35197 var map = this._map; 35198 var length = map.length; 35199 if (length <= 0x10000) { 35200 for (var i = 0; i < length; i++) { 35201 if (map[i] !== undefined) { 35202 callback(i, map[i]); 35203 } 35204 } 35205 } else { 35206 for (var _i in map) { 35207 callback(_i, map[_i]); 35208 } 35209 } 35210 }, 35211 charCodeOf: function charCodeOf(value) { 35212 var map = this._map; 35213 if (map.length <= 0x10000) { 35214 return map.indexOf(value); 35215 } 35216 for (var charCode in map) { 35217 if (map[charCode] === value) { 35218 return charCode | 0; 35219 } 35220 } 35221 return -1; 35222 }, 35223 getMap: function getMap() { 35224 return this._map; 35225 }, 35226 readCharCode: function readCharCode(str, offset, out) { 35227 var c = 0; 35228 var codespaceRanges = this.codespaceRanges; 35229 var codespaceRangesLen = this.codespaceRanges.length; 35230 for (var n = 0; n < codespaceRangesLen; n++) { 35231 c = (c << 8 | str.charCodeAt(offset + n)) >>> 0; 35232 var codespaceRange = codespaceRanges[n]; 35233 for (var k = 0, kk = codespaceRange.length; k < kk;) { 35234 var low = codespaceRange[k++]; 35235 var high = codespaceRange[k++]; 35236 if (c >= low && c <= high) {
vendor: 11,169 bytes, lines 35237-35576
35237 out.charcode = c; 35238 out.length = n + 1; 35239 return; 35240 } 35241 } 35242 } 35243 out.charcode = 0; 35244 out.length = 1; 35245 }, 35246 35247 get length() { 35248 return this._map.length; 35249 }, 35250 get isIdentityCMap() { 35251 if (!(this.name === 'Identity-H' || this.name === 'Identity-V')) { 35252 return false; 35253 } 35254 if (this._map.length !== 0x10000) { 35255 return false; 35256 } 35257 for (var i = 0; i < 0x10000; i++) { 35258 if (this._map[i] !== i) { 35259 return false; 35260 } 35261 } 35262 return true; 35263 } 35264 }; 35265 return CMap; 35266}(); 35267var IdentityCMap = function IdentityCMapClosure() { 35268 function IdentityCMap(vertical, n) { 35269 CMap.call(this); 35270 this.vertical = vertical; 35271 this.addCodespaceRange(n, 0, 0xffff); 35272 } 35273 _util.Util.inherit(IdentityCMap, CMap, {}); 35274 IdentityCMap.prototype = { 35275 addCodespaceRange: CMap.prototype.addCodespaceRange, 35276 mapCidRange: function mapCidRange(low, high, dstLow) { 35277 (0, _util.unreachable)('should not call mapCidRange'); 35278 }, 35279 mapBfRange: function mapBfRange(low, high, dstLow) { 35280 (0, _util.unreachable)('should not call mapBfRange'); 35281 }, 35282 mapBfRangeToArray: function mapBfRangeToArray(low, high, array) { 35283 (0, _util.unreachable)('should not call mapBfRangeToArray'); 35284 }, 35285 mapOne: function mapOne(src, dst) { 35286 (0, _util.unreachable)('should not call mapCidOne'); 35287 }, 35288 lookup: function lookup(code) { 35289 return Number.isInteger(code) && code <= 0xffff ? code : undefined; 35290 }, 35291 contains: function contains(code) { 35292 return Number.isInteger(code) && code <= 0xffff; 35293 }, 35294 forEach: function forEach(callback) { 35295 for (var i = 0; i <= 0xffff; i++) { 35296 callback(i, i); 35297 } 35298 }, 35299 charCodeOf: function charCodeOf(value) { 35300 return Number.isInteger(value) && value <= 0xffff ? value : -1; 35301 }, 35302 getMap: function getMap() { 35303 var map = new Array(0x10000); 35304 for (var i = 0; i <= 0xffff; i++) { 35305 map[i] = i; 35306 } 35307 return map; 35308 }, 35309 35310 readCharCode: CMap.prototype.readCharCode, 35311 get length() { 35312 return 0x10000; 35313 }, 35314 get isIdentityCMap() { 35315 (0, _util.unreachable)('should not access .isIdentityCMap'); 35316 } 35317 }; 35318 return IdentityCMap; 35319}(); 35320var BinaryCMapReader = function BinaryCMapReaderClosure() { 35321 function hexToInt(a, size) { 35322 var n = 0; 35323 for (var i = 0; i <= size; i++) { 35324 n = n << 8 | a[i]; 35325 } 35326 return n >>> 0; 35327 } 35328 function hexToStr(a, size) { 35329 if (size === 1) { 35330 return String.fromCharCode(a[0], a[1]); 35331 } 35332 if (size === 3) { 35333 return String.fromCharCode(a[0], a[1], a[2], a[3]); 35334 } 35335 return String.fromCharCode.apply(null, a.subarray(0, size + 1)); 35336 } 35337 function addHex(a, b, size) { 35338 var c = 0; 35339 for (var i = size; i >= 0; i--) { 35340 c += a[i] + b[i]; 35341 a[i] = c & 255; 35342 c >>= 8; 35343 } 35344 } 35345 function incHex(a, size) { 35346 var c = 1; 35347 for (var i = size; i >= 0 && c > 0; i--) { 35348 c += a[i]; 35349 a[i] = c & 255; 35350 c >>= 8; 35351 } 35352 } 35353 var MAX_NUM_SIZE = 16; 35354 var MAX_ENCODED_NUM_SIZE = 19; 35355 function BinaryCMapStream(data) { 35356 this.buffer = data; 35357 this.pos = 0; 35358 this.end = data.length; 35359 this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE); 35360 } 35361 BinaryCMapStream.prototype = { 35362 readByte: function readByte() { 35363 if (this.pos >= this.end) { 35364 return -1; 35365 } 35366 return this.buffer[this.pos++]; 35367 }, 35368 readNumber: function readNumber() { 35369 var n = 0; 35370 var last; 35371 do { 35372 var b = this.readByte(); 35373 if (b < 0) { 35374 throw new _util.FormatError('unexpected EOF in bcmap'); 35375 } 35376 last = !(b & 0x80); 35377 n = n << 7 | b & 0x7F; 35378 } while (!last); 35379 return n; 35380 }, 35381 readSigned: function readSigned() { 35382 var n = this.readNumber(); 35383 return n & 1 ? ~(n >>> 1) : n >>> 1; 35384 }, 35385 readHex: function readHex(num, size) { 35386 num.set(this.buffer.subarray(this.pos, this.pos + size + 1)); 35387 this.pos += size + 1; 35388 }, 35389 readHexNumber: function readHexNumber(num, size) { 35390 var last; 35391 var stack = this.tmpBuf, 35392 sp = 0; 35393 do { 35394 var b = this.readByte(); 35395 if (b < 0) { 35396 throw new _util.FormatError('unexpected EOF in bcmap'); 35397 } 35398 last = !(b & 0x80); 35399 stack[sp++] = b & 0x7F; 35400 } while (!last); 35401 var i = size, 35402 buffer = 0, 35403 bufferSize = 0; 35404 while (i >= 0) { 35405 while (bufferSize < 8 && stack.length > 0) { 35406 buffer = stack[--sp] << bufferSize | buffer; 35407 bufferSize += 7; 35408 } 35409 num[i] = buffer & 255; 35410 i--; 35411 buffer >>= 8; 35412 bufferSize -= 8; 35413 } 35414 }, 35415 readHexSigned: function readHexSigned(num, size) { 35416 this.readHexNumber(num, size); 35417 var sign = num[size] & 1 ? 255 : 0; 35418 var c = 0; 35419 for (var i = 0; i <= size; i++) { 35420 c = (c & 1) << 8 | num[i]; 35421 num[i] = c >> 1 ^ sign; 35422 } 35423 }, 35424 readString: function readString() { 35425 var len = this.readNumber(); 35426 var s = ''; 35427 for (var i = 0; i < len; i++) { 35428 s += String.fromCharCode(this.readNumber()); 35429 } 35430 return s; 35431 } 35432 }; 35433 function processBinaryCMap(data, cMap, extend) { 35434 return new Promise(function (resolve, reject) { 35435 var stream = new BinaryCMapStream(data); 35436 var header = stream.readByte(); 35437 cMap.vertical = !!(header & 1); 35438 var useCMap = null; 35439 var start = new Uint8Array(MAX_NUM_SIZE); 35440 var end = new Uint8Array(MAX_NUM_SIZE); 35441 var char = new Uint8Array(MAX_NUM_SIZE); 35442 var charCode = new Uint8Array(MAX_NUM_SIZE); 35443 var tmp = new Uint8Array(MAX_NUM_SIZE); 35444 var code; 35445 var b; 35446 while ((b = stream.readByte()) >= 0) { 35447 var type = b >> 5; 35448 if (type === 7) { 35449 switch (b & 0x1F) { 35450 case 0: 35451 stream.readString(); 35452 break; 35453 case 1: 35454 useCMap = stream.readString(); 35455 break; 35456 } 35457 continue; 35458 } 35459 var sequence = !!(b & 0x10); 35460 var dataSize = b & 15; 35461 if (dataSize + 1 > MAX_NUM_SIZE) { 35462 throw new Error('processBinaryCMap: Invalid dataSize.'); 35463 } 35464 var ucs2DataSize = 1; 35465 var subitemsCount = stream.readNumber(); 35466 var i; 35467 switch (type) { 35468 case 0: 35469 stream.readHex(start, dataSize); 35470 stream.readHexNumber(end, dataSize); 35471 addHex(end, start, dataSize); 35472 cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); 35473 for (i = 1; i < subitemsCount; i++) { 35474 incHex(end, dataSize); 35475 stream.readHexNumber(start, dataSize); 35476 addHex(start, end, dataSize); 35477 stream.readHexNumber(end, dataSize); 35478 addHex(end, start, dataSize); 35479 cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); 35480 } 35481 break; 35482 case 1: 35483 stream.readHex(start, dataSize); 35484 stream.readHexNumber(end, dataSize); 35485 addHex(end, start, dataSize); 35486 stream.readNumber(); 35487 for (i = 1; i < subitemsCount; i++) { 35488 incHex(end, dataSize); 35489 stream.readHexNumber(start, dataSize); 35490 addHex(start, end, dataSize); 35491 stream.readHexNumber(end, dataSize); 35492 addHex(end, start, dataSize); 35493 stream.readNumber(); 35494 } 35495 break; 35496 case 2: 35497 stream.readHex(char, dataSize); 35498 code = stream.readNumber(); 35499 cMap.mapOne(hexToInt(char, dataSize), code); 35500 for (i = 1; i < subitemsCount; i++) { 35501 incHex(char, dataSize); 35502 if (!sequence) { 35503 stream.readHexNumber(tmp, dataSize); 35504 addHex(char, tmp, dataSize); 35505 } 35506 code = stream.readSigned() + (code + 1); 35507 cMap.mapOne(hexToInt(char, dataSize), code); 35508 } 35509 break; 35510 case 3: 35511 stream.readHex(start, dataSize); 35512 stream.readHexNumber(end, dataSize); 35513 addHex(end, start, dataSize); 35514 code = stream.readNumber(); 35515 cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); 35516 for (i = 1; i < subitemsCount; i++) { 35517 incHex(end, dataSize); 35518 if (!sequence) { 35519 stream.readHexNumber(start, dataSize); 35520 addHex(start, end, dataSize); 35521 } else { 35522 start.set(end); 35523 } 35524 stream.readHexNumber(end, dataSize); 35525 addHex(end, start, dataSize); 35526 code = stream.readNumber(); 35527 cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); 35528 } 35529 break; 35530 case 4: 35531 stream.readHex(char, ucs2DataSize); 35532 stream.readHex(charCode, dataSize); 35533 cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); 35534 for (i = 1; i < subitemsCount; i++) { 35535 incHex(char, ucs2DataSize); 35536 if (!sequence) { 35537 stream.readHexNumber(tmp, ucs2DataSize); 35538 addHex(char, tmp, ucs2DataSize); 35539 } 35540 incHex(charCode, dataSize); 35541 stream.readHexSigned(tmp, dataSize); 35542 addHex(charCode, tmp, dataSize); 35543 cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); 35544 } 35545 break; 35546 case 5: 35547 stream.readHex(start, ucs2DataSize); 35548 stream.readHexNumber(end, ucs2DataSize); 35549 addHex(end, start, ucs2DataSize); 35550 stream.readHex(charCode, dataSize); 35551 cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); 35552 for (i = 1; i < subitemsCount; i++) { 35553 incHex(end, ucs2DataSize); 35554 if (!sequence) { 35555 stream.readHexNumber(start, ucs2DataSize); 35556 addHex(start, end, ucs2DataSize); 35557 } else { 35558 start.set(end); 35559 } 35560 stream.readHexNumber(end, ucs2DataSize); 35561 addHex(end, start, ucs2DataSize); 35562 stream.readHex(charCode, dataSize); 35563 cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); 35564 } 35565 break; 35566 default: 35567 reject(new Error('processBinaryCMap: Unknown type: ' + type)); 35568 return; 35569 } 35570 } 35571 if (useCMap) { 35572 resolve(extend(useCMap)); 35573 return; 35574 } 35575 resolve(cMap); 35576 });
35577 } 35578 function BinaryCMapReader() {} 35579 BinaryCMapReader.prototype = { process: processBinaryCMap }; 35580 return BinaryCMapReader; 35581}(); 35582var CMapFactory = function CMapFactoryClosure() { 35583 function strToInt(str) { 35584 var a = 0; 35585 for (var i = 0; i < str.length; i++) { 35586 a = a << 8 | str.charCodeAt(i); 35587 } 35588 return a >>> 0; 35589 } 35590 function expectString(obj) { 35591 if (!(0, _util.isString)(obj)) { 35592 throw new _util.FormatError('Malformed CMap: expected string.'); 35593 } 35594 } 35595 function expectInt(obj) { 35596 if (!Number.isInteger(obj)) { 35597 throw new _util.FormatError('Malformed CMap: expected int.'); 35598 } 35599 } 35600 function parseBfChar(cMap, lexer) { 35601 while (true) { 35602 var obj = lexer.getObj(); 35603 if ((0, _primitives.isEOF)(obj)) { 35604 break; 35605 } 35606 if ((0, _primitives.isCmd)(obj, 'endbfchar')) { 35607 return; 35608 } 35609 expectString(obj); 35610 var src = strToInt(obj); 35611 obj = lexer.getObj(); 35612 expectString(obj); 35613 var dst = obj; 35614 cMap.mapOne(src, dst); 35615 } 35616 } 35617 function parseBfRange(cMap, lexer) { 35618 while (true) { 35619 var obj = lexer.getObj(); 35620 if ((0, _primitives.isEOF)(obj)) { 35621 break; 35622 } 35623 if ((0, _primitives.isCmd)(obj, 'endbfrange')) { 35624 return; 35625 } 35626 expectString(obj); 35627 var low = strToInt(obj); 35628 obj = lexer.getObj(); 35629 expectString(obj); 35630 var high = strToInt(obj); 35631 obj = lexer.getObj(); 35632 if (Number.isInteger(obj) || (0, _util.isString)(obj)) { 35633 var dstLow = Number.isInteger(obj) ? String.fromCharCode(obj) : obj; 35634 cMap.mapBfRange(low, high, dstLow); 35635 } else if ((0, _primitives.isCmd)(obj, '[')) { 35636 obj = lexer.getObj(); 35637 var array = []; 35638 while (!(0, _primitives.isCmd)(obj, ']') && !(0, _primitives.isEOF)(obj)) { 35639 array.push(obj); 35640 obj = lexer.getObj(); 35641 } 35642 cMap.mapBfRangeToArray(low, high, array); 35643 } else { 35644 break; 35645 } 35646 } 35647 throw new _util.FormatError('Invalid bf range.'); 35648 } 35649 function parseCidChar(cMap, lexer) { 35650 while (true) { 35651 var obj = lexer.getObj(); 35652 if ((0, _primitives.isEOF)(obj)) { 35653 break; 35654 } 35655 if ((0, _primitives.isCmd)(obj, 'endcidchar')) { 35656 return; 35657 } 35658 expectString(obj); 35659 var src = strToInt(obj); 35660 obj = lexer.getObj(); 35661 expectInt(obj); 35662 var dst = obj; 35663 cMap.mapOne(src, dst); 35664 } 35665 } 35666 function parseCidRange(cMap, lexer) { 35667 while (true) { 35668 var obj = lexer.getObj(); 35669 if ((0, _primitives.isEOF)(obj)) { 35670 break; 35671 } 35672 if ((0, _primitives.isCmd)(obj, 'endcidrange')) { 35673 return; 35674 } 35675 expectString(obj); 35676 var low = strToInt(obj); 35677 obj = lexer.getObj(); 35678 expectString(obj); 35679 var high = strToInt(obj); 35680 obj = lexer.getObj(); 35681 expectInt(obj); 35682 var dstLow = obj; 35683 cMap.mapCidRange(low, high, dstLow); 35684 } 35685 } 35686 function parseCodespaceRange(cMap, lexer) { 35687 while (true) { 35688 var obj = lexer.getObj(); 35689 if ((0, _primitives.isEOF)(obj)) { 35690 break; 35691 } 35692 if ((0, _primitives.isCmd)(obj, 'endcodespacerange')) { 35693 return; 35694 } 35695 if (!(0, _util.isString)(obj)) { 35696 break; 35697 } 35698 var low = strToInt(obj); 35699 obj = lexer.getObj(); 35700 if (!(0, _util.isString)(obj)) { 35701 break; 35702 } 35703 var high = strToInt(obj); 35704 cMap.addCodespaceRange(obj.length, low, high); 35705 } 35706 throw new _util.FormatError('Invalid codespace range.'); 35707 } 35708 function parseWMode(cMap, lexer) { 35709 var obj = lexer.getObj(); 35710 if (Number.isInteger(obj)) { 35711 cMap.vertical = !!obj; 35712 } 35713 } 35714 function parseCMapName(cMap, lexer) { 35715 var obj = lexer.getObj(); 35716 if ((0, _primitives.isName)(obj) && (0, _util.isString)(obj.name)) { 35717 cMap.name = obj.name; 35718 } 35719 } 35720 function parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap) { 35721 var previous; 35722 var embededUseCMap; 35723 objLoop: while (true) {
35724 try { 35725 var obj = lexer.getObj(); 35726 if ((0, _primitives.isEOF)(obj)) { 35727 break; 35728 } else if ((0, _primitives.isName)(obj)) { 35729 if (obj.name === 'WMode') { 35730 parseWMode(cMap, lexer); 35731 } else if (obj.name === 'CMapName') { 35732 parseCMapName(cMap, lexer); 35733 } 35734 previous = obj; 35735 } else if ((0, _primitives.isCmd)(obj)) { 35736 switch (obj.cmd) { 35737 case 'endcmap': 35738 break objLoop; 35739 case 'usecmap': 35740 if ((0, _primitives.isName)(previous)) { 35741 embededUseCMap = previous.name; 35742 } 35743 break; 35744 case 'begincodespacerange': 35745 parseCodespaceRange(cMap, lexer); 35746 break; 35747 case 'beginbfchar': 35748 parseBfChar(cMap, lexer); 35749 break; 35750 case 'begincidchar': 35751 parseCidChar(cMap, lexer); 35752 break; 35753 case 'beginbfrange': 35754 parseBfRange(cMap, lexer); 35755 break; 35756 case 'begincidrange': 35757 parseCidRange(cMap, lexer); 35758 break; 35759 } 35760 } 35761 } catch (ex) { 35762 if (ex instanceof _util.MissingDataException) { 35763 throw ex; 35764 } 35765 (0, _util.warn)('Invalid cMap data: ' + ex); 35766 continue; 35767 } 35768 } 35769 if (!useCMap && embededUseCMap) { 35770 useCMap = embededUseCMap; 35771 } 35772 if (useCMap) { 35773 return extendCMap(cMap, fetchBuiltInCMap, useCMap); 35774 } 35775 return Promise.resolve(cMap); 35776 } 35777 function extendCMap(cMap, fetchBuiltInCMap, useCMap) { 35778 return createBuiltInCMap(useCMap, fetchBuiltInCMap).then(function (newCMap) { 35779 cMap.useCMap = newCMap; 35780 if (cMap.numCodespaceRanges === 0) { 35781 var useCodespaceRanges = cMap.useCMap.codespaceRanges; 35782 for (var i = 0; i < useCodespaceRanges.length; i++) { 35783 cMap.codespaceRanges[i] = useCodespaceRanges[i].slice(); 35784 } 35785 cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges; 35786 } 35787 cMap.useCMap.forEach(function (key, value) { 35788 if (!cMap.contains(key)) { 35789 cMap.mapOne(key, cMap.useCMap.lookup(key)); 35790 } 35791 }); 35792 return cMap; 35793 }); 35794 } 35795 function createBuiltInCMap(name, fetchBuiltInCMap) { 35796 if (name === 'Identity-H') { 35797 return Promise.resolve(new IdentityCMap(false, 2)); 35798 } else if (name === 'Identity-V') { 35799 return Promise.resolve(new IdentityCMap(true, 2)); 35800 } 35801 if (BUILT_IN_CMAPS.indexOf(name) === -1) { 35802 return Promise.reject(new Error('Unknown CMap name: ' + name)); 35803 } 35804 if (!fetchBuiltInCMap) { 35805 return Promise.reject(new Error('Built-in CMap parameters are not provided.')); 35806 } 35807 return fetchBuiltInCMap(name).then(function (data) { 35808 var cMapData = data.cMapData, 35809 compressionType = data.compressionType; 35810 var cMap = new CMap(true); 35811 if (compressionType === _util.CMapCompressionType.BINARY) { 35812 return new BinaryCMapReader().process(cMapData, cMap, function (useCMap) { 35813 return extendCMap(cMap, fetchBuiltInCMap, useCMap); 35814 }); 35815 } 35816 if (compressionType === _util.CMapCompressionType.NONE) { 35817 var lexer = new _parser.Lexer(new _stream.Stream(cMapData)); 35818 return parseCMap(cMap, lexer, fetchBuiltInCMap, null); 35819 } 35820 return Promise.reject(new Error('TODO: Only BINARY/NONE CMap compression is currently supported.')); 35821 }); 35822 } 35823 return { 35824 create: function create(params) { 35825 var encoding = params.encoding; 35826 var fetchBuiltInCMap = params.fetchBuiltInCMap; 35827 var useCMap = params.useCMap; 35828 if ((0, _primitives.isName)(encoding)) { 35829 return createBuiltInCMap(encoding.name, fetchBuiltInCMap); 35830 } else if ((0, _primitives.isStream)(encoding)) { 35831 var cMap = new CMap(); 35832 var lexer = new _parser.Lexer(encoding); 35833 return parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap).then(function (parsedCMap) { 35834 if (parsedCMap.isIdentityCMap) { 35835 return createBuiltInCMap(parsedCMap.name, fetchBuiltInCMap); 35836 } 35837 return parsedCMap; 35838 }); 35839 } 35840 return Promise.reject(new Error('Encoding required.')); 35841 } 35842 }; 35843}(); 35844exports.CMap = CMap; 35845exports.IdentityCMap = IdentityCMap; 35846exports.CMapFactory = CMapFactory;
35847 35848/***/ }), 35849/* 137 */ 35850/***/ (function(module, exports, __w_pdfjs_require__) { 35851 35852"use strict"; 35853 35854 35855Object.defineProperty(exports, "__esModule", { 35856 value: true 35857}); 35858exports.getFontType = exports.ProblematicCharRanges = exports.IdentityToUnicodeMap = exports.ToUnicodeMap = exports.FontFlags = exports.Font = exports.ErrorFont = exports.PRIVATE_USE_OFFSET_END = exports.PRIVATE_USE_OFFSET_START = exports.SEAC_ANALYSIS_ENABLED = undefined; 35859 35860var _util = __w_pdfjs_require__(0); 35861 35862var _cff_parser = __w_pdfjs_require__(68); 35863 35864var _glyphlist = __w_pdfjs_require__(43); 35865 35866var _encodings = __w_pdfjs_require__(21); 35867 35868var _standard_fonts = __w_pdfjs_require__(69); 35869 35870var _unicode = __w_pdfjs_require__(70); 35871 35872var _font_renderer = __w_pdfjs_require__(139); 35873 35874var _stream = __w_pdfjs_require__(2); 35875 35876var _type1_parser = __w_pdfjs_require__(140); 35877 35878var PRIVATE_USE_OFFSET_START = 0xE000; 35879var PRIVATE_USE_OFFSET_END = 0xF8FF; 35880var SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = false; 35881var PDF_GLYPH_SPACE_UNITS = 1000; 35882var SEAC_ANALYSIS_ENABLED = false; 35883var FontFlags = { 35884 FixedPitch: 1, 35885 Serif: 2, 35886 Symbolic: 4, 35887 Script: 8, 35888 Nonsymbolic: 32, 35889 Italic: 64, 35890 AllCap: 65536, 35891 SmallCap: 131072, 35892 ForceBold: 262144 35893}; 35894var MacStandardGlyphOrdering = ['.notdef', '.null', 'nonmarkingreturn', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', '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', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'grave', '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', 'braceleft', 'bar', 'braceright', 'asciitilde', 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', 'Odieresis', 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', 'atilde', 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', 'ograve', 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', 'ucircumflex', 'udieresis', 'dagger', 'degree', 'cent', 'sterling', 'section', 'bullet', 'paragraph', 'germandbls', 'registered', 'copyright', 'trademark', 'acute', 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', 'plusminus', 'lessequal', 'greaterequal', 'yen', 'mu', 'partialdiff', 'summation', 'product', 'pi', 'integral', 'ordfeminine', 'ordmasculine', 'Omega', 'ae', 'oslash', 'questiondown', 'exclamdown', 'logicalnot', 'radical', 'florin', 'approxequal', 'Delta', 'guillemotleft', 'guillemotright', 'ellipsis', 'nonbreakingspace', 'Agrave', 'Atilde', 'Otilde', 'OE', 'oe', 'endash', 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', 'quoteright', 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', 'currency', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', 'periodcentered', 'quotesinglbase', 'quotedblbase', 'perthousand', 'Acircumflex', 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', 'Ograve', 'Uacute', 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'Lslash', 'lslash', 'Scaron', 'scaron', 'Zcaron', 'zcaron', 'brokenbar', 'Eth', 'eth', 'Yacute', 'yacute', 'Thorn', 'thorn', 'minus', 'multiply', 'onesuperior', 'twosuperior', 'threesuperior', 'onehalf', 'onequarter', 'threequarters', 'franc', 'Gbreve', 'gbreve', 'Idotaccent', 'Scedilla', 'scedilla', 'Cacute', 'cacute', 'Ccaron', 'ccaron', 'dcroat']; 35895function adjustWidths(properties) { 35896 if (!properties.fontMatrix) { 35897 return; 35898 } 35899 if (properties.fontMatrix[0] === _util.FONT_IDENTITY_MATRIX[0]) { 35900 return; 35901 } 35902 var scale = 0.001 / properties.fontMatrix[0]; 35903 var glyphsWidths = properties.widths; 35904 for (var glyph in glyphsWidths) { 35905 glyphsWidths[glyph] *= scale; 35906 } 35907 properties.defaultWidth *= scale; 35908} 35909function adjustToUnicode(properties, builtInEncoding) { 35910 if (properties.hasIncludedToUnicodeMap) { 35911 return; 35912 } 35913 if (properties.hasEncoding) { 35914 return; 35915 } 35916 if (builtInEncoding === properties.defaultEncoding) { 35917 return; 35918 } 35919 if (properties.toUnicode instanceof IdentityToUnicodeMap) { 35920 return; 35921 } 35922 var toUnicode = [], 35923 glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)();
35924 for (var charCode in builtInEncoding) { 35925 var glyphName = builtInEncoding[charCode]; 35926 var unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap); 35927 if (unicode !== -1) { 35928 toUnicode[charCode] = String.fromCharCode(unicode); 35929 } 35930 } 35931 properties.toUnicode.amend(toUnicode); 35932} 35933function getFontType(type, subtype) { 35934 switch (type) { 35935 case 'Type1': 35936 return subtype === 'Type1C' ? _util.FontType.TYPE1C : _util.FontType.TYPE1; 35937 case 'CIDFontType0': 35938 return subtype === 'CIDFontType0C' ? _util.FontType.CIDFONTTYPE0C : _util.FontType.CIDFONTTYPE0; 35939 case 'OpenType': 35940 return _util.FontType.OPENTYPE; 35941 case 'TrueType': 35942 return _util.FontType.TRUETYPE; 35943 case 'CIDFontType2': 35944 return _util.FontType.CIDFONTTYPE2; 35945 case 'MMType1': 35946 return _util.FontType.MMTYPE1; 35947 case 'Type0': 35948 return _util.FontType.TYPE0; 35949 default: 35950 return _util.FontType.UNKNOWN; 35951 } 35952} 35953function recoverGlyphName(name, glyphsUnicodeMap) { 35954 if (glyphsUnicodeMap[name] !== undefined) { 35955 return name; 35956 } 35957 var unicode = (0, _unicode.getUnicodeForGlyph)(name, glyphsUnicodeMap); 35958 if (unicode !== -1) { 35959 for (var key in glyphsUnicodeMap) { 35960 if (glyphsUnicodeMap[key] === unicode) { 35961 return key; 35962 } 35963 } 35964 } 35965 (0, _util.info)('Unable to recover a standard glyph name for: ' + name); 35966 return name; 35967} 35968var Glyph = function GlyphClosure() { 35969 function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont) { 35970 this.fontChar = fontChar; 35971 this.unicode = unicode; 35972 this.accent = accent; 35973 this.width = width; 35974 this.vmetric = vmetric; 35975 this.operatorListId = operatorListId; 35976 this.isSpace = isSpace; 35977 this.isInFont = isInFont; 35978 } 35979 Glyph.prototype.matchesForCache = function (fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont) { 35980 return this.fontChar === fontChar && this.unicode === unicode && this.accent === accent && this.width === width && this.vmetric === vmetric && this.operatorListId === operatorListId && this.isSpace === isSpace && this.isInFont === isInFont; 35981 }; 35982 return Glyph; 35983}(); 35984var ToUnicodeMap = function ToUnicodeMapClosure() { 35985 function ToUnicodeMap() { 35986 var cmap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; 35987 35988 this._map = cmap; 35989 } 35990 ToUnicodeMap.prototype = { 35991 get length() { 35992 return this._map.length; 35993 }, 35994 forEach: function forEach(callback) { 35995 for (var charCode in this._map) { 35996 callback(charCode, this._map[charCode].charCodeAt(0)); 35997 } 35998 }, 35999 has: function has(i) { 36000 return this._map[i] !== undefined; 36001 }, 36002 get: function get(i) { 36003 return this._map[i]; 36004 }, 36005 charCodeOf: function charCodeOf(value) { 36006 var map = this._map; 36007 if (map.length <= 0x10000) { 36008 return map.indexOf(value); 36009 } 36010 for (var charCode in map) { 36011 if (map[charCode] === value) { 36012 return charCode | 0; 36013 } 36014 } 36015 return -1; 36016 }, 36017 amend: function amend(map) { 36018 for (var charCode in map) { 36019 this._map[charCode] = map[charCode]; 36020 } 36021 } 36022 }; 36023 return ToUnicodeMap; 36024}(); 36025var IdentityToUnicodeMap = function IdentityToUnicodeMapClosure() { 36026 function IdentityToUnicodeMap(firstChar, lastChar) { 36027 this.firstChar = firstChar; 36028 this.lastChar = lastChar; 36029 } 36030 IdentityToUnicodeMap.prototype = { 36031 get length() { 36032 return this.lastChar + 1 - this.firstChar; 36033 }, 36034 forEach: function forEach(callback) { 36035 for (var i = this.firstChar, ii = this.lastChar; i <= ii; i++) { 36036 callback(i, i); 36037 } 36038 }, 36039 has: function has(i) { 36040 return this.firstChar <= i && i <= this.lastChar; 36041 }, 36042 get: function get(i) { 36043 if (this.firstChar <= i && i <= this.lastChar) { 36044 return String.fromCharCode(i); 36045 } 36046 return undefined; 36047 }, 36048 charCodeOf: function charCodeOf(v) { 36049 return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar ? v : -1; 36050 }, 36051 amend: function amend(map) { 36052 (0, _util.unreachable)('Should not call amend()'); 36053 } 36054 }; 36055 return IdentityToUnicodeMap; 36056}(); 36057var OpenTypeFileBuilder = function OpenTypeFileBuilderClosure() { 36058 function writeInt16(dest, offset, num) { 36059 dest[offset] = num >> 8 & 0xFF; 36060 dest[offset + 1] = num & 0xFF; 36061 } 36062 function writeInt32(dest, offset, num) { 36063 dest[offset] = num >> 24 & 0xFF; 36064 dest[offset + 1] = num >> 16 & 0xFF; 36065 dest[offset + 2] = num >> 8 & 0xFF; 36066 dest[offset + 3] = num & 0xFF; 36067 } 36068 function writeData(dest, offset, data) { 36069 var i, ii; 36070 if (data instanceof Uint8Array) { 36071 dest.set(data, offset); 36072 } else if (typeof data === 'string') { 36073 for (i = 0, ii = data.length; i < ii; i++) { 36074 dest[offset++] = data.charCodeAt(i) & 0xFF; 36075 } 36076 } else { 36077 for (i = 0, ii = data.length; i < ii; i++) { 36078 dest[offset++] = data[i] & 0xFF; 36079 } 36080 } 36081 } 36082 function OpenTypeFileBuilder(sfnt) { 36083 this.sfnt = sfnt; 36084 this.tables = Object.create(null); 36085 } 36086 OpenTypeFileBuilder.getSearchParams = function OpenTypeFileBuilder_getSearchParams(entriesCount, entrySize) { 36087 var maxPower2 = 1, 36088 log2 = 0; 36089 while ((maxPower2 ^ entriesCount) > maxPower2) { 36090 maxPower2 <<= 1; 36091 log2++; 36092 } 36093 var searchRange = maxPower2 * entrySize; 36094 return {
36095 range: searchRange, 36096 entry: log2, 36097 rangeShift: entrySize * entriesCount - searchRange 36098 }; 36099 }; 36100 var OTF_HEADER_SIZE = 12; 36101 var OTF_TABLE_ENTRY_SIZE = 16; 36102 OpenTypeFileBuilder.prototype = { 36103 toArray: function OpenTypeFileBuilder_toArray() { 36104 var sfnt = this.sfnt; 36105 var tables = this.tables; 36106 var tablesNames = Object.keys(tables); 36107 tablesNames.sort(); 36108 var numTables = tablesNames.length; 36109 var i, j, jj, table, tableName; 36110 var offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE; 36111 var tableOffsets = [offset]; 36112 for (i = 0; i < numTables; i++) { 36113 table = tables[tablesNames[i]]; 36114 var paddedLength = (table.length + 3 & ~3) >>> 0; 36115 offset += paddedLength; 36116 tableOffsets.push(offset); 36117 } 36118 var file = new Uint8Array(offset); 36119 for (i = 0; i < numTables; i++) { 36120 table = tables[tablesNames[i]]; 36121 writeData(file, tableOffsets[i], table); 36122 } 36123 if (sfnt === 'true') { 36124 sfnt = (0, _util.string32)(0x00010000); 36125 } 36126 file[0] = sfnt.charCodeAt(0) & 0xFF; 36127 file[1] = sfnt.charCodeAt(1) & 0xFF; 36128 file[2] = sfnt.charCodeAt(2) & 0xFF; 36129 file[3] = sfnt.charCodeAt(3) & 0xFF; 36130 writeInt16(file, 4, numTables); 36131 var searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16); 36132 writeInt16(file, 6, searchParams.range); 36133 writeInt16(file, 8, searchParams.entry); 36134 writeInt16(file, 10, searchParams.rangeShift); 36135 offset = OTF_HEADER_SIZE; 36136 for (i = 0; i < numTables; i++) { 36137 tableName = tablesNames[i]; 36138 file[offset] = tableName.charCodeAt(0) & 0xFF; 36139 file[offset + 1] = tableName.charCodeAt(1) & 0xFF; 36140 file[offset + 2] = tableName.charCodeAt(2) & 0xFF; 36141 file[offset + 3] = tableName.charCodeAt(3) & 0xFF; 36142 var checksum = 0; 36143 for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) { 36144 var quad = (0, _util.readUint32)(file, j); 36145 checksum = checksum + quad >>> 0; 36146 } 36147 writeInt32(file, offset + 4, checksum); 36148 writeInt32(file, offset + 8, tableOffsets[i]); 36149 writeInt32(file, offset + 12, tables[tableName].length); 36150 offset += OTF_TABLE_ENTRY_SIZE; 36151 } 36152 return file; 36153 }, 36154 addTable: function OpenTypeFileBuilder_addTable(tag, data) { 36155 if (tag in this.tables) { 36156 throw new Error('Table ' + tag + ' already exists'); 36157 } 36158 this.tables[tag] = data; 36159 } 36160 }; 36161 return OpenTypeFileBuilder; 36162}(); 36163var ProblematicCharRanges = new Int32Array([0x0000, 0x0020, 0x007F, 0x00A1, 0x00AD, 0x00AE, 0x0600, 0x0780, 0x08A0, 0x10A0, 0x1780, 0x1800, 0x1C00, 0x1C50, 0x2000, 0x2010, 0x2011, 0x2012, 0x2028, 0x2030, 0x205F, 0x2070, 0x25CC, 0x25CD, 0x3000, 0x3001, 0x3164, 0x3165, 0xAA60, 0xAA80, 0xD800, 0xE000, 0xFFF0, 0x10000]); 36164var Font = function FontClosure() { 36165 function Font(name, file, properties) { 36166 var charCode; 36167 this.name = name; 36168 this.loadedName = properties.loadedName; 36169 this.isType3Font = properties.isType3Font; 36170 this.sizes = []; 36171 this.missingFile = false; 36172 this.glyphCache = Object.create(null); 36173 this.isSerifFont = !!(properties.flags & FontFlags.Serif); 36174 this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); 36175 this.isMonospace = !!(properties.flags & FontFlags.FixedPitch); 36176 var type = properties.type; 36177 var subtype = properties.subtype; 36178 this.type = type; 36179 this.subtype = subtype; 36180 this.fallbackName = this.isMonospace ? 'monospace' : this.isSerifFont ? 'serif' : 'sans-serif'; 36181 this.differences = properties.differences; 36182 this.widths = properties.widths; 36183 this.defaultWidth = properties.defaultWidth; 36184 this.composite = properties.composite; 36185 this.wideChars = properties.wideChars; 36186 this.cMap = properties.cMap; 36187 this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS; 36188 this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS; 36189 this.fontMatrix = properties.fontMatrix; 36190 this.bbox = properties.bbox; 36191 this.defaultEncoding = properties.defaultEncoding; 36192 this.toUnicode = properties.toUnicode; 36193 this.fallbackToUnicode = properties.fallbackToUnicode || new ToUnicodeMap(); 36194 this.toFontChar = []; 36195 if (properties.type === 'Type3') { 36196 for (charCode = 0; charCode < 256; charCode++) { 36197 this.toFontChar[charCode] = this.differences[charCode] || properties.defaultEncoding[charCode]; 36198 } 36199 this.fontType = _util.FontType.TYPE3; 36200 return; 36201 } 36202 this.cidEncoding = properties.cidEncoding; 36203 this.vertical = properties.vertical; 36204 if (this.vertical) { 36205 this.vmetrics = properties.vmetrics; 36206 this.defaultVMetrics = properties.defaultVMetrics; 36207 } 36208 if (!file || file.isEmpty) { 36209 if (file) { 36210 (0, _util.warn)('Font file is empty in "' + name + '" (' + this.loadedName + ')'); 36211 } 36212 this.fallbackToSystemFont(); 36213 return; 36214 } 36215 if (subtype === 'Type1C') { 36216 if (type !== 'Type1' && type !== 'MMType1') { 36217 if (isTrueTypeFile(file)) { 36218 subtype = 'TrueType'; 36219 } else { 36220 type = 'Type1'; 36221 } 36222 } else if (isOpenTypeFile(file)) { 36223 subtype = 'OpenType'; 36224 } 36225 } 36226 if (subtype === 'CIDFontType0C' && type !== 'CIDFontType0') { 36227 type = 'CIDFontType0'; 36228 } 36229 if (type === 'CIDFontType0') { 36230 if (isType1File(file)) { 36231 subtype = 'CIDFontType0'; 36232 } else if (isOpenTypeFile(file)) { 36233 subtype = 'OpenType'; 36234 } else { 36235 subtype = 'CIDFontType0C'; 36236 } 36237 } 36238 if (subtype === 'OpenType' && type !== 'OpenType') { 36239 type = 'OpenType'; 36240 } 36241 try { 36242 var data; 36243 switch (type) { 36244 case 'MMType1': 36245 (0, _util.info)('MMType1 font (' + name + '), falling back to Type1.'); 36246 case 'Type1': 36247 case 'CIDFontType0': 36248 this.mimetype = 'font/opentype'; 36249 var cff = subtype === 'Type1C' || subtype === 'CIDFontType0C' ? new CFFFont(file, properties) : new Type1Font(name, file, properties); 36250 adjustWidths(properties); 36251 data = this.convert(name, cff, properties); 36252 break; 36253 case 'OpenType': 36254 case 'TrueType': 36255 case 'CIDFontType2': 36256 this.mimetype = 'font/opentype'; 36257 data = this.checkAndRepair(name, file, properties); 36258 if (this.isOpenType) { 36259 adjustWidths(properties); 36260 type = 'OpenType'; 36261 } 36262 break; 36263 default: 36264 throw new _util.FormatError('Font ' + type + ' is not supported'); 36265 } 36266 } catch (e) { 36267 if (!(e instanceof _util.FormatError)) { 36268 throw e; 36269 } 36270 (0, _util.warn)(e); 36271 this.fallbackToSystemFont(); 36272 return; 36273 } 36274 this.data = data; 36275 this.fontType = getFontType(type, subtype); 36276 this.fontMatrix = properties.fontMatrix; 36277 this.widths = properties.widths; 36278 this.defaultWidth = properties.defaultWidth; 36279 this.toUnicode = properties.toUnicode; 36280 this.encoding = properties.baseEncoding; 36281 this.seacMap = properties.seacMap; 36282 this.loading = true; 36283 } 36284 Font.getFontID = function () { 36285 var ID = 1; 36286 return function Font_getFontID() { 36287 return String(ID++); 36288 }; 36289 }(); 36290 function int16(b0, b1) { 36291 return (b0 << 8) + b1;
36292 } 36293 function writeSignedInt16(bytes, index, value) { 36294 bytes[index + 1] = value; 36295 bytes[index] = value >>> 8; 36296 } 36297 function signedInt16(b0, b1) { 36298 var value = (b0 << 8) + b1; 36299 return value & 1 << 15 ? value - 0x10000 : value; 36300 } 36301 function int32(b0, b1, b2, b3) { 36302 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 36303 } 36304 function string16(value) { 36305 return String.fromCharCode(value >> 8 & 0xff, value & 0xff); 36306 } 36307 function safeString16(value) { 36308 value = value > 0x7FFF ? 0x7FFF : value < -0x8000 ? -0x8000 : value; 36309 return String.fromCharCode(value >> 8 & 0xff, value & 0xff); 36310 } 36311 function isTrueTypeFile(file) { 36312 var header = file.peekBytes(4); 36313 return (0, _util.readUint32)(header, 0) === 0x00010000; 36314 } 36315 function isTrueTypeCollectionFile(file) { 36316 var header = file.peekBytes(4); 36317 return (0, _util.bytesToString)(header) === 'ttcf'; 36318 } 36319 function isOpenTypeFile(file) { 36320 var header = file.peekBytes(4); 36321 return (0, _util.bytesToString)(header) === 'OTTO'; 36322 } 36323 function isType1File(file) { 36324 var header = file.peekBytes(2); 36325 if (header[0] === 0x25 && header[1] === 0x21) { 36326 return true; 36327 } 36328 if (header[0] === 0x80 && header[1] === 0x01) { 36329 return true; 36330 } 36331 return false; 36332 } 36333 function buildToFontChar(encoding, glyphsUnicodeMap, differences) { 36334 var toFontChar = [], 36335 unicode; 36336 for (var i = 0, ii = encoding.length; i < ii; i++) { 36337 unicode = (0, _unicode.getUnicodeForGlyph)(encoding[i], glyphsUnicodeMap); 36338 if (unicode !== -1) { 36339 toFontChar[i] = unicode; 36340 } 36341 } 36342 for (var charCode in differences) { 36343 unicode = (0, _unicode.getUnicodeForGlyph)(differences[charCode], glyphsUnicodeMap); 36344 if (unicode !== -1) { 36345 toFontChar[+charCode] = unicode; 36346 } 36347 } 36348 return toFontChar; 36349 } 36350 function isProblematicUnicodeLocation(code) { 36351 var i = 0, 36352 j = ProblematicCharRanges.length - 1; 36353 while (i < j) { 36354 var c = i + j + 1 >> 1; 36355 if (code < ProblematicCharRanges[c]) { 36356 j = c - 1; 36357 } else { 36358 i = c; 36359 } 36360 } 36361 return !(i & 1); 36362 } 36363 function adjustMapping(charCodeToGlyphId, properties, missingGlyphs) { 36364 var toUnicode = properties.toUnicode; 36365 var isSymbolic = !!(properties.flags & FontFlags.Symbolic); 36366 var isIdentityUnicode = properties.toUnicode instanceof IdentityToUnicodeMap; 36367 var newMap = Object.create(null); 36368 var toFontChar = []; 36369 var usedFontCharCodes = []; 36370 var nextAvailableFontCharCode = PRIVATE_USE_OFFSET_START; 36371 for (var originalCharCode in charCodeToGlyphId) { 36372 originalCharCode |= 0; 36373 var glyphId = charCodeToGlyphId[originalCharCode]; 36374 if (missingGlyphs[glyphId]) { 36375 continue; 36376 } 36377 var fontCharCode = originalCharCode; 36378 var hasUnicodeValue = false; 36379 if (!isIdentityUnicode && toUnicode.has(originalCharCode)) { 36380 hasUnicodeValue = true; 36381 var unicode = toUnicode.get(fontCharCode); 36382 if (unicode.length === 1) { 36383 fontCharCode = unicode.charCodeAt(0); 36384 } 36385 } 36386 if (usedFontCharCodes[fontCharCode] !== undefined || isProblematicUnicodeLocation(fontCharCode) || isSymbolic && !hasUnicodeValue) { 36387 do { 36388 if (nextAvailableFontCharCode > PRIVATE_USE_OFFSET_END) { 36389 (0, _util.warn)('Ran out of space in font private use area.'); 36390 break; 36391 } 36392 fontCharCode = nextAvailableFontCharCode++; 36393 if (SKIP_PRIVATE_USE_RANGE_F000_TO_F01F && fontCharCode === 0xF000) { 36394 fontCharCode = 0xF020; 36395 nextAvailableFontCharCode = fontCharCode + 1; 36396 } 36397 } while (usedFontCharCodes[fontCharCode] !== undefined); 36398 } 36399 newMap[fontCharCode] = glyphId; 36400 toFontChar[originalCharCode] = fontCharCode; 36401 usedFontCharCodes[fontCharCode] = true; 36402 } 36403 return { 36404 toFontChar: toFontChar, 36405 charCodeToGlyphId: newMap, 36406 nextAvailableFontCharCode: nextAvailableFontCharCode 36407 }; 36408 } 36409 function getRanges(glyphs, numGlyphs) { 36410 var codes = [];
36411 for (var charCode in glyphs) { 36412 if (glyphs[charCode] >= numGlyphs) { 36413 continue; 36414 } 36415 codes.push({ 36416 fontCharCode: charCode | 0, 36417 glyphId: glyphs[charCode] 36418 }); 36419 } 36420 if (codes.length === 0) { 36421 codes.push({ 36422 fontCharCode: 0, 36423 glyphId: 0 36424 }); 36425 } 36426 codes.sort(function fontGetRangesSort(a, b) { 36427 return a.fontCharCode - b.fontCharCode; 36428 }); 36429 var ranges = []; 36430 var length = codes.length; 36431 for (var n = 0; n < length;) { 36432 var start = codes[n].fontCharCode; 36433 var codeIndices = [codes[n].glyphId]; 36434 ++n; 36435 var end = start; 36436 while (n < length && end + 1 === codes[n].fontCharCode) { 36437 codeIndices.push(codes[n].glyphId); 36438 ++end; 36439 ++n; 36440 if (end === 0xFFFF) { 36441 break; 36442 } 36443 } 36444 ranges.push([start, end, codeIndices]); 36445 } 36446 return ranges; 36447 } 36448 function createCmapTable(glyphs, numGlyphs) { 36449 var ranges = getRanges(glyphs, numGlyphs); 36450 var numTables = ranges[ranges.length - 1][1] > 0xFFFF ? 2 : 1; 36451 var cmap = '\x00\x00' + string16(numTables) + '\x00\x03' + '\x00\x01' + (0, _util.string32)(4 + numTables * 8); 36452 var i, ii, j, jj; 36453 for (i = ranges.length - 1; i >= 0; --i) { 36454 if (ranges[i][0] <= 0xFFFF) { 36455 break; 36456 } 36457 } 36458 var bmpLength = i + 1; 36459 if (ranges[i][0] < 0xFFFF && ranges[i][1] === 0xFFFF) { 36460 ranges[i][1] = 0xFFFE; 36461 } 36462 var trailingRangesCount = ranges[i][1] < 0xFFFF ? 1 : 0; 36463 var segCount = bmpLength + trailingRangesCount; 36464 var searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2); 36465 var startCount = ''; 36466 var endCount = ''; 36467 var idDeltas = ''; 36468 var idRangeOffsets = ''; 36469 var glyphsIds = ''; 36470 var bias = 0; 36471 var range, start, end, codes; 36472 for (i = 0, ii = bmpLength; i < ii; i++) { 36473 range = ranges[i]; 36474 start = range[0]; 36475 end = range[1]; 36476 startCount += string16(start); 36477 endCount += string16(end); 36478 codes = range[2]; 36479 var contiguous = true; 36480 for (j = 1, jj = codes.length; j < jj; ++j) { 36481 if (codes[j] !== codes[j - 1] + 1) { 36482 contiguous = false; 36483 break; 36484 } 36485 } 36486 if (!contiguous) { 36487 var offset = (segCount - i) * 2 + bias * 2; 36488 bias += end - start + 1; 36489 idDeltas += string16(0); 36490 idRangeOffsets += string16(offset); 36491 for (j = 0, jj = codes.length; j < jj; ++j) { 36492 glyphsIds += string16(codes[j]); 36493 } 36494 } else { 36495 var startCode = codes[0]; 36496 idDeltas += string16(startCode - start & 0xFFFF); 36497 idRangeOffsets += string16(0); 36498 } 36499 } 36500 if (trailingRangesCount > 0) { 36501 endCount += '\xFF\xFF'; 36502 startCount += '\xFF\xFF'; 36503 idDeltas += '\x00\x01'; 36504 idRangeOffsets += '\x00\x00'; 36505 } 36506 var format314 = '\x00\x00' + string16(2 * segCount) + string16(searchParams.range) + string16(searchParams.entry) + string16(searchParams.rangeShift) + endCount + '\x00\x00' + startCount + idDeltas + idRangeOffsets + glyphsIds; 36507 var format31012 = ''; 36508 var header31012 = ''; 36509 if (numTables > 1) { 36510 cmap += '\x00\x03' + '\x00\x0A' + (0, _util.string32)(4 + numTables * 8 + 4 + format314.length); 36511 format31012 = ''; 36512 for (i = 0, ii = ranges.length; i < ii; i++) { 36513 range = ranges[i]; 36514 start = range[0]; 36515 codes = range[2]; 36516 var code = codes[0]; 36517 for (j = 1, jj = codes.length; j < jj; ++j) { 36518 if (codes[j] !== codes[j - 1] + 1) { 36519 end = range[0] + j - 1; 36520 format31012 += (0, _util.string32)(start) + (0, _util.string32)(end) + (0, _util.string32)(code); 36521 start = end + 1; 36522 code = codes[j]; 36523 } 36524 } 36525 format31012 += (0, _util.string32)(start) + (0, _util.string32)(range[1]) + (0, _util.string32)(code); 36526 } 36527 header31012 = '\x00\x0C' + '\x00\x00' + (0, _util.string32)(format31012.length + 16) + '\x00\x00\x00\x00' + (0, _util.string32)(format31012.length / 12); 36528 } 36529 return cmap + '\x00\x04' + string16(format314.length + 4) + format314 + header31012 + format31012; 36530 } 36531 function validateOS2Table(os2) { 36532 var stream = new _stream.Stream(os2.data); 36533 var version = stream.getUint16(); 36534 stream.getBytes(60); 36535 var selection = stream.getUint16(); 36536 if (version < 4 && selection & 0x0300) { 36537 return false; 36538 } 36539 var firstChar = stream.getUint16(); 36540 var lastChar = stream.getUint16(); 36541 if (firstChar > lastChar) { 36542 return false; 36543 } 36544 stream.getBytes(6); 36545 var usWinAscent = stream.getUint16();
vendor: 5,476 bytes, lines 36546-36663
36546 if (usWinAscent === 0) { 36547 return false; 36548 } 36549 os2.data[8] = os2.data[9] = 0; 36550 return true; 36551 } 36552 function createOS2Table(properties, charstrings, override) { 36553 override = override || { 36554 unitsPerEm: 0, 36555 yMax: 0, 36556 yMin: 0, 36557 ascent: 0, 36558 descent: 0 36559 }; 36560 var ulUnicodeRange1 = 0; 36561 var ulUnicodeRange2 = 0; 36562 var ulUnicodeRange3 = 0; 36563 var ulUnicodeRange4 = 0; 36564 var firstCharIndex = null; 36565 var lastCharIndex = 0; 36566 if (charstrings) { 36567 for (var code in charstrings) { 36568 code |= 0; 36569 if (firstCharIndex > code || !firstCharIndex) { 36570 firstCharIndex = code; 36571 } 36572 if (lastCharIndex < code) { 36573 lastCharIndex = code; 36574 } 36575 var position = (0, _unicode.getUnicodeRangeFor)(code); 36576 if (position < 32) { 36577 ulUnicodeRange1 |= 1 << position; 36578 } else if (position < 64) { 36579 ulUnicodeRange2 |= 1 << position - 32; 36580 } else if (position < 96) { 36581 ulUnicodeRange3 |= 1 << position - 64; 36582 } else if (position < 123) { 36583 ulUnicodeRange4 |= 1 << position - 96; 36584 } else { 36585 throw new _util.FormatError('Unicode ranges Bits > 123 are reserved for internal usage'); 36586 } 36587 } 36588 } else { 36589 firstCharIndex = 0; 36590 lastCharIndex = 255; 36591 } 36592 var bbox = properties.bbox || [0, 0, 0, 0]; 36593 var unitsPerEm = override.unitsPerEm || 1 / (properties.fontMatrix || _util.FONT_IDENTITY_MATRIX)[0]; 36594 var scale = properties.ascentScaled ? 1.0 : unitsPerEm / PDF_GLYPH_SPACE_UNITS; 36595 var typoAscent = override.ascent || Math.round(scale * (properties.ascent || bbox[3])); 36596 var typoDescent = override.descent || Math.round(scale * (properties.descent || bbox[1])); 36597 if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) { 36598 typoDescent = -typoDescent; 36599 } 36600 var winAscent = override.yMax || typoAscent; 36601 var winDescent = -override.yMin || -typoDescent; 36602 return '\x00\x03' + '\x02\x24' + '\x01\xF4' + '\x00\x05' + '\x00\x00' + '\x02\x8A' + '\x02\xBB' + '\x00\x00' + '\x00\x8C' + '\x02\x8A' + '\x02\xBB' + '\x00\x00' + '\x01\xDF' + '\x00\x31' + '\x01\x02' + '\x00\x00' + '\x00\x00\x06' + String.fromCharCode(properties.fixedPitch ? 0x09 : 0x00) + '\x00\x00\x00\x00\x00\x00' + (0, _util.string32)(ulUnicodeRange1) + (0, _util.string32)(ulUnicodeRange2) + (0, _util.string32)(ulUnicodeRange3) + (0, _util.string32)(ulUnicodeRange4) + '\x2A\x32\x31\x2A' + string16(properties.italicAngle ? 1 : 0) + string16(firstCharIndex || properties.firstChar) + string16(lastCharIndex || properties.lastChar) + string16(typoAscent) + string16(typoDescent) + '\x00\x64' + string16(winAscent) + string16(winDescent) + '\x00\x00\x00\x00' + '\x00\x00\x00\x00' + string16(properties.xHeight) + string16(properties.capHeight) + string16(0) + string16(firstCharIndex || properties.firstChar) + '\x00\x03'; 36603 } 36604 function createPostTable(properties) { 36605 var angle = Math.floor(properties.italicAngle * Math.pow(2, 16)); 36606 return '\x00\x03\x00\x00' + (0, _util.string32)(angle) + '\x00\x00' + '\x00\x00' + (0, _util.string32)(properties.fixedPitch) + '\x00\x00\x00\x00' + '\x00\x00\x00\x00' + '\x00\x00\x00\x00' + '\x00\x00\x00\x00'; 36607 } 36608 function createNameTable(name, proto) { 36609 if (!proto) { 36610 proto = [[], []]; 36611 } 36612 var strings = [proto[0][0] || 'Original licence', proto[0][1] || name, proto[0][2] || 'Unknown', proto[0][3] || 'uniqueID', proto[0][4] || name, proto[0][5] || 'Version 0.11', proto[0][6] || '', proto[0][7] || 'Unknown', proto[0][8] || 'Unknown', proto[0][9] || 'Unknown']; 36613 var stringsUnicode = []; 36614 var i, ii, j, jj, str; 36615 for (i = 0, ii = strings.length; i < ii; i++) { 36616 str = proto[1][i] || strings[i]; 36617 var strBufUnicode = []; 36618 for (j = 0, jj = str.length; j < jj; j++) { 36619 strBufUnicode.push(string16(str.charCodeAt(j))); 36620 } 36621 stringsUnicode.push(strBufUnicode.join('')); 36622 } 36623 var names = [strings, stringsUnicode]; 36624 var platforms = ['\x00\x01', '\x00\x03']; 36625 var encodings = ['\x00\x00', '\x00\x01']; 36626 var languages = ['\x00\x00', '\x04\x09']; 36627 var namesRecordCount = strings.length * platforms.length; 36628 var nameTable = '\x00\x00' + string16(namesRecordCount) + string16(namesRecordCount * 12 + 6); 36629 var strOffset = 0; 36630 for (i = 0, ii = platforms.length; i < ii; i++) { 36631 var strs = names[i]; 36632 for (j = 0, jj = strs.length; j < jj; j++) { 36633 str = strs[j]; 36634 var nameRecord = platforms[i] + encodings[i] + languages[i] + string16(j) + string16(str.length) + string16(strOffset); 36635 nameTable += nameRecord; 36636 strOffset += str.length; 36637 } 36638 } 36639 nameTable += strings.join('') + stringsUnicode.join(''); 36640 return nameTable; 36641 } 36642 Font.prototype = { 36643 name: null, 36644 font: null, 36645 mimetype: null, 36646 encoding: null, 36647 get renderer() { 36648 var renderer = _font_renderer.FontRendererFactory.create(this, SEAC_ANALYSIS_ENABLED); 36649 return (0, _util.shadow)(this, 'renderer', renderer); 36650 }, 36651 exportData: function Font_exportData() { 36652 var data = {}; 36653 for (var i in this) { 36654 if (this.hasOwnProperty(i)) { 36655 data[i] = this[i]; 36656 } 36657 } 36658 return data; 36659 }, 36660 fallbackToSystemFont: function Font_fallbackToSystemFont() { 36661 var _this = this; 36662 36663 this.missingFile = true;
36664 var charCode, unicode; 36665 var name = this.name; 36666 var type = this.type; 36667 var subtype = this.subtype; 36668 var fontName = name.replace(/[,_]/g, '-'); 36669 var stdFontMap = (0, _standard_fonts.getStdFontMap)(), 36670 nonStdFontMap = (0, _standard_fonts.getNonStdFontMap)(); 36671 var isStandardFont = !!stdFontMap[fontName] || !!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]); 36672 fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName; 36673 this.bold = fontName.search(/bold/gi) !== -1; 36674 this.italic = fontName.search(/oblique/gi) !== -1 || fontName.search(/italic/gi) !== -1; 36675 this.black = name.search(/Black/g) !== -1; 36676 this.remeasure = Object.keys(this.widths).length > 0; 36677 if (isStandardFont && type === 'CIDFontType2' && this.cidEncoding.indexOf('Identity-') === 0) { 36678 var GlyphMapForStandardFonts = (0, _standard_fonts.getGlyphMapForStandardFonts)(); 36679 var map = []; 36680 for (charCode in GlyphMapForStandardFonts) { 36681 map[+charCode] = GlyphMapForStandardFonts[charCode]; 36682 } 36683 if (/Arial-?Black/i.test(name)) { 36684 var SupplementalGlyphMapForArialBlack = (0, _standard_fonts.getSupplementalGlyphMapForArialBlack)(); 36685 for (charCode in SupplementalGlyphMapForArialBlack) { 36686 map[+charCode] = SupplementalGlyphMapForArialBlack[charCode]; 36687 } 36688 } else if (/Calibri/i.test(name)) { 36689 var SupplementalGlyphMapForCalibri = (0, _standard_fonts.getSupplementalGlyphMapForCalibri)(); 36690 for (charCode in SupplementalGlyphMapForCalibri) { 36691 map[+charCode] = SupplementalGlyphMapForCalibri[charCode]; 36692 } 36693 } 36694 var isIdentityUnicode = this.toUnicode instanceof IdentityToUnicodeMap; 36695 if (!isIdentityUnicode) { 36696 this.toUnicode.forEach(function (charCode, unicodeCharCode) { 36697 map[+charCode] = unicodeCharCode; 36698 }); 36699 } 36700 this.toFontChar = map; 36701 this.toUnicode = new ToUnicodeMap(map); 36702 } else if (/Symbol/i.test(fontName)) { 36703 this.toFontChar = buildToFontChar(_encodings.SymbolSetEncoding, (0, _glyphlist.getGlyphsUnicode)(), this.differences); 36704 } else if (/Dingbats/i.test(fontName)) { 36705 if (/Wingdings/i.test(name)) { 36706 (0, _util.warn)('Non-embedded Wingdings font, falling back to ZapfDingbats.'); 36707 } 36708 this.toFontChar = buildToFontChar(_encodings.ZapfDingbatsEncoding, (0, _glyphlist.getDingbatsGlyphsUnicode)(), this.differences); 36709 } else if (isStandardFont) { 36710 this.toFontChar = buildToFontChar(this.defaultEncoding, (0, _glyphlist.getGlyphsUnicode)(), this.differences); 36711 } else { 36712 var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 36713 this.toUnicode.forEach(function (charCode, unicodeCharCode) { 36714 if (!_this.composite) { 36715 var glyphName = _this.differences[charCode] || _this.defaultEncoding[charCode]; 36716 unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap); 36717 if (unicode !== -1) { 36718 unicodeCharCode = unicode; 36719 } 36720 } 36721 _this.toFontChar[charCode] = unicodeCharCode; 36722 }); 36723 } 36724 this.loadedName = fontName.split('-')[0]; 36725 this.loading = false; 36726 this.fontType = getFontType(type, subtype); 36727 }, 36728 checkAndRepair: function Font_checkAndRepair(name, font, properties) { 36729 var VALID_TABLES = ['OS/2', 'cmap', 'head', 'hhea', 'hmtx', 'maxp', 'name', 'post', 'loca', 'glyf', 'fpgm', 'prep', 'cvt ', 'CFF ']; 36730 function readTables(file, numTables) { 36731 var tables = Object.create(null); 36732 tables['OS/2'] = null; 36733 tables['cmap'] = null; 36734 tables['head'] = null; 36735 tables['hhea'] = null; 36736 tables['hmtx'] = null; 36737 tables['maxp'] = null; 36738 tables['name'] = null; 36739 tables['post'] = null; 36740 for (var i = 0; i < numTables; i++) { 36741 var table = readTableEntry(font); 36742 if (VALID_TABLES.indexOf(table.tag) < 0) { 36743 continue; 36744 } 36745 if (table.length === 0) { 36746 continue; 36747 } 36748 tables[table.tag] = table; 36749 } 36750 return tables; 36751 } 36752 function readTableEntry(file) { 36753 var tag = (0, _util.bytesToString)(file.getBytes(4)); 36754 var checksum = file.getInt32() >>> 0; 36755 var offset = file.getInt32() >>> 0; 36756 var length = file.getInt32() >>> 0; 36757 var previousPosition = file.pos; 36758 file.pos = file.start ? file.start : 0; 36759 file.skip(offset); 36760 var data = file.getBytes(length); 36761 file.pos = previousPosition; 36762 if (tag === 'head') { 36763 data[8] = data[9] = data[10] = data[11] = 0; 36764 data[17] |= 0x20; 36765 } 36766 return { 36767 tag: tag, 36768 checksum: checksum, 36769 length: length, 36770 offset: offset, 36771 data: data 36772 }; 36773 } 36774 function readOpenTypeHeader(ttf) { 36775 return { 36776 version: (0, _util.bytesToString)(ttf.getBytes(4)), 36777 numTables: ttf.getUint16(), 36778 searchRange: ttf.getUint16(), 36779 entrySelector: ttf.getUint16(), 36780 rangeShift: ttf.getUint16() 36781 }; 36782 } 36783 function readTrueTypeCollectionHeader(ttc) { 36784 var ttcTag = (0, _util.bytesToString)(ttc.getBytes(4)); 36785 (0, _util.assert)(ttcTag === 'ttcf', 'Must be a TrueType Collection font.'); 36786 var majorVersion = ttc.getUint16(); 36787 var minorVersion = ttc.getUint16(); 36788 var numFonts = ttc.getInt32() >>> 0; 36789 var offsetTable = []; 36790 for (var i = 0; i < numFonts; i++) { 36791 offsetTable.push(ttc.getInt32() >>> 0); 36792 } 36793 var header = { 36794 ttcTag: ttcTag, 36795 majorVersion: majorVersion, 36796 minorVersion: minorVersion, 36797 numFonts: numFonts, 36798 offsetTable: offsetTable 36799 }; 36800 switch (majorVersion) { 36801 case 1: 36802 return header; 36803 case 2: 36804 header.dsigTag = ttc.getInt32() >>> 0; 36805 header.dsigLength = ttc.getInt32() >>> 0; 36806 header.dsigOffset = ttc.getInt32() >>> 0; 36807 return header; 36808 } 36809 throw new _util.FormatError('Invalid TrueType Collection majorVersion: ' + majorVersion + '.'); 36810 } 36811 function readTrueTypeCollectionData(ttc, fontName) { 36812 var _readTrueTypeCollecti = readTrueTypeCollectionHeader(ttc), 36813 numFonts = _readTrueTypeCollecti.numFonts, 36814 offsetTable = _readTrueTypeCollecti.offsetTable; 36815 36816 for (var i = 0; i < numFonts; i++) { 36817 ttc.pos = (ttc.start || 0) + offsetTable[i]; 36818 var potentialHeader = readOpenTypeHeader(ttc); 36819 var potentialTables = readTables(ttc, potentialHeader.numTables); 36820 if (!potentialTables['name']) { 36821 throw new _util.FormatError('TrueType Collection font must contain a "name" table.'); 36822 } 36823 var nameTable = readNameTable(potentialTables['name']); 36824 for (var j = 0, jj = nameTable.length; j < jj; j++) { 36825 for (var k = 0, kk = nameTable[j].length; k < kk; k++) { 36826 var nameEntry = nameTable[j][k]; 36827 if (nameEntry && nameEntry.replace(/\s/g, '') === fontName) { 36828 return { 36829 header: potentialHeader, 36830 tables: potentialTables 36831 }; 36832 } 36833 } 36834 } 36835 } 36836 throw new _util.FormatError('TrueType Collection does not contain "' + fontName + '" font.'); 36837 } 36838 function readCmapTable(cmap, font, isSymbolicFont, hasEncoding) { 36839 if (!cmap) { 36840 (0, _util.warn)('No cmap table available.'); 36841 return { 36842 platformId: -1, 36843 encodingId: -1, 36844 mappings: [], 36845 hasShortCmap: false 36846 }; 36847 } 36848 var segment; 36849 var start = (font.start ? font.start : 0) + cmap.offset; 36850 font.pos = start; 36851 font.getUint16(); 36852 var numTables = font.getUint16(); 36853 var potentialTable; 36854 var canBreak = false; 36855 for (var i = 0; i < numTables; i++) { 36856 var platformId = font.getUint16(); 36857 var encodingId = font.getUint16(); 36858 var offset = font.getInt32() >>> 0; 36859 var useTable = false; 36860 if (potentialTable && potentialTable.platformId === platformId && potentialTable.encodingId === encodingId) { 36861 continue; 36862 } 36863 if (platformId === 0 && encodingId === 0) { 36864 useTable = true; 36865 } else if (platformId === 1 && encodingId === 0) { 36866 useTable = true; 36867 } else if (platformId === 3 && encodingId === 1 && (hasEncoding || !potentialTable)) { 36868 useTable = true; 36869 if (!isSymbolicFont) { 36870 canBreak = true; 36871 } 36872 } else if (isSymbolicFont && platformId === 3 && encodingId === 0) { 36873 useTable = true; 36874 canBreak = true; 36875 } 36876 if (useTable) { 36877 potentialTable = { 36878 platformId: platformId, 36879 encodingId: encodingId, 36880 offset: offset 36881 }; 36882 } 36883 if (canBreak) { 36884 break; 36885 } 36886 } 36887 if (potentialTable) { 36888 font.pos = start + potentialTable.offset; 36889 } 36890 if (!potentialTable || font.peekByte() === -1) { 36891 (0, _util.warn)('Could not find a preferred cmap table.'); 36892 return { 36893 platformId: -1, 36894 encodingId: -1, 36895 mappings: [], 36896 hasShortCmap: false 36897 }; 36898 } 36899 var format = font.getUint16(); 36900 font.getUint16(); 36901 font.getUint16(); 36902 var hasShortCmap = false; 36903 var mappings = []; 36904 var j, glyphId; 36905 if (format === 0) { 36906 for (j = 0; j < 256; j++) { 36907 var index = font.getByte(); 36908 if (!index) { 36909 continue; 36910 } 36911 mappings.push({
vendor: 4,141 bytes, lines 36912-37021
36912 charCode: j, 36913 glyphId: index 36914 }); 36915 } 36916 hasShortCmap = true; 36917 } else if (format === 4) { 36918 var segCount = font.getUint16() >> 1; 36919 font.getBytes(6); 36920 var segIndex, 36921 segments = []; 36922 for (segIndex = 0; segIndex < segCount; segIndex++) { 36923 segments.push({ end: font.getUint16() }); 36924 } 36925 font.getUint16(); 36926 for (segIndex = 0; segIndex < segCount; segIndex++) { 36927 segments[segIndex].start = font.getUint16(); 36928 } 36929 for (segIndex = 0; segIndex < segCount; segIndex++) { 36930 segments[segIndex].delta = font.getUint16(); 36931 } 36932 var offsetsCount = 0; 36933 for (segIndex = 0; segIndex < segCount; segIndex++) { 36934 segment = segments[segIndex]; 36935 var rangeOffset = font.getUint16(); 36936 if (!rangeOffset) { 36937 segment.offsetIndex = -1; 36938 continue; 36939 } 36940 var offsetIndex = (rangeOffset >> 1) - (segCount - segIndex); 36941 segment.offsetIndex = offsetIndex; 36942 offsetsCount = Math.max(offsetsCount, offsetIndex + segment.end - segment.start + 1); 36943 } 36944 var offsets = []; 36945 for (j = 0; j < offsetsCount; j++) { 36946 offsets.push(font.getUint16()); 36947 } 36948 for (segIndex = 0; segIndex < segCount; segIndex++) { 36949 segment = segments[segIndex]; 36950 start = segment.start; 36951 var end = segment.end; 36952 var delta = segment.delta; 36953 offsetIndex = segment.offsetIndex; 36954 for (j = start; j <= end; j++) { 36955 if (j === 0xFFFF) { 36956 continue; 36957 } 36958 glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start]; 36959 glyphId = glyphId + delta & 0xFFFF; 36960 mappings.push({ 36961 charCode: j, 36962 glyphId: glyphId 36963 }); 36964 } 36965 } 36966 } else if (format === 6) { 36967 var firstCode = font.getUint16(); 36968 var entryCount = font.getUint16(); 36969 for (j = 0; j < entryCount; j++) { 36970 glyphId = font.getUint16(); 36971 var charCode = firstCode + j; 36972 mappings.push({ 36973 charCode: charCode, 36974 glyphId: glyphId 36975 }); 36976 } 36977 } else { 36978 (0, _util.warn)('cmap table has unsupported format: ' + format); 36979 return { 36980 platformId: -1, 36981 encodingId: -1, 36982 mappings: [], 36983 hasShortCmap: false 36984 }; 36985 } 36986 mappings.sort(function (a, b) { 36987 return a.charCode - b.charCode; 36988 }); 36989 for (i = 1; i < mappings.length; i++) { 36990 if (mappings[i - 1].charCode === mappings[i].charCode) { 36991 mappings.splice(i, 1); 36992 i--; 36993 } 36994 } 36995 return { 36996 platformId: potentialTable.platformId, 36997 encodingId: potentialTable.encodingId, 36998 mappings: mappings, 36999 hasShortCmap: hasShortCmap 37000 }; 37001 } 37002 function sanitizeMetrics(font, header, metrics, numGlyphs) { 37003 if (!header) { 37004 if (metrics) { 37005 metrics.data = null; 37006 } 37007 return; 37008 } 37009 font.pos = (font.start ? font.start : 0) + header.offset; 37010 font.pos += header.length - 2; 37011 var numOfMetrics = font.getUint16(); 37012 if (numOfMetrics > numGlyphs) { 37013 (0, _util.info)('The numOfMetrics (' + numOfMetrics + ') should not be ' + 'greater than the numGlyphs (' + numGlyphs + ')'); 37014 numOfMetrics = numGlyphs; 37015 header.data[34] = (numOfMetrics & 0xff00) >> 8; 37016 header.data[35] = numOfMetrics & 0x00ff; 37017 } 37018 var numOfSidebearings = numGlyphs - numOfMetrics; 37019 var numMissing = numOfSidebearings - (metrics.length - numOfMetrics * 4 >> 1); 37020 if (numMissing > 0) { 37021 var entries = new Uint8Array(metrics.length + numMissing * 2);
37022 entries.set(metrics.data); 37023 metrics.data = entries; 37024 } 37025 } 37026 function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, hintsValid) { 37027 var glyphProfile = { 37028 length: 0, 37029 sizeOfInstructions: 0 37030 }; 37031 if (sourceEnd - sourceStart <= 12) { 37032 return glyphProfile; 37033 } 37034 var glyf = source.subarray(sourceStart, sourceEnd); 37035 var contoursCount = signedInt16(glyf[0], glyf[1]); 37036 if (contoursCount < 0) { 37037 contoursCount = -1; 37038 writeSignedInt16(glyf, 0, contoursCount); 37039 dest.set(glyf, destStart); 37040 glyphProfile.length = glyf.length; 37041 return glyphProfile; 37042 } 37043 var i, 37044 j = 10, 37045 flagsCount = 0; 37046 for (i = 0; i < contoursCount; i++) { 37047 var endPoint = glyf[j] << 8 | glyf[j + 1]; 37048 flagsCount = endPoint + 1; 37049 j += 2; 37050 } 37051 var instructionsStart = j; 37052 var instructionsLength = glyf[j] << 8 | glyf[j + 1]; 37053 glyphProfile.sizeOfInstructions = instructionsLength; 37054 j += 2 + instructionsLength; 37055 var instructionsEnd = j; 37056 var coordinatesLength = 0; 37057 for (i = 0; i < flagsCount; i++) { 37058 var flag = glyf[j++]; 37059 if (flag & 0xC0) { 37060 glyf[j - 1] = flag & 0x3F; 37061 } 37062 var xyLength = (flag & 2 ? 1 : flag & 16 ? 0 : 2) + (flag & 4 ? 1 : flag & 32 ? 0 : 2); 37063 coordinatesLength += xyLength; 37064 if (flag & 8) { 37065 var repeat = glyf[j++]; 37066 i += repeat; 37067 coordinatesLength += repeat * xyLength; 37068 } 37069 } 37070 if (coordinatesLength === 0) { 37071 return glyphProfile; 37072 } 37073 var glyphDataLength = j + coordinatesLength; 37074 if (glyphDataLength > glyf.length) { 37075 return glyphProfile; 37076 } 37077 if (!hintsValid && instructionsLength > 0) { 37078 dest.set(glyf.subarray(0, instructionsStart), destStart); 37079 dest.set([0, 0], destStart + instructionsStart); 37080 dest.set(glyf.subarray(instructionsEnd, glyphDataLength), destStart + instructionsStart + 2); 37081 glyphDataLength -= instructionsLength; 37082 if (glyf.length - glyphDataLength > 3) { 37083 glyphDataLength = glyphDataLength + 3 & ~3; 37084 } 37085 glyphProfile.length = glyphDataLength; 37086 return glyphProfile; 37087 } 37088 if (glyf.length - glyphDataLength > 3) { 37089 glyphDataLength = glyphDataLength + 3 & ~3; 37090 dest.set(glyf.subarray(0, glyphDataLength), destStart); 37091 glyphProfile.length = glyphDataLength; 37092 return glyphProfile; 37093 } 37094 dest.set(glyf, destStart); 37095 glyphProfile.length = glyf.length; 37096 return glyphProfile; 37097 } 37098 function sanitizeHead(head, numGlyphs, locaLength) { 37099 var data = head.data; 37100 var version = int32(data[0], data[1], data[2], data[3]); 37101 if (version >> 16 !== 1) { 37102 (0, _util.info)('Attempting to fix invalid version in head table: ' + version); 37103 data[0] = 0; 37104 data[1] = 1; 37105 data[2] = 0; 37106 data[3] = 0; 37107 } 37108 var indexToLocFormat = int16(data[50], data[51]); 37109 if (indexToLocFormat < 0 || indexToLocFormat > 1) { 37110 (0, _util.info)('Attempting to fix invalid indexToLocFormat in head table: ' + indexToLocFormat); 37111 var numGlyphsPlusOne = numGlyphs + 1; 37112 if (locaLength === numGlyphsPlusOne << 1) { 37113 data[50] = 0; 37114 data[51] = 0; 37115 } else if (locaLength === numGlyphsPlusOne << 2) { 37116 data[50] = 0; 37117 data[51] = 1; 37118 } else { 37119 throw new _util.FormatError('Could not fix indexToLocFormat: ' + indexToLocFormat); 37120 } 37121 } 37122 } 37123 function sanitizeGlyphLocations(loca, glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions) { 37124 var itemSize, itemDecode, itemEncode; 37125 if (isGlyphLocationsLong) { 37126 itemSize = 4; 37127 itemDecode = function fontItemDecodeLong(data, offset) { 37128 return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; 37129 }; 37130 itemEncode = function fontItemEncodeLong(data, offset, value) { 37131 data[offset] = value >>> 24 & 0xFF; 37132 data[offset + 1] = value >> 16 & 0xFF; 37133 data[offset + 2] = value >> 8 & 0xFF; 37134 data[offset + 3] = value & 0xFF; 37135 }; 37136 } else { 37137 itemSize = 2; 37138 itemDecode = function fontItemDecode(data, offset) { 37139 return data[offset] << 9 | data[offset + 1] << 1; 37140 }; 37141 itemEncode = function fontItemEncode(data, offset, value) { 37142 data[offset] = value >> 9 & 0xFF; 37143 data[offset + 1] = value >> 1 & 0xFF; 37144 }; 37145 } 37146 var locaData = loca.data; 37147 var locaDataSize = itemSize * (1 + numGlyphs); 37148 if (locaData.length !== locaDataSize) { 37149 locaData = new Uint8Array(locaDataSize); 37150 locaData.set(loca.data.subarray(0, locaDataSize)); 37151 loca.data = locaData; 37152 } 37153 var oldGlyfData = glyf.data; 37154 var oldGlyfDataLength = oldGlyfData.length; 37155 var newGlyfData = new Uint8Array(oldGlyfDataLength); 37156 var startOffset = itemDecode(locaData, 0); 37157 var writeOffset = 0; 37158 var missingGlyphs = Object.create(null); 37159 itemEncode(locaData, 0, writeOffset); 37160 var i, j; 37161 var locaCount = dupFirstEntry ? numGlyphs - 1 : numGlyphs; 37162 for (i = 0, j = itemSize; i < locaCount; i++, j += itemSize) { 37163 var endOffset = itemDecode(locaData, j); 37164 if (endOffset === 0) { 37165 endOffset = startOffset; 37166 } 37167 if (endOffset > oldGlyfDataLength && (oldGlyfDataLength + 3 & ~3) === endOffset) { 37168 endOffset = oldGlyfDataLength; 37169 } 37170 if (endOffset > oldGlyfDataLength) { 37171 startOffset = endOffset; 37172 } 37173 var glyphProfile = sanitizeGlyph(oldGlyfData, startOffset, endOffset, newGlyfData, writeOffset, hintsValid); 37174 var newLength = glyphProfile.length; 37175 if (newLength === 0) { 37176 missingGlyphs[i] = true; 37177 }
vendor: 15,262 bytes, lines 37178-37584
37178 if (glyphProfile.sizeOfInstructions > maxSizeOfInstructions) { 37179 maxSizeOfInstructions = glyphProfile.sizeOfInstructions; 37180 } 37181 writeOffset += newLength; 37182 itemEncode(locaData, j, writeOffset); 37183 startOffset = endOffset; 37184 } 37185 if (writeOffset === 0) { 37186 var simpleGlyph = new Uint8Array([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]); 37187 for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { 37188 itemEncode(locaData, j, simpleGlyph.length); 37189 } 37190 glyf.data = simpleGlyph; 37191 } else if (dupFirstEntry) { 37192 var firstEntryLength = itemDecode(locaData, itemSize); 37193 if (newGlyfData.length > firstEntryLength + writeOffset) { 37194 glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset); 37195 } else { 37196 glyf.data = new Uint8Array(firstEntryLength + writeOffset); 37197 glyf.data.set(newGlyfData.subarray(0, writeOffset)); 37198 } 37199 glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset); 37200 itemEncode(loca.data, locaData.length - itemSize, writeOffset + firstEntryLength); 37201 } else { 37202 glyf.data = newGlyfData.subarray(0, writeOffset); 37203 } 37204 return { 37205 missingGlyphs: missingGlyphs, 37206 maxSizeOfInstructions: maxSizeOfInstructions 37207 }; 37208 } 37209 function readPostScriptTable(post, properties, maxpNumGlyphs) { 37210 var start = (font.start ? font.start : 0) + post.offset; 37211 font.pos = start; 37212 var length = post.length, 37213 end = start + length; 37214 var version = font.getInt32(); 37215 font.getBytes(28); 37216 var glyphNames; 37217 var valid = true; 37218 var i; 37219 switch (version) { 37220 case 0x00010000: 37221 glyphNames = MacStandardGlyphOrdering; 37222 break; 37223 case 0x00020000: 37224 var numGlyphs = font.getUint16(); 37225 if (numGlyphs !== maxpNumGlyphs) { 37226 valid = false; 37227 break; 37228 } 37229 var glyphNameIndexes = []; 37230 for (i = 0; i < numGlyphs; ++i) { 37231 var index = font.getUint16(); 37232 if (index >= 32768) { 37233 valid = false; 37234 break; 37235 } 37236 glyphNameIndexes.push(index); 37237 } 37238 if (!valid) { 37239 break; 37240 } 37241 var customNames = []; 37242 var strBuf = []; 37243 while (font.pos < end) { 37244 var stringLength = font.getByte(); 37245 strBuf.length = stringLength; 37246 for (i = 0; i < stringLength; ++i) { 37247 strBuf[i] = String.fromCharCode(font.getByte()); 37248 } 37249 customNames.push(strBuf.join('')); 37250 } 37251 glyphNames = []; 37252 for (i = 0; i < numGlyphs; ++i) { 37253 var j = glyphNameIndexes[i]; 37254 if (j < 258) { 37255 glyphNames.push(MacStandardGlyphOrdering[j]); 37256 continue; 37257 } 37258 glyphNames.push(customNames[j - 258]); 37259 } 37260 break; 37261 case 0x00030000: 37262 break; 37263 default: 37264 (0, _util.warn)('Unknown/unsupported post table version ' + version); 37265 valid = false; 37266 if (properties.defaultEncoding) { 37267 glyphNames = properties.defaultEncoding; 37268 } 37269 break; 37270 } 37271 properties.glyphNames = glyphNames; 37272 return valid; 37273 } 37274 function readNameTable(nameTable) { 37275 var start = (font.start ? font.start : 0) + nameTable.offset; 37276 font.pos = start; 37277 var names = [[], []]; 37278 var length = nameTable.length, 37279 end = start + length; 37280 var format = font.getUint16(); 37281 var FORMAT_0_HEADER_LENGTH = 6; 37282 if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) { 37283 return names; 37284 } 37285 var numRecords = font.getUint16(); 37286 var stringsStart = font.getUint16(); 37287 var records = []; 37288 var NAME_RECORD_LENGTH = 12; 37289 var i, ii; 37290 for (i = 0; i < numRecords && font.pos + NAME_RECORD_LENGTH <= end; i++) { 37291 var r = { 37292 platform: font.getUint16(), 37293 encoding: font.getUint16(), 37294 language: font.getUint16(), 37295 name: font.getUint16(), 37296 length: font.getUint16(), 37297 offset: font.getUint16() 37298 }; 37299 if (r.platform === 1 && r.encoding === 0 && r.language === 0 || r.platform === 3 && r.encoding === 1 && r.language === 0x409) { 37300 records.push(r); 37301 } 37302 } 37303 for (i = 0, ii = records.length; i < ii; i++) { 37304 var record = records[i]; 37305 if (record.length <= 0) { 37306 continue; 37307 } 37308 var pos = start + stringsStart + record.offset; 37309 if (pos + record.length > end) { 37310 continue; 37311 } 37312 font.pos = pos; 37313 var nameIndex = record.name; 37314 if (record.encoding) { 37315 var str = ''; 37316 for (var j = 0, jj = record.length; j < jj; j += 2) { 37317 str += String.fromCharCode(font.getUint16()); 37318 } 37319 names[1][nameIndex] = str; 37320 } else { 37321 names[0][nameIndex] = (0, _util.bytesToString)(font.getBytes(record.length)); 37322 } 37323 } 37324 return names; 37325 } 37326 var TTOpsStackDeltas = [0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2, 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2]; 37327 function sanitizeTTProgram(table, ttContext) { 37328 var data = table.data; 37329 var i = 0, 37330 j, 37331 n, 37332 b, 37333 funcId, 37334 pc, 37335 lastEndf = 0, 37336 lastDeff = 0; 37337 var stack = []; 37338 var callstack = []; 37339 var functionsCalled = []; 37340 var tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions; 37341 var inFDEF = false, 37342 ifLevel = 0, 37343 inELSE = 0; 37344 for (var ii = data.length; i < ii;) { 37345 var op = data[i++]; 37346 if (op === 0x40) { 37347 n = data[i++]; 37348 if (inFDEF || inELSE) { 37349 i += n; 37350 } else { 37351 for (j = 0; j < n; j++) { 37352 stack.push(data[i++]); 37353 } 37354 } 37355 } else if (op === 0x41) { 37356 n = data[i++]; 37357 if (inFDEF || inELSE) { 37358 i += n * 2; 37359 } else { 37360 for (j = 0; j < n; j++) { 37361 b = data[i++]; 37362 stack.push(b << 8 | data[i++]); 37363 } 37364 } 37365 } else if ((op & 0xF8) === 0xB0) { 37366 n = op - 0xB0 + 1; 37367 if (inFDEF || inELSE) { 37368 i += n; 37369 } else { 37370 for (j = 0; j < n; j++) { 37371 stack.push(data[i++]); 37372 } 37373 } 37374 } else if ((op & 0xF8) === 0xB8) { 37375 n = op - 0xB8 + 1; 37376 if (inFDEF || inELSE) { 37377 i += n * 2; 37378 } else { 37379 for (j = 0; j < n; j++) { 37380 b = data[i++]; 37381 stack.push(b << 8 | data[i++]); 37382 } 37383 } 37384 } else if (op === 0x2B && !tooComplexToFollowFunctions) { 37385 if (!inFDEF && !inELSE) { 37386 funcId = stack[stack.length - 1]; 37387 ttContext.functionsUsed[funcId] = true; 37388 if (funcId in ttContext.functionsStackDeltas) { 37389 stack.length += ttContext.functionsStackDeltas[funcId]; 37390 } else if (funcId in ttContext.functionsDefined && functionsCalled.indexOf(funcId) < 0) { 37391 callstack.push({ 37392 data: data, 37393 i: i, 37394 stackTop: stack.length - 1 37395 }); 37396 functionsCalled.push(funcId); 37397 pc = ttContext.functionsDefined[funcId]; 37398 if (!pc) { 37399 (0, _util.warn)('TT: CALL non-existent function'); 37400 ttContext.hintsValid = false; 37401 return; 37402 } 37403 data = pc.data; 37404 i = pc.i; 37405 } 37406 } 37407 } else if (op === 0x2C && !tooComplexToFollowFunctions) { 37408 if (inFDEF || inELSE) { 37409 (0, _util.warn)('TT: nested FDEFs not allowed'); 37410 tooComplexToFollowFunctions = true; 37411 } 37412 inFDEF = true; 37413 lastDeff = i; 37414 funcId = stack.pop(); 37415 ttContext.functionsDefined[funcId] = { 37416 data: data, 37417 i: i 37418 }; 37419 } else if (op === 0x2D) { 37420 if (inFDEF) { 37421 inFDEF = false; 37422 lastEndf = i; 37423 } else { 37424 pc = callstack.pop(); 37425 if (!pc) { 37426 (0, _util.warn)('TT: ENDF bad stack'); 37427 ttContext.hintsValid = false; 37428 return; 37429 } 37430 funcId = functionsCalled.pop(); 37431 data = pc.data; 37432 i = pc.i; 37433 ttContext.functionsStackDeltas[funcId] = stack.length - pc.stackTop; 37434 } 37435 } else if (op === 0x89) { 37436 if (inFDEF || inELSE) { 37437 (0, _util.warn)('TT: nested IDEFs not allowed'); 37438 tooComplexToFollowFunctions = true; 37439 } 37440 inFDEF = true; 37441 lastDeff = i; 37442 } else if (op === 0x58) { 37443 ++ifLevel; 37444 } else if (op === 0x1B) { 37445 inELSE = ifLevel; 37446 } else if (op === 0x59) { 37447 if (inELSE === ifLevel) { 37448 inELSE = 0; 37449 } 37450 --ifLevel; 37451 } else if (op === 0x1C) { 37452 if (!inFDEF && !inELSE) { 37453 var offset = stack[stack.length - 1]; 37454 if (offset > 0) { 37455 i += offset - 1; 37456 } 37457 } 37458 } 37459 if (!inFDEF && !inELSE) { 37460 var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0; 37461 if (op >= 0x71 && op <= 0x75) { 37462 n = stack.pop(); 37463 if (!isNaN(n)) { 37464 stackDelta = -n * 2; 37465 } 37466 } 37467 while (stackDelta < 0 && stack.length > 0) { 37468 stack.pop(); 37469 stackDelta++; 37470 } 37471 while (stackDelta > 0) { 37472 stack.push(NaN); 37473 stackDelta--; 37474 } 37475 } 37476 } 37477 ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; 37478 var content = [data]; 37479 if (i > data.length) { 37480 content.push(new Uint8Array(i - data.length)); 37481 } 37482 if (lastDeff > lastEndf) { 37483 (0, _util.warn)('TT: complementing a missing function tail'); 37484 content.push(new Uint8Array([0x22, 0x2D])); 37485 } 37486 foldTTTable(table, content); 37487 } 37488 function checkInvalidFunctions(ttContext, maxFunctionDefs) { 37489 if (ttContext.tooComplexToFollowFunctions) { 37490 return; 37491 } 37492 if (ttContext.functionsDefined.length > maxFunctionDefs) { 37493 (0, _util.warn)('TT: more functions defined than expected'); 37494 ttContext.hintsValid = false; 37495 return; 37496 } 37497 for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { 37498 if (j > maxFunctionDefs) { 37499 (0, _util.warn)('TT: invalid function id: ' + j); 37500 ttContext.hintsValid = false; 37501 return; 37502 } 37503 if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) { 37504 (0, _util.warn)('TT: undefined function: ' + j); 37505 ttContext.hintsValid = false; 37506 return; 37507 } 37508 } 37509 } 37510 function foldTTTable(table, content) { 37511 if (content.length > 1) { 37512 var newLength = 0; 37513 var j, jj; 37514 for (j = 0, jj = content.length; j < jj; j++) { 37515 newLength += content[j].length; 37516 } 37517 newLength = newLength + 3 & ~3; 37518 var result = new Uint8Array(newLength); 37519 var pos = 0; 37520 for (j = 0, jj = content.length; j < jj; j++) { 37521 result.set(content[j], pos); 37522 pos += content[j].length; 37523 } 37524 table.data = result; 37525 table.length = newLength; 37526 } 37527 } 37528 function sanitizeTTPrograms(fpgm, prep, cvt, maxFunctionDefs) { 37529 var ttContext = { 37530 functionsDefined: [], 37531 functionsUsed: [], 37532 functionsStackDeltas: [], 37533 tooComplexToFollowFunctions: false, 37534 hintsValid: true 37535 }; 37536 if (fpgm) { 37537 sanitizeTTProgram(fpgm, ttContext); 37538 } 37539 if (prep) { 37540 sanitizeTTProgram(prep, ttContext); 37541 } 37542 if (fpgm) { 37543 checkInvalidFunctions(ttContext, maxFunctionDefs); 37544 } 37545 if (cvt && cvt.length & 1) { 37546 var cvtData = new Uint8Array(cvt.length + 1); 37547 cvtData.set(cvt.data); 37548 cvt.data = cvtData; 37549 } 37550 return ttContext.hintsValid; 37551 } 37552 font = new _stream.Stream(new Uint8Array(font.getBytes())); 37553 var header = void 0, 37554 tables = void 0; 37555 if (isTrueTypeCollectionFile(font)) { 37556 var ttcData = readTrueTypeCollectionData(font, this.name); 37557 header = ttcData.header; 37558 tables = ttcData.tables; 37559 } else { 37560 header = readOpenTypeHeader(font); 37561 tables = readTables(font, header.numTables); 37562 } 37563 var cff = void 0, 37564 cffFile = void 0; 37565 var isTrueType = !tables['CFF ']; 37566 if (!isTrueType) { 37567 if (header.version === 'OTTO' && !(properties.composite && properties.cidToGidMap) || !tables['head'] || !tables['hhea'] || !tables['maxp'] || !tables['post']) { 37568 cffFile = new _stream.Stream(tables['CFF '].data); 37569 cff = new CFFFont(cffFile, properties); 37570 adjustWidths(properties); 37571 return this.convert(name, cff, properties); 37572 } 37573 delete tables['glyf']; 37574 delete tables['loca']; 37575 delete tables['fpgm']; 37576 delete tables['prep']; 37577 delete tables['cvt ']; 37578 this.isOpenType = true; 37579 } else { 37580 if (!tables['loca']) { 37581 throw new _util.FormatError('Required "loca" table is not found'); 37582 } 37583 if (!tables['glyf']) { 37584 (0, _util.warn)('Required "glyf" table is not found -- trying to re
37584cover.'); 37585 tables['glyf'] = { 37586 tag: 'glyf', 37587 data: new Uint8Array(0) 37588 }; 37589 } 37590 this.isOpenType = false; 37591 } 37592 if (!tables['maxp']) { 37593 throw new _util.FormatError('Required "maxp" table is not found'); 37594 } 37595 font.pos = (font.start || 0) + tables['maxp'].offset; 37596 var version = font.getInt32(); 37597 var numGlyphs = font.getUint16(); 37598 var maxFunctionDefs = 0; 37599 var maxSizeOfInstructions = 0; 37600 if (version >= 0x00010000 && tables['maxp'].length >= 22) { 37601 font.pos += 8; 37602 var maxZones = font.getUint16(); 37603 if (maxZones > 2) { 37604 tables['maxp'].data[14] = 0; 37605 tables['maxp'].data[15] = 2; 37606 } 37607 font.pos += 4; 37608 maxFunctionDefs = font.getUint16(); 37609 font.pos += 6; 37610 maxSizeOfInstructions = font.getUint16(); 37611 } 37612 var dupFirstEntry = false; 37613 if (properties.type === 'CIDFontType2' && properties.toUnicode && properties.toUnicode.get(0) > '\0') { 37614 dupFirstEntry = true; 37615 numGlyphs++; 37616 tables['maxp'].data[4] = numGlyphs >> 8; 37617 tables['maxp'].data[5] = numGlyphs & 255; 37618 } 37619 var hintsValid = sanitizeTTPrograms(tables['fpgm'], tables['prep'], tables['cvt '], maxFunctionDefs); 37620 if (!hintsValid) { 37621 delete tables['fpgm']; 37622 delete tables['prep']; 37623 delete tables['cvt ']; 37624 } 37625 sanitizeMetrics(font, tables['hhea'], tables['hmtx'], numGlyphs); 37626 if (!tables['head']) { 37627 throw new _util.FormatError('Required "head" table is not found'); 37628 } 37629 sanitizeHead(tables['head'], numGlyphs, isTrueType ? tables['loca'].length : 0); 37630 var missingGlyphs = Object.create(null); 37631 if (isTrueType) { 37632 var isGlyphLocationsLong = int16(tables['head'].data[50], tables['head'].data[51]); 37633 var glyphsInfo = sanitizeGlyphLocations(tables['loca'], tables['glyf'], numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions); 37634 missingGlyphs = glyphsInfo.missingGlyphs; 37635 if (version >= 0x00010000 && tables['maxp'].length >= 22) { 37636 tables['maxp'].data[26] = glyphsInfo.maxSizeOfInstructions >> 8; 37637 tables['maxp'].data[27] = glyphsInfo.maxSizeOfInstructions & 255; 37638 } 37639 } 37640 if (!tables['hhea']) { 37641 throw new _util.FormatError('Required "hhea" table is not found'); 37642 } 37643 if (tables['hhea'].data[10] === 0 && tables['hhea'].data[11] === 0) { 37644 tables['hhea'].data[10] = 0xFF; 37645 tables['hhea'].data[11] = 0xFF; 37646 } 37647 var metricsOverride = { 37648 unitsPerEm: int16(tables['head'].data[18], tables['head'].data[19]), 37649 yMax: int16(tables['head'].data[42], tables['head'].data[43]), 37650 yMin: signedInt16(tables['head'].data[38], tables['head'].data[39]), 37651 ascent: int16(tables['hhea'].data[4], tables['hhea'].data[5]), 37652 descent: signedInt16(tables['hhea'].data[6], tables['hhea'].data[7]) 37653 }; 37654 this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm; 37655 this.descent = metricsOverride.descent / metricsOverride.unitsPerEm; 37656 if (tables['post']) { 37657 var valid = readPostScriptTable(tables['post'], properties, numGlyphs); 37658 if (!valid) { 37659 tables['post'] = null; 37660 } 37661 } 37662 var charCodeToGlyphId = [], 37663 charCode; 37664 function hasGlyph(glyphId) { 37665 return !missingGlyphs[glyphId]; 37666 } 37667 if (properties.composite) { 37668 var cidToGidMap = properties.cidToGidMap || []; 37669 var isCidToGidMapEmpty = cidToGidMap.length === 0; 37670 properties.cMap.forEach(function (charCode, cid) { 37671 if (cid > 0xffff) { 37672 throw new _util.FormatError('Max size of CID is 65,535'); 37673 } 37674 var glyphId = -1; 37675 if (isCidToGidMapEmpty) { 37676 glyphId = cid; 37677 } else if (cidToGidMap[cid] !== undefined) { 37678 glyphId = cidToGidMap[cid]; 37679 } 37680 if (glyphId >= 0 && glyphId < numGlyphs && hasGlyph(glyphId)) {
vendor: 1,228 bytes, lines 37681-37700
37681 charCodeToGlyphId[charCode] = glyphId; 37682 } 37683 }); 37684 if (dupFirstEntry && (isCidToGidMapEmpty || !charCodeToGlyphId[0])) { 37685 charCodeToGlyphId[0] = numGlyphs - 1; 37686 } 37687 } else { 37688 var cmapTable = readCmapTable(tables['cmap'], font, this.isSymbolicFont, properties.hasEncoding); 37689 var cmapPlatformId = cmapTable.platformId; 37690 var cmapEncodingId = cmapTable.encodingId; 37691 var cmapMappings = cmapTable.mappings; 37692 var cmapMappingsLength = cmapMappings.length; 37693 if (properties.hasEncoding && (cmapPlatformId === 3 && cmapEncodingId === 1 || cmapPlatformId === 1 && cmapEncodingId === 0) || cmapPlatformId === -1 && cmapEncodingId === -1 && !!(0, _encodings.getEncoding)(properties.baseEncodingName)) { 37694 var baseEncoding = []; 37695 if (properties.baseEncodingName === 'MacRomanEncoding' || properties.baseEncodingName === 'WinAnsiEncoding') { 37696 baseEncoding = (0, _encodings.getEncoding)(properties.baseEncodingName); 37697 } 37698 var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 37699 for (charCode = 0; charCode < 256; charCode++) { 37700 var glyphName, standardGlyphName;
37701 if (this.differences && charCode in this.differences) { 37702 glyphName = this.differences[charCode]; 37703 } else if (charCode in baseEncoding && baseEncoding[charCode] !== '') { 37704 glyphName = baseEncoding[charCode]; 37705 } else { 37706 glyphName = _encodings.StandardEncoding[charCode]; 37707 } 37708 if (!glyphName) { 37709 continue; 37710 } 37711 standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); 37712 var unicodeOrCharCode; 37713 if (cmapPlatformId === 3 && cmapEncodingId === 1) { 37714 unicodeOrCharCode = glyphsUnicodeMap[standardGlyphName]; 37715 } else if (cmapPlatformId === 1 && cmapEncodingId === 0) { 37716 unicodeOrCharCode = _encodings.MacRomanEncoding.indexOf(standardGlyphName); 37717 } 37718 var found = false; 37719 for (var i = 0; i < cmapMappingsLength; ++i) { 37720 if (cmapMappings[i].charCode !== unicodeOrCharCode) { 37721 continue; 37722 } 37723 charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; 37724 found = true; 37725 break; 37726 } 37727 if (!found && properties.glyphNames) { 37728 var glyphId = properties.glyphNames.indexOf(glyphName); 37729 if (glyphId === -1 && standardGlyphName !== glyphName) { 37730 glyphId = properties.glyphNames.indexOf(standardGlyphName); 37731 } 37732 if (glyphId > 0 && hasGlyph(glyphId)) { 37733 charCodeToGlyphId[charCode] = glyphId; 37734 } 37735 } 37736 } 37737 } else if (cmapPlatformId === 0 && cmapEncodingId === 0) { 37738 for (var _i = 0; _i < cmapMappingsLength; ++_i) { 37739 charCodeToGlyphId[cmapMappings[_i].charCode] = cmapMappings[_i].glyphId; 37740 } 37741 } else { 37742 for (var _i2 = 0; _i2 < cmapMappingsLength; ++_i2) { 37743 charCode = cmapMappings[_i2].charCode; 37744 if (cmapPlatformId === 3 && charCode >= 0xF000 && charCode <= 0xF0FF) { 37745 charCode &= 0xFF; 37746 } 37747 charCodeToGlyphId[charCode] = cmapMappings[_i2].glyphId; 37748 } 37749 } 37750 } 37751 if (charCodeToGlyphId.length === 0) { 37752 charCodeToGlyphId[0] = 0; 37753 } 37754 var newMapping = adjustMapping(charCodeToGlyphId, properties, missingGlyphs); 37755 this.toFontChar = newMapping.toFontChar; 37756 tables['cmap'] = { 37757 tag: 'cmap', 37758 data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphs) 37759 }; 37760 if (!tables['OS/2'] || !validateOS2Table(tables['OS/2'])) { 37761 tables['OS/2'] = { 37762 tag: 'OS/2', 37763 data: createOS2Table(properties, newMapping.charCodeToGlyphId, metricsOverride) 37764 }; 37765 } 37766 if (!tables['post']) { 37767 tables['post'] = { 37768 tag: 'post', 37769 data: createPostTable(properties) 37770 }; 37771 } 37772 if (!isTrueType) { 37773 try { 37774 cffFile = new _stream.Stream(tables['CFF '].data); 37775 var parser = new _cff_parser.CFFParser(cffFile, properties, SEAC_ANALYSIS_ENABLED); 37776 cff = parser.parse(); 37777 var compiler = new _cff_parser.CFFCompiler(cff); 37778 tables['CFF '].data = compiler.compile(); 37779 } catch (e) { 37780 (0, _util.warn)('Failed to compile font ' + properties.loadedName); 37781 } 37782 } 37783 if (!tables['name']) { 37784 tables['name'] = { 37785 tag: 'name', 37786 data: createNameTable(this.name) 37787 }; 37788 } else { 37789 var namePrototype = readNameTable(tables['name']); 37790 tables['name'].data = createNameTable(name, namePrototype); 37791 } 37792 var builder = new OpenTypeFileBuilder(header.version); 37793 for (var tableTag in tables) { 37794 builder.addTable(tableTag, tables[tableTag].data); 37795 } 37796 return builder.toArray(); 37797 }, 37798 convert: function Font_convert(fontName, font, properties) { 37799 properties.fixedPitch = false; 37800 if (properties.builtInEncoding) { 37801 adjustToUnicode(properties, properties.builtInEncoding); 37802 } 37803 var mapping = font.getGlyphMapping(properties); 37804 var newMapping = adjustMapping(mapping, properties, Object.create(null)); 37805 this.toFontChar = newMapping.toFontChar; 37806 var numGlyphs = font.numGlyphs; 37807 function getCharCodes(charCodeToGlyphId, glyphId) {
vendor: 5,670 bytes, lines 37808-37929
37808 var charCodes = null; 37809 for (var charCode in charCodeToGlyphId) { 37810 if (glyphId === charCodeToGlyphId[charCode]) { 37811 if (!charCodes) { 37812 charCodes = []; 37813 } 37814 charCodes.push(charCode | 0); 37815 } 37816 } 37817 return charCodes; 37818 } 37819 function createCharCode(charCodeToGlyphId, glyphId) { 37820 for (var charCode in charCodeToGlyphId) { 37821 if (glyphId === charCodeToGlyphId[charCode]) { 37822 return charCode | 0; 37823 } 37824 } 37825 newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = glyphId; 37826 return newMapping.nextAvailableFontCharCode++; 37827 } 37828 var seacs = font.seacs; 37829 if (SEAC_ANALYSIS_ENABLED && seacs && seacs.length) { 37830 var matrix = properties.fontMatrix || _util.FONT_IDENTITY_MATRIX; 37831 var charset = font.getCharset(); 37832 var seacMap = Object.create(null); 37833 for (var glyphId in seacs) { 37834 glyphId |= 0; 37835 var seac = seacs[glyphId]; 37836 var baseGlyphName = _encodings.StandardEncoding[seac[2]]; 37837 var accentGlyphName = _encodings.StandardEncoding[seac[3]]; 37838 var baseGlyphId = charset.indexOf(baseGlyphName); 37839 var accentGlyphId = charset.indexOf(accentGlyphName); 37840 if (baseGlyphId < 0 || accentGlyphId < 0) { 37841 continue; 37842 } 37843 var accentOffset = { 37844 x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4], 37845 y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] 37846 }; 37847 var charCodes = getCharCodes(mapping, glyphId); 37848 if (!charCodes) { 37849 continue; 37850 } 37851 for (var i = 0, ii = charCodes.length; i < ii; i++) { 37852 var charCode = charCodes[i]; 37853 var charCodeToGlyphId = newMapping.charCodeToGlyphId; 37854 var baseFontCharCode = createCharCode(charCodeToGlyphId, baseGlyphId); 37855 var accentFontCharCode = createCharCode(charCodeToGlyphId, accentGlyphId); 37856 seacMap[charCode] = { 37857 baseFontCharCode: baseFontCharCode, 37858 accentFontCharCode: accentFontCharCode, 37859 accentOffset: accentOffset 37860 }; 37861 } 37862 } 37863 properties.seacMap = seacMap; 37864 } 37865 var unitsPerEm = 1 / (properties.fontMatrix || _util.FONT_IDENTITY_MATRIX)[0]; 37866 var builder = new OpenTypeFileBuilder('\x4F\x54\x54\x4F'); 37867 builder.addTable('CFF ', font.data); 37868 builder.addTable('OS/2', createOS2Table(properties, newMapping.charCodeToGlyphId)); 37869 builder.addTable('cmap', createCmapTable(newMapping.charCodeToGlyphId, numGlyphs)); 37870 builder.addTable('head', '\x00\x01\x00\x00' + '\x00\x00\x10\x00' + '\x00\x00\x00\x00' + '\x5F\x0F\x3C\xF5' + '\x00\x00' + safeString16(unitsPerEm) + '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + '\x00\x00' + safeString16(properties.descent) + '\x0F\xFF' + safeString16(properties.ascent) + string16(properties.italicAngle ? 2 : 0) + '\x00\x11' + '\x00\x00' + '\x00\x00' + '\x00\x00'); 37871 builder.addTable('hhea', '\x00\x01\x00\x00' + safeString16(properties.ascent) + safeString16(properties.descent) + '\x00\x00' + '\xFF\xFF' + '\x00\x00' + '\x00\x00' + '\x00\x00' + safeString16(properties.capHeight) + safeString16(Math.tan(properties.italicAngle) * properties.xHeight) + '\x00\x00' + '\x00\x00' + '\x00\x00' + '\x00\x00' + '\x00\x00' + '\x00\x00' + string16(numGlyphs)); 37872 builder.addTable('hmtx', function fontFieldsHmtx() { 37873 var charstrings = font.charstrings; 37874 var cffWidths = font.cff ? font.cff.widths : null; 37875 var hmtx = '\x00\x00\x00\x00'; 37876 for (var i = 1, ii = numGlyphs; i < ii; i++) { 37877 var width = 0; 37878 if (charstrings) { 37879 var charstring = charstrings[i - 1]; 37880 width = 'width' in charstring ? charstring.width : 0; 37881 } else if (cffWidths) { 37882 width = Math.ceil(cffWidths[i] || 0); 37883 } 37884 hmtx += string16(width) + string16(0); 37885 } 37886 return hmtx; 37887 }()); 37888 builder.addTable('maxp', '\x00\x00\x50\x00' + string16(numGlyphs)); 37889 builder.addTable('name', createNameTable(fontName)); 37890 builder.addTable('post', createPostTable(properties)); 37891 return builder.toArray(); 37892 }, 37893 get spaceWidth() { 37894 if ('_shadowWidth' in this) { 37895 return this._shadowWidth; 37896 } 37897 var possibleSpaceReplacements = ['space', 'minus', 'one', 'i', 'I']; 37898 var width; 37899 for (var i = 0, ii = possibleSpaceReplacements.length; i < ii; i++) { 37900 var glyphName = possibleSpaceReplacements[i]; 37901 if (glyphName in this.widths) { 37902 width = this.widths[glyphName]; 37903 break; 37904 } 37905 var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 37906 var glyphUnicode = glyphsUnicodeMap[glyphName]; 37907 var charcode = 0; 37908 if (this.composite) { 37909 if (this.cMap.contains(glyphUnicode)) { 37910 charcode = this.cMap.lookup(glyphUnicode); 37911 } 37912 } 37913 if (!charcode && this.toUnicode) { 37914 charcode = this.toUnicode.charCodeOf(glyphUnicode); 37915 } 37916 if (charcode <= 0) { 37917 charcode = glyphUnicode; 37918 } 37919 width = this.widths[charcode]; 37920 if (width) { 37921 break; 37922 } 37923 } 37924 width = width || this.defaultWidth; 37925 this._shadowWidth = width; 37926 return width; 37927 }, 37928 charToGlyph: function Font_charToGlyph(charcode, isSpace) { 37929 var fontCharCode, width, operatorListId;
37930 var widthCode = charcode; 37931 if (this.cMap && this.cMap.contains(charcode)) { 37932 widthCode = this.cMap.lookup(charcode); 37933 } 37934 width = this.widths[widthCode]; 37935 width = (0, _util.isNum)(width) ? width : this.defaultWidth; 37936 var vmetric = this.vmetrics && this.vmetrics[widthCode]; 37937 var unicode = this.toUnicode.get(charcode) || this.fallbackToUnicode.get(charcode) || charcode; 37938 if (typeof unicode === 'number') { 37939 unicode = String.fromCharCode(unicode); 37940 } 37941 var isInFont = charcode in this.toFontChar; 37942 fontCharCode = this.toFontChar[charcode] || charcode; 37943 if (this.missingFile) { 37944 fontCharCode = (0, _unicode.mapSpecialUnicodeValues)(fontCharCode); 37945 } 37946 if (this.isType3Font) { 37947 operatorListId = fontCharCode; 37948 } 37949 var accent = null; 37950 if (this.seacMap && this.seacMap[charcode]) { 37951 isInFont = true; 37952 var seac = this.seacMap[charcode]; 37953 fontCharCode = seac.baseFontCharCode; 37954 accent = { 37955 fontChar: String.fromCharCode(seac.accentFontCharCode), 37956 offset: seac.accentOffset 37957 }; 37958 } 37959 var fontChar = String.fromCharCode(fontCharCode); 37960 var glyph = this.glyphCache[charcode]; 37961 if (!glyph || !glyph.matchesForCache(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont)) { 37962 glyph = new Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont); 37963 this.glyphCache[charcode] = glyph; 37964 } 37965 return glyph; 37966 }, 37967 charsToGlyphs: function Font_charsToGlyphs(chars) { 37968 var charsCache = this.charsCache; 37969 var glyphs, glyph, charcode; 37970 if (charsCache) { 37971 glyphs = charsCache[chars]; 37972 if (glyphs) { 37973 return glyphs; 37974 } 37975 } 37976 if (!charsCache) { 37977 charsCache = this.charsCache = Object.create(null); 37978 } 37979 glyphs = []; 37980 var charsCacheKey = chars; 37981 var i = 0, 37982 ii; 37983 if (this.cMap) { 37984 var c = Object.create(null); 37985 while (i < chars.length) { 37986 this.cMap.readCharCode(chars, i, c); 37987 charcode = c.charcode; 37988 var length = c.length; 37989 i += length; 37990 var isSpace = length === 1 && chars.charCodeAt(i - 1) === 0x20; 37991 glyph = this.charToGlyph(charcode, isSpace); 37992 glyphs.push(glyph); 37993 } 37994 } else { 37995 for (i = 0, ii = chars.length; i < ii; ++i) { 37996 charcode = chars.charCodeAt(i); 37997 glyph = this.charToGlyph(charcode, charcode === 0x20); 37998 glyphs.push(glyph); 37999 } 38000 } 38001 return charsCache[charsCacheKey] = glyphs; 38002 } 38003 }; 38004 return Font; 38005}();
38006var ErrorFont = function ErrorFontClosure() { 38007 function ErrorFont(error) { 38008 this.error = error; 38009 this.loadedName = 'g_font_error'; 38010 this.loading = false; 38011 } 38012 ErrorFont.prototype = { 38013 charsToGlyphs: function ErrorFont_charsToGlyphs() { 38014 return []; 38015 }, 38016 exportData: function ErrorFont_exportData() { 38017 return { error: this.error }; 38018 } 38019 }; 38020 return ErrorFont; 38021}(); 38022function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) { 38023 var charCodeToGlyphId = Object.create(null); 38024 var glyphId, charCode, baseEncoding; 38025 var isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); 38026 if (properties.baseEncodingName) { 38027 baseEncoding = (0, _encodings.getEncoding)(properties.baseEncodingName); 38028 for (charCode = 0; charCode < baseEncoding.length; charCode++) { 38029 glyphId = glyphNames.indexOf(baseEncoding[charCode]); 38030 if (glyphId >= 0) { 38031 charCodeToGlyphId[charCode] = glyphId; 38032 } else { 38033 charCodeToGlyphId[charCode] = 0; 38034 } 38035 } 38036 } else if (isSymbolicFont) { 38037 for (charCode in builtInEncoding) { 38038 charCodeToGlyphId[charCode] = builtInEncoding[charCode]; 38039 } 38040 } else { 38041 baseEncoding = _encodings.StandardEncoding; 38042 for (charCode = 0; charCode < baseEncoding.length; charCode++) { 38043 glyphId = glyphNames.indexOf(baseEncoding[charCode]); 38044 if (glyphId >= 0) { 38045 charCodeToGlyphId[charCode] = glyphId; 38046 } else { 38047 charCodeToGlyphId[charCode] = 0; 38048 } 38049 } 38050 } 38051 var differences = properties.differences, 38052 glyphsUnicodeMap; 38053 if (differences) { 38054 for (charCode in differences) { 38055 var glyphName = differences[charCode]; 38056 glyphId = glyphNames.indexOf(glyphName); 38057 if (glyphId === -1) { 38058 if (!glyphsUnicodeMap) { 38059 glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 38060 } 38061 var standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); 38062 if (standardGlyphName !== glyphName) { 38063 glyphId = glyphNames.indexOf(standardGlyphName); 38064 } 38065 } 38066 if (glyphId >= 0) { 38067 charCodeToGlyphId[charCode] = glyphId; 38068 } else { 38069 charCodeToGlyphId[charCode] = 0; 38070 } 38071 } 38072 } 38073 return charCodeToGlyphId; 38074} 38075var Type1Font = function Type1FontClosure() { 38076 function findBlock(streamBytes, signature, startIndex) { 38077 var streamBytesLength = streamBytes.length; 38078 var signatureLength = signature.length; 38079 var scanLength = streamBytesLength - signatureLength; 38080 var i = startIndex, 38081 j, 38082 found = false; 38083 while (i < scanLength) { 38084 j = 0; 38085 while (j < signatureLength && streamBytes[i + j] === signature[j]) { 38086 j++; 38087 } 38088 if (j >= signatureLength) { 38089 i += j; 38090 while (i < streamBytesLength && (0, _util.isSpace)(streamBytes[i])) { 38091 i++; 38092 } 38093 found = true; 38094 break; 38095 } 38096 i++; 38097 } 38098 return { 38099 found: found, 38100 length: i 38101 }; 38102 } 38103 function getHeaderBlock(stream, suggestedLength) { 38104 var EEXEC_SIGNATURE = [0x65, 0x65, 0x78, 0x65, 0x63]; 38105 var streamStartPos = stream.pos; 38106 var headerBytes, headerBytesLength, block; 38107 try { 38108 headerBytes = stream.getBytes(suggestedLength); 38109 headerBytesLength = headerBytes.length; 38110 } catch (ex) { 38111 if (ex instanceof _util.MissingDataException) { 38112 throw ex; 38113 } 38114 } 38115 if (headerBytesLength === suggestedLength) { 38116 block = findBlock(headerBytes, EEXEC_SIGNATURE, suggestedLength - 2 * EEXEC_SIGNATURE.length); 38117 if (block.found && block.length === suggestedLength) { 38118 return { 38119 stream: new _stream.Stream(headerBytes), 38120 length: suggestedLength 38121 }; 38122 } 38123 } 38124 (0, _util.warn)('Invalid "Length1" property in Type1 font -- trying to recover.'); 38125 stream.pos = streamStartPos; 38126 var SCAN_BLOCK_LENGTH = 2048; 38127 var actualLength; 38128 while (true) { 38129 var scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); 38130 block = findBlock(scanBytes, EEXEC_SIGNATURE, 0); 38131 if (block.length === 0) { 38132 break; 38133 } 38134 stream.pos += block.length; 38135 if (block.found) { 38136 actualLength = stream.pos - streamStartPos; 38137 break; 38138 } 38139 } 38140 stream.pos = streamStartPos; 38141 if (actualLength) { 38142 return { 38143 stream: new _stream.Stream(stream.getBytes(actualLength)), 38144 length: actualLength 38145 }; 38146 }
vendor: 5,104 bytes, lines 38147-38276
38147 (0, _util.warn)('Unable to recover "Length1" property in Type1 font -- using as is.'); 38148 return { 38149 stream: new _stream.Stream(stream.getBytes(suggestedLength)), 38150 length: suggestedLength 38151 }; 38152 } 38153 function getEexecBlock(stream, suggestedLength) { 38154 var eexecBytes = stream.getBytes(); 38155 return { 38156 stream: new _stream.Stream(eexecBytes), 38157 length: eexecBytes.length 38158 }; 38159 } 38160 function Type1Font(name, file, properties) { 38161 var PFB_HEADER_SIZE = 6; 38162 var headerBlockLength = properties.length1; 38163 var eexecBlockLength = properties.length2; 38164 var pfbHeader = file.peekBytes(PFB_HEADER_SIZE); 38165 var pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01; 38166 if (pfbHeaderPresent) { 38167 file.skip(PFB_HEADER_SIZE); 38168 headerBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; 38169 } 38170 var headerBlock = getHeaderBlock(file, headerBlockLength); 38171 var headerBlockParser = new _type1_parser.Type1Parser(headerBlock.stream, false, SEAC_ANALYSIS_ENABLED); 38172 headerBlockParser.extractFontHeader(properties); 38173 if (pfbHeaderPresent) { 38174 pfbHeader = file.getBytes(PFB_HEADER_SIZE); 38175 eexecBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; 38176 } 38177 var eexecBlock = getEexecBlock(file, eexecBlockLength); 38178 var eexecBlockParser = new _type1_parser.Type1Parser(eexecBlock.stream, true, SEAC_ANALYSIS_ENABLED); 38179 var data = eexecBlockParser.extractFontProgram(); 38180 for (var info in data.properties) { 38181 properties[info] = data.properties[info]; 38182 } 38183 var charstrings = data.charstrings; 38184 var type2Charstrings = this.getType2Charstrings(charstrings); 38185 var subrs = this.getType2Subrs(data.subrs); 38186 this.charstrings = charstrings; 38187 this.data = this.wrap(name, type2Charstrings, this.charstrings, subrs, properties); 38188 this.seacs = this.getSeacs(data.charstrings); 38189 } 38190 Type1Font.prototype = { 38191 get numGlyphs() { 38192 return this.charstrings.length + 1; 38193 }, 38194 getCharset: function Type1Font_getCharset() { 38195 var charset = ['.notdef']; 38196 var charstrings = this.charstrings; 38197 for (var glyphId = 0; glyphId < charstrings.length; glyphId++) { 38198 charset.push(charstrings[glyphId].glyphName); 38199 } 38200 return charset; 38201 }, 38202 getGlyphMapping: function Type1Font_getGlyphMapping(properties) { 38203 var charstrings = this.charstrings; 38204 var glyphNames = ['.notdef'], 38205 glyphId; 38206 for (glyphId = 0; glyphId < charstrings.length; glyphId++) { 38207 glyphNames.push(charstrings[glyphId].glyphName); 38208 } 38209 var encoding = properties.builtInEncoding; 38210 if (encoding) { 38211 var builtInEncoding = Object.create(null); 38212 for (var charCode in encoding) { 38213 glyphId = glyphNames.indexOf(encoding[charCode]); 38214 if (glyphId >= 0) { 38215 builtInEncoding[charCode] = glyphId; 38216 } 38217 } 38218 } 38219 return type1FontGlyphMapping(properties, builtInEncoding, glyphNames); 38220 }, 38221 getSeacs: function Type1Font_getSeacs(charstrings) { 38222 var i, ii; 38223 var seacMap = []; 38224 for (i = 0, ii = charstrings.length; i < ii; i++) { 38225 var charstring = charstrings[i]; 38226 if (charstring.seac) { 38227 seacMap[i + 1] = charstring.seac; 38228 } 38229 } 38230 return seacMap; 38231 }, 38232 getType2Charstrings: function Type1Font_getType2Charstrings(type1Charstrings) { 38233 var type2Charstrings = []; 38234 for (var i = 0, ii = type1Charstrings.length; i < ii; i++) { 38235 type2Charstrings.push(type1Charstrings[i].charstring); 38236 } 38237 return type2Charstrings; 38238 }, 38239 getType2Subrs: function Type1Font_getType2Subrs(type1Subrs) { 38240 var bias = 0; 38241 var count = type1Subrs.length; 38242 if (count < 1133) { 38243 bias = 107; 38244 } else if (count < 33769) { 38245 bias = 1131; 38246 } else { 38247 bias = 32768; 38248 } 38249 var type2Subrs = []; 38250 var i; 38251 for (i = 0; i < bias; i++) { 38252 type2Subrs.push([0x0B]); 38253 } 38254 for (i = 0; i < count; i++) { 38255 type2Subrs.push(type1Subrs[i]); 38256 } 38257 return type2Subrs; 38258 }, 38259 wrap: function Type1Font_wrap(name, glyphs, charstrings, subrs, properties) { 38260 var cff = new _cff_parser.CFF(); 38261 cff.header = new _cff_parser.CFFHeader(1, 0, 4, 4); 38262 cff.names = [name]; 38263 var topDict = new _cff_parser.CFFTopDict(); 38264 topDict.setByName('version', 391); 38265 topDict.setByName('Notice', 392); 38266 topDict.setByName('FullName', 393); 38267 topDict.setByName('FamilyName', 394); 38268 topDict.setByName('Weight', 395); 38269 topDict.setByName('Encoding', null); 38270 topDict.setByName('FontMatrix', properties.fontMatrix); 38271 topDict.setByName('FontBBox', properties.bbox); 38272 topDict.setByName('charset', null); 38273 topDict.setByName('CharStrings', null); 38274 topDict.setByName('Private', null); 38275 cff.topDict = topDict; 38276 var strings = new _cff_parser.CFFStrings();
38277 strings.add('Version 0.11'); 38278 strings.add('See original notice'); 38279 strings.add(name); 38280 strings.add(name); 38281 strings.add('Medium'); 38282 cff.strings = strings; 38283 cff.globalSubrIndex = new _cff_parser.CFFIndex(); 38284 var count = glyphs.length; 38285 var charsetArray = [0]; 38286 var i, ii; 38287 for (i = 0; i < count; i++) { 38288 var index = _cff_parser.CFFStandardStrings.indexOf(charstrings[i].glyphName); 38289 if (index === -1) { 38290 index = 0; 38291 } 38292 charsetArray.push(index >> 8 & 0xff, index & 0xff); 38293 } 38294 cff.charset = new _cff_parser.CFFCharset(false, 0, [], charsetArray); 38295 var charStringsIndex = new _cff_parser.CFFIndex(); 38296 charStringsIndex.add([0x8B, 0x0E]); 38297 for (i = 0; i < count; i++) { 38298 var glyph = glyphs[i]; 38299 if (glyph.length === 0) { 38300 charStringsIndex.add([0x8B, 0x0E]); 38301 continue; 38302 } 38303 charStringsIndex.add(glyph); 38304 } 38305 cff.charStrings = charStringsIndex; 38306 var privateDict = new _cff_parser.CFFPrivateDict(); 38307 privateDict.setByName('Subrs', null); 38308 var fields = ['BlueValues', 'OtherBlues', 'FamilyBlues', 'FamilyOtherBlues', 'StemSnapH', 'StemSnapV', 'BlueShift', 'BlueFuzz', 'BlueScale', 'LanguageGroup', 'ExpansionFactor', 'ForceBold', 'StdHW', 'StdVW']; 38309 for (i = 0, ii = fields.length; i < ii; i++) { 38310 var field = fields[i]; 38311 if (!(field in properties.privateData)) { 38312 continue; 38313 } 38314 var value = properties.privateData[field]; 38315 if (Array.isArray(value)) { 38316 for (var j = value.length - 1; j > 0; j--) { 38317 value[j] -= value[j - 1]; 38318 } 38319 } 38320 privateDict.setByName(field, value); 38321 } 38322 cff.topDict.privateDict = privateDict; 38323 var subrIndex = new _cff_parser.CFFIndex(); 38324 for (i = 0, ii = subrs.length; i < ii; i++) { 38325 subrIndex.add(subrs[i]); 38326 } 38327 privateDict.subrsIndex = subrIndex; 38328 var compiler = new _cff_parser.CFFCompiler(cff); 38329 return compiler.compile(); 38330 } 38331 }; 38332 return Type1Font; 38333}(); 38334var CFFFont = function CFFFontClosure() { 38335 function CFFFont(file, properties) { 38336 this.properties = properties; 38337 var parser = new _cff_parser.CFFParser(file, properties, SEAC_ANALYSIS_ENABLED); 38338 this.cff = parser.parse(); 38339 var compiler = new _cff_parser.CFFCompiler(this.cff); 38340 this.seacs = this.cff.seacs; 38341 try { 38342 this.data = compiler.compile(); 38343 } catch (e) { 38344 (0, _util.warn)('Failed to compile font ' + properties.loadedName); 38345 this.data = file; 38346 } 38347 } 38348 CFFFont.prototype = { 38349 get numGlyphs() { 38350 return this.cff.charStrings.count; 38351 }, 38352 getCharset: function CFFFont_getCharset() { 38353 return this.cff.charset.charset; 38354 }, 38355 getGlyphMapping: function CFFFont_getGlyphMapping() { 38356 var cff = this.cff; 38357 var properties = this.properties; 38358 var charsets = cff.charset.charset; 38359 var charCodeToGlyphId; 38360 var glyphId; 38361 if (properties.composite) { 38362 charCodeToGlyphId = Object.create(null); 38363 if (cff.isCIDFont) { 38364 for (glyphId = 0; glyphId < charsets.length; glyphId++) { 38365 var cid = charsets[glyphId]; 38366 var charCode = properties.cMap.charCodeOf(cid); 38367 charCodeToGlyphId[charCode] = glyphId; 38368 } 38369 } else { 38370 for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) { 38371 charCodeToGlyphId[glyphId] = glyphId; 38372 } 38373 } 38374 return charCodeToGlyphId; 38375 } 38376 var encoding = cff.encoding ? cff.encoding.encoding : null; 38377 charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets); 38378 return charCodeToGlyphId; 38379 } 38380 }; 38381 return CFFFont; 38382}(); 38383(function checkSeacSupport() { 38384 if (typeof navigator !== 'undefined' && /Windows/.test(navigator.userAgent)) { 38385 exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED = true; 38386 } 38387})(); 38388(function checkChromeWindows() { 38389 if (typeof navigator !== 'undefined' && /Windows.*Chrome/.test(navigator.userAgent)) { 38390 SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = true; 38391 } 38392})(); 38393exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED; 38394exports.PRIVATE_USE_OFFSET_START = PRIVATE_USE_OFFSET_START; 38395exports.PRIVATE_USE_OFFSET_END = PRIVATE_USE_OFFSET_END;
38396exports.ErrorFont = ErrorFont; 38397exports.Font = Font; 38398exports.FontFlags = FontFlags; 38399exports.ToUnicodeMap = ToUnicodeMap; 38400exports.IdentityToUnicodeMap = IdentityToUnicodeMap; 38401exports.ProblematicCharRanges = ProblematicCharRanges; 38402exports.getFontType = getFontType; 38403 38404/***/ }), 38405/* 138 */ 38406/***/ (function(module, exports, __w_pdfjs_require__) { 38407 38408"use strict"; 38409 38410 38411Object.defineProperty(exports, "__esModule", { 38412 value: true 38413}); 38414var ISOAdobeCharset = ['.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', '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', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'quoteleft', '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', 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', 'questiondown', 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'emdash', 'AE', 'ordfeminine', 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', 'dotlessi', 'lslash', 'oslash', 'oe', 'germandbls', 'onesuperior', 'logicalnot', 'mu', 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', 'onequarter', 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', 'twosuperior', 'registered', 'minus', 'eth', 'multiply', 'threesuperior', 'copyright', 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', 'Atilde', 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', 'Ocircumflex', 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', 'Ucircumflex', 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', 'aacute', 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', 'ccedilla', 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', 'icircumflex', 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', 'odieresis', 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', 'udieresis', 'ugrave', 'yacute', 'ydieresis', 'zcaron']; 38415var ExpertCharset = ['.notdef', 'space', 'exclamsmall', 'Hungarumlautsmall', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'questionsmall', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', 'Tildesmall', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', 'Dotaccentsmall', 'Macronsmall', 'figuredash', 'hypheninferior', 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', 'onequarter', 'onehalf', 'threequarters', 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', 'Ydieresissmall']; 38416var ExpertSubsetCharset = ['.notdef', 'space', 'dollaroldstyle', 'dollarsuperior', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', 'hyphensuperior', 'colonmonetary', 'onefitted', 'rupiah', 'centoldstyle', 'figuredash', 'hypheninferior', 'onequarter', 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior']; 38417exports.ISOAdobeCharset = ISOAdobeCharset; 38418exports.ExpertCharset = ExpertCharset; 38419exports.ExpertSubsetCharset = ExpertSubsetCharset; 38420 38421/***/ }), 38422/* 139 */ 38423/***/ (function(module, exports, __w_pdfjs_require__) { 38424 38425"use strict"; 38426 38427 38428Object.defineProperty(exports, "__esModule", { 38429 value: true 38430}); 38431exports.FontRendererFactory = undefined; 38432 38433var _util = __w_pdfjs_require__(0); 38434 38435var _cff_parser = __w_pdfjs_require__(68); 38436 38437var _glyphlist = __w_pdfjs_require__(43); 38438 38439var _encodings = __w_pdfjs_require__(21); 38440 38441var _stream = __w_pdfjs_require__(2); 38442 38443var FontRendererFactory = function FontRendererFactoryClosure() { 38444 function getLong(data, offset) { 38445 return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; 38446 } 38447 function getUshort(data, offset) { 38448 return data[offset] << 8 | data[offset + 1]; 38449 } 38450 function parseCmap(data, start, end) {
38451 var offset = getUshort(data, start + 2) === 1 ? getLong(data, start + 8) : getLong(data, start + 16); 38452 var format = getUshort(data, start + offset); 38453 var ranges, p, i; 38454 if (format === 4) { 38455 getUshort(data, start + offset + 2); 38456 var segCount = getUshort(data, start + offset + 6) >> 1; 38457 p = start + offset + 14; 38458 ranges = []; 38459 for (i = 0; i < segCount; i++, p += 2) { 38460 ranges[i] = { end: getUshort(data, p) }; 38461 } 38462 p += 2; 38463 for (i = 0; i < segCount; i++, p += 2) { 38464 ranges[i].start = getUshort(data, p); 38465 } 38466 for (i = 0; i < segCount; i++, p += 2) { 38467 ranges[i].idDelta = getUshort(data, p); 38468 } 38469 for (i = 0; i < segCount; i++, p += 2) { 38470 var idOffset = getUshort(data, p); 38471 if (idOffset === 0) { 38472 continue; 38473 } 38474 ranges[i].ids = []; 38475 for (var j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) { 38476 ranges[i].ids[j] = getUshort(data, p + idOffset); 38477 idOffset += 2; 38478 } 38479 } 38480 return ranges; 38481 } else if (format === 12) { 38482 getLong(data, start + offset + 4); 38483 var groups = getLong(data, start + offset + 12); 38484 p = start + offset + 16; 38485 ranges = []; 38486 for (i = 0; i < groups; i++) { 38487 ranges.push({ 38488 start: getLong(data, p), 38489 end: getLong(data, p + 4), 38490 idDelta: getLong(data, p + 8) - getLong(data, p) 38491 }); 38492 p += 12; 38493 } 38494 return ranges; 38495 } 38496 throw new _util.FormatError('unsupported cmap: ' + format); 38497 } 38498 function parseCff(data, start, end, seacAnalysisEnabled) { 38499 var properties = {}; 38500 var parser = new _cff_parser.CFFParser(new _stream.Stream(data, start, end - start), properties, seacAnalysisEnabled); 38501 var cff = parser.parse(); 38502 return { 38503 glyphs: cff.charStrings.objects, 38504 subrs: cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex && cff.topDict.privateDict.subrsIndex.objects, 38505 gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects 38506 }; 38507 } 38508 function parseGlyfTable(glyf, loca, isGlyphLocationsLong) { 38509 var itemSize, itemDecode; 38510 if (isGlyphLocationsLong) { 38511 itemSize = 4; 38512 itemDecode = function fontItemDecodeLong(data, offset) { 38513 return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; 38514 }; 38515 } else { 38516 itemSize = 2; 38517 itemDecode = function fontItemDecode(data, offset) { 38518 return data[offset] << 9 | data[offset + 1] << 1; 38519 }; 38520 } 38521 var glyphs = []; 38522 var startOffset = itemDecode(loca, 0); 38523 for (var j = itemSize; j < loca.length; j += itemSize) { 38524 var endOffset = itemDecode(loca, j); 38525 glyphs.push(glyf.subarray(startOffset, endOffset)); 38526 startOffset = endOffset; 38527 } 38528 return glyphs; 38529 } 38530 function lookupCmap(ranges, unicode) { 38531 var code = unicode.charCodeAt(0), 38532 gid = 0; 38533 var l = 0, 38534 r = ranges.length - 1; 38535 while (l < r) { 38536 var c = l + r + 1 >> 1; 38537 if (code < ranges[c].start) { 38538 r = c - 1; 38539 } else { 38540 l = c; 38541 } 38542 } 38543 if (ranges[l].start <= code && code <= ranges[l].end) { 38544 gid = ranges[l].idDelta + (ranges[l].ids ? ranges[l].ids[code - ranges[l].start] : code) & 0xFFFF; 38545 } 38546 return { 38547 charCode: code, 38548 glyphId: gid 38549 }; 38550 } 38551 function compileGlyf(code, cmds, font) { 38552 function moveTo(x, y) { 38553 cmds.push({ 38554 cmd: 'moveTo', 38555 args: [x, y] 38556 }); 38557 } 38558 function lineTo(x, y) { 38559 cmds.push({ 38560 cmd: 'lineTo', 38561 args: [x, y] 38562 }); 38563 } 38564 function quadraticCurveTo(xa, ya, x, y) { 38565 cmds.push({ 38566 cmd: 'quadraticCurveTo', 38567 args: [xa, ya, x, y] 38568 }); 38569 } 38570 var i = 0; 38571 var numberOfContours = (code[i] << 24 | code[i + 1] << 16) >> 16; 38572 var flags; 38573 var x = 0, 38574 y = 0; 38575 i += 10; 38576 if (numberOfContours < 0) { 38577 do { 38578 flags = code[i] << 8 | code[i + 1];
38579 var glyphIndex = code[i + 2] << 8 | code[i + 3]; 38580 i += 4; 38581 var arg1, arg2; 38582 if (flags & 0x01) { 38583 arg1 = (code[i] << 24 | code[i + 1] << 16) >> 16; 38584 arg2 = (code[i + 2] << 24 | code[i + 3] << 16) >> 16; 38585 i += 4; 38586 } else { 38587 arg1 = code[i++]; 38588 arg2 = code[i++]; 38589 } 38590 if (flags & 0x02) { 38591 x = arg1; 38592 y = arg2; 38593 } else { 38594 x = 0; 38595 y = 0; 38596 } 38597 var scaleX = 1, 38598 scaleY = 1, 38599 scale01 = 0, 38600 scale10 = 0; 38601 if (flags & 0x08) { 38602 scaleX = scaleY = (code[i] << 24 | code[i + 1] << 16) / 1073741824; 38603 i += 2; 38604 } else if (flags & 0x40) { 38605 scaleX = (code[i] << 24 | code[i + 1] << 16) / 1073741824; 38606 scaleY = (code[i + 2] << 24 | code[i + 3] << 16) / 1073741824; 38607 i += 4; 38608 } else if (flags & 0x80) { 38609 scaleX = (code[i] << 24 | code[i + 1] << 16) / 1073741824; 38610 scale01 = (code[i + 2] << 24 | code[i + 3] << 16) / 1073741824; 38611 scale10 = (code[i + 4] << 24 | code[i + 5] << 16) / 1073741824; 38612 scaleY = (code[i + 6] << 24 | code[i + 7] << 16) / 1073741824; 38613 i += 8; 38614 } 38615 var subglyph = font.glyphs[glyphIndex]; 38616 if (subglyph) { 38617 cmds.push({ cmd: 'save' }); 38618 cmds.push({ 38619 cmd: 'transform', 38620 args: [scaleX, scale01, scale10, scaleY, x, y] 38621 }); 38622 compileGlyf(subglyph, cmds, font); 38623 cmds.push({ cmd: 'restore' }); 38624 } 38625 } while (flags & 0x20); 38626 } else { 38627 var endPtsOfContours = []; 38628 var j, jj; 38629 for (j = 0; j < numberOfContours; j++) { 38630 endPtsOfContours.push(code[i] << 8 | code[i + 1]); 38631 i += 2; 38632 } 38633 var instructionLength = code[i] << 8 | code[i + 1]; 38634 i += 2 + instructionLength; 38635 var numberOfPoints = endPtsOfContours[endPtsOfContours.length - 1] + 1; 38636 var points = []; 38637 while (points.length < numberOfPoints) { 38638 flags = code[i++]; 38639 var repeat = 1; 38640 if (flags & 0x08) { 38641 repeat += code[i++]; 38642 } 38643 while (repeat-- > 0) { 38644 points.push({ flags: flags }); 38645 } 38646 } 38647 for (j = 0; j < numberOfPoints; j++) { 38648 switch (points[j].flags & 0x12) { 38649 case 0x00: 38650 x += (code[i] << 24 | code[i + 1] << 16) >> 16; 38651 i += 2; 38652 break; 38653 case 0x02: 38654 x -= code[i++]; 38655 break; 38656 case 0x12: 38657 x += code[i++]; 38658 break; 38659 } 38660 points[j].x = x; 38661 } 38662 for (j = 0; j < numberOfPoints; j++) { 38663 switch (points[j].flags & 0x24) { 38664 case 0x00: 38665 y += (code[i] << 24 | code[i + 1] << 16) >> 16; 38666 i += 2; 38667 break; 38668 case 0x04: 38669 y -= code[i++]; 38670 break; 38671 case 0x24: 38672 y += code[i++]; 38673 break; 38674 } 38675 points[j].y = y; 38676 } 38677 var startPoint = 0; 38678 for (i = 0; i < numberOfContours; i++) { 38679 var endPoint = endPtsOfContours[i]; 38680 var contour = points.slice(startPoint, endPoint + 1); 38681 if (contour[0].flags & 1) { 38682 contour.push(contour[0]); 38683 } else if (contour[contour.length - 1].flags & 1) { 38684 contour.unshift(contour[contour.length - 1]); 38685 } else { 38686 var p = { 38687 flags: 1, 38688 x: (contour[0].x + contour[contour.length - 1].x) / 2, 38689 y: (contour[0].y + contour[contour.length - 1].y) / 2 38690 }; 38691 contour.unshift(p); 38692 contour.push(p); 38693 } 38694 moveTo(contour[0].x, contour[0].y); 38695 for (j = 1, jj = contour.length; j < jj; j++) { 38696 if (contour[j].flags & 1) { 38697 lineTo(contour[j].x, contour[j].y); 38698 } else if (contour[j + 1].flags & 1) { 38699 quadraticCurveTo(contour[j].x, contour[j].y, contour[j + 1].x, contour[j + 1].y); 38700 j++; 38701 } else { 38702 quadraticCurveTo(contour[j].x, contour[j].y, (contour[j].x + contour[j + 1].x) / 2, (contour[j].y + contour[j + 1].y) / 2); 38703 } 38704 } 38705 startPoint = endPoint + 1; 38706 } 38707 } 38708 } 38709 function compileCharString(code, cmds, font) { 38710 var stack = []; 38711 var x = 0, 38712 y = 0; 38713 var stems = 0; 38714 function moveTo(x, y) { 38715 cmds.push({ 38716 cmd: 'moveTo', 38717 args: [x, y] 38718 }); 38719 } 38720 function lineTo(x, y) { 38721 cmds.push({ 38722 cmd: 'lineTo', 38723 args: [x, y] 38724 }); 38725 } 38726 function bezierCurveTo(x1, y1, x2, y2, x, y) { 38727 cmds.push({ 38728 cmd: 'bezierCurveTo', 38729 args: [x1, y1, x2, y2, x, y] 38730 }); 38731 } 38732 function parse(code) { 38733 var i = 0; 38734 while (i < code.length) { 38735 var stackClean = false; 38736 var v = code[i++]; 38737 var xa, xb, ya, yb, y1, y2, y3, n, subrCode; 38738 switch (v) { 38739 case 1: 38740 stems += stack.length >> 1; 38741 stackClean = true; 38742 break; 38743 case 3: 38744 stems += stack.length >> 1; 38745 stackClean = true; 38746 break; 38747 case 4: 38748 y += stack.pop(); 38749 moveTo(x, y); 38750 stackClean = true; 38751 break; 38752 case 5: 38753 while (stack.length > 0) { 38754 x += stack.shift(); 38755 y += stack.shift(); 38756 lineTo(x, y); 38757 } 38758 break; 38759 case 6: 38760 while (stack.length > 0) { 38761 x += stack.shift(); 38762 lineTo(x, y); 38763 if (stack.length === 0) { 38764 break; 38765 } 38766 y += stack.shift(); 38767 lineTo(x, y); 38768 } 38769 break; 38770 case 7: 38771 while (stack.length > 0) { 38772 y += stack.shift(); 38773 lineTo(x, y); 38774 if (stack.length === 0) { 38775 break; 38776 } 38777 x += stack.shift(); 38778 lineTo(x, y); 38779 } 38780 break; 38781 case 8: 38782 while (stack.length > 0) { 38783 xa = x + stack.shift(); 38784 ya = y + stack.shift(); 38785 xb = xa + stack.shift(); 38786 yb = ya + stack.shift(); 38787 x = xb + stack.shift(); 38788 y = yb + stack.shift(); 38789 bezierCurveTo(xa, ya, xb, yb, x, y); 38790 } 38791 break; 38792 case 10: 38793 n = stack.pop() + font.subrsBias; 38794 subrCode = font.subrs[n]; 38795 if (subrCode) { 38796 parse(subrCode); 38797 } 38798 break; 38799 case 11: 38800 return; 38801 case 12: 38802 v = code[i++]; 38803 switch (v) { 38804 case 34: 38805 xa = x + stack.shift(); 38806 xb = xa + stack.shift(); 38807 y1 = y + stack.shift(); 38808 x = xb + stack.shift(); 38809 bezierCurveTo(xa, y, xb, y1, x, y1);
vendor: 8,080 bytes, lines 38810-39036
38810 xa = x + stack.shift(); 38811 xb = xa + stack.shift(); 38812 x = xb + stack.shift(); 38813 bezierCurveTo(xa, y1, xb, y, x, y); 38814 break; 38815 case 35: 38816 xa = x + stack.shift(); 38817 ya = y + stack.shift(); 38818 xb = xa + stack.shift(); 38819 yb = ya + stack.shift(); 38820 x = xb + stack.shift(); 38821 y = yb + stack.shift(); 38822 bezierCurveTo(xa, ya, xb, yb, x, y); 38823 xa = x + stack.shift(); 38824 ya = y + stack.shift(); 38825 xb = xa + stack.shift(); 38826 yb = ya + stack.shift(); 38827 x = xb + stack.shift(); 38828 y = yb + stack.shift(); 38829 bezierCurveTo(xa, ya, xb, yb, x, y); 38830 stack.pop(); 38831 break; 38832 case 36: 38833 xa = x + stack.shift(); 38834 y1 = y + stack.shift(); 38835 xb = xa + stack.shift(); 38836 y2 = y1 + stack.shift(); 38837 x = xb + stack.shift(); 38838 bezierCurveTo(xa, y1, xb, y2, x, y2); 38839 xa = x + stack.shift(); 38840 xb = xa + stack.shift(); 38841 y3 = y2 + stack.shift(); 38842 x = xb + stack.shift(); 38843 bezierCurveTo(xa, y2, xb, y3, x, y); 38844 break; 38845 case 37: 38846 var x0 = x, 38847 y0 = y; 38848 xa = x + stack.shift(); 38849 ya = y + stack.shift(); 38850 xb = xa + stack.shift(); 38851 yb = ya + stack.shift(); 38852 x = xb + stack.shift(); 38853 y = yb + stack.shift(); 38854 bezierCurveTo(xa, ya, xb, yb, x, y); 38855 xa = x + stack.shift(); 38856 ya = y + stack.shift(); 38857 xb = xa + stack.shift(); 38858 yb = ya + stack.shift(); 38859 x = xb; 38860 y = yb; 38861 if (Math.abs(x - x0) > Math.abs(y - y0)) { 38862 x += stack.shift(); 38863 } else { 38864 y += stack.shift(); 38865 } 38866 bezierCurveTo(xa, ya, xb, yb, x, y); 38867 break; 38868 default: 38869 throw new _util.FormatError('unknown operator: 12 ' + v); 38870 } 38871 break; 38872 case 14: 38873 if (stack.length >= 4) { 38874 var achar = stack.pop(); 38875 var bchar = stack.pop(); 38876 y = stack.pop(); 38877 x = stack.pop(); 38878 cmds.push({ cmd: 'save' }); 38879 cmds.push({ 38880 cmd: 'translate', 38881 args: [x, y] 38882 }); 38883 var cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[_encodings.StandardEncoding[achar]])); 38884 compileCharString(font.glyphs[cmap.glyphId], cmds, font); 38885 cmds.push({ cmd: 'restore' }); 38886 cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[_encodings.StandardEncoding[bchar]])); 38887 compileCharString(font.glyphs[cmap.glyphId], cmds, font); 38888 } 38889 return; 38890 case 18: 38891 stems += stack.length >> 1; 38892 stackClean = true; 38893 break; 38894 case 19: 38895 stems += stack.length >> 1; 38896 i += stems + 7 >> 3; 38897 stackClean = true; 38898 break; 38899 case 20: 38900 stems += stack.length >> 1; 38901 i += stems + 7 >> 3; 38902 stackClean = true; 38903 break; 38904 case 21: 38905 y += stack.pop(); 38906 x += stack.pop(); 38907 moveTo(x, y); 38908 stackClean = true; 38909 break; 38910 case 22: 38911 x += stack.pop(); 38912 moveTo(x, y); 38913 stackClean = true; 38914 break; 38915 case 23: 38916 stems += stack.length >> 1; 38917 stackClean = true; 38918 break; 38919 case 24: 38920 while (stack.length > 2) { 38921 xa = x + stack.shift(); 38922 ya = y + stack.shift(); 38923 xb = xa + stack.shift(); 38924 yb = ya + stack.shift(); 38925 x = xb + stack.shift(); 38926 y = yb + stack.shift(); 38927 bezierCurveTo(xa, ya, xb, yb, x, y); 38928 } 38929 x += stack.shift(); 38930 y += stack.shift(); 38931 lineTo(x, y); 38932 break; 38933 case 25: 38934 while (stack.length > 6) { 38935 x += stack.shift(); 38936 y += stack.shift(); 38937 lineTo(x, y); 38938 } 38939 xa = x + stack.shift(); 38940 ya = y + stack.shift(); 38941 xb = xa + stack.shift(); 38942 yb = ya + stack.shift(); 38943 x = xb + stack.shift(); 38944 y = yb + stack.shift(); 38945 bezierCurveTo(xa, ya, xb, yb, x, y); 38946 break; 38947 case 26: 38948 if (stack.length % 2) { 38949 x += stack.shift(); 38950 } 38951 while (stack.length > 0) { 38952 xa = x; 38953 ya = y + stack.shift(); 38954 xb = xa + stack.shift(); 38955 yb = ya + stack.shift(); 38956 x = xb; 38957 y = yb + stack.shift(); 38958 bezierCurveTo(xa, ya, xb, yb, x, y); 38959 } 38960 break; 38961 case 27: 38962 if (stack.length % 2) { 38963 y += stack.shift(); 38964 } 38965 while (stack.length > 0) { 38966 xa = x + stack.shift(); 38967 ya = y; 38968 xb = xa + stack.shift(); 38969 yb = ya + stack.shift(); 38970 x = xb + stack.shift(); 38971 y = yb; 38972 bezierCurveTo(xa, ya, xb, yb, x, y); 38973 } 38974 break; 38975 case 28: 38976 stack.push((code[i] << 24 | code[i + 1] << 16) >> 16); 38977 i += 2; 38978 break; 38979 case 29: 38980 n = stack.pop() + font.gsubrsBias; 38981 subrCode = font.gsubrs[n]; 38982 if (subrCode) { 38983 parse(subrCode); 38984 } 38985 break; 38986 case 30: 38987 while (stack.length > 0) { 38988 xa = x; 38989 ya = y + stack.shift(); 38990 xb = xa + stack.shift(); 38991 yb = ya + stack.shift(); 38992 x = xb + stack.shift(); 38993 y = yb + (stack.length === 1 ? stack.shift() : 0); 38994 bezierCurveTo(xa, ya, xb, yb, x, y); 38995 if (stack.length === 0) { 38996 break; 38997 } 38998 xa = x + stack.shift(); 38999 ya = y; 39000 xb = xa + stack.shift(); 39001 yb = ya + stack.shift(); 39002 y = yb + stack.shift(); 39003 x = xb + (stack.length === 1 ? stack.shift() : 0); 39004 bezierCurveTo(xa, ya, xb, yb, x, y); 39005 } 39006 break; 39007 case 31: 39008 while (stack.length > 0) { 39009 xa = x + stack.shift(); 39010 ya = y; 39011 xb = xa + stack.shift(); 39012 yb = ya + stack.shift(); 39013 y = yb + stack.shift(); 39014 x = xb + (stack.length === 1 ? stack.shift() : 0); 39015 bezierCurveTo(xa, ya, xb, yb, x, y); 39016 if (stack.length === 0) { 39017 break; 39018 } 39019 xa = x; 39020 ya = y + stack.shift(); 39021 xb = xa + stack.shift(); 39022 yb = ya + stack.shift(); 39023 x = xb + stack.shift(); 39024 y = yb + (stack.length === 1 ? stack.shift() : 0); 39025 bezierCurveTo(xa, ya, xb, yb, x, y); 39026 } 39027 break; 39028 default: 39029 if (v < 32) { 39030 throw new _util.FormatError('unknown operator: ' + v); 39031 } 39032 if (v < 247) { 39033 stack.push(v - 139); 39034 } else if (v < 251) { 39035 stack.push((v - 247) * 256 + code[i++] + 108); 39036 } else if (v < 255) {
39037 stack.push(-(v - 251) * 256 - code[i++] - 108); 39038 } else { 39039 stack.push((code[i] << 24 | code[i + 1] << 16 | code[i + 2] << 8 | code[i + 3]) / 65536); 39040 i += 4; 39041 } 39042 break; 39043 } 39044 if (stackClean) { 39045 stack.length = 0; 39046 } 39047 } 39048 } 39049 parse(code); 39050 } 39051 var noop = ''; 39052 function CompiledFont(fontMatrix) { 39053 this.compiledGlyphs = Object.create(null); 39054 this.compiledCharCodeToGlyphId = Object.create(null); 39055 this.fontMatrix = fontMatrix; 39056 } 39057 CompiledFont.prototype = { 39058 getPathJs: function getPathJs(unicode) { 39059 var cmap = lookupCmap(this.cmap, unicode); 39060 var fn = this.compiledGlyphs[cmap.glyphId]; 39061 if (!fn) { 39062 fn = this.compileGlyph(this.glyphs[cmap.glyphId]); 39063 this.compiledGlyphs[cmap.glyphId] = fn; 39064 } 39065 if (this.compiledCharCodeToGlyphId[cmap.charCode] === undefined) { 39066 this.compiledCharCodeToGlyphId[cmap.charCode] = cmap.glyphId; 39067 } 39068 return fn; 39069 }, 39070 compileGlyph: function compileGlyph(code) { 39071 if (!code || code.length === 0 || code[0] === 14) { 39072 return noop; 39073 } 39074 var cmds = []; 39075 cmds.push({ cmd: 'save' }); 39076 cmds.push({ 39077 cmd: 'transform', 39078 args: this.fontMatrix.slice() 39079 }); 39080 cmds.push({ 39081 cmd: 'scale', 39082 args: ['size', '-size'] 39083 }); 39084 this.compileGlyphImpl(code, cmds); 39085 cmds.push({ cmd: 'restore' }); 39086 return cmds; 39087 }, 39088 compileGlyphImpl: function compileGlyphImpl() { 39089 (0, _util.unreachable)('Children classes should implement this.'); 39090 }, 39091 hasBuiltPath: function hasBuiltPath(unicode) { 39092 var cmap = lookupCmap(this.cmap, unicode); 39093 return this.compiledGlyphs[cmap.glyphId] !== undefined && this.compiledCharCodeToGlyphId[cmap.charCo
vendor: 11,366 bytes, lines 39093-39422
39093de] !== undefined; 39094 } 39095 }; 39096 function TrueTypeCompiled(glyphs, cmap, fontMatrix) { 39097 fontMatrix = fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0]; 39098 CompiledFont.call(this, fontMatrix); 39099 this.glyphs = glyphs; 39100 this.cmap = cmap; 39101 } 39102 _util.Util.inherit(TrueTypeCompiled, CompiledFont, { 39103 compileGlyphImpl: function compileGlyphImpl(code, cmds) { 39104 compileGlyf(code, cmds, this); 39105 } 39106 }); 39107 function Type2Compiled(cffInfo, cmap, fontMatrix, glyphNameMap) { 39108 fontMatrix = fontMatrix || [0.001, 0, 0, 0.001, 0, 0]; 39109 CompiledFont.call(this, fontMatrix); 39110 this.glyphs = cffInfo.glyphs; 39111 this.gsubrs = cffInfo.gsubrs || []; 39112 this.subrs = cffInfo.subrs || []; 39113 this.cmap = cmap; 39114 this.glyphNameMap = glyphNameMap || (0, _glyphlist.getGlyphsUnicode)(); 39115 this.gsubrsBias = this.gsubrs.length < 1240 ? 107 : this.gsubrs.length < 33900 ? 1131 : 32768; 39116 this.subrsBias = this.subrs.length < 1240 ? 107 : this.subrs.length < 33900 ? 1131 : 32768; 39117 } 39118 _util.Util.inherit(Type2Compiled, CompiledFont, { 39119 compileGlyphImpl: function compileGlyphImpl(code, cmds) { 39120 compileCharString(code, cmds, this); 39121 } 39122 }); 39123 return { 39124 create: function FontRendererFactory_create(font, seacAnalysisEnabled) { 39125 var data = new Uint8Array(font.data); 39126 var cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm; 39127 var numTables = getUshort(data, 4); 39128 for (var i = 0, p = 12; i < numTables; i++, p += 16) { 39129 var tag = (0, _util.bytesToString)(data.subarray(p, p + 4)); 39130 var offset = getLong(data, p + 8); 39131 var length = getLong(data, p + 12); 39132 switch (tag) { 39133 case 'cmap': 39134 cmap = parseCmap(data, offset, offset + length); 39135 break; 39136 case 'glyf': 39137 glyf = data.subarray(offset, offset + length); 39138 break; 39139 case 'loca': 39140 loca = data.subarray(offset, offset + length); 39141 break; 39142 case 'head': 39143 unitsPerEm = getUshort(data, offset + 18); 39144 indexToLocFormat = getUshort(data, offset + 50); 39145 break; 39146 case 'CFF ': 39147 cff = parseCff(data, offset, offset + length, seacAnalysisEnabled); 39148 break; 39149 } 39150 } 39151 if (glyf) { 39152 var fontMatrix = !unitsPerEm ? font.fontMatrix : [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0]; 39153 return new TrueTypeCompiled(parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); 39154 } 39155 return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap); 39156 } 39157 }; 39158}(); 39159exports.FontRendererFactory = FontRendererFactory; 39160 39161/***/ }), 39162/* 140 */ 39163/***/ (function(module, exports, __w_pdfjs_require__) { 39164 39165"use strict"; 39166 39167 39168Object.defineProperty(exports, "__esModule", { 39169 value: true 39170}); 39171exports.Type1Parser = undefined; 39172 39173var _util = __w_pdfjs_require__(0); 39174 39175var _encodings = __w_pdfjs_require__(21); 39176 39177var _stream = __w_pdfjs_require__(2); 39178 39179var HINTING_ENABLED = false; 39180var Type1CharString = function Type1CharStringClosure() { 39181 var COMMAND_MAP = { 39182 'hstem': [1], 39183 'vstem': [3], 39184 'vmoveto': [4], 39185 'rlineto': [5], 39186 'hlineto': [6], 39187 'vlineto': [7], 39188 'rrcurveto': [8], 39189 'callsubr': [10], 39190 'flex': [12, 35], 39191 'drop': [12, 18], 39192 'endchar': [14], 39193 'rmoveto': [21], 39194 'hmoveto': [22], 39195 'vhcurveto': [30], 39196 'hvcurveto': [31] 39197 }; 39198 function Type1CharString() { 39199 this.width = 0; 39200 this.lsb = 0; 39201 this.flexing = false; 39202 this.output = []; 39203 this.stack = []; 39204 } 39205 Type1CharString.prototype = { 39206 convert: function Type1CharString_convert(encoded, subrs, seacAnalysisEnabled) { 39207 var count = encoded.length; 39208 var error = false; 39209 var wx, sbx, subrNumber; 39210 for (var i = 0; i < count; i++) { 39211 var value = encoded[i]; 39212 if (value < 32) { 39213 if (value === 12) { 39214 value = (value << 8) + encoded[++i]; 39215 } 39216 switch (value) { 39217 case 1: 39218 if (!HINTING_ENABLED) { 39219 this.stack = []; 39220 break; 39221 } 39222 error = this.executeCommand(2, COMMAND_MAP.hstem); 39223 break; 39224 case 3: 39225 if (!HINTING_ENABLED) { 39226 this.stack = []; 39227 break; 39228 } 39229 error = this.executeCommand(2, COMMAND_MAP.vstem); 39230 break; 39231 case 4: 39232 if (this.flexing) { 39233 if (this.stack.length < 1) { 39234 error = true; 39235 break; 39236 } 39237 var dy = this.stack.pop(); 39238 this.stack.push(0, dy); 39239 break; 39240 } 39241 error = this.executeCommand(1, COMMAND_MAP.vmoveto); 39242 break; 39243 case 5: 39244 error = this.executeCommand(2, COMMAND_MAP.rlineto); 39245 break; 39246 case 6: 39247 error = this.executeCommand(1, COMMAND_MAP.hlineto); 39248 break; 39249 case 7: 39250 error = this.executeCommand(1, COMMAND_MAP.vlineto); 39251 break; 39252 case 8: 39253 error = this.executeCommand(6, COMMAND_MAP.rrcurveto); 39254 break; 39255 case 9: 39256 this.stack = []; 39257 break; 39258 case 10: 39259 if (this.stack.length < 1) { 39260 error = true; 39261 break; 39262 } 39263 subrNumber = this.stack.pop(); 39264 if (!subrs[subrNumber]) { 39265 error = true; 39266 break; 39267 } 39268 error = this.convert(subrs[subrNumber], subrs, seacAnalysisEnabled); 39269 break; 39270 case 11: 39271 return error; 39272 case 13: 39273 if (this.stack.length < 2) { 39274 error = true; 39275 break; 39276 } 39277 wx = this.stack.pop(); 39278 sbx = this.stack.pop(); 39279 this.lsb = sbx; 39280 this.width = wx; 39281 this.stack.push(wx, sbx); 39282 error = this.executeCommand(2, COMMAND_MAP.hmoveto); 39283 break; 39284 case 14: 39285 this.output.push(COMMAND_MAP.endchar[0]); 39286 break; 39287 case 21: 39288 if (this.flexing) { 39289 break; 39290 } 39291 error = this.executeCommand(2, COMMAND_MAP.rmoveto); 39292 break; 39293 case 22: 39294 if (this.flexing) { 39295 this.stack.push(0); 39296 break; 39297 } 39298 error = this.executeCommand(1, COMMAND_MAP.hmoveto); 39299 break; 39300 case 30: 39301 error = this.executeCommand(4, COMMAND_MAP.vhcurveto); 39302 break; 39303 case 31: 39304 error = this.executeCommand(4, COMMAND_MAP.hvcurveto); 39305 break; 39306 case (12 << 8) + 0: 39307 this.stack = []; 39308 break; 39309 case (12 << 8) + 1: 39310 if (!HINTING_ENABLED) { 39311 this.stack = []; 39312 break; 39313 } 39314 error = this.executeCommand(2, COMMAND_MAP.vstem); 39315 break; 39316 case (12 << 8) + 2: 39317 if (!HINTING_ENABLED) { 39318 this.stack = []; 39319 break; 39320 } 39321 error = this.executeCommand(2, COMMAND_MAP.hstem); 39322 break; 39323 case (12 << 8) + 6: 39324 if (seacAnalysisEnabled) { 39325 this.seac = this.stack.splice(-4, 4); 39326 error = this.executeCommand(0, COMMAND_MAP.endchar); 39327 } else { 39328 error = this.executeCommand(4, COMMAND_MAP.endchar); 39329 } 39330 break; 39331 case (12 << 8) + 7: 39332 if (this.stack.length < 4) { 39333 error = true; 39334 break; 39335 } 39336 this.stack.pop(); 39337 wx = this.stack.pop(); 39338 var sby = this.stack.pop(); 39339 sbx = this.stack.pop(); 39340 this.lsb = sbx; 39341 this.width = wx; 39342 this.stack.push(wx, sbx, sby); 39343 error = this.executeCommand(3, COMMAND_MAP.rmoveto); 39344 break; 39345 case (12 << 8) + 12: 39346 if (this.stack.length < 2) { 39347 error = true; 39348 break; 39349 } 39350 var num2 = this.stack.pop(); 39351 var num1 = this.stack.pop(); 39352 this.stack.push(num1 / num2); 39353 break; 39354 case (12 << 8) + 16: 39355 if (this.stack.length < 2) { 39356 error = true; 39357 break; 39358 } 39359 subrNumber = this.stack.pop(); 39360 var numArgs = this.stack.pop(); 39361 if (subrNumber === 0 && numArgs === 3) { 39362 var flexArgs = this.stack.splice(this.stack.length - 17, 17); 39363 this.stack.push(flexArgs[2] + flexArgs[0], flexArgs[3] + flexArgs[1], flexArgs[4], flexArgs[5], flexArgs[6], flexArgs[7], flexArgs[8], flexArgs[9], flexArgs[10], flexArgs[11], flexArgs[12], flexArgs[13], flexArgs[14]); 39364 error = this.executeCommand(13, COMMAND_MAP.flex, true); 39365 this.flexing = false; 39366 this.stack.push(flexArgs[15], flexArgs[16]); 39367 } else if (subrNumber === 1 && numArgs === 0) { 39368 this.flexing = true; 39369 } 39370 break; 39371 case (12 << 8) + 17: 39372 break; 39373 case (12 << 8) + 33: 39374 this.stack = []; 39375 break; 39376 default: 39377 (0, _util.warn)('Unknown type 1 charstring command of "' + value + '"'); 39378 break; 39379 } 39380 if (error) { 39381 break; 39382 } 39383 continue; 39384 } else if (value <= 246) { 39385 value = value - 139; 39386 } else if (value <= 250) { 39387 value = (value - 247) * 256 + encoded[++i] + 108; 39388 } else if (value <= 254) { 39389 value = -((value - 251) * 256) - encoded[++i] - 108; 39390 } else { 39391 value = (encoded[++i] & 0xff) << 24 | (encoded[++i] & 0xff) << 16 | (encoded[++i] & 0xff) << 8 | (encoded[++i] & 0xff) << 0; 39392 } 39393 this.stack.push(value); 39394 } 39395 return error; 39396 }, 39397 executeCommand: function executeCommand(howManyArgs, command, keepStack) { 39398 var stackLength = this.stack.length; 39399 if (howManyArgs > stackLength) { 39400 return true; 39401 } 39402 var start = stackLength - howManyArgs; 39403 for (var i = start; i < stackLength; i++) { 39404 var value = this.stack[i]; 39405 if (Number.isInteger(value)) { 39406 this.output.push(28, value >> 8 & 0xff, value & 0xff); 39407 } else { 39408 value = 65536 * value | 0; 39409 this.output.push(255, value >> 24 & 0xFF, value >> 16 & 0xFF, value >> 8 & 0xFF, value & 0xFF); 39410 } 39411 } 39412 this.output.push.apply(this.output, command); 39413 if (keepStack) { 39414 this.stack.splice(start, howManyArgs); 39415 } else { 39416 this.stack.length = 0; 39417 } 39418 return false; 39419 } 39420 }; 39421 return Type1CharString; 39422}();
39423var Type1Parser = function Type1ParserClosure() { 39424 var EEXEC_ENCRYPT_KEY = 55665; 39425 var CHAR_STRS_ENCRYPT_KEY = 4330; 39426 function isHexDigit(code) { 39427 return code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102; 39428 } 39429 function decrypt(data, key, discardNumber) { 39430 if (discardNumber >= data.length) { 39431 return new Uint8Array(0); 39432 } 39433 var r = key | 0, 39434 c1 = 52845, 39435 c2 = 22719, 39436 i, 39437 j; 39438 for (i = 0; i < discardNumber; i++) { 39439 r = (data[i] + r) * c1 + c2 & (1 << 16) - 1; 39440 } 39441 var count = data.length - discardNumber; 39442 var decrypted = new Uint8Array(count); 39443 for (i = discardNumber, j = 0; j < count; i++, j++) { 39444 var value = data[i]; 39445 decrypted[j] = value ^ r >> 8; 39446 r = (value + r) * c1 + c2 & (1 << 16) - 1; 39447 } 39448 return decrypted; 39449 } 39450 function decryptAscii(data, key, discardNumber) { 39451 var r = key | 0, 39452 c1 = 52845, 39453 c2 = 22719; 39454 var count = data.length, 39455 maybeLength = count >>> 1; 39456 var decrypted = new Uint8Array(maybeLength); 39457 var i, j; 39458 for (i = 0, j = 0; i < count; i++) { 39459 var digit1 = data[i]; 39460 if (!isHexDigit(digit1)) { 39461 continue; 39462 } 39463 i++; 39464 var digit2; 39465 while (i < count && !isHexDigit(digit2 = data[i])) { 39466 i++; 39467 } 39468 if (i < count) { 39469 var value = parseInt(String.fromCharCode(digit1, digit2), 16); 39470 decrypted[j++] = value ^ r >> 8; 39471 r = (value + r) * c1 + c2 & (1 << 16) - 1; 39472 } 39473 } 39474 return Array.prototype.slice.call(decrypted, discardNumber, j); 39475 } 39476 function isSpecial(c) { 39477 return c === 0x2F || c === 0x5B || c === 0x5D || c === 0x7B || c === 0x7D || c === 0x28 || c === 0x29; 39478 } 39479 function Type1Parser(stream, encrypted, seacAnalysisEnabled) { 39480 if (encrypted) { 39481 var data = stream.getBytes(); 39482 var isBinary = !(isHexDigit(data[0]) && isHexDigit(data[1]) && isHexDigit(data[2]) && isHexDigit(data[3])); 39483 stream = new _stream.Stream(isBinary ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) : decryptAscii(data, EEXEC_ENCRYPT_KEY, 4)); 39484 } 39485 this.seacAnalysisEnabled = !!seacAnalysisEnabled; 39486 this.stream = stream; 39487 this.nextChar(); 39488 } 39489 Type1Parser.prototype = { 39490 readNumberArray: function Type1Parser_readNumberArray() { 39491 this.getToken(); 39492 var array = []; 39493 while (true) { 39494 var token = this.getToken(); 39495 if (token === null || token === ']' || token === '}') { 39496 break; 39497 } 39498 array.push(parseFloat(token || 0)); 39499 } 39500 return array; 39501 }, 39502 readNumber: function Type1Parser_readNumber() { 39503 var token = this.getToken(); 39504 return parseFloat(token || 0); 39505 }, 39506 readInt: function Type1Parser_readInt() { 39507 var token = this.getToken(); 39508 return parseInt(token || 0, 10) | 0; 39509 }, 39510 readBoolean: function Type1Parser_readBoolean() { 39511 var token = this.getToken(); 39512 return token === 'true' ? 1 : 0; 39513 }, 39514 nextChar: function Type1_nextChar() { 39515 return this.currentChar = this.stream.getByte(); 39516 }, 39517 getToken: function Type1Parser_getToken() { 39518 var comment = false; 39519 var ch = this.currentChar; 39520 while (true) { 39521 if (ch === -1) { 39522 return null; 39523 } 39524 if (comment) { 39525 if (ch === 0x0A || ch === 0x0D) { 39526 comment = false; 39527 } 39528 } else if (ch === 0x25) { 39529 comment = true; 39530 } else if (!(0, _util.isSpace)(ch)) { 39531 break; 39532 } 39533 ch = this.nextChar(); 39534 } 39535 if (isSpecial(ch)) { 39536 this.nextChar(); 39537 return String.fromCharCode(ch); 39538 } 39539 var token = ''; 39540 do { 39541 token += String.fromCharCode(ch); 39542 ch = this.nextChar(); 39543 } while (ch >= 0 && !(0, _util.isSpace)(ch) && !isSpecial(ch)); 39544 return token; 39545 }, 39546 readCharStrings: function Type1Parser_readCharStrings(bytes, lenIV) { 39547 if (lenIV === -1) { 39548 return bytes; 39549 } 39550 return decrypt(bytes, CHAR_STRS_ENCRYPT_KEY, lenIV); 39551 }, 39552 extractFontProgram: function Type1Parser_extractFontProgram() { 39553 var stream = this.stream; 39554 var subrs = [], 39555 charstrings = []; 39556 var privateData = Object.create(null); 39557 privateData['lenIV'] = 4; 39558 var program = { 39559 subrs: [], 39560 charstrings: [], 39561 properties: { 'privateData': privateData } 39562 }; 39563 var token, length, data, lenIV, encoded; 39564 while ((token = this.getToken()) !== null) { 39565 if (token !== '/') { 39566 continue; 39567 } 39568 token = this.getToken(); 39569 switch (token) { 39570 case 'CharStrings': 39571 this.getToken(); 39572 this.getToken(); 39573 this.getToken(); 39574 this.getToken(); 39575 while (true) { 39576 token = this.getToken(); 39577 if (token === null || token === 'end') { 39578 break; 39579 } 39580 if (token !== '/') { 39581 continue; 39582 } 39583 var glyph = this.getToken(); 39584 length = this.readInt(); 39585 this.getToken(); 39586 data = stream.makeSubStream(stream.pos, length); 39587 lenIV = program.properties.privateData['lenIV']; 39588 encoded = this.readCharStrings(data.getBytes(), lenIV); 39589 stream.skip(length); 39590 this.nextChar(); 39591 token = this.getToken(); 39592 if (token === 'noaccess') { 39593 this.getToken(); 39594 } 39595 charstrings.push({ 39596 glyph: glyph, 39597 encoded: encoded 39598 }); 39599 } 39600 break; 39601 case 'Subrs': 39602 this.readInt(); 39603 this.getToken(); 39604 while (this.getToken() === 'dup') { 39605 var index = this.readInt(); 39606 length = this.readInt(); 39607 this.getToken(); 39608 data = stream.makeSubStream(stream.pos, length); 39609 lenIV = program.properties.privateData['lenIV']; 39610 encoded = this.readCharStrings(data.getBytes(), lenIV); 39611 stream.skip(length); 39612 this.nextChar(); 39613 token = this.getToken(); 39614 if (token === 'noaccess') { 39615 this.getToken(); 39616 } 39617 subrs[index] = encoded; 39618 } 39619 break; 39620 case 'BlueValues': 39621 case 'OtherBlues': 39622 case 'FamilyBlues': 39623 case 'FamilyOtherBlues': 39624 var blueArray = this.readNumberArray(); 39625 if (blueArray.length > 0 && blueArray.length % 2 === 0 && HINTING_ENABLED) { 39626 program.properties.privateData[token] = blueArray; 39627 } 39628 break; 39629 case 'StemSnapH': 39630 case 'StemSnapV': 39631 program.properties.privateData[token] = this.readNumberArray(); 39632 break; 39633 case 'StdHW': 39634 case 'StdVW': 39635 program.properties.privateData[token] = this.readNumberArray()[0]; 39636 break;
39637 case 'BlueShift': 39638 case 'lenIV': 39639 case 'BlueFuzz': 39640 case 'BlueScale': 39641 case 'LanguageGroup': 39642 case 'ExpansionFactor': 39643 program.properties.privateData[token] = this.readNumber(); 39644 break; 39645 case 'ForceBold': 39646 program.properties.privateData[token] = this.readBoolean(); 39647 break; 39648 } 39649 } 39650 for (var i = 0; i < charstrings.length; i++) { 39651 glyph = charstrings[i].glyph; 39652 encoded = charstrings[i].encoded; 39653 var charString = new Type1CharString(); 39654 var error = charString.convert(encoded, subrs, this.seacAnalysisEnabled); 39655 var output = charString.output; 39656 if (error) { 39657 output = [14]; 39658 } 39659 program.charstrings.push({ 39660 glyphName: glyph, 39661 charstring: output, 39662 width: charString.width, 39663 lsb: charString.lsb, 39664 seac: charString.seac 39665 }); 39666 } 39667 return program; 39668 }, 39669 extractFontHeader: function Type1Parser_extractFontHeader(properties) { 39670 var token; 39671 while ((token = this.getToken()) !== null) { 39672 if (token !== '/') { 39673 continue; 39674 } 39675 token = this.getToken(); 39676 switch (token) { 39677 case 'FontMatrix': 39678 var matrix = this.readNumberArray(); 39679 properties.fontMatrix = matrix; 39680 break; 39681 case 'Encoding': 39682 var encodingArg = this.getToken(); 39683 var encoding; 39684 if (!/^\d+$/.test(encodingArg)) { 39685 encoding = (0, _encodings.getEncoding)(encodingArg); 39686 } else { 39687 encoding = []; 39688 var size = parseInt(encodingArg, 10) | 0; 39689 this.getToken(); 39690 for (var j = 0; j < size; j++) { 39691 token = this.getToken(); 39692 while (token !== 'dup' && token !== 'def') { 39693 token = this.getToken(); 39694 if (token === null) { 39695 return; 39696 } 39697 } 39698 if (token === 'def') { 39699 break; 39700 } 39701 var index = this.readInt(); 39702 this.getToken(); 39703 var glyph = this.getToken(); 39704 encoding[index] = glyph; 39705 this.getToken(); 39706 } 39707 } 39708 properties.builtInEncoding = encoding; 39709 break; 39710 case 'FontBBox': 39711 var fontBBox = this.readNumberArray(); 39712 properties.ascent = Math.max(fontBBox[3], fontBBox[1]); 39713 properties.descent = Math.min(fontBBox[1], fontBBox[3]); 39714 properties.ascentScaled = true; 39715 break; 39716 } 39717 } 39718 } 39719 }; 39720 return Type1Parser; 39721}(); 39722exports.Type1Parser = Type1Parser; 39723 39724/***/ }), 39725/* 141 */ 39726/***/ (function(module, exports, __w_pdfjs_require__) { 39727 39728"use strict"; 39729 39730 39731Object.defineProperty(exports, "__esModule", { 39732 value: true 39733}); 39734exports.getTilingPatternIR = exports.Pattern = undefined; 39735 39736var _util = __w_pdfjs_require__(0); 39737 39738var _colorspace = __w_pdfjs_require__(20); 39739 39740var _primitives = __w_pdfjs_require__(1); 39741 39742var ShadingType = { 39743 FUNCTION_BASED: 1, 39744 AXIAL: 2, 39745 RADIAL: 3, 39746 FREE_FORM_MESH: 4, 39747 LATTICE_FORM_MESH: 5, 39748 COONS_PATCH_MESH: 6, 39749 TENSOR_PATCH_MESH: 7 39750}; 39751var Pattern = function PatternClosure() { 39752 function Pattern() { 39753 (0, _util.unreachable)('should not call Pattern constructor'); 39754 } 39755 Pattern.prototype = { 39756 getPattern: function Pattern_getPattern(ctx) { 39757 (0, _util.unreachable)('Should not call Pattern.getStyle: ' + ctx); 39758 } 39759 }; 39760 Pattern.parseShading = function (shading, matrix, xref, res, handler, pdfFunctionFactory) { 39761 var dict = (0, _primitives.isStream)(shading) ? shading.dict : shading; 39762 var type = dict.get('ShadingType'); 39763 try { 39764 switch (type) { 39765 case ShadingType.AXIAL: 39766 case ShadingType.RADIAL: 39767 return new Shadings.RadialAxial(dict, matrix, xref, res, pdfFunctionFactory); 39768 case ShadingType.FREE_FORM_MESH: 39769 case ShadingType.LATTICE_FORM_MESH: 39770 case ShadingType.COONS_PATCH_MESH: 39771 case ShadingType.TENSOR_PATCH_MESH: 39772 return new Shadings.Mesh(shading, matrix, xref, res, pdfFunctionFactory); 39773 default: 39774 throw new _util.FormatError('Unsupported ShadingType: ' + type); 39775 } 39776 } catch (ex) { 39777 if (ex instanceof _util.MissingDataException) { 39778 throw ex; 39779 } 39780 handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.shadingPattern }); 39781 (0, _util.warn)(ex); 39782 return new Shadings.Dummy(); 39783 } 39784 }; 39785 return Pattern; 39786}(); 39787var Shadings = {}; 39788Shadings.SMALL_NUMBER = 1e-6; 39789Shadings.RadialAxial = function RadialAxialClosure() { 39790 function RadialAxial(dict, matrix, xref, res, pdfFunctionFactory) { 39791 this.matrix = matrix; 39792 this.coordsArr = dict.getArray('Coords'); 39793 this.shadingType = dict.get('ShadingType'); 39794 this.type = 'Pattern'; 39795 var cs = dict.get('ColorSpace', 'CS'); 39796 cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory); 39797 this.cs = cs; 39798 var t0 = 0.0, 39799 t1 = 1.0; 39800 if (dict.has('Domain')) { 39801 var domainArr = dict.getArray('Domain'); 39802 t0 = domainArr[0]; 39803 t1 = domainArr[1]; 39804 } 39805 var extendStart = false, 39806 extendEnd = false; 39807 if (dict.has('Extend')) { 39808 var extendArr = dict.getArray('Extend'); 39809 extendStart = extendArr[0]; 39810 extendEnd = extendArr[1]; 39811 } 39812 if (this.shadingType === ShadingType.RADIAL && (!extendStart || !extendEnd)) { 39813 var x1 = this.coordsArr[0]; 39814 var y1 = this.coordsArr[1]; 39815 var r1 = this.coordsArr[2]; 39816 var x2 = this.coordsArr[3]; 39817 var y2 = this.coordsArr[4]; 39818 var r2 = this.coordsArr[5]; 39819 var distance = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); 39820 if (r1 <= r2 + distance && r2 <= r1 + distance) { 39821 (0, _util.warn)('Unsupported radial gradient.'); 39822 } 39823 } 39824 this.extendStart = extendStart; 39825 this.extendEnd = extendEnd; 39826 var fnObj = dict.get('Function'); 39827 var fn = pdfFunctionFactory.createFromArray(fnObj); 39828 var diff = t1 - t0; 39829 var step = diff / 10; 39830 var colorStops = this.colorStops = []; 39831 if (t0 >= t1 || step <= 0) { 39832 (0, _util.info)('Bad shading domain.'); 39833 return; 39834 } 39835 var color = new Float32Array(cs.numComps), 39836 ratio = new Float32Array(1); 39837 var rgbColor; 39838 for (var i = t0; i <= t1; i += step) { 39839 ratio[0] = i; 39840 fn(ratio, 0, color, 0); 39841 rgbColor = cs.getRgb(color, 0); 39842 var cssColor = _util.Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); 39843 colorStops.push([(i - t0) / diff, cssColor]);
vendor: 6,230 bytes, lines 39844-40017
39844 } 39845 var background = 'transparent'; 39846 if (dict.has('Background')) { 39847 rgbColor = cs.getRgb(dict.get('Background'), 0); 39848 background = _util.Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); 39849 } 39850 if (!extendStart) { 39851 colorStops.unshift([0, background]); 39852 colorStops[1][0] += Shadings.SMALL_NUMBER; 39853 } 39854 if (!extendEnd) { 39855 colorStops[colorStops.length - 1][0] -= Shadings.SMALL_NUMBER; 39856 colorStops.push([1, background]); 39857 } 39858 this.colorStops = colorStops; 39859 } 39860 RadialAxial.prototype = { 39861 getIR: function RadialAxial_getIR() { 39862 var coordsArr = this.coordsArr; 39863 var shadingType = this.shadingType; 39864 var type, p0, p1, r0, r1; 39865 if (shadingType === ShadingType.AXIAL) { 39866 p0 = [coordsArr[0], coordsArr[1]]; 39867 p1 = [coordsArr[2], coordsArr[3]]; 39868 r0 = null; 39869 r1 = null; 39870 type = 'axial'; 39871 } else if (shadingType === ShadingType.RADIAL) { 39872 p0 = [coordsArr[0], coordsArr[1]]; 39873 p1 = [coordsArr[3], coordsArr[4]]; 39874 r0 = coordsArr[2]; 39875 r1 = coordsArr[5]; 39876 type = 'radial'; 39877 } else { 39878 (0, _util.unreachable)('getPattern type unknown: ' + shadingType); 39879 } 39880 var matrix = this.matrix; 39881 if (matrix) { 39882 p0 = _util.Util.applyTransform(p0, matrix); 39883 p1 = _util.Util.applyTransform(p1, matrix); 39884 if (shadingType === ShadingType.RADIAL) { 39885 var scale = _util.Util.singularValueDecompose2dScale(matrix); 39886 r0 *= scale[0]; 39887 r1 *= scale[1]; 39888 } 39889 } 39890 return ['RadialAxial', type, this.colorStops, p0, p1, r0, r1]; 39891 } 39892 }; 39893 return RadialAxial; 39894}(); 39895Shadings.Mesh = function MeshClosure() { 39896 function MeshStreamReader(stream, context) { 39897 this.stream = stream; 39898 this.context = context; 39899 this.buffer = 0; 39900 this.bufferLength = 0; 39901 var numComps = context.numComps; 39902 this.tmpCompsBuf = new Float32Array(numComps); 39903 var csNumComps = context.colorSpace.numComps; 39904 this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : this.tmpCompsBuf; 39905 } 39906 MeshStreamReader.prototype = { 39907 get hasData() { 39908 if (this.stream.end) { 39909 return this.stream.pos < this.stream.end; 39910 } 39911 if (this.bufferLength > 0) { 39912 return true; 39913 } 39914 var nextByte = this.stream.getByte(); 39915 if (nextByte < 0) { 39916 return false; 39917 } 39918 this.buffer = nextByte; 39919 this.bufferLength = 8; 39920 return true; 39921 }, 39922 readBits: function MeshStreamReader_readBits(n) { 39923 var buffer = this.buffer; 39924 var bufferLength = this.bufferLength; 39925 if (n === 32) { 39926 if (bufferLength === 0) { 39927 return (this.stream.getByte() << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte()) >>> 0; 39928 } 39929 buffer = buffer << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte(); 39930 var nextByte = this.stream.getByte(); 39931 this.buffer = nextByte & (1 << bufferLength) - 1; 39932 return (buffer << 8 - bufferLength | (nextByte & 0xFF) >> bufferLength) >>> 0; 39933 } 39934 if (n === 8 && bufferLength === 0) { 39935 return this.stream.getByte(); 39936 } 39937 while (bufferLength < n) { 39938 buffer = buffer << 8 | this.stream.getByte(); 39939 bufferLength += 8; 39940 } 39941 bufferLength -= n; 39942 this.bufferLength = bufferLength; 39943 this.buffer = buffer & (1 << bufferLength) - 1; 39944 return buffer >> bufferLength; 39945 }, 39946 align: function MeshStreamReader_align() { 39947 this.buffer = 0; 39948 this.bufferLength = 0; 39949 }, 39950 readFlag: function MeshStreamReader_readFlag() { 39951 return this.readBits(this.context.bitsPerFlag); 39952 }, 39953 readCoordinate: function MeshStreamReader_readCoordinate() { 39954 var bitsPerCoordinate = this.context.bitsPerCoordinate; 39955 var xi = this.readBits(bitsPerCoordinate); 39956 var yi = this.readBits(bitsPerCoordinate); 39957 var decode = this.context.decode; 39958 var scale = bitsPerCoordinate < 32 ? 1 / ((1 << bitsPerCoordinate) - 1) : 2.3283064365386963e-10; 39959 return [xi * scale * (decode[1] - decode[0]) + decode[0], yi * scale * (decode[3] - decode[2]) + decode[2]]; 39960 }, 39961 readComponents: function MeshStreamReader_readComponents() { 39962 var numComps = this.context.numComps; 39963 var bitsPerComponent = this.context.bitsPerComponent; 39964 var scale = bitsPerComponent < 32 ? 1 / ((1 << bitsPerComponent) - 1) : 2.3283064365386963e-10; 39965 var decode = this.context.decode; 39966 var components = this.tmpCompsBuf; 39967 for (var i = 0, j = 4; i < numComps; i++, j += 2) { 39968 var ci = this.readBits(bitsPerComponent); 39969 components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j]; 39970 } 39971 var color = this.tmpCsCompsBuf; 39972 if (this.context.colorFn) { 39973 this.context.colorFn(components, 0, color, 0); 39974 } 39975 return this.context.colorSpace.getRgb(color, 0); 39976 } 39977 }; 39978 function decodeType4Shading(mesh, reader) { 39979 var coords = mesh.coords; 39980 var colors = mesh.colors; 39981 var operators = []; 39982 var ps = []; 39983 var verticesLeft = 0; 39984 while (reader.hasData) { 39985 var f = reader.readFlag(); 39986 var coord = reader.readCoordinate(); 39987 var color = reader.readComponents(); 39988 if (verticesLeft === 0) { 39989 if (!(0 <= f && f <= 2)) { 39990 throw new _util.FormatError('Unknown type4 flag'); 39991 } 39992 switch (f) { 39993 case 0: 39994 verticesLeft = 3; 39995 break; 39996 case 1: 39997 ps.push(ps[ps.length - 2], ps[ps.length - 1]); 39998 verticesLeft = 1; 39999 break; 40000 case 2: 40001 ps.push(ps[ps.length - 3], ps[ps.length - 1]); 40002 verticesLeft = 1; 40003 break; 40004 } 40005 operators.push(f); 40006 } 40007 ps.push(coords.length); 40008 coords.push(coord); 40009 colors.push(color); 40010 verticesLeft--; 40011 reader.align(); 40012 } 40013 mesh.figures.push({ 40014 type: 'triangles', 40015 coords: new Int32Array(ps), 40016 colors: new Int32Array(ps) 40017 });
vendor: 4,234 bytes, lines 40018-40118
40018 } 40019 function decodeType5Shading(mesh, reader, verticesPerRow) { 40020 var coords = mesh.coords; 40021 var colors = mesh.colors; 40022 var ps = []; 40023 while (reader.hasData) { 40024 var coord = reader.readCoordinate(); 40025 var color = reader.readComponents(); 40026 ps.push(coords.length); 40027 coords.push(coord); 40028 colors.push(color); 40029 } 40030 mesh.figures.push({ 40031 type: 'lattice', 40032 coords: new Int32Array(ps), 40033 colors: new Int32Array(ps), 40034 verticesPerRow: verticesPerRow 40035 }); 40036 } 40037 var MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3; 40038 var MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20; 40039 var TRIANGLE_DENSITY = 20; 40040 var getB = function getBClosure() { 40041 function buildB(count) { 40042 var lut = []; 40043 for (var i = 0; i <= count; i++) { 40044 var t = i / count, 40045 t_ = 1 - t; 40046 lut.push(new Float32Array([t_ * t_ * t_, 3 * t * t_ * t_, 3 * t * t * t_, t * t * t])); 40047 } 40048 return lut; 40049 } 40050 var cache = []; 40051 return function getB(count) { 40052 if (!cache[count]) { 40053 cache[count] = buildB(count); 40054 } 40055 return cache[count]; 40056 }; 40057 }(); 40058 function buildFigureFromPatch(mesh, index) { 40059 var figure = mesh.figures[index]; 40060 (0, _util.assert)(figure.type === 'patch', 'Unexpected patch mesh figure'); 40061 var coords = mesh.coords, 40062 colors = mesh.colors; 40063 var pi = figure.coords; 40064 var ci = figure.colors; 40065 var figureMinX = Math.min(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); 40066 var figureMinY = Math.min(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); 40067 var figureMaxX = Math.max(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); 40068 var figureMaxY = Math.max(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); 40069 var splitXBy = Math.ceil((figureMaxX - figureMinX) * TRIANGLE_DENSITY / (mesh.bounds[2] - mesh.bounds[0])); 40070 splitXBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy)); 40071 var splitYBy = Math.ceil((figureMaxY - figureMinY) * TRIANGLE_DENSITY / (mesh.bounds[3] - mesh.bounds[1])); 40072 splitYBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy)); 40073 var verticesPerRow = splitXBy + 1; 40074 var figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow); 40075 var figureColors = new Int32Array((splitYBy + 1) * verticesPerRow); 40076 var k = 0; 40077 var cl = new Uint8Array(3), 40078 cr = new Uint8Array(3); 40079 var c0 = colors[ci[0]], 40080 c1 = colors[ci[1]], 40081 c2 = colors[ci[2]], 40082 c3 = colors[ci[3]]; 40083 var bRow = getB(splitYBy), 40084 bCol = getB(splitXBy); 40085 for (var row = 0; row <= splitYBy; row++) { 40086 cl[0] = (c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy | 0; 40087 cl[1] = (c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy | 0; 40088 cl[2] = (c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy | 0; 40089 cr[0] = (c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy | 0; 40090 cr[1] = (c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy | 0; 40091 cr[2] = (c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy | 0; 40092 for (var col = 0; col <= splitXBy; col++, k++) { 40093 if ((row === 0 || row === splitYBy) && (col === 0 || col === splitXBy)) { 40094 continue; 40095 } 40096 var x = 0, 40097 y = 0; 40098 var q = 0; 40099 for (var i = 0; i <= 3; i++) { 40100 for (var j = 0; j <= 3; j++, q++) { 40101 var m = bRow[row][i] * bCol[col][j]; 40102 x += coords[pi[q]][0] * m; 40103 y += coords[pi[q]][1] * m; 40104 } 40105 } 40106 figureCoords[k] = coords.length; 40107 coords.push([x, y]); 40108 figureColors[k] = colors.length; 40109 var newColor = new Uint8Array(3); 40110 newColor[0] = (cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy | 0; 40111 newColor[1] = (cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy | 0; 40112 newColor[2] = (cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy | 0; 40113 colors.push(newColor); 40114 } 40115 } 40116 figureCoords[0] = pi[0]; 40117 figureColors[0] = ci[0]; 40118 figureCoords[splitXBy] = pi[3];
vendor: 10,343 bytes, lines 40119-40431
40119 figureColors[splitXBy] = ci[1]; 40120 figureCoords[verticesPerRow * splitYBy] = pi[12]; 40121 figureColors[verticesPerRow * splitYBy] = ci[2]; 40122 figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15]; 40123 figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3]; 40124 mesh.figures[index] = { 40125 type: 'lattice', 40126 coords: figureCoords, 40127 colors: figureColors, 40128 verticesPerRow: verticesPerRow 40129 }; 40130 } 40131 function decodeType6Shading(mesh, reader) { 40132 var coords = mesh.coords; 40133 var colors = mesh.colors; 40134 var ps = new Int32Array(16); 40135 var cs = new Int32Array(4); 40136 while (reader.hasData) { 40137 var f = reader.readFlag(); 40138 if (!(0 <= f && f <= 3)) { 40139 throw new _util.FormatError('Unknown type6 flag'); 40140 } 40141 var i, ii; 40142 var pi = coords.length; 40143 for (i = 0, ii = f !== 0 ? 8 : 12; i < ii; i++) { 40144 coords.push(reader.readCoordinate()); 40145 } 40146 var ci = colors.length; 40147 for (i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { 40148 colors.push(reader.readComponents()); 40149 } 40150 var tmp1, tmp2, tmp3, tmp4; 40151 switch (f) { 40152 case 0: 40153 ps[12] = pi + 3; 40154 ps[13] = pi + 4; 40155 ps[14] = pi + 5; 40156 ps[15] = pi + 6; 40157 ps[8] = pi + 2; 40158 ps[11] = pi + 7; 40159 ps[4] = pi + 1; 40160 ps[7] = pi + 8; 40161 ps[0] = pi; 40162 ps[1] = pi + 11; 40163 ps[2] = pi + 10; 40164 ps[3] = pi + 9; 40165 cs[2] = ci + 1; 40166 cs[3] = ci + 2; 40167 cs[0] = ci; 40168 cs[1] = ci + 3; 40169 break; 40170 case 1: 40171 tmp1 = ps[12]; 40172 tmp2 = ps[13]; 40173 tmp3 = ps[14]; 40174 tmp4 = ps[15]; 40175 ps[12] = tmp4; 40176 ps[13] = pi + 0; 40177 ps[14] = pi + 1; 40178 ps[15] = pi + 2; 40179 ps[8] = tmp3; 40180 ps[11] = pi + 3; 40181 ps[4] = tmp2; 40182 ps[7] = pi + 4; 40183 ps[0] = tmp1; 40184 ps[1] = pi + 7; 40185 ps[2] = pi + 6; 40186 ps[3] = pi + 5; 40187 tmp1 = cs[2]; 40188 tmp2 = cs[3]; 40189 cs[2] = tmp2; 40190 cs[3] = ci; 40191 cs[0] = tmp1; 40192 cs[1] = ci + 1; 40193 break; 40194 case 2: 40195 tmp1 = ps[15]; 40196 tmp2 = ps[11]; 40197 ps[12] = ps[3]; 40198 ps[13] = pi + 0; 40199 ps[14] = pi + 1; 40200 ps[15] = pi + 2; 40201 ps[8] = ps[7]; 40202 ps[11] = pi + 3; 40203 ps[4] = tmp2; 40204 ps[7] = pi + 4; 40205 ps[0] = tmp1; 40206 ps[1] = pi + 7; 40207 ps[2] = pi + 6; 40208 ps[3] = pi + 5; 40209 tmp1 = cs[3]; 40210 cs[2] = cs[1]; 40211 cs[3] = ci; 40212 cs[0] = tmp1; 40213 cs[1] = ci + 1; 40214 break; 40215 case 3: 40216 ps[12] = ps[0]; 40217 ps[13] = pi + 0; 40218 ps[14] = pi + 1; 40219 ps[15] = pi + 2; 40220 ps[8] = ps[1]; 40221 ps[11] = pi + 3; 40222 ps[4] = ps[2]; 40223 ps[7] = pi + 4; 40224 ps[0] = ps[3]; 40225 ps[1] = pi + 7; 40226 ps[2] = pi + 6; 40227 ps[3] = pi + 5; 40228 cs[2] = cs[0]; 40229 cs[3] = ci; 40230 cs[0] = cs[1]; 40231 cs[1] = ci + 1; 40232 break; 40233 } 40234 ps[5] = coords.length; 40235 coords.push([(-4 * coords[ps[0]][0] - coords[ps[15]][0] + 6 * (coords[ps[4]][0] + coords[ps[1]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[13]][0] + coords[ps[7]][0])) / 9, (-4 * coords[ps[0]][1] - coords[ps[15]][1] + 6 * (coords[ps[4]][1] + coords[ps[1]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[13]][1] + coords[ps[7]][1])) / 9]); 40236 ps[6] = coords.length; 40237 coords.push([(-4 * coords[ps[3]][0] - coords[ps[12]][0] + 6 * (coords[ps[2]][0] + coords[ps[7]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[4]][0] + coords[ps[14]][0])) / 9, (-4 * coords[ps[3]][1] - coords[ps[12]][1] + 6 * (coords[ps[2]][1] + coords[ps[7]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[4]][1] + coords[ps[14]][1])) / 9]); 40238 ps[9] = coords.length; 40239 coords.push([(-4 * coords[ps[12]][0] - coords[ps[3]][0] + 6 * (coords[ps[8]][0] + coords[ps[13]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[11]][0] + coords[ps[1]][0])) / 9, (-4 * coords[ps[12]][1] - coords[ps[3]][1] + 6 * (coords[ps[8]][1] + coords[ps[13]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[11]][1] + coords[ps[1]][1])) / 9]); 40240 ps[10] = coords.length; 40241 coords.push([(-4 * coords[ps[15]][0] - coords[ps[0]][0] + 6 * (coords[ps[11]][0] + coords[ps[14]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[2]][0] + coords[ps[8]][0])) / 9, (-4 * coords[ps[15]][1] - coords[ps[0]][1] + 6 * (coords[ps[11]][1] + coords[ps[14]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[2]][1] + coords[ps[8]][1])) / 9]); 40242 mesh.figures.push({ 40243 type: 'patch', 40244 coords: new Int32Array(ps), 40245 colors: new Int32Array(cs) 40246 }); 40247 } 40248 } 40249 function decodeType7Shading(mesh, reader) { 40250 var coords = mesh.coords; 40251 var colors = mesh.colors; 40252 var ps = new Int32Array(16); 40253 var cs = new Int32Array(4); 40254 while (reader.hasData) { 40255 var f = reader.readFlag(); 40256 if (!(0 <= f && f <= 3)) { 40257 throw new _util.FormatError('Unknown type7 flag'); 40258 } 40259 var i, ii; 40260 var pi = coords.length; 40261 for (i = 0, ii = f !== 0 ? 12 : 16; i < ii; i++) { 40262 coords.push(reader.readCoordinate()); 40263 } 40264 var ci = colors.length; 40265 for (i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { 40266 colors.push(reader.readComponents()); 40267 } 40268 var tmp1, tmp2, tmp3, tmp4; 40269 switch (f) { 40270 case 0: 40271 ps[12] = pi + 3; 40272 ps[13] = pi + 4; 40273 ps[14] = pi + 5; 40274 ps[15] = pi + 6; 40275 ps[8] = pi + 2; 40276 ps[9] = pi + 13; 40277 ps[10] = pi + 14; 40278 ps[11] = pi + 7; 40279 ps[4] = pi + 1; 40280 ps[5] = pi + 12; 40281 ps[6] = pi + 15; 40282 ps[7] = pi + 8; 40283 ps[0] = pi; 40284 ps[1] = pi + 11; 40285 ps[2] = pi + 10; 40286 ps[3] = pi + 9; 40287 cs[2] = ci + 1; 40288 cs[3] = ci + 2; 40289 cs[0] = ci; 40290 cs[1] = ci + 3; 40291 break; 40292 case 1: 40293 tmp1 = ps[12]; 40294 tmp2 = ps[13]; 40295 tmp3 = ps[14]; 40296 tmp4 = ps[15]; 40297 ps[12] = tmp4; 40298 ps[13] = pi + 0; 40299 ps[14] = pi + 1; 40300 ps[15] = pi + 2; 40301 ps[8] = tmp3; 40302 ps[9] = pi + 9; 40303 ps[10] = pi + 10; 40304 ps[11] = pi + 3; 40305 ps[4] = tmp2; 40306 ps[5] = pi + 8; 40307 ps[6] = pi + 11; 40308 ps[7] = pi + 4; 40309 ps[0] = tmp1; 40310 ps[1] = pi + 7; 40311 ps[2] = pi + 6; 40312 ps[3] = pi + 5; 40313 tmp1 = cs[2]; 40314 tmp2 = cs[3]; 40315 cs[2] = tmp2; 40316 cs[3] = ci; 40317 cs[0] = tmp1; 40318 cs[1] = ci + 1; 40319 break; 40320 case 2: 40321 tmp1 = ps[15]; 40322 tmp2 = ps[11]; 40323 ps[12] = ps[3]; 40324 ps[13] = pi + 0; 40325 ps[14] = pi + 1; 40326 ps[15] = pi + 2; 40327 ps[8] = ps[7]; 40328 ps[9] = pi + 9; 40329 ps[10] = pi + 10; 40330 ps[11] = pi + 3; 40331 ps[4] = tmp2; 40332 ps[5] = pi + 8; 40333 ps[6] = pi + 11; 40334 ps[7] = pi + 4; 40335 ps[0] = tmp1; 40336 ps[1] = pi + 7; 40337 ps[2] = pi + 6; 40338 ps[3] = pi + 5; 40339 tmp1 = cs[3]; 40340 cs[2] = cs[1]; 40341 cs[3] = ci; 40342 cs[0] = tmp1; 40343 cs[1] = ci + 1; 40344 break; 40345 case 3: 40346 ps[12] = ps[0]; 40347 ps[13] = pi + 0; 40348 ps[14] = pi + 1; 40349 ps[15] = pi + 2; 40350 ps[8] = ps[1]; 40351 ps[9] = pi + 9; 40352 ps[10] = pi + 10; 40353 ps[11] = pi + 3; 40354 ps[4] = ps[2]; 40355 ps[5] = pi + 8; 40356 ps[6] = pi + 11; 40357 ps[7] = pi + 4; 40358 ps[0] = ps[3]; 40359 ps[1] = pi + 7; 40360 ps[2] = pi + 6; 40361 ps[3] = pi + 5; 40362 cs[2] = cs[0]; 40363 cs[3] = ci; 40364 cs[0] = cs[1]; 40365 cs[1] = ci + 1; 40366 break; 40367 } 40368 mesh.figures.push({ 40369 type: 'patch', 40370 coords: new Int32Array(ps), 40371 colors: new Int32Array(cs) 40372 }); 40373 } 40374 } 40375 function updateBounds(mesh) { 40376 var minX = mesh.coords[0][0], 40377 minY = mesh.coords[0][1], 40378 maxX = minX, 40379 maxY = minY; 40380 for (var i = 1, ii = mesh.coords.length; i < ii; i++) { 40381 var x = mesh.coords[i][0], 40382 y = mesh.coords[i][1]; 40383 minX = minX > x ? x : minX; 40384 minY = minY > y ? y : minY; 40385 maxX = maxX < x ? x : maxX; 40386 maxY = maxY < y ? y : maxY; 40387 } 40388 mesh.bounds = [minX, minY, maxX, maxY]; 40389 } 40390 function packData(mesh) { 40391 var i, ii, j, jj; 40392 var coords = mesh.coords; 40393 var coordsPacked = new Float32Array(coords.length * 2); 40394 for (i = 0, j = 0, ii = coords.length; i < ii; i++) { 40395 var xy = coords[i]; 40396 coordsPacked[j++] = xy[0]; 40397 coordsPacked[j++] = xy[1]; 40398 } 40399 mesh.coords = coordsPacked; 40400 var colors = mesh.colors; 40401 var colorsPacked = new Uint8Array(colors.length * 3); 40402 for (i = 0, j = 0, ii = colors.length; i < ii; i++) { 40403 var c = colors[i]; 40404 colorsPacked[j++] = c[0]; 40405 colorsPacked[j++] = c[1]; 40406 colorsPacked[j++] = c[2]; 40407 } 40408 mesh.colors = colorsPacked; 40409 var figures = mesh.figures; 40410 for (i = 0, ii = figures.length; i < ii; i++) { 40411 var figure = figures[i], 40412 ps = figure.coords, 40413 cs = figure.colors; 40414 for (j = 0, jj = ps.length; j < jj; j++) { 40415 ps[j] *= 2; 40416 cs[j] *= 3; 40417 } 40418 } 40419 } 40420 function Mesh(stream, matrix, xref, res, pdfFunctionFactory) { 40421 if (!(0, _primitives.isStream)(stream)) { 40422 throw new _util.FormatError('Mesh data is not a stream'); 40423 } 40424 var dict = stream.dict; 40425 this.matrix = matrix; 40426 this.shadingType = dict.get('ShadingType'); 40427 this.type = 'Pattern'; 40428 this.bbox = dict.getArray('BBox'); 40429 var cs = dict.get('ColorSpace', 'CS'); 40430 cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory); 40431 this.cs = cs;
40432 this.background = dict.has('Background') ? cs.getRgb(dict.get('Background'), 0) : null; 40433 var fnObj = dict.get('Function'); 40434 var fn = fnObj ? pdfFunctionFactory.createFromArray(fnObj) : null; 40435 this.coords = []; 40436 this.colors = []; 40437 this.figures = []; 40438 var decodeContext = { 40439 bitsPerCoordinate: dict.get('BitsPerCoordinate'), 40440 bitsPerComponent: dict.get('BitsPerComponent'), 40441 bitsPerFlag: dict.get('BitsPerFlag'), 40442 decode: dict.getArray('Decode'), 40443 colorFn: fn, 40444 colorSpace: cs, 40445 numComps: fn ? 1 : cs.numComps 40446 }; 40447 var reader = new MeshStreamReader(stream, decodeContext); 40448 var patchMesh = false; 40449 switch (this.shadingType) { 40450 case ShadingType.FREE_FORM_MESH: 40451 decodeType4Shading(this, reader); 40452 break; 40453 case ShadingType.LATTICE_FORM_MESH: 40454 var verticesPerRow = dict.get('VerticesPerRow') | 0; 40455 if (verticesPerRow < 2) { 40456 throw new _util.FormatError('Invalid VerticesPerRow'); 40457 } 40458 decodeType5Shading(this, reader, verticesPerRow); 40459 break; 40460 case ShadingType.COONS_PATCH_MESH: 40461 decodeType6Shading(this, reader); 40462 patchMesh = true; 40463 break; 40464 case ShadingType.TENSOR_PATCH_MESH: 40465 decodeType7Shading(this, reader); 40466 patchMesh = true; 40467 break; 40468 default: 40469 (0, _util.unreachable)('Unsupported mesh type.'); 40470 break; 40471 } 40472 if (patchMesh) { 40473 updateBounds(this); 40474 for (var i = 0, ii = this.figures.length; i < ii; i++) { 40475 buildFigureFromPatch(this, i); 40476 } 40477 } 40478 updateBounds(this); 40479 packData(this); 40480 } 40481 Mesh.prototype = { 40482 getIR: function Mesh_getIR() { 40483 return ['Mesh', this.shadingType, this.coords, this.colors, this.figures, this.bounds, this.matrix, this.bbox, this.background]; 40484 } 40485 }; 40486 return Mesh; 40487}(); 40488Shadings.Dummy = function DummyClosure() { 40489 function Dummy() { 40490 this.type = 'Pattern'; 40491 } 40492 Dummy.prototype = { 40493 getIR: function Dummy_getIR() { 40494 return ['Dummy']; 40495 } 40496 }; 40497 return Dummy; 40498}(); 40499function getTilingPatternIR(operatorList, dict, args) { 40500 var matrix = dict.getArray('Matrix'); 40501 var bbox = _util.Util.normalizeRect(dict.getArray('BBox')); 40502 var xstep = dict.get('XStep'); 40503 var ystep = dict.get('YStep'); 40504 var paintType = dict.get('PaintType'); 40505 var tilingType = dict.get('TilingType'); 40506 if (bbox[2] - bbox[0] === 0 || bbox[3] - bbox[1] === 0) { 40507 throw new _util.FormatError('Invalid getTilingPatternIR /BBox array: [' + bbox + '].'); 40508 } 40509 return ['TilingPattern', args, operatorList, matrix, bbox, xstep, ystep, paintType, tilingType]; 40510} 40511exports.Pattern = Pattern; 40512exports.getTilingPatternIR = getTilingPatternIR; 40513 40514/***/ }), 40515/* 142 */ 40516/***/ (function(module, exports, __w_pdfjs_require__) { 40517 40518"use strict"; 40519 40520 40521Object.defineProperty(exports, "__esModule", { 40522 value: true 40523}); 40524exports.bidi = undefined; 40525 40526var _util = __w_pdfjs_require__(0); 40527 40528var baseTypes = ['BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'S', 'B', 'S', 'WS', 'B', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'B', 'B', 'B', 'S', 'WS', 'ON', 'ON', 'ET', 'ET', 'ET', 'ON', 'ON', 'ON', 'ON', 'ON', 'ES', 'CS', 'ES', 'CS', 'CS', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'CS', 'ON', 'ON', 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'ON', 'ON', 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'ON', 'ON', 'ON', 'ON', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'B', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'CS', 'ON', 'ET', 'ET', 'ET', 'ET', 'ON', 'ON', 'ON', 'ON', 'L', 'ON', 'ON', 'BN', 'ON', 'ON', 'ET', 'ET', 'EN', 'EN', 'ON', 'L', 'ON', 'ON', 'ON', 'EN', 'L', 'ON', 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L']; 40529var arabicTypes = ['AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'ON', 'ON', 'AL', 'ET', 'ET', 'AL', 'CS', 'AL', 'ON', 'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', '', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'ET', 'AN', 'AN', 'AL', 'AL', 'AL', 'NSM', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AN', 'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'NSM', 'NSM', 'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL']; 40530function isOdd(i) { 40531 return (i & 1) !== 0; 40532} 40533function isEven(i) { 40534 return (i & 1) === 0; 40535} 40536function findUnequal(arr, start, value) { 40537 for (var j = start, jj = arr.length; j < jj; ++j) { 40538 if (arr[j] !== value) { 40539 return j; 40540 } 40541 } 40542 return j; 40543} 40544function setValues(arr, start, end, value) { 40545 for (var j = start; j < end; ++j) { 40546 arr[j] = value; 40547 } 40548} 40549function reverseValues(arr, start, end) { 40550 for (var i = start, j = end - 1; i < j; ++i, --j) { 40551 var temp = arr[i]; 40552 arr[i] = arr[j]; 40553 arr[j] = temp; 40554 } 40555} 40556function createBidiText(str, isLTR, vertical) { 40557 return { 40558 str: str, 40559 dir: vertical ? 'ttb' : isLTR ? 'ltr' : 'rtl' 40560 }; 40561} 40562var chars = []; 40563var types = []; 40564function bidi(str, startLevel, vertical) { 40565 var isLTR = true; 40566 var strLength = str.length; 40567 if (strLength === 0 || vertical) { 40568 return createBidiText(str, isLTR, vertical); 40569 } 40570 chars.length = strLength; 40571 types.length = strLength; 40572 var numBidi = 0; 40573 var i, ii; 40574 for (i = 0; i < strLength; ++i) { 40575 chars[i] = str.charAt(i);
vendor: 7,623 bytes, lines 40576-40891
40576 var charCode = str.charCodeAt(i); 40577 var charType = 'L'; 40578 if (charCode <= 0x00ff) { 40579 charType = baseTypes[charCode]; 40580 } else if (0x0590 <= charCode && charCode <= 0x05f4) { 40581 charType = 'R'; 40582 } else if (0x0600 <= charCode && charCode <= 0x06ff) { 40583 charType = arabicTypes[charCode & 0xff]; 40584 if (!charType) { 40585 (0, _util.warn)('Bidi: invalid Unicode character ' + charCode.toString(16)); 40586 } 40587 } else if (0x0700 <= charCode && charCode <= 0x08AC) { 40588 charType = 'AL'; 40589 } 40590 if (charType === 'R' || charType === 'AL' || charType === 'AN') { 40591 numBidi++; 40592 } 40593 types[i] = charType; 40594 } 40595 if (numBidi === 0) { 40596 isLTR = true; 40597 return createBidiText(str, isLTR); 40598 } 40599 if (startLevel === -1) { 40600 if (numBidi / strLength < 0.3) { 40601 isLTR = true; 40602 startLevel = 0; 40603 } else { 40604 isLTR = false; 40605 startLevel = 1; 40606 } 40607 } 40608 var levels = []; 40609 for (i = 0; i < strLength; ++i) { 40610 levels[i] = startLevel; 40611 } 40612 var e = isOdd(startLevel) ? 'R' : 'L'; 40613 var sor = e; 40614 var eor = sor; 40615 var lastType = sor; 40616 for (i = 0; i < strLength; ++i) { 40617 if (types[i] === 'NSM') { 40618 types[i] = lastType; 40619 } else { 40620 lastType = types[i]; 40621 } 40622 } 40623 lastType = sor; 40624 var t; 40625 for (i = 0; i < strLength; ++i) { 40626 t = types[i]; 40627 if (t === 'EN') { 40628 types[i] = lastType === 'AL' ? 'AN' : 'EN'; 40629 } else if (t === 'R' || t === 'L' || t === 'AL') { 40630 lastType = t; 40631 } 40632 } 40633 for (i = 0; i < strLength; ++i) { 40634 t = types[i]; 40635 if (t === 'AL') { 40636 types[i] = 'R'; 40637 } 40638 } 40639 for (i = 1; i < strLength - 1; ++i) { 40640 if (types[i] === 'ES' && types[i - 1] === 'EN' && types[i + 1] === 'EN') { 40641 types[i] = 'EN'; 40642 } 40643 if (types[i] === 'CS' && (types[i - 1] === 'EN' || types[i - 1] === 'AN') && types[i + 1] === types[i - 1]) { 40644 types[i] = types[i - 1]; 40645 } 40646 } 40647 for (i = 0; i < strLength; ++i) { 40648 if (types[i] === 'EN') { 40649 var j; 40650 for (j = i - 1; j >= 0; --j) { 40651 if (types[j] !== 'ET') { 40652 break; 40653 } 40654 types[j] = 'EN'; 40655 } 40656 for (j = i + 1; j < strLength; ++j) { 40657 if (types[j] !== 'ET') { 40658 break; 40659 } 40660 types[j] = 'EN'; 40661 } 40662 } 40663 } 40664 for (i = 0; i < strLength; ++i) { 40665 t = types[i]; 40666 if (t === 'WS' || t === 'ES' || t === 'ET' || t === 'CS') { 40667 types[i] = 'ON'; 40668 } 40669 } 40670 lastType = sor; 40671 for (i = 0; i < strLength; ++i) { 40672 t = types[i]; 40673 if (t === 'EN') { 40674 types[i] = lastType === 'L' ? 'L' : 'EN'; 40675 } else if (t === 'R' || t === 'L') { 40676 lastType = t; 40677 } 40678 } 40679 for (i = 0; i < strLength; ++i) { 40680 if (types[i] === 'ON') { 40681 var end = findUnequal(types, i + 1, 'ON'); 40682 var before = sor; 40683 if (i > 0) { 40684 before = types[i - 1]; 40685 } 40686 var after = eor; 40687 if (end + 1 < strLength) { 40688 after = types[end + 1]; 40689 } 40690 if (before !== 'L') { 40691 before = 'R'; 40692 } 40693 if (after !== 'L') { 40694 after = 'R'; 40695 } 40696 if (before === after) { 40697 setValues(types, i, end, before); 40698 } 40699 i = end - 1; 40700 } 40701 } 40702 for (i = 0; i < strLength; ++i) { 40703 if (types[i] === 'ON') { 40704 types[i] = e; 40705 } 40706 } 40707 for (i = 0; i < strLength; ++i) { 40708 t = types[i]; 40709 if (isEven(levels[i])) { 40710 if (t === 'R') { 40711 levels[i] += 1; 40712 } else if (t === 'AN' || t === 'EN') { 40713 levels[i] += 2; 40714 } 40715 } else { 40716 if (t === 'L' || t === 'AN' || t === 'EN') { 40717 levels[i] += 1; 40718 } 40719 } 40720 } 40721 var highestLevel = -1; 40722 var lowestOddLevel = 99; 40723 var level; 40724 for (i = 0, ii = levels.length; i < ii; ++i) { 40725 level = levels[i]; 40726 if (highestLevel < level) { 40727 highestLevel = level; 40728 } 40729 if (lowestOddLevel > level && isOdd(level)) { 40730 lowestOddLevel = level; 40731 } 40732 } 40733 for (level = highestLevel; level >= lowestOddLevel; --level) { 40734 var start = -1; 40735 for (i = 0, ii = levels.length; i < ii; ++i) { 40736 if (levels[i] < level) { 40737 if (start >= 0) { 40738 reverseValues(chars, start, i); 40739 start = -1; 40740 } 40741 } else if (start < 0) { 40742 start = i; 40743 } 40744 } 40745 if (start >= 0) { 40746 reverseValues(chars, start, levels.length); 40747 } 40748 } 40749 for (i = 0, ii = chars.length; i < ii; ++i) { 40750 var ch = chars[i]; 40751 if (ch === '<' || ch === '>') { 40752 chars[i] = ''; 40753 } 40754 } 40755 return createBidiText(chars.join(''), isLTR); 40756} 40757exports.bidi = bidi; 40758 40759/***/ }), 40760/* 143 */ 40761/***/ (function(module, exports, __w_pdfjs_require__) { 40762 40763"use strict"; 40764 40765 40766Object.defineProperty(exports, "__esModule", { 40767 value: true 40768}); 40769exports.getMetrics = undefined; 40770 40771var _util = __w_pdfjs_require__(0); 40772 40773var getMetrics = (0, _util.getLookupTableFactory)(function (t) { 40774 t['Courier'] = 600; 40775 t['Courier-Bold'] = 600; 40776 t['Courier-BoldOblique'] = 600; 40777 t['Courier-Oblique'] = 600; 40778 t['Helvetica'] = (0, _util.getLookupTableFactory)(function (t) { 40779 t['space'] = 278; 40780 t['exclam'] = 278; 40781 t['quotedbl'] = 355; 40782 t['numbersign'] = 556; 40783 t['dollar'] = 556; 40784 t['percent'] = 889; 40785 t['ampersand'] = 667; 40786 t['quoteright'] = 222; 40787 t['parenleft'] = 333; 40788 t['parenright'] = 333; 40789 t['asterisk'] = 389; 40790 t['plus'] = 584; 40791 t['comma'] = 278; 40792 t['hyphen'] = 333; 40793 t['period'] = 278; 40794 t['slash'] = 278; 40795 t['zero'] = 556; 40796 t['one'] = 556; 40797 t['two'] = 556; 40798 t['three'] = 556; 40799 t['four'] = 556; 40800 t['five'] = 556; 40801 t['six'] = 556; 40802 t['seven'] = 556; 40803 t['eight'] = 556; 40804 t['nine'] = 556; 40805 t['colon'] = 278; 40806 t['semicolon'] = 278; 40807 t['less'] = 584; 40808 t['equal'] = 584; 40809 t['greater'] = 584; 40810 t['question'] = 556; 40811 t['at'] = 1015; 40812 t['A'] = 667; 40813 t['B'] = 667; 40814 t['C'] = 722; 40815 t['D'] = 722; 40816 t['E'] = 667; 40817 t['F'] = 611; 40818 t['G'] = 778; 40819 t['H'] = 722; 40820 t['I'] = 278; 40821 t['J'] = 500; 40822 t['K'] = 667; 40823 t['L'] = 556; 40824 t['M'] = 833; 40825 t['N'] = 722; 40826 t['O'] = 778; 40827 t['P'] = 667; 40828 t['Q'] = 778; 40829 t['R'] = 722; 40830 t['S'] = 667; 40831 t['T'] = 611; 40832 t['U'] = 722; 40833 t['V'] = 667; 40834 t['W'] = 944; 40835 t['X'] = 667; 40836 t['Y'] = 667; 40837 t['Z'] = 611; 40838 t['bracketleft'] = 278; 40839 t['backslash'] = 278; 40840 t['bracketright'] = 278; 40841 t['asciicircum'] = 469; 40842 t['underscore'] = 556; 40843 t['quoteleft'] = 222; 40844 t['a'] = 556; 40845 t['b'] = 556; 40846 t['c'] = 500; 40847 t['d'] = 556; 40848 t['e'] = 556; 40849 t['f'] = 278; 40850 t['g'] = 556; 40851 t['h'] = 556; 40852 t['i'] = 222; 40853 t['j'] = 222; 40854 t['k'] = 500; 40855 t['l'] = 222; 40856 t['m'] = 833; 40857 t['n'] = 556; 40858 t['o'] = 556; 40859 t['p'] = 556; 40860 t['q'] = 556; 40861 t['r'] = 333; 40862 t['s'] = 500; 40863 t['t'] = 278; 40864 t['u'] = 556; 40865 t['v'] = 500; 40866 t['w'] = 722; 40867 t['x'] = 500; 40868 t['y'] = 500; 40869 t['z'] = 500; 40870 t['braceleft'] = 334; 40871 t['bar'] = 260; 40872 t['braceright'] = 334; 40873 t['asciitilde'] = 584; 40874 t['exclamdown'] = 333; 40875 t['cent'] = 556; 40876 t['sterling'] = 556; 40877 t['fraction'] = 167; 40878 t['yen'] = 556; 40879 t['florin'] = 556; 40880 t['section'] = 556; 40881 t['currency'] = 556; 40882 t['quotesingle'] = 191; 40883 t['quotedblleft'] = 333; 40884 t['guillemotleft'] = 556; 40885 t['guilsinglleft'] = 333; 40886 t['guilsinglright'] = 333; 40887 t['fi'] = 500; 40888 t['fl'] = 500; 40889 t['endash'] = 556; 40890 t['dagger'] = 556; 40891 t['daggerdbl'] = 556;
40892 t['periodcentered'] = 278; 40893 t['paragraph'] = 537; 40894 t['bullet'] = 350; 40895 t['quotesinglbase'] = 222; 40896 t['quotedblbase'] = 333; 40897 t['quotedblright'] = 333; 40898 t['guillemotright'] = 556; 40899 t['ellipsis'] = 1000; 40900 t['perthousand'] = 1000; 40901 t['questiondown'] = 611; 40902 t['grave'] = 333; 40903 t['acute'] = 333; 40904 t['circumflex'] = 333; 40905 t['tilde'] = 333; 40906 t['macron'] = 333; 40907 t['breve'] = 333; 40908 t['dotaccent'] = 333; 40909 t['dieresis'] = 333; 40910 t['ring'] = 333; 40911 t['cedilla'] = 333; 40912 t['hungarumlaut'] = 333; 40913 t['ogonek'] = 333; 40914 t['caron'] = 333; 40915 t['emdash'] = 1000; 40916 t['AE'] = 1000; 40917 t['ordfeminine'] = 370; 40918 t['Lslash'] = 556; 40919 t['Oslash'] = 778; 40920 t['OE'] = 1000; 40921 t['ordmasculine'] = 365; 40922 t['ae'] = 889; 40923 t['dotlessi'] = 278; 40924 t['lslash'] = 222; 40925 t['oslash'] = 611; 40926 t['oe'] = 944; 40927 t['germandbls'] = 611; 40928 t['Idieresis'] = 278; 40929 t['eacute'] = 556; 40930 t['abreve'] = 556; 40931 t['uhungarumlaut'] = 556; 40932 t['ecaron'] = 556; 40933 t['Ydieresis'] = 667; 40934 t['divide'] = 584; 40935 t['Yacute'] = 667; 40936 t['Acircumflex'] = 667; 40937 t['aacute'] = 556; 40938 t['Ucircumflex'] = 722; 40939 t['yacute'] = 500; 40940 t['scommaaccent'] = 500; 40941 t['ecircumflex'] = 556; 40942 t['Uring'] = 722; 40943 t['Udieresis'] = 722; 40944 t['aogonek'] = 556; 40945 t['Uacute'] = 722; 40946 t['uogonek'] = 556; 40947 t['Edieresis'] = 667; 40948 t['Dcroat'] = 722; 40949 t['commaaccent'] = 250; 40950 t['copyright'] = 737; 40951 t['Emacron'] = 667; 40952 t['ccaron'] = 500; 40953 t['aring'] = 556; 40954 t['Ncommaaccent'] = 722; 40955 t['lacute'] = 222; 40956 t['agrave'] = 556; 40957 t['Tcommaaccent'] = 611; 40958 t['Cacute'] = 722; 40959 t['atilde'] = 556; 40960 t['Edotaccent'] = 667; 40961 t['scaron'] = 500; 40962 t['scedilla'] = 500; 40963 t['iacute'] = 278; 40964 t['lozenge'] = 471; 40965 t['Rcaron'] = 722; 40966 t['Gcommaaccent'] = 778; 40967 t['ucircumflex'] = 556; 40968 t['acircumflex'] = 556; 40969 t['Amacron'] = 667; 40970 t['rcaron'] = 333; 40971 t['ccedilla'] = 500; 40972 t['Zdotaccent'] = 611; 40973 t['Thorn'] = 667; 40974 t['Omacron'] = 778; 40975 t['Racute'] = 722; 40976 t['Sacute'] = 667; 40977 t['dcaron'] = 643; 40978 t['Umacron'] = 722; 40979 t['uring'] = 556; 40980 t['threesuperior'] = 333; 40981 t['Ograve'] = 778; 40982 t['Agrave'] = 667; 40983 t['Abreve'] = 667; 40984 t['multiply'] = 584; 40985 t['uacute'] = 556; 40986 t['Tcaron'] = 611; 40987 t['partialdiff'] = 476; 40988 t['ydieresis'] = 500; 40989 t['Nacute'] = 722; 40990 t['icircumflex'] = 278; 40991 t['Ecircumflex'] = 667; 40992 t['adieresis'] = 556; 40993 t['edieresis'] = 556; 40994 t['cacute'] = 500; 40995 t['nacute'] = 556; 40996 t['umacron'] = 556; 40997 t['Ncaron'] = 722; 40998 t['Iacute'] = 278; 40999 t['plusminus'] = 584; 41000 t['brokenbar'] = 260; 41001 t['registered'] = 737; 41002 t['Gbreve'] = 778; 41003 t['Idotaccent'] = 278; 41004 t['summation'] = 600; 41005 t['Egrave'] = 667; 41006 t['racute'] = 333; 41007 t['omacron'] = 556; 41008 t['Zacute'] = 611; 41009 t['Zcaron'] = 611; 41010 t['greaterequal'] = 549; 41011 t['Eth'] = 722; 41012 t['Ccedilla'] = 722; 41013 t['lcommaaccent'] = 222; 41014 t['tcaron'] = 317; 41015 t['eogonek'] = 556; 41016 t['Uogonek'] = 722; 41017 t['Aacute'] = 667; 41018 t['Adieresis'] = 667; 41019 t['egrave'] = 556; 41020 t['zacute'] = 500; 41021 t['iogonek'] = 222; 41022 t['Oacute'] = 778; 41023 t['oacute'] = 556; 41024 t['amacron'] = 556; 41025 t['sacute'] = 500; 41026 t['idieresis'] = 278; 41027 t['Ocircumflex'] = 778; 41028 t['Ugrave'] = 722; 41029 t['Delta'] = 612; 41030 t['thorn'] = 556; 41031 t['twosuperior'] = 333; 41032 t['Odieresis'] = 778; 41033 t['mu'] = 556; 41034 t['igrave'] = 278; 41035 t['ohungarumlaut'] = 556; 41036 t['Eogonek'] = 667; 41037 t['dcroat'] = 556; 41038 t['threequarters'] = 834; 41039 t['Scedilla'] = 667; 41040 t['lcaron'] = 299; 41041 t['Kcommaaccent'] = 667; 41042 t['Lacute'] = 556; 41043 t['trademark'] = 1000; 41044 t['edotaccent'] = 556; 41045 t['Igrave'] = 278; 41046 t['Imacron'] = 278; 41047 t['Lcaron'] = 556; 41048 t['onehalf'] = 834; 41049 t['lessequal'] = 549; 41050 t['ocircumflex'] = 556; 41051 t['ntilde'] = 556; 41052 t['Uhungarumlaut'] = 722; 41053 t['Eacute'] = 667; 41054 t['emacron'] = 556; 41055 t['gbreve'] = 556; 41056 t['onequarter'] = 834; 41057 t['Scaron'] = 667; 41058 t['Scommaaccent'] = 667; 41059 t['Ohungarumlaut'] = 778; 41060 t['degree'] = 400; 41061 t['ograve'] = 556; 41062 t['Ccaron'] = 722; 41063 t['ugrave'] = 556; 41064 t['radical'] = 453; 41065 t['Dcaron'] = 722; 41066 t['rcommaaccent'] = 333; 41067 t['Ntilde'] = 722; 41068 t['otilde'] = 556; 41069 t['Rcommaaccent'] = 722; 41070 t['Lcommaaccent'] = 556; 41071 t['Atilde'] = 667; 41072 t['Aogonek'] = 667; 41073 t['Aring'] = 667; 41074 t['Otilde'] = 778; 41075 t['zdotaccent'] = 500; 41076 t['Ecaron'] = 667; 41077 t['Iogonek'] = 278; 41078 t['kcommaaccent'] = 500; 41079 t['minus'] = 584; 41080 t['Icircumflex'] = 278; 41081 t['ncaron'] = 556; 41082 t['tcommaaccent'] = 278; 41083 t['logicalnot'] = 584; 41084 t['odieresis'] = 556; 41085 t['udieresis'] = 556; 41086 t['notequal'] = 549; 41087 t['gcommaaccent'] = 556; 41088 t['eth'] = 556; 41089 t['zcaron'] = 500; 41090 t['ncommaaccent'] = 556; 41091 t['onesuperior'] = 333; 41092 t['imacron'] = 278; 41093 t['Euro'] = 556; 41094 }); 41095 t['Helvetica-Bold'] = (0, _util.getLookupTableFactory)(function (t) { 41096 t['space'] = 278; 41097 t['exclam'] = 333; 41098 t['quotedbl'] = 474; 41099 t['numbersign'] = 556; 41100 t['dollar'] = 556; 41101 t['percent'] = 889; 41102 t['ampersand'] = 722; 41103 t['quoteright'] = 278; 41104 t['parenleft'] = 333; 41105 t['parenright'] = 333; 41106 t['asterisk'] = 389; 41107 t['plus'] = 584; 41108 t['comma'] = 278; 41109 t['hyphen'] = 333; 41110 t['period'] = 278; 41111 t['slash'] = 278; 41112 t['zero'] = 556; 41113 t['one'] = 556; 41114 t['two'] = 556; 41115 t['three'] = 556; 41116 t['four'] = 556; 41117 t['five'] = 556; 41118 t['six'] = 556; 41119 t['seven'] = 556; 41120 t['eight'] = 556; 41121 t['nine'] = 556; 41122 t['colon'] = 333; 41123 t['semicolon'] = 333; 41124 t['less'] = 584; 41125 t['equal'] = 584; 41126 t['greater'] = 584; 41127 t['question'] = 611; 41128 t['at'] = 975; 41129 t['A'] = 722; 41130 t['B'] = 722; 41131 t['C'] = 722; 41132 t['D'] = 722; 41133 t['E'] = 667; 41134 t['F'] = 611; 41135 t['G'] = 778; 41136 t['H'] = 722; 41137 t['I'] = 278; 41138 t['J'] = 556; 41139 t['K'] = 722; 41140 t['L'] = 611; 41141 t['M'] = 833; 41142 t['N'] = 722; 41143 t['O'] = 778; 41144 t['P'] = 667; 41145 t['Q'] = 778; 41146 t['R'] = 722; 41147 t['S'] = 667; 41148 t['T'] = 611; 41149 t['U'] = 722; 41150 t['V'] = 667; 41151 t['W'] = 944; 41152 t['X'] = 667; 41153 t['Y'] = 667; 41154 t['Z'] = 611; 41155 t['bracketleft'] = 333; 41156 t['backslash'] = 278; 41157 t['bracketright'] = 333; 41158 t['asciicircum'] = 584; 41159 t['underscore'] = 556; 41160 t['quoteleft'] = 278; 41161 t['a'] = 556; 41162 t['b'] = 611; 41163 t['c'] = 556; 41164 t['d'] = 611; 41165 t['e'] = 556; 41166 t['f'] = 333; 41167 t['g'] = 611; 41168 t['h'] = 611; 41169 t['i'] = 278; 41170 t['j'] = 278; 41171 t['k'] = 556; 41172 t['l'] = 278; 41173 t['m'] = 889; 41174 t['n'] = 611; 41175 t['o'] = 611; 41176 t['p'] = 611; 41177 t['q'] = 611; 41178 t['r'] = 389; 41179 t['s'] = 556; 41180 t['t'] = 333; 41181 t['u'] = 611; 41182 t['v'] = 556; 41183 t['w'] = 778; 41184 t['x'] = 556; 41185 t['y'] = 556; 41186 t['z'] = 500; 41187 t['braceleft'] = 389; 41188 t['bar'] = 280; 41189 t['braceright'] = 389; 41190 t['asciitilde'] = 584; 41191 t['exclamdown'] = 333; 41192 t['cent'] = 556; 41193 t['sterling'] = 556; 41194 t['fraction'] = 167; 41195 t['yen'] = 556; 41196 t['florin'] = 556; 41197 t['section'] = 556; 41198 t['currency'] = 556; 41199 t['quotesingle'] = 238; 41200 t['quotedblleft'] = 500; 41201 t['guillemotleft'] = 556; 41202 t['guilsinglleft'] = 333; 41203 t['guilsinglright'] = 333; 41204 t['fi'] = 611; 41205 t['fl'] = 611; 41206 t['endash'] = 556; 41207 t['dagger'] = 556; 41208 t['daggerdbl'] = 556;
41209 t['periodcentered'] = 278; 41210 t['paragraph'] = 556; 41211 t['bullet'] = 350; 41212 t['quotesinglbase'] = 278; 41213 t['quotedblbase'] = 500; 41214 t['quotedblright'] = 500; 41215 t['guillemotright'] = 556; 41216 t['ellipsis'] = 1000; 41217 t['perthousand'] = 1000; 41218 t['questiondown'] = 611; 41219 t['grave'] = 333; 41220 t['acute'] = 333; 41221 t['circumflex'] = 333; 41222 t['tilde'] = 333; 41223 t['macron'] = 333; 41224 t['breve'] = 333; 41225 t['dotaccent'] = 333; 41226 t['dieresis'] = 333; 41227 t['ring'] = 333; 41228 t['cedilla'] = 333; 41229 t['hungarumlaut'] = 333; 41230 t['ogonek'] = 333; 41231 t['caron'] = 333; 41232 t['emdash'] = 1000; 41233 t['AE'] = 1000; 41234 t['ordfeminine'] = 370; 41235 t['Lslash'] = 611; 41236 t['Oslash'] = 778; 41237 t['OE'] = 1000; 41238 t['ordmasculine'] = 365; 41239 t['ae'] = 889; 41240 t['dotlessi'] = 278; 41241 t['lslash'] = 278; 41242 t['oslash'] = 611; 41243 t['oe'] = 944; 41244 t['germandbls'] = 611; 41245 t['Idieresis'] = 278; 41246 t['eacute'] = 556; 41247 t['abreve'] = 556; 41248 t['uhungarumlaut'] = 611; 41249 t['ecaron'] = 556; 41250 t['Ydieresis'] = 667; 41251 t['divide'] = 584; 41252 t['Yacute'] = 667; 41253 t['Acircumflex'] = 722; 41254 t['aacute'] = 556; 41255 t['Ucircumflex'] = 722; 41256 t['yacute'] = 556; 41257 t['scommaaccent'] = 556; 41258 t['ecircumflex'] = 556; 41259 t['Uring'] = 722; 41260 t['Udieresis'] = 722; 41261 t['aogonek'] = 556; 41262 t['Uacute'] = 722; 41263 t['uogonek'] = 611; 41264 t['Edieresis'] = 667; 41265 t['Dcroat'] = 722; 41266 t['commaaccent'] = 250; 41267 t['copyright'] = 737; 41268 t['Emacron'] = 667; 41269 t['ccaron'] = 556; 41270 t['aring'] = 556; 41271 t['Ncommaaccent'] = 722; 41272 t['lacute'] = 278; 41273 t['agrave'] = 556; 41274 t['Tcommaaccent'] = 611; 41275 t['Cacute'] = 722; 41276 t['atilde'] = 556; 41277 t['Edotaccent'] = 667; 41278 t['scaron'] = 556; 41279 t['scedilla'] = 556; 41280 t['iacute'] = 278; 41281 t['lozenge'] = 494; 41282 t['Rcaron'] = 722; 41283 t['Gcommaaccent'] = 778; 41284 t['ucircumflex'] = 611; 41285 t['acircumflex'] = 556; 41286 t['Amacron'] = 722; 41287 t['rcaron'] = 389; 41288 t['ccedilla'] = 556; 41289 t['Zdotaccent'] = 611; 41290 t['Thorn'] = 667; 41291 t['Omacron'] = 778; 41292 t['Racute'] = 722; 41293 t['Sacute'] = 667; 41294 t['dcaron'] = 743; 41295 t['Umacron'] = 722; 41296 t['uring'] = 611; 41297 t['threesuperior'] = 333; 41298 t['Ograve'] = 778; 41299 t['Agrave'] = 722; 41300 t['Abreve'] = 722; 41301 t['multiply'] = 584; 41302 t['uacute'] = 611; 41303 t['Tcaron'] = 611; 41304 t['partialdiff'] = 494; 41305 t['ydieresis'] = 556; 41306 t['Nacute'] = 722; 41307 t['icircumflex'] = 278; 41308 t['Ecircumflex'] = 667; 41309 t['adieresis'] = 556; 41310 t['edieresis'] = 556; 41311 t['cacute'] = 556; 41312 t['nacute'] = 611; 41313 t['umacron'] = 611; 41314 t['Ncaron'] = 722; 41315 t['Iacute'] = 278; 41316 t['plusminus'] = 584; 41317 t['brokenbar'] = 280; 41318 t['registered'] = 737; 41319 t['Gbreve'] = 778; 41320 t['Idotaccent'] = 278; 41321 t['summation'] = 600; 41322 t['Egrave'] = 667; 41323 t['racute'] = 389; 41324 t['omacron'] = 611; 41325 t['Zacute'] = 611; 41326 t['Zcaron'] = 611; 41327 t['greaterequal'] = 549; 41328 t['Eth'] = 722; 41329 t['Ccedilla'] = 722; 41330 t['lcommaaccent'] = 278; 41331 t['tcaron'] = 389; 41332 t['eogonek'] = 556; 41333 t['Uogonek'] = 722; 41334 t['Aacute'] = 722; 41335 t['Adieresis'] = 722; 41336 t['egrave'] = 556; 41337 t['zacute'] = 500; 41338 t['iogonek'] = 278; 41339 t['Oacute'] = 778; 41340 t['oacute'] = 611; 41341 t['amacron'] = 556; 41342 t['sacute'] = 556; 41343 t['idieresis'] = 278; 41344 t['Ocircumflex'] = 778; 41345 t['Ugrave'] = 722; 41346 t['Delta'] = 612; 41347 t['thorn'] = 611; 41348 t['twosuperior'] = 333; 41349 t['Odieresis'] = 778; 41350 t['mu'] = 611; 41351 t['igrave'] = 278; 41352 t['ohungarumlaut'] = 611; 41353 t['Eogonek'] = 667; 41354 t['dcroat'] = 611; 41355 t['threequarters'] = 834; 41356 t['Scedilla'] = 667; 41357 t['lcaron'] = 400; 41358 t['Kcommaaccent'] = 722; 41359 t['Lacute'] = 611; 41360 t['trademark'] = 1000; 41361 t['edotaccent'] = 556; 41362 t['Igrave'] = 278; 41363 t['Imacron'] = 278; 41364 t['Lcaron'] = 611; 41365 t['onehalf'] = 834; 41366 t['lessequal'] = 549; 41367 t['ocircumflex'] = 611; 41368 t['ntilde'] = 611; 41369 t['Uhungarumlaut'] = 722; 41370 t['Eacute'] = 667; 41371 t['emacron'] = 556; 41372 t['gbreve'] = 611; 41373 t['onequarter'] = 834; 41374 t['Scaron'] = 667; 41375 t['Scommaaccent'] = 667; 41376 t['Ohungarumlaut'] = 778; 41377 t['degree'] = 400; 41378 t['ograve'] = 611; 41379 t['Ccaron'] = 722; 41380 t['ugrave'] = 611; 41381 t['radical'] = 549; 41382 t['Dcaron'] = 722; 41383 t['rcommaaccent'] = 389; 41384 t['Ntilde'] = 722; 41385 t['otilde'] = 611; 41386 t['Rcommaaccent'] = 722; 41387 t['Lcommaaccent'] = 611; 41388 t['Atilde'] = 722; 41389 t['Aogonek'] = 722; 41390 t['Aring'] = 722; 41391 t['Otilde'] = 778; 41392 t['zdotaccent'] = 500; 41393 t['Ecaron'] = 667; 41394 t['Iogonek'] = 278; 41395 t['kcommaaccent'] = 556; 41396 t['minus'] = 584; 41397 t['Icircumflex'] = 278; 41398 t['ncaron'] = 611; 41399 t['tcommaaccent'] = 333; 41400 t['logicalnot'] = 584; 41401 t['odieresis'] = 611; 41402 t['udieresis'] = 611; 41403 t['notequal'] = 549; 41404 t['gcommaaccent'] = 611; 41405 t['eth'] = 611; 41406 t['zcaron'] = 500; 41407 t['ncommaaccent'] = 611; 41408 t['onesuperior'] = 333; 41409 t['imacron'] = 278; 41410 t['Euro'] = 556; 41411 }); 41412 t['Helvetica-BoldOblique'] = (0, _util.getLookupTableFactory)(function (t) { 41413 t['space'] = 278; 41414 t['exclam'] = 333; 41415 t['quotedbl'] = 474; 41416 t['numbersign'] = 556; 41417 t['dollar'] = 556; 41418 t['percent'] = 889; 41419 t['ampersand'] = 722; 41420 t['quoteright'] = 278; 41421 t['parenleft'] = 333; 41422 t['parenright'] = 333; 41423 t['asterisk'] = 389; 41424 t['plus'] = 584; 41425 t['comma'] = 278; 41426 t['hyphen'] = 333; 41427 t['period'] = 278; 41428 t['slash'] = 278; 41429 t['zero'] = 556; 41430 t['one'] = 556; 41431 t['two'] = 556; 41432 t['three'] = 556; 41433 t['four'] = 556; 41434 t['five'] = 556; 41435 t['six'] = 556; 41436 t['seven'] = 556; 41437 t['eight'] = 556; 41438 t['nine'] = 556; 41439 t['colon'] = 333; 41440 t['semicolon'] = 333; 41441 t['less'] = 584; 41442 t['equal'] = 584; 41443 t['greater'] = 584; 41444 t['question'] = 611; 41445 t['at'] = 975; 41446 t['A'] = 722; 41447 t['B'] = 722; 41448 t['C'] = 722; 41449 t['D'] = 722; 41450 t['E'] = 667; 41451 t['F'] = 611; 41452 t['G'] = 778; 41453 t['H'] = 722; 41454 t['I'] = 278; 41455 t['J'] = 556; 41456 t['K'] = 722; 41457 t['L'] = 611; 41458 t['M'] = 833; 41459 t['N'] = 722; 41460 t['O'] = 778; 41461 t['P'] = 667; 41462 t['Q'] = 778; 41463 t['R'] = 722; 41464 t['S'] = 667; 41465 t['T'] = 611; 41466 t['U'] = 722; 41467 t['V'] = 667; 41468 t['W'] = 944; 41469 t['X'] = 667; 41470 t['Y'] = 667; 41471 t['Z'] = 611; 41472 t['bracketleft'] = 333; 41473 t['backslash'] = 278; 41474 t['bracketright'] = 333; 41475 t['asciicircum'] = 584; 41476 t['underscore'] = 556; 41477 t['quoteleft'] = 278; 41478 t['a'] = 556; 41479 t['b'] = 611; 41480 t['c'] = 556; 41481 t['d'] = 611; 41482 t['e'] = 556; 41483 t['f'] = 333; 41484 t['g'] = 611; 41485 t['h'] = 611; 41486 t['i'] = 278; 41487 t['j'] = 278; 41488 t['k'] = 556; 41489 t['l'] = 278; 41490 t['m'] = 889; 41491 t['n'] = 611; 41492 t['o'] = 611; 41493 t['p'] = 611; 41494 t['q'] = 611; 41495 t['r'] = 389; 41496 t['s'] = 556; 41497 t['t'] = 333; 41498 t['u'] = 611; 41499 t['v'] = 556; 41500 t['w'] = 778; 41501 t['x'] = 556; 41502 t['y'] = 556; 41503 t['z'] = 500; 41504 t['braceleft'] = 389; 41505 t['bar'] = 280; 41506 t['braceright'] = 389; 41507 t['asciitilde'] = 584; 41508 t['exclamdown'] = 333; 41509 t['cent'] = 556; 41510 t['sterling'] = 556; 41511 t['fraction'] = 167; 41512 t['yen'] = 556; 41513 t['florin'] = 556; 41514 t['section'] = 556; 41515 t['currency'] = 556; 41516 t['quotesingle'] = 238; 41517 t['quotedblleft'] = 500; 41518 t['guillemotleft'] = 556; 41519 t['guilsinglleft'] = 333; 41520 t['guilsinglright'] = 333; 41521 t['fi'] = 611; 41522 t['fl'] = 611; 41523 t['endash'] = 556; 41524 t['dagger'] = 556; 41525 t['daggerdbl'] = 556;
41526 t['periodcentered'] = 278; 41527 t['paragraph'] = 556; 41528 t['bullet'] = 350; 41529 t['quotesinglbase'] = 278; 41530 t['quotedblbase'] = 500; 41531 t['quotedblright'] = 500; 41532 t['guillemotright'] = 556; 41533 t['ellipsis'] = 1000; 41534 t['perthousand'] = 1000; 41535 t['questiondown'] = 611; 41536 t['grave'] = 333; 41537 t['acute'] = 333; 41538 t['circumflex'] = 333; 41539 t['tilde'] = 333; 41540 t['macron'] = 333; 41541 t['breve'] = 333; 41542 t['dotaccent'] = 333; 41543 t['dieresis'] = 333; 41544 t['ring'] = 333; 41545 t['cedilla'] = 333; 41546 t['hungarumlaut'] = 333; 41547 t['ogonek'] = 333; 41548 t['caron'] = 333; 41549 t['emdash'] = 1000; 41550 t['AE'] = 1000; 41551 t['ordfeminine'] = 370; 41552 t['Lslash'] = 611; 41553 t['Oslash'] = 778; 41554 t['OE'] = 1000; 41555 t['ordmasculine'] = 365; 41556 t['ae'] = 889; 41557 t['dotlessi'] = 278; 41558 t['lslash'] = 278; 41559 t['oslash'] = 611; 41560 t['oe'] = 944; 41561 t['germandbls'] = 611; 41562 t['Idieresis'] = 278; 41563 t['eacute'] = 556; 41564 t['abreve'] = 556; 41565 t['uhungarumlaut'] = 611; 41566 t['ecaron'] = 556; 41567 t['Ydieresis'] = 667; 41568 t['divide'] = 584; 41569 t['Yacute'] = 667; 41570 t['Acircumflex'] = 722; 41571 t['aacute'] = 556; 41572 t['Ucircumflex'] = 722; 41573 t['yacute'] = 556; 41574 t['scommaaccent'] = 556; 41575 t['ecircumflex'] = 556; 41576 t['Uring'] = 722; 41577 t['Udieresis'] = 722; 41578 t['aogonek'] = 556; 41579 t['Uacute'] = 722; 41580 t['uogonek'] = 611; 41581 t['Edieresis'] = 667; 41582 t['Dcroat'] = 722; 41583 t['commaaccent'] = 250; 41584 t['copyright'] = 737; 41585 t['Emacron'] = 667; 41586 t['ccaron'] = 556; 41587 t['aring'] = 556; 41588 t['Ncommaaccent'] = 722; 41589 t['lacute'] = 278; 41590 t['agrave'] = 556; 41591 t['Tcommaaccent'] = 611; 41592 t['Cacute'] = 722; 41593 t['atilde'] = 556; 41594 t['Edotaccent'] = 667; 41595 t['scaron'] = 556; 41596 t['scedilla'] = 556; 41597 t['iacute'] = 278; 41598 t['lozenge'] = 494; 41599 t['Rcaron'] = 722; 41600 t['Gcommaaccent'] = 778; 41601 t['ucircumflex'] = 611; 41602 t['acircumflex'] = 556; 41603 t['Amacron'] = 722; 41604 t['rcaron'] = 389; 41605 t['ccedilla'] = 556; 41606 t['Zdotaccent'] = 611; 41607 t['Thorn'] = 667; 41608 t['Omacron'] = 778; 41609 t['Racute'] = 722; 41610 t['Sacute'] = 667; 41611 t['dcaron'] = 743; 41612 t['Umacron'] = 722; 41613 t['uring'] = 611; 41614 t['threesuperior'] = 333; 41615 t['Ograve'] = 778; 41616 t['Agrave'] = 722; 41617 t['Abreve'] = 722; 41618 t['multiply'] = 584; 41619 t['uacute'] = 611; 41620 t['Tcaron'] = 611; 41621 t['partialdiff'] = 494; 41622 t['ydieresis'] = 556; 41623 t['Nacute'] = 722; 41624 t['icircumflex'] = 278; 41625 t['Ecircumflex'] = 667; 41626 t['adieresis'] = 556; 41627 t['edieresis'] = 556; 41628 t['cacute'] = 556; 41629 t['nacute'] = 611; 41630 t['umacron'] = 611; 41631 t['Ncaron'] = 722; 41632 t['Iacute'] = 278; 41633 t['plusminus'] = 584; 41634 t['brokenbar'] = 280; 41635 t['registered'] = 737; 41636 t['Gbreve'] = 778; 41637 t['Idotaccent'] = 278; 41638 t['summation'] = 600; 41639 t['Egrave'] = 667; 41640 t['racute'] = 389; 41641 t['omacron'] = 611; 41642 t['Zacute'] = 611; 41643 t['Zcaron'] = 611; 41644 t['greaterequal'] = 549; 41645 t['Eth'] = 722; 41646 t['Ccedilla'] = 722; 41647 t['lcommaaccent'] = 278; 41648 t['tcaron'] = 389; 41649 t['eogonek'] = 556; 41650 t['Uogonek'] = 722; 41651 t['Aacute'] = 722; 41652 t['Adieresis'] = 722; 41653 t['egrave'] = 556; 41654 t['zacute'] = 500; 41655 t['iogonek'] = 278; 41656 t['Oacute'] = 778; 41657 t['oacute'] = 611; 41658 t['amacron'] = 556; 41659 t['sacute'] = 556; 41660 t['idieresis'] = 278; 41661 t['Ocircumflex'] = 778; 41662 t['Ugrave'] = 722; 41663 t['Delta'] = 612; 41664 t['thorn'] = 611; 41665 t['twosuperior'] = 333; 41666 t['Odieresis'] = 778; 41667 t['mu'] = 611; 41668 t['igrave'] = 278; 41669 t['ohungarumlaut'] = 611; 41670 t['Eogonek'] = 667; 41671 t['dcroat'] = 611; 41672 t['threequarters'] = 834; 41673 t['Scedilla'] = 667; 41674 t['lcaron'] = 400; 41675 t['Kcommaaccent'] = 722; 41676 t['Lacute'] = 611; 41677 t['trademark'] = 1000; 41678 t['edotaccent'] = 556; 41679 t['Igrave'] = 278; 41680 t['Imacron'] = 278; 41681 t['Lcaron'] = 611; 41682 t['onehalf'] = 834; 41683 t['lessequal'] = 549; 41684 t['ocircumflex'] = 611; 41685 t['ntilde'] = 611; 41686 t['Uhungarumlaut'] = 722; 41687 t['Eacute'] = 667; 41688 t['emacron'] = 556; 41689 t['gbreve'] = 611; 41690 t['onequarter'] = 834; 41691 t['Scaron'] = 667; 41692 t['Scommaaccent'] = 667; 41693 t['Ohungarumlaut'] = 778; 41694 t['degree'] = 400; 41695 t['ograve'] = 611; 41696 t['Ccaron'] = 722; 41697 t['ugrave'] = 611; 41698 t['radical'] = 549; 41699 t['Dcaron'] = 722; 41700 t['rcommaaccent'] = 389; 41701 t['Ntilde'] = 722; 41702 t['otilde'] = 611; 41703 t['Rcommaaccent'] = 722; 41704 t['Lcommaaccent'] = 611; 41705 t['Atilde'] = 722; 41706 t['Aogonek'] = 722; 41707 t['Aring'] = 722; 41708 t['Otilde'] = 778; 41709 t['zdotaccent'] = 500; 41710 t['Ecaron'] = 667; 41711 t['Iogonek'] = 278; 41712 t['kcommaaccent'] = 556; 41713 t['minus'] = 584; 41714 t['Icircumflex'] = 278; 41715 t['ncaron'] = 611; 41716 t['tcommaaccent'] = 333; 41717 t['logicalnot'] = 584; 41718 t['odieresis'] = 611; 41719 t['udieresis'] = 611; 41720 t['notequal'] = 549; 41721 t['gcommaaccent'] = 611; 41722 t['eth'] = 611; 41723 t['zcaron'] = 500; 41724 t['ncommaaccent'] = 611; 41725 t['onesuperior'] = 333; 41726 t['imacron'] = 278; 41727 t['Euro'] = 556; 41728 }); 41729 t['Helvetica-Oblique'] = (0, _util.getLookupTableFactory)(function (t) { 41730 t['space'] = 278; 41731 t['exclam'] = 278; 41732 t['quotedbl'] = 355; 41733 t['numbersign'] = 556; 41734 t['dollar'] = 556; 41735 t['percent'] = 889; 41736 t['ampersand'] = 667; 41737 t['quoteright'] = 222; 41738 t['parenleft'] = 333; 41739 t['parenright'] = 333; 41740 t['asterisk'] = 389; 41741 t['plus'] = 584; 41742 t['comma'] = 278; 41743 t['hyphen'] = 333; 41744 t['period'] = 278; 41745 t['slash'] = 278; 41746 t['zero'] = 556; 41747 t['one'] = 556; 41748 t['two'] = 556; 41749 t['three'] = 556; 41750 t['four'] = 556; 41751 t['five'] = 556; 41752 t['six'] = 556; 41753 t['seven'] = 556; 41754 t['eight'] = 556; 41755 t['nine'] = 556; 41756 t['colon'] = 278; 41757 t['semicolon'] = 278; 41758 t['less'] = 584; 41759 t['equal'] = 584; 41760 t['greater'] = 584; 41761 t['question'] = 556; 41762 t['at'] = 1015; 41763 t['A'] = 667; 41764 t['B'] = 667; 41765 t['C'] = 722; 41766 t['D'] = 722; 41767 t['E'] = 667; 41768 t['F'] = 611; 41769 t['G'] = 778; 41770 t['H'] = 722; 41771 t['I'] = 278; 41772 t['J'] = 500; 41773 t['K'] = 667; 41774 t['L'] = 556; 41775 t['M'] = 833; 41776 t['N'] = 722; 41777 t['O'] = 778; 41778 t['P'] = 667; 41779 t['Q'] = 778; 41780 t['R'] = 722; 41781 t['S'] = 667; 41782 t['T'] = 611; 41783 t['U'] = 722; 41784 t['V'] = 667; 41785 t['W'] = 944; 41786 t['X'] = 667; 41787 t['Y'] = 667; 41788 t['Z'] = 611; 41789 t['bracketleft'] = 278; 41790 t['backslash'] = 278; 41791 t['bracketright'] = 278; 41792 t['asciicircum'] = 469; 41793 t['underscore'] = 556; 41794 t['quoteleft'] = 222; 41795 t['a'] = 556; 41796 t['b'] = 556; 41797 t['c'] = 500; 41798 t['d'] = 556; 41799 t['e'] = 556; 41800 t['f'] = 278; 41801 t['g'] = 556; 41802 t['h'] = 556; 41803 t['i'] = 222; 41804 t['j'] = 222; 41805 t['k'] = 500; 41806 t['l'] = 222; 41807 t['m'] = 833; 41808 t['n'] = 556; 41809 t['o'] = 556; 41810 t['p'] = 556; 41811 t['q'] = 556; 41812 t['r'] = 333; 41813 t['s'] = 500; 41814 t['t'] = 278; 41815 t['u'] = 556; 41816 t['v'] = 500; 41817 t['w'] = 722; 41818 t['x'] = 500; 41819 t['y'] = 500; 41820 t['z'] = 500; 41821 t['braceleft'] = 334; 41822 t['bar'] = 260; 41823 t['braceright'] = 334; 41824 t['asciitilde'] = 584; 41825 t['exclamdown'] = 333; 41826 t['cent'] = 556; 41827 t['sterling'] = 556; 41828 t['fraction'] = 167; 41829 t['yen'] = 556; 41830 t['florin'] = 556; 41831 t['section'] = 556; 41832 t['currency'] = 556; 41833 t['quotesingle'] = 191; 41834 t['quotedblleft'] = 333; 41835 t['guillemotleft'] = 556; 41836 t['guilsinglleft'] = 333; 41837 t['guilsinglright'] = 333; 41838 t['fi'] = 500; 41839 t['fl'] = 500; 41840 t['endash'] = 556; 41841 t['dagger'] = 556; 41842 t['daggerdbl'] = 556;
41843 t['periodcentered'] = 278; 41844 t['paragraph'] = 537; 41845 t['bullet'] = 350; 41846 t['quotesinglbase'] = 222; 41847 t['quotedblbase'] = 333; 41848 t['quotedblright'] = 333; 41849 t['guillemotright'] = 556; 41850 t['ellipsis'] = 1000; 41851 t['perthousand'] = 1000; 41852 t['questiondown'] = 611; 41853 t['grave'] = 333; 41854 t['acute'] = 333; 41855 t['circumflex'] = 333; 41856 t['tilde'] = 333; 41857 t['macron'] = 333; 41858 t['breve'] = 333; 41859 t['dotaccent'] = 333; 41860 t['dieresis'] = 333; 41861 t['ring'] = 333; 41862 t['cedilla'] = 333; 41863 t['hungarumlaut'] = 333; 41864 t['ogonek'] = 333; 41865 t['caron'] = 333; 41866 t['emdash'] = 1000; 41867 t['AE'] = 1000; 41868 t['ordfeminine'] = 370; 41869 t['Lslash'] = 556; 41870 t['Oslash'] = 778; 41871 t['OE'] = 1000; 41872 t['ordmasculine'] = 365; 41873 t['ae'] = 889; 41874 t['dotlessi'] = 278; 41875 t['lslash'] = 222; 41876 t['oslash'] = 611; 41877 t['oe'] = 944; 41878 t['germandbls'] = 611; 41879 t['Idieresis'] = 278; 41880 t['eacute'] = 556; 41881 t['abreve'] = 556; 41882 t['uhungarumlaut'] = 556; 41883 t['ecaron'] = 556; 41884 t['Ydieresis'] = 667; 41885 t['divide'] = 584; 41886 t['Yacute'] = 667; 41887 t['Acircumflex'] = 667; 41888 t['aacute'] = 556; 41889 t['Ucircumflex'] = 722; 41890 t['yacute'] = 500; 41891 t['scommaaccent'] = 500; 41892 t['ecircumflex'] = 556; 41893 t['Uring'] = 722; 41894 t['Udieresis'] = 722; 41895 t['aogonek'] = 556; 41896 t['Uacute'] = 722; 41897 t['uogonek'] = 556; 41898 t['Edieresis'] = 667; 41899 t['Dcroat'] = 722; 41900 t['commaaccent'] = 250; 41901 t['copyright'] = 737; 41902 t['Emacron'] = 667; 41903 t['ccaron'] = 500; 41904 t['aring'] = 556; 41905 t['Ncommaaccent'] = 722; 41906 t['lacute'] = 222; 41907 t['agrave'] = 556; 41908 t['Tcommaaccent'] = 611; 41909 t['Cacute'] = 722; 41910 t['atilde'] = 556; 41911 t['Edotaccent'] = 667; 41912 t['scaron'] = 500; 41913 t['scedilla'] = 500; 41914 t['iacute'] = 278; 41915 t['lozenge'] = 471; 41916 t['Rcaron'] = 722; 41917 t['Gcommaaccent'] = 778; 41918 t['ucircumflex'] = 556; 41919 t['acircumflex'] = 556; 41920 t['Amacron'] = 667; 41921 t['rcaron'] = 333; 41922 t['ccedilla'] = 500; 41923 t['Zdotaccent'] = 611; 41924 t['Thorn'] = 667; 41925 t['Omacron'] = 778; 41926 t['Racute'] = 722; 41927 t['Sacute'] = 667; 41928 t['dcaron'] = 643; 41929 t['Umacron'] = 722; 41930 t['uring'] = 556; 41931 t['threesuperior'] = 333; 41932 t['Ograve'] = 778; 41933 t['Agrave'] = 667; 41934 t['Abreve'] = 667; 41935 t['multiply'] = 584; 41936 t['uacute'] = 556; 41937 t['Tcaron'] = 611; 41938 t['partialdiff'] = 476; 41939 t['ydieresis'] = 500; 41940 t['Nacute'] = 722; 41941 t['icircumflex'] = 278; 41942 t['Ecircumflex'] = 667; 41943 t['adieresis'] = 556; 41944 t['edieresis'] = 556; 41945 t['cacute'] = 500; 41946 t['nacute'] = 556; 41947 t['umacron'] = 556; 41948 t['Ncaron'] = 722; 41949 t['Iacute'] = 278; 41950 t['plusminus'] = 584; 41951 t['brokenbar'] = 260; 41952 t['registered'] = 737; 41953 t['Gbreve'] = 778; 41954 t['Idotaccent'] = 278; 41955 t['summation'] = 600; 41956 t['Egrave'] = 667; 41957 t['racute'] = 333; 41958 t['omacron'] = 556; 41959 t['Zacute'] = 611; 41960 t['Zcaron'] = 611; 41961 t['greaterequal'] = 549; 41962 t['Eth'] = 722; 41963 t['Ccedilla'] = 722; 41964 t['lcommaaccent'] = 222; 41965 t['tcaron'] = 317; 41966 t['eogonek'] = 556; 41967 t['Uogonek'] = 722; 41968 t['Aacute'] = 667; 41969 t['Adieresis'] = 667; 41970 t['egrave'] = 556; 41971 t['zacute'] = 500; 41972 t['iogonek'] = 222; 41973 t['Oacute'] = 778; 41974 t['oacute'] = 556; 41975 t['amacron'] = 556; 41976 t['sacute'] = 500; 41977 t['idieresis'] = 278; 41978 t['Ocircumflex'] = 778; 41979 t['Ugrave'] = 722; 41980 t['Delta'] = 612; 41981 t['thorn'] = 556; 41982 t['twosuperior'] = 333; 41983 t['Odieresis'] = 778; 41984 t['mu'] = 556; 41985 t['igrave'] = 278; 41986 t['ohungarumlaut'] = 556; 41987 t['Eogonek'] = 667; 41988 t['dcroat'] = 556; 41989 t['threequarters'] = 834; 41990 t['Scedilla'] = 667; 41991 t['lcaron'] = 299; 41992 t['Kcommaaccent'] = 667; 41993 t['Lacute'] = 556; 41994 t['trademark'] = 1000; 41995 t['edotaccent'] = 556; 41996 t['Igrave'] = 278; 41997 t['Imacron'] = 278; 41998 t['Lcaron'] = 556; 41999 t['onehalf'] = 834; 42000 t['lessequal'] = 549; 42001 t['ocircumflex'] = 556; 42002 t['ntilde'] = 556; 42003 t['Uhungarumlaut'] = 722; 42004 t['Eacute'] = 667; 42005 t['emacron'] = 556; 42006 t['gbreve'] = 556; 42007 t['onequarter'] = 834; 42008 t['Scaron'] = 667; 42009 t['Scommaaccent'] = 667; 42010 t['Ohungarumlaut'] = 778; 42011 t['degree'] = 400; 42012 t['ograve'] = 556; 42013 t['Ccaron'] = 722; 42014 t['ugrave'] = 556; 42015 t['radical'] = 453; 42016 t['Dcaron'] = 722; 42017 t['rcommaaccent'] = 333; 42018 t['Ntilde'] = 722; 42019 t['otilde'] = 556; 42020 t['Rcommaaccent'] = 722; 42021 t['Lcommaaccent'] = 556; 42022 t['Atilde'] = 667; 42023 t['Aogonek'] = 667; 42024 t['Aring'] = 667; 42025 t['Otilde'] = 778; 42026 t['zdotaccent'] = 500; 42027 t['Ecaron'] = 667; 42028 t['Iogonek'] = 278; 42029 t['kcommaaccent'] = 500; 42030 t['minus'] = 584; 42031 t['Icircumflex'] = 278; 42032 t['ncaron'] = 556; 42033 t['tcommaaccent'] = 278; 42034 t['logicalnot'] = 584; 42035 t['odieresis'] = 556; 42036 t['udieresis'] = 556; 42037 t['notequal'] = 549; 42038 t['gcommaaccent'] = 556; 42039 t['eth'] = 556; 42040 t['zcaron'] = 500; 42041 t['ncommaaccent'] = 556; 42042 t['onesuperior'] = 333; 42043 t['imacron'] = 278; 42044 t['Euro'] = 556; 42045 }); 42046 t['Symbol'] = (0, _util.getLookupTableFactory)(function (t) { 42047 t['space'] = 250; 42048 t['exclam'] = 333; 42049 t['universal'] = 713; 42050 t['numbersign'] = 500; 42051 t['existential'] = 549; 42052 t['percent'] = 833; 42053 t['ampersand'] = 778; 42054 t['suchthat'] = 439; 42055 t['parenleft'] = 333; 42056 t['parenright'] = 333; 42057 t['asteriskmath'] = 500; 42058 t['plus'] = 549; 42059 t['comma'] = 250; 42060 t['minus'] = 549; 42061 t['period'] = 250; 42062 t['slash'] = 278; 42063 t['zero'] = 500; 42064 t['one'] = 500; 42065 t['two'] = 500; 42066 t['three'] = 500; 42067 t['four'] = 500; 42068 t['five'] = 500; 42069 t['six'] = 500; 42070 t['seven'] = 500; 42071 t['eight'] = 500; 42072 t['nine'] = 500; 42073 t['colon'] = 278; 42074 t['semicolon'] = 278; 42075 t['less'] = 549; 42076 t['equal'] = 549; 42077 t['greater'] = 549; 42078 t['question'] = 444; 42079 t['congruent'] = 549; 42080 t['Alpha'] = 722; 42081 t['Beta'] = 667; 42082 t['Chi'] = 722; 42083 t['Delta'] = 612; 42084 t['Epsilon'] = 611; 42085 t['Phi'] = 763; 42086 t['Gamma'] = 603; 42087 t['Eta'] = 722; 42088 t['Iota'] = 333; 42089 t['theta1'] = 631; 42090 t['Kappa'] = 722; 42091 t['Lambda'] = 686; 42092 t['Mu'] = 889; 42093 t['Nu'] = 722; 42094 t['Omicron'] = 722; 42095 t['Pi'] = 768; 42096 t['Theta'] = 741; 42097 t['Rho'] = 556;
42098 t['Sigma'] = 592; 42099 t['Tau'] = 611; 42100 t['Upsilon'] = 690; 42101 t['sigma1'] = 439; 42102 t['Omega'] = 768; 42103 t['Xi'] = 645; 42104 t['Psi'] = 795; 42105 t['Zeta'] = 611; 42106 t['bracketleft'] = 333; 42107 t['therefore'] = 863; 42108 t['bracketright'] = 333; 42109 t['perpendicular'] = 658; 42110 t['underscore'] = 500; 42111 t['radicalex'] = 500; 42112 t['alpha'] = 631; 42113 t['beta'] = 549; 42114 t['chi'] = 549; 42115 t['delta'] = 494; 42116 t['epsilon'] = 439; 42117 t['phi'] = 521; 42118 t['gamma'] = 411; 42119 t['eta'] = 603; 42120 t['iota'] = 329; 42121 t['phi1'] = 603; 42122 t['kappa'] = 549; 42123 t['lambda'] = 549; 42124 t['mu'] = 576; 42125 t['nu'] = 521; 42126 t['omicron'] = 549; 42127 t['pi'] = 549; 42128 t['theta'] = 521; 42129 t['rho'] = 549; 42130 t['sigma'] = 603; 42131 t['tau'] = 439; 42132 t['upsilon'] = 576; 42133 t['omega1'] = 713; 42134 t['omega'] = 686; 42135 t['xi'] = 493; 42136 t['psi'] = 686; 42137 t['zeta'] = 494; 42138 t['braceleft'] = 480; 42139 t['bar'] = 200; 42140 t['braceright'] = 480; 42141 t['similar'] = 549; 42142 t['Euro'] = 750; 42143 t['Upsilon1'] = 620; 42144 t['minute'] = 247; 42145 t['lessequal'] = 549; 42146 t['fraction'] = 167; 42147 t['infinity'] = 713; 42148 t['florin'] = 500; 42149 t['club'] = 753; 42150 t['diamond'] = 753; 42151 t['heart'] = 753; 42152 t['spade'] = 753; 42153 t['arrowboth'] = 1042; 42154 t['arrowleft'] = 987; 42155 t['arrowup'] = 603; 42156 t['arrowright'] = 987; 42157 t['arrowdown'] = 603; 42158 t['degree'] = 400; 42159 t['plusminus'] = 549; 42160 t['second'] = 411; 42161 t['greaterequal'] = 549; 42162 t['multiply'] = 549; 42163 t['proportional'] = 713; 42164 t['partialdiff'] = 494; 42165 t['bullet'] = 460; 42166 t['divide'] = 549; 42167 t['notequal'] = 549; 42168 t['equivalence'] = 549; 42169 t['approxequal'] = 549; 42170 t['ellipsis'] = 1000; 42171 t['arrowvertex'] = 603; 42172 t['arrowhorizex'] = 1000; 42173 t['carriagereturn'] = 658; 42174 t['aleph'] = 823; 42175 t['Ifraktur'] = 686; 42176 t['Rfraktur'] = 795; 42177 t['weierstrass'] = 987; 42178 t['circlemultiply'] = 768; 42179 t['circleplus'] = 768; 42180 t['emptyset'] = 823; 42181 t['intersection'] = 768; 42182 t['union'] = 768; 42183 t['propersuperset'] = 713; 42184 t['reflexsuperset'] = 713; 42185 t['notsubset'] = 713; 42186 t['propersubset'] = 713; 42187 t['reflexsubset'] = 713; 42188 t['element'] = 713; 42189 t['notelement'] = 713; 42190 t['angle'] = 768; 42191 t['gradient'] = 713; 42192 t['registerserif'] = 790; 42193 t['copyrightserif'] = 790; 42194 t['trademarkserif'] = 890; 42195 t['product'] = 823; 42196 t['radical'] = 549; 42197 t['dotmath'] = 250; 42198 t['logicalnot'] = 713; 42199 t['logicaland'] = 603; 42200 t['logicalor'] = 603; 42201 t['arrowdblboth'] = 1042; 42202 t['arrowdblleft'] = 987; 42203 t['arrowdblup'] = 603; 42204 t['arrowdblright'] = 987; 42205 t['arrowdbldown'] = 603; 42206 t['lozenge'] = 494; 42207 t['angleleft'] = 329; 42208 t['registersans'] = 790; 42209 t['copyrightsans'] = 790; 42210 t['trademarksans'] = 786; 42211 t['summation'] = 713; 42212 t['parenlefttp'] = 384; 42213 t['parenleftex'] = 384; 42214 t['parenleftbt'] = 384; 42215 t['bracketlefttp'] = 384; 42216 t['bracketleftex'] = 384; 42217 t['bracketleftbt'] = 384; 42218 t['bracelefttp'] = 494; 42219 t['braceleftmid'] = 494; 42220 t['braceleftbt'] = 494; 42221 t['braceex'] = 494; 42222 t['angleright'] = 329; 42223 t['integral'] = 274; 42224 t['integraltp'] = 686; 42225 t['integralex'] = 686; 42226 t['integralbt'] = 686; 42227 t['parenrighttp'] = 384; 42228 t['parenrightex'] = 384; 42229 t['parenrightbt'] = 384; 42230 t['bracketrighttp'] = 384; 42231 t['bracketrightex'] = 384; 42232 t['bracketrightbt'] = 384; 42233 t['bracerighttp'] = 494; 42234 t['bracerightmid'] = 494; 42235 t['bracerightbt'] = 494; 42236 t['apple'] = 790; 42237 }); 42238 t['Times-Roman'] = (0, _util.getLookupTableFactory)(function (t) { 42239 t['space'] = 250; 42240 t['exclam'] = 333; 42241 t['quotedbl'] = 408; 42242 t['numbersign'] = 500; 42243 t['dollar'] = 500; 42244 t['percent'] = 833; 42245 t['ampersand'] = 778; 42246 t['quoteright'] = 333; 42247 t['parenleft'] = 333; 42248 t['parenright'] = 333; 42249 t['asterisk'] = 500; 42250 t['plus'] = 564; 42251 t['comma'] = 250; 42252 t['hyphen'] = 333; 42253 t['period'] = 250; 42254 t['slash'] = 278; 42255 t['zero'] = 500; 42256 t['one'] = 500; 42257 t['two'] = 500; 42258 t['three'] = 500; 42259 t['four'] = 500; 42260 t['five'] = 500; 42261 t['six'] = 500; 42262 t['seven'] = 500; 42263 t['eight'] = 500; 42264 t['nine'] = 500; 42265 t['colon'] = 278; 42266 t['semicolon'] = 278; 42267 t['less'] = 564; 42268 t['equal'] = 564; 42269 t['greater'] = 564; 42270 t['question'] = 444; 42271 t['at'] = 921; 42272 t['A'] = 722; 42273 t['B'] = 667; 42274 t['C'] = 667; 42275 t['D'] = 722; 42276 t['E'] = 611; 42277 t['F'] = 556; 42278 t['G'] = 722; 42279 t['H'] = 722; 42280 t['I'] = 333; 42281 t['J'] = 389; 42282 t['K'] = 722; 42283 t['L'] = 611; 42284 t['M'] = 889; 42285 t['N'] = 722; 42286 t['O'] = 722; 42287 t['P'] = 556; 42288 t['Q'] = 722; 42289 t['R'] = 667; 42290 t['S'] = 556; 42291 t['T'] = 611; 42292 t['U'] = 722; 42293 t['V'] = 722; 42294 t['W'] = 944; 42295 t['X'] = 722; 42296 t['Y'] = 722; 42297 t['Z'] = 611; 42298 t['bracketleft'] = 333; 42299 t['backslash'] = 278; 42300 t['bracketright'] = 333; 42301 t['asciicircum'] = 469; 42302 t['underscore'] = 500; 42303 t['quoteleft'] = 333; 42304 t['a'] = 444; 42305 t['b'] = 500; 42306 t['c'] = 444; 42307 t['d'] = 500; 42308 t['e'] = 444; 42309 t['f'] = 333; 42310 t['g'] = 500; 42311 t['h'] = 500; 42312 t['i'] = 278; 42313 t['j'] = 278; 42314 t['k'] = 500; 42315 t['l'] = 278; 42316 t['m'] = 778; 42317 t['n'] = 500; 42318 t['o'] = 500; 42319 t['p'] = 500; 42320 t['q'] = 500; 42321 t['r'] = 333; 42322 t['s'] = 389; 42323 t['t'] = 278; 42324 t['u'] = 500; 42325 t['v'] = 500; 42326 t['w'] = 722; 42327 t['x'] = 500; 42328 t['y'] = 500; 42329 t['z'] = 444; 42330 t['braceleft'] = 480; 42331 t['bar'] = 200; 42332 t['braceright'] = 480; 42333 t['asciitilde'] = 541; 42334 t['exclamdown'] = 333; 42335 t['cent'] = 500; 42336 t['sterling'] = 500; 42337 t['fraction'] = 167; 42338 t['yen'] = 500; 42339 t['florin'] = 500; 42340 t['section'] = 500; 42341 t['currency'] = 500; 42342 t['quotesingle'] = 180; 42343 t['quotedblleft'] = 444; 42344 t['guillemotleft'] = 500; 42345 t['guilsinglleft'] = 333; 42346 t['guilsinglright'] = 333; 42347 t['fi'] = 556; 42348 t['fl'] = 556; 42349 t['endash'] = 500; 42350 t['dagger'] = 500; 42351 t['daggerdbl'] = 500;
42352 t['periodcentered'] = 250; 42353 t['paragraph'] = 453; 42354 t['bullet'] = 350; 42355 t['quotesinglbase'] = 333; 42356 t['quotedblbase'] = 444; 42357 t['quotedblright'] = 444; 42358 t['guillemotright'] = 500; 42359 t['ellipsis'] = 1000; 42360 t['perthousand'] = 1000; 42361 t['questiondown'] = 444; 42362 t['grave'] = 333; 42363 t['acute'] = 333; 42364 t['circumflex'] = 333; 42365 t['tilde'] = 333; 42366 t['macron'] = 333; 42367 t['breve'] = 333; 42368 t['dotaccent'] = 333; 42369 t['dieresis'] = 333; 42370 t['ring'] = 333; 42371 t['cedilla'] = 333; 42372 t['hungarumlaut'] = 333; 42373 t['ogonek'] = 333; 42374 t['caron'] = 333; 42375 t['emdash'] = 1000; 42376 t['AE'] = 889; 42377 t['ordfeminine'] = 276; 42378 t['Lslash'] = 611; 42379 t['Oslash'] = 722; 42380 t['OE'] = 889; 42381 t['ordmasculine'] = 310; 42382 t['ae'] = 667; 42383 t['dotlessi'] = 278; 42384 t['lslash'] = 278; 42385 t['oslash'] = 500; 42386 t['oe'] = 722; 42387 t['germandbls'] = 500; 42388 t['Idieresis'] = 333; 42389 t['eacute'] = 444; 42390 t['abreve'] = 444; 42391 t['uhungarumlaut'] = 500; 42392 t['ecaron'] = 444; 42393 t['Ydieresis'] = 722; 42394 t['divide'] = 564; 42395 t['Yacute'] = 722; 42396 t['Acircumflex'] = 722; 42397 t['aacute'] = 444; 42398 t['Ucircumflex'] = 722; 42399 t['yacute'] = 500; 42400 t['scommaaccent'] = 389; 42401 t['ecircumflex'] = 444; 42402 t['Uring'] = 722; 42403 t['Udieresis'] = 722; 42404 t['aogonek'] = 444; 42405 t['Uacute'] = 722; 42406 t['uogonek'] = 500; 42407 t['Edieresis'] = 611; 42408 t['Dcroat'] = 722; 42409 t['commaaccent'] = 250; 42410 t['copyright'] = 760; 42411 t['Emacron'] = 611; 42412 t['ccaron'] = 444; 42413 t['aring'] = 444; 42414 t['Ncommaaccent'] = 722; 42415 t['lacute'] = 278; 42416 t['agrave'] = 444; 42417 t['Tcommaaccent'] = 611; 42418 t['Cacute'] = 667; 42419 t['atilde'] = 444; 42420 t['Edotaccent'] = 611; 42421 t['scaron'] = 389; 42422 t['scedilla'] = 389; 42423 t['iacute'] = 278; 42424 t['lozenge'] = 471; 42425 t['Rcaron'] = 667; 42426 t['Gcommaaccent'] = 722; 42427 t['ucircumflex'] = 500; 42428 t['acircumflex'] = 444; 42429 t['Amacron'] = 722; 42430 t['rcaron'] = 333; 42431 t['ccedilla'] = 444; 42432 t['Zdotaccent'] = 611; 42433 t['Thorn'] = 556; 42434 t['Omacron'] = 722; 42435 t['Racute'] = 667; 42436 t['Sacute'] = 556; 42437 t['dcaron'] = 588; 42438 t['Umacron'] = 722; 42439 t['uring'] = 500; 42440 t['threesuperior'] = 300; 42441 t['Ograve'] = 722; 42442 t['Agrave'] = 722; 42443 t['Abreve'] = 722; 42444 t['multiply'] = 564; 42445 t['uacute'] = 500; 42446 t['Tcaron'] = 611; 42447 t['partialdiff'] = 476; 42448 t['ydieresis'] = 500; 42449 t['Nacute'] = 722; 42450 t['icircumflex'] = 278; 42451 t['Ecircumflex'] = 611; 42452 t['adieresis'] = 444; 42453 t['edieresis'] = 444; 42454 t['cacute'] = 444; 42455 t['nacute'] = 500; 42456 t['umacron'] = 500; 42457 t['Ncaron'] = 722; 42458 t['Iacute'] = 333; 42459 t['plusminus'] = 564; 42460 t['brokenbar'] = 200; 42461 t['registered'] = 760; 42462 t['Gbreve'] = 722; 42463 t['Idotaccent'] = 333; 42464 t['summation'] = 600; 42465 t['Egrave'] = 611; 42466 t['racute'] = 333; 42467 t['omacron'] = 500; 42468 t['Zacute'] = 611; 42469 t['Zcaron'] = 611; 42470 t['greaterequal'] = 549; 42471 t['Eth'] = 722; 42472 t['Ccedilla'] = 667; 42473 t['lcommaaccent'] = 278; 42474 t['tcaron'] = 326; 42475 t['eogonek'] = 444; 42476 t['Uogonek'] = 722; 42477 t['Aacute'] = 722; 42478 t['Adieresis'] = 722; 42479 t['egrave'] = 444; 42480 t['zacute'] = 444; 42481 t['iogonek'] = 278; 42482 t['Oacute'] = 722; 42483 t['oacute'] = 500; 42484 t['amacron'] = 444; 42485 t['sacute'] = 389; 42486 t['idieresis'] = 278; 42487 t['Ocircumflex'] = 722; 42488 t['Ugrave'] = 722; 42489 t['Delta'] = 612; 42490 t['thorn'] = 500; 42491 t['twosuperior'] = 300; 42492 t['Odieresis'] = 722; 42493 t['mu'] = 500; 42494 t['igrave'] = 278; 42495 t['ohungarumlaut'] = 500; 42496 t['Eogonek'] = 611; 42497 t['dcroat'] = 500; 42498 t['threequarters'] = 750; 42499 t['Scedilla'] = 556; 42500 t['lcaron'] = 344; 42501 t['Kcommaaccent'] = 722; 42502 t['Lacute'] = 611; 42503 t['trademark'] = 980; 42504 t['edotaccent'] = 444; 42505 t['Igrave'] = 333; 42506 t['Imacron'] = 333; 42507 t['Lcaron'] = 611; 42508 t['onehalf'] = 750; 42509 t['lessequal'] = 549; 42510 t['ocircumflex'] = 500; 42511 t['ntilde'] = 500; 42512 t['Uhungarumlaut'] = 722; 42513 t['Eacute'] = 611; 42514 t['emacron'] = 444; 42515 t['gbreve'] = 500; 42516 t['onequarter'] = 750; 42517 t['Scaron'] = 556; 42518 t['Scommaaccent'] = 556; 42519 t['Ohungarumlaut'] = 722; 42520 t['degree'] = 400; 42521 t['ograve'] = 500; 42522 t['Ccaron'] = 667; 42523 t['ugrave'] = 500; 42524 t['radical'] = 453; 42525 t['Dcaron'] = 722; 42526 t['rcommaaccent'] = 333; 42527 t['Ntilde'] = 722; 42528 t['otilde'] = 500; 42529 t['Rcommaaccent'] = 667; 42530 t['Lcommaaccent'] = 611; 42531 t['Atilde'] = 722; 42532 t['Aogonek'] = 722; 42533 t['Aring'] = 722; 42534 t['Otilde'] = 722; 42535 t['zdotaccent'] = 444; 42536 t['Ecaron'] = 611; 42537 t['Iogonek'] = 333; 42538 t['kcommaaccent'] = 500; 42539 t['minus'] = 564; 42540 t['Icircumflex'] = 333; 42541 t['ncaron'] = 500; 42542 t['tcommaaccent'] = 278; 42543 t['logicalnot'] = 564; 42544 t['odieresis'] = 500; 42545 t['udieresis'] = 500; 42546 t['notequal'] = 549; 42547 t['gcommaaccent'] = 500; 42548 t['eth'] = 500; 42549 t['zcaron'] = 444; 42550 t['ncommaaccent'] = 500; 42551 t['onesuperior'] = 300; 42552 t['imacron'] = 278; 42553 t['Euro'] = 500; 42554 }); 42555 t['Times-Bold'] = (0, _util.getLookupTableFactory)(function (t) { 42556 t['space'] = 250; 42557 t['exclam'] = 333; 42558 t['quotedbl'] = 555; 42559 t['numbersign'] = 500; 42560 t['dollar'] = 500; 42561 t['percent'] = 1000; 42562 t['ampersand'] = 833; 42563 t['quoteright'] = 333; 42564 t['parenleft'] = 333; 42565 t['parenright'] = 333; 42566 t['asterisk'] = 500; 42567 t['plus'] = 570; 42568 t['comma'] = 250; 42569 t['hyphen'] = 333; 42570 t['period'] = 250; 42571 t['slash'] = 278; 42572 t['zero'] = 500; 42573 t['one'] = 500; 42574 t['two'] = 500; 42575 t['three'] = 500; 42576 t['four'] = 500; 42577 t['five'] = 500; 42578 t['six'] = 500; 42579 t['seven'] = 500; 42580 t['eight'] = 500; 42581 t['nine'] = 500; 42582 t['colon'] = 333; 42583 t['semicolon'] = 333; 42584 t['less'] = 570; 42585 t['equal'] = 570; 42586 t['greater'] = 570; 42587 t['question'] = 500; 42588 t['at'] = 930; 42589 t['A'] = 722; 42590 t['B'] = 667; 42591 t['C'] = 722; 42592 t['D'] = 722; 42593 t['E'] = 667; 42594 t['F'] = 611; 42595 t['G'] = 778; 42596 t['H'] = 778; 42597 t['I'] = 389; 42598 t['J'] = 500; 42599 t['K'] = 778; 42600 t['L'] = 667; 42601 t['M'] = 944; 42602 t['N'] = 722; 42603 t['O'] = 778; 42604 t['P'] = 611; 42605 t['Q'] = 778; 42606 t['R'] = 722; 42607 t['S'] = 556; 42608 t['T'] = 667; 42609 t['U'] = 722; 42610 t['V'] = 722; 42611 t['W'] = 1000; 42612 t['X'] = 722; 42613 t['Y'] = 722; 42614 t['Z'] = 667; 42615 t['bracketleft'] = 333; 42616 t['backslash'] = 278; 42617 t['bracketright'] = 333; 42618 t['asciicircum'] = 581; 42619 t['underscore'] = 500; 42620 t['quoteleft'] = 333; 42621 t['a'] = 500; 42622 t['b'] = 556; 42623 t['c'] = 444; 42624 t['d'] = 556; 42625 t['e'] = 444; 42626 t['f'] = 333; 42627 t['g'] = 500; 42628 t['h'] = 556; 42629 t['i'] = 278; 42630 t['j'] = 333; 42631 t['k'] = 556; 42632 t['l'] = 278; 42633 t['m'] = 833; 42634 t['n'] = 556; 42635 t['o'] = 500; 42636 t['p'] = 556; 42637 t['q'] = 556; 42638 t['r'] = 444; 42639 t['s'] = 389; 42640 t['t'] = 333; 42641 t['u'] = 556; 42642 t['v'] = 500; 42643 t['w'] = 722; 42644 t['x'] = 500; 42645 t['y'] = 500; 42646 t['z'] = 444; 42647 t['braceleft'] = 394; 42648 t['bar'] = 220; 42649 t['braceright'] = 394; 42650 t['asciitilde'] = 520; 42651 t['exclamdown'] = 333; 42652 t['cent'] = 500; 42653 t['sterling'] = 500; 42654 t['fraction'] = 167; 42655 t['yen'] = 500; 42656 t['florin'] = 500; 42657 t['section'] = 500; 42658 t['currency'] = 500; 42659 t['quotesingle'] = 278; 42660 t['quotedblleft'] = 500; 42661 t['guillemotleft'] = 500; 42662 t['guilsinglleft'] = 333; 42663 t['guilsinglright'] = 333; 42664 t['fi'] = 556; 42665 t['fl'] = 556; 42666 t['endash'] = 500; 42667 t['dagger'] = 500; 42668 t['daggerdbl'] = 500;
42669 t['periodcentered'] = 250; 42670 t['paragraph'] = 540; 42671 t['bullet'] = 350; 42672 t['quotesinglbase'] = 333; 42673 t['quotedblbase'] = 500; 42674 t['quotedblright'] = 500; 42675 t['guillemotright'] = 500; 42676 t['ellipsis'] = 1000; 42677 t['perthousand'] = 1000; 42678 t['questiondown'] = 500; 42679 t['grave'] = 333; 42680 t['acute'] = 333; 42681 t['circumflex'] = 333; 42682 t['tilde'] = 333; 42683 t['macron'] = 333; 42684 t['breve'] = 333; 42685 t['dotaccent'] = 333; 42686 t['dieresis'] = 333; 42687 t['ring'] = 333; 42688 t['cedilla'] = 333; 42689 t['hungarumlaut'] = 333; 42690 t['ogonek'] = 333; 42691 t['caron'] = 333; 42692 t['emdash'] = 1000; 42693 t['AE'] = 1000; 42694 t['ordfeminine'] = 300; 42695 t['Lslash'] = 667; 42696 t['Oslash'] = 778; 42697 t['OE'] = 1000; 42698 t['ordmasculine'] = 330; 42699 t['ae'] = 722; 42700 t['dotlessi'] = 278; 42701 t['lslash'] = 278; 42702 t['oslash'] = 500; 42703 t['oe'] = 722; 42704 t['germandbls'] = 556; 42705 t['Idieresis'] = 389; 42706 t['eacute'] = 444; 42707 t['abreve'] = 500; 42708 t['uhungarumlaut'] = 556; 42709 t['ecaron'] = 444; 42710 t['Ydieresis'] = 722; 42711 t['divide'] = 570; 42712 t['Yacute'] = 722; 42713 t['Acircumflex'] = 722; 42714 t['aacute'] = 500; 42715 t['Ucircumflex'] = 722; 42716 t['yacute'] = 500; 42717 t['scommaaccent'] = 389; 42718 t['ecircumflex'] = 444; 42719 t['Uring'] = 722; 42720 t['Udieresis'] = 722; 42721 t['aogonek'] = 500; 42722 t['Uacute'] = 722; 42723 t['uogonek'] = 556; 42724 t['Edieresis'] = 667; 42725 t['Dcroat'] = 722; 42726 t['commaaccent'] = 250; 42727 t['copyright'] = 747; 42728 t['Emacron'] = 667; 42729 t['ccaron'] = 444; 42730 t['aring'] = 500; 42731 t['Ncommaaccent'] = 722; 42732 t['lacute'] = 278; 42733 t['agrave'] = 500; 42734 t['Tcommaaccent'] = 667; 42735 t['Cacute'] = 722; 42736 t['atilde'] = 500; 42737 t['Edotaccent'] = 667; 42738 t['scaron'] = 389; 42739 t['scedilla'] = 389; 42740 t['iacute'] = 278; 42741 t['lozenge'] = 494; 42742 t['Rcaron'] = 722; 42743 t['Gcommaaccent'] = 778; 42744 t['ucircumflex'] = 556; 42745 t['acircumflex'] = 500; 42746 t['Amacron'] = 722; 42747 t['rcaron'] = 444; 42748 t['ccedilla'] = 444; 42749 t['Zdotaccent'] = 667; 42750 t['Thorn'] = 611; 42751 t['Omacron'] = 778; 42752 t['Racute'] = 722; 42753 t['Sacute'] = 556; 42754 t['dcaron'] = 672; 42755 t['Umacron'] = 722; 42756 t['uring'] = 556; 42757 t['threesuperior'] = 300; 42758 t['Ograve'] = 778; 42759 t['Agrave'] = 722; 42760 t['Abreve'] = 722; 42761 t['multiply'] = 570; 42762 t['uacute'] = 556; 42763 t['Tcaron'] = 667; 42764 t['partialdiff'] = 494; 42765 t['ydieresis'] = 500; 42766 t['Nacute'] = 722; 42767 t['icircumflex'] = 278; 42768 t['Ecircumflex'] = 667; 42769 t['adieresis'] = 500; 42770 t['edieresis'] = 444; 42771 t['cacute'] = 444; 42772 t['nacute'] = 556; 42773 t['umacron'] = 556; 42774 t['Ncaron'] = 722; 42775 t['Iacute'] = 389; 42776 t['plusminus'] = 570; 42777 t['brokenbar'] = 220; 42778 t['registered'] = 747; 42779 t['Gbreve'] = 778; 42780 t['Idotaccent'] = 389; 42781 t['summation'] = 600; 42782 t['Egrave'] = 667; 42783 t['racute'] = 444; 42784 t['omacron'] = 500; 42785 t['Zacute'] = 667; 42786 t['Zcaron'] = 667; 42787 t['greaterequal'] = 549; 42788 t['Eth'] = 722; 42789 t['Ccedilla'] = 722; 42790 t['lcommaaccent'] = 278; 42791 t['tcaron'] = 416; 42792 t['eogonek'] = 444; 42793 t['Uogonek'] = 722; 42794 t['Aacute'] = 722; 42795 t['Adieresis'] = 722; 42796 t['egrave'] = 444; 42797 t['zacute'] = 444; 42798 t['iogonek'] = 278; 42799 t['Oacute'] = 778; 42800 t['oacute'] = 500; 42801 t['amacron'] = 500; 42802 t['sacute'] = 389; 42803 t['idieresis'] = 278; 42804 t['Ocircumflex'] = 778; 42805 t['Ugrave'] = 722; 42806 t['Delta'] = 612; 42807 t['thorn'] = 556; 42808 t['twosuperior'] = 300; 42809 t['Odieresis'] = 778; 42810 t['mu'] = 556; 42811 t['igrave'] = 278; 42812 t['ohungarumlaut'] = 500; 42813 t['Eogonek'] = 667; 42814 t['dcroat'] = 556; 42815 t['threequarters'] = 750; 42816 t['Scedilla'] = 556; 42817 t['lcaron'] = 394; 42818 t['Kcommaaccent'] = 778; 42819 t['Lacute'] = 667; 42820 t['trademark'] = 1000; 42821 t['edotaccent'] = 444; 42822 t['Igrave'] = 389; 42823 t['Imacron'] = 389; 42824 t['Lcaron'] = 667; 42825 t['onehalf'] = 750; 42826 t['lessequal'] = 549; 42827 t['ocircumflex'] = 500; 42828 t['ntilde'] = 556; 42829 t['Uhungarumlaut'] = 722; 42830 t['Eacute'] = 667; 42831 t['emacron'] = 444; 42832 t['gbreve'] = 500; 42833 t['onequarter'] = 750; 42834 t['Scaron'] = 556; 42835 t['Scommaaccent'] = 556; 42836 t['Ohungarumlaut'] = 778; 42837 t['degree'] = 400; 42838 t['ograve'] = 500; 42839 t['Ccaron'] = 722; 42840 t['ugrave'] = 556; 42841 t['radical'] = 549; 42842 t['Dcaron'] = 722; 42843 t['rcommaaccent'] = 444; 42844 t['Ntilde'] = 722; 42845 t['otilde'] = 500; 42846 t['Rcommaaccent'] = 722; 42847 t['Lcommaaccent'] = 667; 42848 t['Atilde'] = 722; 42849 t['Aogonek'] = 722; 42850 t['Aring'] = 722; 42851 t['Otilde'] = 778; 42852 t['zdotaccent'] = 444; 42853 t['Ecaron'] = 667; 42854 t['Iogonek'] = 389; 42855 t['kcommaaccent'] = 556; 42856 t['minus'] = 570; 42857 t['Icircumflex'] = 389; 42858 t['ncaron'] = 556; 42859 t['tcommaaccent'] = 333; 42860 t['logicalnot'] = 570; 42861 t['odieresis'] = 500; 42862 t['udieresis'] = 556; 42863 t['notequal'] = 549; 42864 t['gcommaaccent'] = 500; 42865 t['eth'] = 500; 42866 t['zcaron'] = 444; 42867 t['ncommaaccent'] = 556; 42868 t['onesuperior'] = 300; 42869 t['imacron'] = 278; 42870 t['Euro'] = 500; 42871 }); 42872 t['Times-BoldItalic'] = (0, _util.getLookupTableFactory)(function (t) { 42873 t['space'] = 250; 42874 t['exclam'] = 389; 42875 t['quotedbl'] = 555; 42876 t['numbersign'] = 500; 42877 t['dollar'] = 500; 42878 t['percent'] = 833; 42879 t['ampersand'] = 778; 42880 t['quoteright'] = 333; 42881 t['parenleft'] = 333; 42882 t['parenright'] = 333; 42883 t['asterisk'] = 500; 42884 t['plus'] = 570; 42885 t['comma'] = 250; 42886 t['hyphen'] = 333; 42887 t['period'] = 250; 42888 t['slash'] = 278; 42889 t['zero'] = 500; 42890 t['one'] = 500; 42891 t['two'] = 500; 42892 t['three'] = 500; 42893 t['four'] = 500; 42894 t['five'] = 500; 42895 t['six'] = 500; 42896 t['seven'] = 500; 42897 t['eight'] = 500; 42898 t['nine'] = 500; 42899 t['colon'] = 333; 42900 t['semicolon'] = 333; 42901 t['less'] = 570; 42902 t['equal'] = 570; 42903 t['greater'] = 570; 42904 t['question'] = 500; 42905 t['at'] = 832; 42906 t['A'] = 667; 42907 t['B'] = 667; 42908 t['C'] = 667; 42909 t['D'] = 722; 42910 t['E'] = 667; 42911 t['F'] = 667; 42912 t['G'] = 722; 42913 t['H'] = 778; 42914 t['I'] = 389; 42915 t['J'] = 500; 42916 t['K'] = 667; 42917 t['L'] = 611; 42918 t['M'] = 889; 42919 t['N'] = 722; 42920 t['O'] = 722; 42921 t['P'] = 611; 42922 t['Q'] = 722; 42923 t['R'] = 667; 42924 t['S'] = 556; 42925 t['T'] = 611; 42926 t['U'] = 722; 42927 t['V'] = 667; 42928 t['W'] = 889; 42929 t['X'] = 667; 42930 t['Y'] = 611; 42931 t['Z'] = 611; 42932 t['bracketleft'] = 333; 42933 t['backslash'] = 278; 42934 t['bracketright'] = 333; 42935 t['asciicircum'] = 570; 42936 t['underscore'] = 500; 42937 t['quoteleft'] = 333; 42938 t['a'] = 500; 42939 t['b'] = 500; 42940 t['c'] = 444; 42941 t['d'] = 500; 42942 t['e'] = 444; 42943 t['f'] = 333; 42944 t['g'] = 500; 42945 t['h'] = 556; 42946 t['i'] = 278; 42947 t['j'] = 278; 42948 t['k'] = 500; 42949 t['l'] = 278; 42950 t['m'] = 778; 42951 t['n'] = 556; 42952 t['o'] = 500; 42953 t['p'] = 500; 42954 t['q'] = 500; 42955 t['r'] = 389; 42956 t['s'] = 389; 42957 t['t'] = 278; 42958 t['u'] = 556; 42959 t['v'] = 444; 42960 t['w'] = 667; 42961 t['x'] = 500; 42962 t['y'] = 444; 42963 t['z'] = 389; 42964 t['braceleft'] = 348; 42965 t['bar'] = 220; 42966 t['braceright'] = 348; 42967 t['asciitilde'] = 570; 42968 t['exclamdown'] = 389; 42969 t['cent'] = 500; 42970 t['sterling'] = 500; 42971 t['fraction'] = 167; 42972 t['yen'] = 500; 42973 t['florin'] = 500; 42974 t['section'] = 500; 42975 t['currency'] = 500; 42976 t['quotesingle'] = 278; 42977 t['quotedblleft'] = 500; 42978 t['guillemotleft'] = 500; 42979 t['guilsinglleft'] = 333; 42980 t['guilsinglright'] = 333; 42981 t['fi'] = 556; 42982 t['fl'] = 556; 42983 t['endash'] = 500; 42984 t['dagger'] = 500; 42985 t['daggerdbl'] = 500;
42986 t['periodcentered'] = 250; 42987 t['paragraph'] = 500; 42988 t['bullet'] = 350; 42989 t['quotesinglbase'] = 333; 42990 t['quotedblbase'] = 500; 42991 t['quotedblright'] = 500; 42992 t['guillemotright'] = 500; 42993 t['ellipsis'] = 1000; 42994 t['perthousand'] = 1000; 42995 t['questiondown'] = 500; 42996 t['grave'] = 333; 42997 t['acute'] = 333; 42998 t['circumflex'] = 333; 42999 t['tilde'] = 333; 43000 t['macron'] = 333; 43001 t['breve'] = 333; 43002 t['dotaccent'] = 333; 43003 t['dieresis'] = 333; 43004 t['ring'] = 333; 43005 t['cedilla'] = 333; 43006 t['hungarumlaut'] = 333; 43007 t['ogonek'] = 333; 43008 t['caron'] = 333; 43009 t['emdash'] = 1000; 43010 t['AE'] = 944; 43011 t['ordfeminine'] = 266; 43012 t['Lslash'] = 611; 43013 t['Oslash'] = 722; 43014 t['OE'] = 944; 43015 t['ordmasculine'] = 300; 43016 t['ae'] = 722; 43017 t['dotlessi'] = 278; 43018 t['lslash'] = 278; 43019 t['oslash'] = 500; 43020 t['oe'] = 722; 43021 t['germandbls'] = 500; 43022 t['Idieresis'] = 389; 43023 t['eacute'] = 444; 43024 t['abreve'] = 500; 43025 t['uhungarumlaut'] = 556; 43026 t['ecaron'] = 444; 43027 t['Ydieresis'] = 611; 43028 t['divide'] = 570; 43029 t['Yacute'] = 611; 43030 t['Acircumflex'] = 667; 43031 t['aacute'] = 500; 43032 t['Ucircumflex'] = 722; 43033 t['yacute'] = 444; 43034 t['scommaaccent'] = 389; 43035 t['ecircumflex'] = 444; 43036 t['Uring'] = 722; 43037 t['Udieresis'] = 722; 43038 t['aogonek'] = 500; 43039 t['Uacute'] = 722; 43040 t['uogonek'] = 556; 43041 t['Edieresis'] = 667; 43042 t['Dcroat'] = 722; 43043 t['commaaccent'] = 250; 43044 t['copyright'] = 747; 43045 t['Emacron'] = 667; 43046 t['ccaron'] = 444; 43047 t['aring'] = 500; 43048 t['Ncommaaccent'] = 722; 43049 t['lacute'] = 278; 43050 t['agrave'] = 500; 43051 t['Tcommaaccent'] = 611; 43052 t['Cacute'] = 667; 43053 t['atilde'] = 500; 43054 t['Edotaccent'] = 667; 43055 t['scaron'] = 389; 43056 t['scedilla'] = 389; 43057 t['iacute'] = 278; 43058 t['lozenge'] = 494; 43059 t['Rcaron'] = 667; 43060 t['Gcommaaccent'] = 722; 43061 t['ucircumflex'] = 556; 43062 t['acircumflex'] = 500; 43063 t['Amacron'] = 667; 43064 t['rcaron'] = 389; 43065 t['ccedilla'] = 444; 43066 t['Zdotaccent'] = 611; 43067 t['Thorn'] = 611; 43068 t['Omacron'] = 722; 43069 t['Racute'] = 667; 43070 t['Sacute'] = 556; 43071 t['dcaron'] = 608; 43072 t['Umacron'] = 722; 43073 t['uring'] = 556; 43074 t['threesuperior'] = 300; 43075 t['Ograve'] = 722; 43076 t['Agrave'] = 667; 43077 t['Abreve'] = 667; 43078 t['multiply'] = 570; 43079 t['uacute'] = 556; 43080 t['Tcaron'] = 611; 43081 t['partialdiff'] = 494; 43082 t['ydieresis'] = 444; 43083 t['Nacute'] = 722; 43084 t['icircumflex'] = 278; 43085 t['Ecircumflex'] = 667; 43086 t['adieresis'] = 500; 43087 t['edieresis'] = 444; 43088 t['cacute'] = 444; 43089 t['nacute'] = 556; 43090 t['umacron'] = 556; 43091 t['Ncaron'] = 722; 43092 t['Iacute'] = 389; 43093 t['plusminus'] = 570; 43094 t['brokenbar'] = 220; 43095 t['registered'] = 747; 43096 t['Gbreve'] = 722; 43097 t['Idotaccent'] = 389; 43098 t['summation'] = 600; 43099 t['Egrave'] = 667; 43100 t['racute'] = 389; 43101 t['omacron'] = 500; 43102 t['Zacute'] = 611; 43103 t['Zcaron'] = 611; 43104 t['greaterequal'] = 549; 43105 t['Eth'] = 722; 43106 t['Ccedilla'] = 667; 43107 t['lcommaaccent'] = 278; 43108 t['tcaron'] = 366; 43109 t['eogonek'] = 444; 43110 t['Uogonek'] = 722; 43111 t['Aacute'] = 667; 43112 t['Adieresis'] = 667; 43113 t['egrave'] = 444; 43114 t['zacute'] = 389; 43115 t['iogonek'] = 278; 43116 t['Oacute'] = 722; 43117 t['oacute'] = 500; 43118 t['amacron'] = 500; 43119 t['sacute'] = 389; 43120 t['idieresis'] = 278; 43121 t['Ocircumflex'] = 722; 43122 t['Ugrave'] = 722; 43123 t['Delta'] = 612; 43124 t['thorn'] = 500; 43125 t['twosuperior'] = 300; 43126 t['Odieresis'] = 722; 43127 t['mu'] = 576; 43128 t['igrave'] = 278; 43129 t['ohungarumlaut'] = 500; 43130 t['Eogonek'] = 667; 43131 t['dcroat'] = 500; 43132 t['threequarters'] = 750; 43133 t['Scedilla'] = 556; 43134 t['lcaron'] = 382; 43135 t['Kcommaaccent'] = 667; 43136 t['Lacute'] = 611; 43137 t['trademark'] = 1000; 43138 t['edotaccent'] = 444; 43139 t['Igrave'] = 389; 43140 t['Imacron'] = 389; 43141 t['Lcaron'] = 611; 43142 t['onehalf'] = 750; 43143 t['lessequal'] = 549; 43144 t['ocircumflex'] = 500; 43145 t['ntilde'] = 556; 43146 t['Uhungarumlaut'] = 722; 43147 t['Eacute'] = 667; 43148 t['emacron'] = 444; 43149 t['gbreve'] = 500; 43150 t['onequarter'] = 750; 43151 t['Scaron'] = 556; 43152 t['Scommaaccent'] = 556; 43153 t['Ohungarumlaut'] = 722; 43154 t['degree'] = 400; 43155 t['ograve'] = 500; 43156 t['Ccaron'] = 667; 43157 t['ugrave'] = 556; 43158 t['radical'] = 549; 43159 t['Dcaron'] = 722; 43160 t['rcommaaccent'] = 389; 43161 t['Ntilde'] = 722; 43162 t['otilde'] = 500; 43163 t['Rcommaaccent'] = 667; 43164 t['Lcommaaccent'] = 611; 43165 t['Atilde'] = 667; 43166 t['Aogonek'] = 667; 43167 t['Aring'] = 667; 43168 t['Otilde'] = 722; 43169 t['zdotaccent'] = 389; 43170 t['Ecaron'] = 667; 43171 t['Iogonek'] = 389; 43172 t['kcommaaccent'] = 500; 43173 t['minus'] = 606; 43174 t['Icircumflex'] = 389; 43175 t['ncaron'] = 556; 43176 t['tcommaaccent'] = 278; 43177 t['logicalnot'] = 606; 43178 t['odieresis'] = 500; 43179 t['udieresis'] = 556; 43180 t['notequal'] = 549; 43181 t['gcommaaccent'] = 500; 43182 t['eth'] = 500; 43183 t['zcaron'] = 389; 43184 t['ncommaaccent'] = 556; 43185 t['onesuperior'] = 300; 43186 t['imacron'] = 278; 43187 t['Euro'] = 500; 43188 }); 43189 t['Times-Italic'] = (0, _util.getLookupTableFactory)(function (t) { 43190 t['space'] = 250; 43191 t['exclam'] = 333; 43192 t['quotedbl'] = 420; 43193 t['numbersign'] = 500; 43194 t['dollar'] = 500; 43195 t['percent'] = 833; 43196 t['ampersand'] = 778; 43197 t['quoteright'] = 333; 43198 t['parenleft'] = 333; 43199 t['parenright'] = 333; 43200 t['asterisk'] = 500; 43201 t['plus'] = 675; 43202 t['comma'] = 250; 43203 t['hyphen'] = 333; 43204 t['period'] = 250; 43205 t['slash'] = 278; 43206 t['zero'] = 500; 43207 t['one'] = 500; 43208 t['two'] = 500; 43209 t['three'] = 500; 43210 t['four'] = 500; 43211 t['five'] = 500; 43212 t['six'] = 500; 43213 t['seven'] = 500; 43214 t['eight'] = 500; 43215 t['nine'] = 500; 43216 t['colon'] = 333; 43217 t['semicolon'] = 333; 43218 t['less'] = 675; 43219 t['equal'] = 675; 43220 t['greater'] = 675; 43221 t['question'] = 500; 43222 t['at'] = 920; 43223 t['A'] = 611; 43224 t['B'] = 611; 43225 t['C'] = 667; 43226 t['D'] = 722; 43227 t['E'] = 611; 43228 t['F'] = 611; 43229 t['G'] = 722; 43230 t['H'] = 722; 43231 t['I'] = 333; 43232 t['J'] = 444; 43233 t['K'] = 667; 43234 t['L'] = 556; 43235 t['M'] = 833; 43236 t['N'] = 667; 43237 t['O'] = 722; 43238 t['P'] = 611; 43239 t['Q'] = 722; 43240 t['R'] = 611; 43241 t['S'] = 500; 43242 t['T'] = 556; 43243 t['U'] = 722; 43244 t['V'] = 611; 43245 t['W'] = 833; 43246 t['X'] = 611; 43247 t['Y'] = 556; 43248 t['Z'] = 556; 43249 t['bracketleft'] = 389; 43250 t['backslash'] = 278; 43251 t['bracketright'] = 389; 43252 t['asciicircum'] = 422; 43253 t['underscore'] = 500; 43254 t['quoteleft'] = 333; 43255 t['a'] = 500; 43256 t['b'] = 500; 43257 t['c'] = 444; 43258 t['d'] = 500; 43259 t['e'] = 444; 43260 t['f'] = 278; 43261 t['g'] = 500; 43262 t['h'] = 500; 43263 t['i'] = 278; 43264 t['j'] = 278; 43265 t['k'] = 444; 43266 t['l'] = 278; 43267 t['m'] = 722; 43268 t['n'] = 500; 43269 t['o'] = 500; 43270 t['p'] = 500; 43271 t['q'] = 500; 43272 t['r'] = 389; 43273 t['s'] = 389; 43274 t['t'] = 278; 43275 t['u'] = 500; 43276 t['v'] = 444; 43277 t['w'] = 667; 43278 t['x'] = 444; 43279 t['y'] = 444; 43280 t['z'] = 389; 43281 t['braceleft'] = 400; 43282 t['bar'] = 275; 43283 t['braceright'] = 400; 43284 t['asciitilde'] = 541; 43285 t['exclamdown'] = 389; 43286 t['cent'] = 500; 43287 t['sterling'] = 500; 43288 t['fraction'] = 167; 43289 t['yen'] = 500; 43290 t['florin'] = 500; 43291 t['section'] = 500; 43292 t['currency'] = 500; 43293 t['quotesingle'] = 214; 43294 t['quotedblleft'] = 556; 43295 t['guillemotleft'] = 500; 43296 t['guilsinglleft'] = 333; 43297 t['guilsinglright'] = 333; 43298 t['fi'] = 500; 43299 t['fl'] = 500; 43300 t['endash'] = 500; 43301 t['dagger'] = 500; 43302 t['daggerdbl'] = 500;
43303 t['periodcentered'] = 250; 43304 t['paragraph'] = 523; 43305 t['bullet'] = 350; 43306 t['quotesinglbase'] = 333; 43307 t['quotedblbase'] = 556; 43308 t['quotedblright'] = 556; 43309 t['guillemotright'] = 500; 43310 t['ellipsis'] = 889; 43311 t['perthousand'] = 1000; 43312 t['questiondown'] = 500; 43313 t['grave'] = 333; 43314 t['acute'] = 333; 43315 t['circumflex'] = 333; 43316 t['tilde'] = 333; 43317 t['macron'] = 333; 43318 t['breve'] = 333; 43319 t['dotaccent'] = 333; 43320 t['dieresis'] = 333; 43321 t['ring'] = 333; 43322 t['cedilla'] = 333; 43323 t['hungarumlaut'] = 333; 43324 t['ogonek'] = 333; 43325 t['caron'] = 333; 43326 t['emdash'] = 889; 43327 t['AE'] = 889; 43328 t['ordfeminine'] = 276; 43329 t['Lslash'] = 556; 43330 t['Oslash'] = 722; 43331 t['OE'] = 944; 43332 t['ordmasculine'] = 310; 43333 t['ae'] = 667; 43334 t['dotlessi'] = 278; 43335 t['lslash'] = 278; 43336 t['oslash'] = 500; 43337 t['oe'] = 667; 43338 t['germandbls'] = 500; 43339 t['Idieresis'] = 333; 43340 t['eacute'] = 444; 43341 t['abreve'] = 500; 43342 t['uhungarumlaut'] = 500; 43343 t['ecaron'] = 444; 43344 t['Ydieresis'] = 556; 43345 t['divide'] = 675; 43346 t['Yacute'] = 556; 43347 t['Acircumflex'] = 611; 43348 t['aacute'] = 500; 43349 t['Ucircumflex'] = 722; 43350 t['yacute'] = 444; 43351 t['scommaaccent'] = 389; 43352 t['ecircumflex'] = 444; 43353 t['Uring'] = 722; 43354 t['Udieresis'] = 722; 43355 t['aogonek'] = 500; 43356 t['Uacute'] = 722; 43357 t['uogonek'] = 500; 43358 t['Edieresis'] = 611; 43359 t['Dcroat'] = 722; 43360 t['commaaccent'] = 250; 43361 t['copyright'] = 760; 43362 t['Emacron'] = 611; 43363 t['ccaron'] = 444; 43364 t['aring'] = 500; 43365 t['Ncommaaccent'] = 667; 43366 t['lacute'] = 278; 43367 t['agrave'] = 500; 43368 t['Tcommaaccent'] = 556; 43369 t['Cacute'] = 667; 43370 t['atilde'] = 500; 43371 t['Edotaccent'] = 611; 43372 t['scaron'] = 389; 43373 t['scedilla'] = 389; 43374 t['iacute'] = 278; 43375 t['lozenge'] = 471; 43376 t['Rcaron'] = 611; 43377 t['Gcommaaccent'] = 722; 43378 t['ucircumflex'] = 500; 43379 t['acircumflex'] = 500; 43380 t['Amacron'] = 611; 43381 t['rcaron'] = 389; 43382 t['ccedilla'] = 444; 43383 t['Zdotaccent'] = 556; 43384 t['Thorn'] = 611; 43385 t['Omacron'] = 722; 43386 t['Racute'] = 611; 43387 t['Sacute'] = 500; 43388 t['dcaron'] = 544; 43389 t['Umacron'] = 722; 43390 t['uring'] = 500; 43391 t['threesuperior'] = 300; 43392 t['Ograve'] = 722; 43393 t['Agrave'] = 611; 43394 t['Abreve'] = 611; 43395 t['multiply'] = 675; 43396 t['uacute'] = 500; 43397 t['Tcaron'] = 556; 43398 t['partialdiff'] = 476; 43399 t['ydieresis'] = 444; 43400 t['Nacute'] = 667; 43401 t['icircumflex'] = 278; 43402 t['Ecircumflex'] = 611; 43403 t['adieresis'] = 500; 43404 t['edieresis'] = 444; 43405 t['cacute'] = 444; 43406 t['nacute'] = 500; 43407 t['umacron'] = 500; 43408 t['Ncaron'] = 667; 43409 t['Iacute'] = 333; 43410 t['plusminus'] = 675; 43411 t['brokenbar'] = 275; 43412 t['registered'] = 760; 43413 t['Gbreve'] = 722; 43414 t['Idotaccent'] = 333; 43415 t['summation'] = 600; 43416 t['Egrave'] = 611; 43417 t['racute'] = 389; 43418 t['omacron'] = 500; 43419 t['Zacute'] = 556; 43420 t['Zcaron'] = 556; 43421 t['greaterequal'] = 549; 43422 t['Eth'] = 722; 43423 t['Ccedilla'] = 667; 43424 t['lcommaaccent'] = 278; 43425 t['tcaron'] = 300; 43426 t['eogonek'] = 444; 43427 t['Uogonek'] = 722; 43428 t['Aacute'] = 611; 43429 t['Adieresis'] = 611; 43430 t['egrave'] = 444; 43431 t['zacute'] = 389; 43432 t['iogonek'] = 278; 43433 t['Oacute'] = 722; 43434 t['oacute'] = 500; 43435 t['amacron'] = 500; 43436 t['sacute'] = 389; 43437 t['idieresis'] = 278; 43438 t['Ocircumflex'] = 722; 43439 t['Ugrave'] = 722; 43440 t['Delta'] = 612; 43441 t['thorn'] = 500; 43442 t['twosuperior'] = 300; 43443 t['Odieresis'] = 722; 43444 t['mu'] = 500; 43445 t['igrave'] = 278; 43446 t['ohungarumlaut'] = 500; 43447 t['Eogonek'] = 611; 43448 t['dcroat'] = 500; 43449 t['threequarters'] = 750; 43450 t['Scedilla'] = 500; 43451 t['lcaron'] = 300; 43452 t['Kcommaaccent'] = 667; 43453 t['Lacute'] = 556; 43454 t['trademark'] = 980; 43455 t['edotaccent'] = 444; 43456 t['Igrave'] = 333; 43457 t['Imacron'] = 333; 43458 t['Lcaron'] = 611; 43459 t['onehalf'] = 750; 43460 t['lessequal'] = 549; 43461 t['ocircumflex'] = 500; 43462 t['ntilde'] = 500; 43463 t['Uhungarumlaut'] = 722; 43464 t['Eacute'] = 611; 43465 t['emacron'] = 444; 43466 t['gbreve'] = 500; 43467 t['onequarter'] = 750; 43468 t['Scaron'] = 500; 43469 t['Scommaaccent'] = 500; 43470 t['Ohungarumlaut'] = 722; 43471 t['degree'] = 400; 43472 t['ograve'] = 500; 43473 t['Ccaron'] = 667; 43474 t['ugrave'] = 500; 43475 t['radical'] = 453; 43476 t['Dcaron'] = 722; 43477 t['rcommaaccent'] = 389; 43478 t['Ntilde'] = 667; 43479 t['otilde'] = 500; 43480 t['Rcommaaccent'] = 611; 43481 t['Lcommaaccent'] = 556; 43482 t['Atilde'] = 611; 43483 t['Aogonek'] = 611; 43484 t['Aring'] = 611; 43485 t['Otilde'] = 722; 43486 t['zdotaccent'] = 389; 43487 t['Ecaron'] = 611; 43488 t['Iogonek'] = 333; 43489 t['kcommaaccent'] = 444; 43490 t['minus'] = 675; 43491 t['Icircumflex'] = 333; 43492 t['ncaron'] = 500; 43493 t['tcommaaccent'] = 278; 43494 t['logicalnot'] = 675; 43495 t['odieresis'] = 500; 43496 t['udieresis'] = 500; 43497 t['notequal'] = 549; 43498 t['gcommaaccent'] = 500; 43499 t['eth'] = 500; 43500 t['zcaron'] = 389; 43501 t['ncommaaccent'] = 500; 43502 t['onesuperior'] = 300; 43503 t['imacron'] = 278; 43504 t['Euro'] = 500; 43505 }); 43506 t['ZapfDingbats'] = (0, _util.getLookupTableFactory)(function (t) { 43507 t['space'] = 278; 43508 t['a1'] = 974; 43509 t['a2'] = 961; 43510 t['a202'] = 974; 43511 t['a3'] = 980; 43512 t['a4'] = 719; 43513 t['a5'] = 789; 43514 t['a119'] = 790; 43515 t['a118'] = 791; 43516 t['a117'] = 690; 43517 t['a11'] = 960; 43518 t['a12'] = 939; 43519 t['a13'] = 549; 43520 t['a14'] = 855; 43521 t['a15'] = 911; 43522 t['a16'] = 933; 43523 t['a105'] = 911; 43524 t['a17'] = 945; 43525 t['a18'] = 974; 43526 t['a19'] = 755; 43527 t['a20'] = 846; 43528 t['a21'] = 762; 43529 t['a22'] = 761; 43530 t['a23'] = 571; 43531 t['a24'] = 677; 43532 t['a25'] = 763; 43533 t['a26'] = 760; 43534 t['a27'] = 759; 43535 t['a28'] = 754; 43536 t['a6'] = 494; 43537 t['a7'] = 552; 43538 t['a8'] = 537; 43539 t['a9'] = 577; 43540 t['a10'] = 692; 43541 t['a29'] = 786; 43542 t['a30'] = 788; 43543 t['a31'] = 788; 43544 t['a32'] = 790; 43545 t['a33'] = 793; 43546 t['a34'] = 794; 43547 t['a35'] = 816; 43548 t['a36'] = 823; 43549 t['a37'] = 789; 43550 t['a38'] = 841; 43551 t['a39'] = 823; 43552 t['a40'] = 833; 43553 t['a41'] = 816; 43554 t['a42'] = 831; 43555 t['a43'] = 923; 43556 t['a44'] = 744; 43557 t['a45'] = 723; 43558 t['a46'] = 749; 43559 t['a47'] = 790; 43560 t['a48'] = 792; 43561 t['a49'] = 695; 43562 t['a50'] = 776; 43563 t['a51'] = 768; 43564 t['a52'] = 792; 43565 t['a53'] = 759; 43566 t['a54'] = 707; 43567 t['a55'] = 708; 43568 t['a56'] = 682; 43569 t['a57'] = 701; 43570 t['a58'] = 826; 43571 t['a59'] = 815; 43572 t['a60'] = 789; 43573 t['a61'] = 789; 43574 t['a62'] = 707; 43575 t['a63'] = 687; 43576 t['a64'] = 696; 43577 t['a65'] = 689; 43578 t['a66'] = 786; 43579 t['a67'] = 787; 43580 t['a68'] = 713; 43581 t['a69'] = 791; 43582 t['a70'] = 785; 43583 t['a71'] = 791; 43584 t['a72'] = 873; 43585 t['a73'] = 761; 43586 t['a74'] = 762; 43587 t['a203'] = 762; 43588 t['a75'] = 759; 43589 t['a204'] = 759; 43590 t['a76'] = 892; 43591 t['a77'] = 892; 43592 t['a78'] = 788; 43593 t['a79'] = 784; 43594 t['a81'] = 438; 43595 t['a82'] = 138; 43596 t['a83'] = 277; 43597 t['a84'] = 415; 43598 t['a97'] = 392; 43599 t['a98'] = 392; 43600 t['a99'] = 668; 43601 t['a100'] = 668; 43602 t['a89'] = 390; 43603 t['a90'] = 390; 43604 t['a93'] = 317; 43605 t['a94'] = 317; 43606 t['a91'] = 276; 43607 t['a92'] = 276; 43608 t['a205'] = 509;
vendor: 5,169 bytes, lines 43609-43799
43609 t['a85'] = 509; 43610 t['a206'] = 410; 43611 t['a86'] = 410; 43612 t['a87'] = 234; 43613 t['a88'] = 234; 43614 t['a95'] = 334; 43615 t['a96'] = 334; 43616 t['a101'] = 732; 43617 t['a102'] = 544; 43618 t['a103'] = 544; 43619 t['a104'] = 910; 43620 t['a106'] = 667; 43621 t['a107'] = 760; 43622 t['a108'] = 760; 43623 t['a112'] = 776; 43624 t['a111'] = 595; 43625 t['a110'] = 694; 43626 t['a109'] = 626; 43627 t['a120'] = 788; 43628 t['a121'] = 788; 43629 t['a122'] = 788; 43630 t['a123'] = 788; 43631 t['a124'] = 788; 43632 t['a125'] = 788; 43633 t['a126'] = 788; 43634 t['a127'] = 788; 43635 t['a128'] = 788; 43636 t['a129'] = 788; 43637 t['a130'] = 788; 43638 t['a131'] = 788; 43639 t['a132'] = 788; 43640 t['a133'] = 788; 43641 t['a134'] = 788; 43642 t['a135'] = 788; 43643 t['a136'] = 788; 43644 t['a137'] = 788; 43645 t['a138'] = 788; 43646 t['a139'] = 788; 43647 t['a140'] = 788; 43648 t['a141'] = 788; 43649 t['a142'] = 788; 43650 t['a143'] = 788; 43651 t['a144'] = 788; 43652 t['a145'] = 788; 43653 t['a146'] = 788; 43654 t['a147'] = 788; 43655 t['a148'] = 788; 43656 t['a149'] = 788; 43657 t['a150'] = 788; 43658 t['a151'] = 788; 43659 t['a152'] = 788; 43660 t['a153'] = 788; 43661 t['a154'] = 788; 43662 t['a155'] = 788; 43663 t['a156'] = 788; 43664 t['a157'] = 788; 43665 t['a158'] = 788; 43666 t['a159'] = 788; 43667 t['a160'] = 894; 43668 t['a161'] = 838; 43669 t['a163'] = 1016; 43670 t['a164'] = 458; 43671 t['a196'] = 748; 43672 t['a165'] = 924; 43673 t['a192'] = 748; 43674 t['a166'] = 918; 43675 t['a167'] = 927; 43676 t['a168'] = 928; 43677 t['a169'] = 928; 43678 t['a170'] = 834; 43679 t['a171'] = 873; 43680 t['a172'] = 828; 43681 t['a173'] = 924; 43682 t['a162'] = 924; 43683 t['a174'] = 917; 43684 t['a175'] = 930; 43685 t['a176'] = 931; 43686 t['a177'] = 463; 43687 t['a178'] = 883; 43688 t['a179'] = 836; 43689 t['a193'] = 836; 43690 t['a180'] = 867; 43691 t['a199'] = 867; 43692 t['a181'] = 696; 43693 t['a200'] = 696; 43694 t['a182'] = 874; 43695 t['a201'] = 874; 43696 t['a183'] = 760; 43697 t['a184'] = 946; 43698 t['a197'] = 771; 43699 t['a185'] = 865; 43700 t['a194'] = 771; 43701 t['a198'] = 888; 43702 t['a186'] = 967; 43703 t['a195'] = 888; 43704 t['a187'] = 831; 43705 t['a188'] = 873; 43706 t['a189'] = 927; 43707 t['a190'] = 970; 43708 t['a191'] = 918; 43709 }); 43710}); 43711exports.getMetrics = getMetrics; 43712 43713/***/ }), 43714/* 144 */ 43715/***/ (function(module, exports, __w_pdfjs_require__) { 43716 43717"use strict"; 43718 43719 43720Object.defineProperty(exports, "__esModule", { 43721 value: true 43722}); 43723exports.PostScriptParser = exports.PostScriptLexer = undefined; 43724 43725var _util = __w_pdfjs_require__(0); 43726 43727var _primitives = __w_pdfjs_require__(1); 43728 43729var PostScriptParser = function PostScriptParserClosure() { 43730 function PostScriptParser(lexer) { 43731 this.lexer = lexer; 43732 this.operators = []; 43733 this.token = null; 43734 this.prev = null; 43735 } 43736 PostScriptParser.prototype = { 43737 nextToken: function PostScriptParser_nextToken() { 43738 this.prev = this.token; 43739 this.token = this.lexer.getToken(); 43740 }, 43741 accept: function PostScriptParser_accept(type) { 43742 if (this.token.type === type) { 43743 this.nextToken(); 43744 return true; 43745 } 43746 return false; 43747 }, 43748 expect: function PostScriptParser_expect(type) { 43749 if (this.accept(type)) { 43750 return true; 43751 } 43752 throw new _util.FormatError('Unexpected symbol: found ' + this.token.type + ' expected ' + type + '.'); 43753 }, 43754 parse: function PostScriptParser_parse() { 43755 this.nextToken(); 43756 this.expect(PostScriptTokenTypes.LBRACE); 43757 this.parseBlock(); 43758 this.expect(PostScriptTokenTypes.RBRACE); 43759 return this.operators; 43760 }, 43761 parseBlock: function PostScriptParser_parseBlock() { 43762 while (true) { 43763 if (this.accept(PostScriptTokenTypes.NUMBER)) { 43764 this.operators.push(this.prev.value); 43765 } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { 43766 this.operators.push(this.prev.value); 43767 } else if (this.accept(PostScriptTokenTypes.LBRACE)) { 43768 this.parseCondition(); 43769 } else { 43770 return; 43771 } 43772 } 43773 }, 43774 parseCondition: function PostScriptParser_parseCondition() { 43775 var conditionLocation = this.operators.length; 43776 this.operators.push(null, null); 43777 this.parseBlock(); 43778 this.expect(PostScriptTokenTypes.RBRACE); 43779 if (this.accept(PostScriptTokenTypes.IF)) { 43780 this.operators[conditionLocation] = this.operators.length; 43781 this.operators[conditionLocation + 1] = 'jz'; 43782 } else if (this.accept(PostScriptTokenTypes.LBRACE)) { 43783 var jumpLocation = this.operators.length; 43784 this.operators.push(null, null); 43785 var endOfTrue = this.operators.length; 43786 this.parseBlock(); 43787 this.expect(PostScriptTokenTypes.RBRACE); 43788 this.expect(PostScriptTokenTypes.IFELSE); 43789 this.operators[jumpLocation] = this.operators.length; 43790 this.operators[jumpLocation + 1] = 'j'; 43791 this.operators[conditionLocation] = endOfTrue; 43792 this.operators[conditionLocation + 1] = 'jz'; 43793 } else { 43794 throw new _util.FormatError('PS Function: error parsing conditional.'); 43795 } 43796 } 43797 }; 43798 return PostScriptParser; 43799}();
43800var PostScriptTokenTypes = { 43801 LBRACE: 0, 43802 RBRACE: 1, 43803 NUMBER: 2, 43804 OPERATOR: 3, 43805 IF: 4, 43806 IFELSE: 5 43807}; 43808var PostScriptToken = function PostScriptTokenClosure() { 43809 function PostScriptToken(type, value) { 43810 this.type = type; 43811 this.value = value; 43812 } 43813 var opCache = Object.create(null); 43814 PostScriptToken.getOperator = function PostScriptToken_getOperator(op) { 43815 var opValue = opCache[op]; 43816 if (opValue) { 43817 return opValue; 43818 } 43819 return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); 43820 }; 43821 PostScriptToken.LBRACE = new PostScriptToken(PostScriptTokenTypes.LBRACE, '{'); 43822 PostScriptToken.RBRACE = new PostScriptToken(PostScriptTokenTypes.RBRACE, '}'); 43823 PostScriptToken.IF = new PostScriptToken(PostScriptTokenTypes.IF, 'IF'); 43824 PostScriptToken.IFELSE = new PostScriptToken(PostScriptTokenTypes.IFELSE, 'IFELSE'); 43825 return PostScriptToken; 43826}(); 43827var PostScriptLexer = function PostScriptLexerClosure() { 43828 function PostScriptLexer(stream) { 43829 this.stream = stream; 43830 this.nextChar(); 43831 this.strBuf = []; 43832 } 43833 PostScriptLexer.prototype = { 43834 nextChar: function PostScriptLexer_nextChar() { 43835 return this.currentChar = this.stream.getByte(); 43836 }, 43837 getToken: function PostScriptLexer_getToken() { 43838 var comment = false; 43839 var ch = this.currentChar; 43840 while (true) { 43841 if (ch < 0) { 43842 return _primitives.EOF; 43843 } 43844 if (comment) { 43845 if (ch === 0x0A || ch === 0x0D) { 43846 comment = false; 43847 } 43848 } else if (ch === 0x25) { 43849 comment = true; 43850 } else if (!(0, _util.isSpace)(ch)) { 43851 break; 43852 } 43853 ch = this.nextChar(); 43854 } 43855 switch (ch | 0) { 43856 case 0x30: 43857 case 0x31: 43858 case 0x32: 43859 case 0x33: 43860 case 0x34: 43861 case 0x35: 43862 case 0x36: 43863 case 0x37: 43864 case 0x38: 43865 case 0x39: 43866 case 0x2B: 43867 case 0x2D: 43868 case 0x2E: 43869 return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber()); 43870 case 0x7B: 43871 this.nextChar(); 43872 return PostScriptToken.LBRACE; 43873 case 0x7D: 43874 this.nextChar(); 43875 return PostScriptToken.RBRACE; 43876 } 43877 var strBuf = this.strBuf; 43878 strBuf.length = 0; 43879 strBuf[0] = String.fromCharCode(ch); 43880 while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5A || ch >= 0x61 && ch <= 0x7A)) { 43881 strBuf.push(String.fromCharCode(ch)); 43882 } 43883 var str = strBuf.join(''); 43884 switch (str.toLowerCase()) { 43885 case 'if': 43886 return PostScriptToken.IF; 43887 case 'ifelse': 43888 return PostScriptToken.IFELSE; 43889 default: 43890 return PostScriptToken.getOperator(str); 43891 } 43892 }, 43893 getNumber: function PostScriptLexer_getNumber() { 43894 var ch = this.currentChar; 43895 var strBuf = this.strBuf; 43896 strBuf.length = 0; 43897 strBuf[0] = String.fromCharCode(ch); 43898 while ((ch = this.nextChar()) >= 0) { 43899 if (ch >= 0x30 && ch <= 0x39 || ch === 0x2D || ch === 0x2E) { 43900 strBuf.push(String.fromCharCode(ch)); 43901 } else { 43902 break; 43903 } 43904 } 43905 var value = parseFloat(strBuf.join('')); 43906 if (isNaN(value)) { 43907 throw new _util.FormatError('Invalid floating point number: ' + value); 43908 } 43909 return value; 43910 } 43911 }; 43912 return PostScriptLexer; 43913}(); 43914exports.PostScriptLexer = PostScriptLexer; 43915exports.PostScriptParser = PostScriptParser; 43916 43917/***/ }), 43918/* 145 */ 43919/***/ (function(module, exports, __w_pdfjs_require__) { 43920 43921"use strict"; 43922 43923 43924Object.defineProperty(exports, "__esModule", { 43925 value: true 43926}); 43927exports.MurmurHash3_64 = undefined; 43928 43929var _util = __w_pdfjs_require__(0); 43930 43931var MurmurHash3_64 = function MurmurHash3_64Closure(seed) { 43932 var MASK_HIGH = 0xffff0000; 43933 var MASK_LOW = 0xffff; 43934 function MurmurHash3_64(seed) { 43935 var SEED = 0xc3d2e1f0; 43936 this.h1 = seed ? seed & 0xffffffff : SEED; 43937 this.h2 = seed ? seed & 0xffffffff : SEED; 43938 } 43939 MurmurHash3_64.prototype = { 43940 update: function MurmurHash3_64_update(input) { 43941 var data = void 0, 43942 length = void 0; 43943 if ((0, _util.isString)(input)) { 43944 data = new Uint8Array(input.length * 2); 43945 length = 0; 43946 for (var i = 0, ii = input.length; i < ii; i++) { 43947 var code = input.charCodeAt(i); 43948 if (code <= 0xff) { 43949 data[length++] = code; 43950 } else { 43951 data[length++] = code >>> 8; 43952 data[length++] = code & 0xff; 43953 } 43954 } 43955 } else if ((0, _util.isArrayBuffer)(input)) { 43956 data = input; 43957 length = data.byteLength; 43958 } else { 43959 throw new Error('Wrong data format in MurmurHash3_64_update. ' + 'Input must be a string or array.'); 43960 } 43961 var blockCounts = length >> 2; 43962 var tailLength = length - blockCounts * 4; 43963 var dataUint32 = new Uint32Array(data.buffer, 0, blockCounts); 43964 var k1 = 0; 43965 var k2 = 0; 43966 var h1 = this.h1; 43967 var h2 = this.h2; 43968 var C1 = 0xcc9e2d51; 43969 var C2 = 0x1b873593; 43970 var C1_LOW = C1 & MASK_LOW; 43971 var C2_LOW = C2 & MASK_LOW; 43972 for (var _i = 0; _i < blockCounts; _i++) { 43973 if (_i & 1) {
43974 k1 = dataUint32[_i]; 43975 k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; 43976 k1 = k1 << 15 | k1 >>> 17; 43977 k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; 43978 h1 ^= k1; 43979 h1 = h1 << 13 | h1 >>> 19; 43980 h1 = h1 * 5 + 0xe6546b64; 43981 } else { 43982 k2 = dataUint32[_i]; 43983 k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW; 43984 k2 = k2 << 15 | k2 >>> 17; 43985 k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW; 43986 h2 ^= k2; 43987 h2 = h2 << 13 | h2 >>> 19; 43988 h2 = h2 * 5 + 0xe6546b64; 43989 } 43990 } 43991 k1 = 0; 43992 switch (tailLength) { 43993 case 3: 43994 k1 ^= data[blockCounts * 4 + 2] << 16; 43995 case 2: 43996 k1 ^= data[blockCounts * 4 + 1] << 8; 43997 case 1: 43998 k1 ^= data[blockCounts * 4]; 43999 k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; 44000 k1 = k1 << 15 | k1 >>> 17; 44001 k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; 44002 if (blockCounts & 1) { 44003 h1 ^= k1; 44004 } else { 44005 h2 ^= k1; 44006 } 44007 } 44008 this.h1 = h1; 44009 this.h2 = h2; 44010 return this; 44011 }, 44012 hexdigest: function MurmurHash3_64_hexdigest() { 44013 var h1 = this.h1; 44014 var h2 = this.h2; 44015 h1 ^= h2 >>> 1; 44016 h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW; 44017 h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16; 44018 h1 ^= h2 >>> 1; 44019 h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW; 44020 h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16; 44021 h1 ^= h2 >>> 1; 44022 for (var i = 0, arr = [h1, h2], str = ''; i < arr.length; i++) { 44023 var hex = (arr[i] >>> 0).toString(16); 44024 while (hex.length < 8) { 44025 hex = '0' + hex; 44026 } 44027 str += hex; 44028 } 44029 return str; 44030 } 44031 }; 44032 return MurmurHash3_64; 44033}(); 44034exports.MurmurHash3_64 = MurmurHash3_64; 44035 44036/***/ }), 44037/* 146 */ 44038/***/ (function(module, exports, __w_pdfjs_require__) { 44039 44040"use strict"; 44041 44042 44043Object.defineProperty(exports, "__esModule", { 44044 value: true 44045}); 44046exports.PDFImage = undefined; 44047 44048var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); 44049 44050var _util = __w_pdfjs_require__(0); 44051 44052var _primitives = __w_pdfjs_require__(1); 44053 44054var _colorspace = __w_pdfjs_require__(20); 44055 44056var _stream = __w_pdfjs_require__(2); 44057 44058var _jpeg_stream = __w_pdfjs_require__(41); 44059 44060var _jpx = __w_pdfjs_require__(66); 44061 44062var PDFImage = function PDFImageClosure() { 44063 function handleImageData(image, nativeDecoder) { 44064 if (nativeDecoder && nativeDecoder.canDecode(image)) { 44065 return nativeDecoder.decode(image); 44066 } 44067 return Promise.resolve(image); 44068 } 44069 function decodeAndClamp(value, addend, coefficient, max) { 44070 value = addend + value * coefficient; 44071 return value < 0 ? 0 : value > max ? max : value; 44072 } 44073 function resizeImageMask(src, bpc, w1, h1, w2, h2) { 44074 var length = w2 * h2; 44075 var dest = bpc <= 8 ? new Uint8Array(length) : bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length); 44076 var xRatio = w1 / w2; 44077 var yRatio = h1 / h2; 44078 var i, 44079 j, 44080 py, 44081 newIndex = 0, 44082 oldIndex; 44083 var xScaled = new Uint16Array(w2); 44084 var w1Scanline = w1; 44085 for (i = 0; i < w2; i++) { 44086 xScaled[i] = Math.floor(i * xRatio); 44087 } 44088 for (i = 0; i < h2; i++) { 44089 py = Math.floor(i * yRatio) * w1Scanline; 44090 for (j = 0; j < w2; j++) { 44091 oldIndex = py + xScaled[j]; 44092 dest[newIndex++] = src[oldIndex]; 44093 } 44094 } 44095 return dest; 44096 } 44097 function PDFImage(_ref) { 44098 var xref = _ref.xref, 44099 res = _ref.res, 44100 image = _ref.image, 44101 _ref$isInline = _ref.isInline, 44102 isInline = _ref$isInline === undefined ? false : _ref$isInline, 44103 _ref$smask = _ref.smask, 44104 smask = _ref$smask === undefined ? null : _ref$smask, 44105 _ref$mask = _ref.mask, 44106 mask = _ref$mask === undefined ? null : _ref$mask, 44107 _ref$isMask = _ref.isMask, 44108 isMask = _ref$isMask === undefined ? false : _ref$isMask, 44109 pdfFunctionFactory = _ref.pdfFunctionFactory;
vendor: 4,176 bytes, lines 44110-44220
44110 44111 this.image = image; 44112 var dict = image.dict; 44113 if (dict.has('Filter')) { 44114 var filter = dict.get('Filter').name; 44115 if (filter === 'JPXDecode') { 44116 var jpxImage = new _jpx.JpxImage(); 44117 jpxImage.parseImageProperties(image.stream); 44118 image.stream.reset(); 44119 image.bitsPerComponent = jpxImage.bitsPerComponent; 44120 image.numComps = jpxImage.componentsCount; 44121 } else if (filter === 'JBIG2Decode') { 44122 image.bitsPerComponent = 1; 44123 image.numComps = 1; 44124 } 44125 } 44126 this.width = dict.get('Width', 'W'); 44127 this.height = dict.get('Height', 'H'); 44128 if (this.width < 1 || this.height < 1) { 44129 throw new _util.FormatError('Invalid image width: ' + this.width + ' or ' + ('height: ' + this.height)); 44130 } 44131 this.interpolate = dict.get('Interpolate', 'I') || false; 44132 this.imageMask = dict.get('ImageMask', 'IM') || false; 44133 this.matte = dict.get('Matte') || false; 44134 var bitsPerComponent = image.bitsPerComponent; 44135 if (!bitsPerComponent) { 44136 bitsPerComponent = dict.get('BitsPerComponent', 'BPC'); 44137 if (!bitsPerComponent) { 44138 if (this.imageMask) { 44139 bitsPerComponent = 1; 44140 } else { 44141 throw new _util.FormatError('Bits per component missing in image: ' + this.imageMask); 44142 } 44143 } 44144 } 44145 this.bpc = bitsPerComponent; 44146 if (!this.imageMask) { 44147 var colorSpace = dict.get('ColorSpace', 'CS'); 44148 if (!colorSpace) { 44149 (0, _util.info)('JPX images (which do not require color spaces)'); 44150 switch (image.numComps) { 44151 case 1: 44152 colorSpace = _primitives.Name.get('DeviceGray'); 44153 break; 44154 case 3: 44155 colorSpace = _primitives.Name.get('DeviceRGB'); 44156 break; 44157 case 4: 44158 colorSpace = _primitives.Name.get('DeviceCMYK'); 44159 break; 44160 default: 44161 throw new Error('JPX images with ' + this.numComps + ' ' + 'color components not supported.'); 44162 } 44163 } 44164 var resources = isInline ? res : null; 44165 this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, resources, pdfFunctionFactory); 44166 this.numComps = this.colorSpace.numComps; 44167 } 44168 this.decode = dict.getArray('Decode', 'D'); 44169 this.needsDecode = false; 44170 if (this.decode && (this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode) || isMask && !_colorspace.ColorSpace.isDefaultDecode(this.decode, 1))) { 44171 this.needsDecode = true; 44172 var max = (1 << bitsPerComponent) - 1; 44173 this.decodeCoefficients = []; 44174 this.decodeAddends = []; 44175 for (var i = 0, j = 0; i < this.decode.length; i += 2, ++j) { 44176 var dmin = this.decode[i]; 44177 var dmax = this.decode[i + 1]; 44178 this.decodeCoefficients[j] = dmax - dmin; 44179 this.decodeAddends[j] = max * dmin; 44180 } 44181 } 44182 if (smask) { 44183 this.smask = new PDFImage({ 44184 xref: xref, 44185 res: res, 44186 image: smask, 44187 isInline: isInline, 44188 pdfFunctionFactory: pdfFunctionFactory 44189 }); 44190 } else if (mask) { 44191 if ((0, _primitives.isStream)(mask)) { 44192 var maskDict = mask.dict, 44193 imageMask = maskDict.get('ImageMask', 'IM'); 44194 if (!imageMask) { 44195 (0, _util.warn)('Ignoring /Mask in image without /ImageMask.'); 44196 } else { 44197 this.mask = new PDFImage({ 44198 xref: xref, 44199 res: res, 44200 image: mask, 44201 isInline: isInline, 44202 isMask: true, 44203 pdfFunctionFactory: pdfFunctionFactory 44204 }); 44205 } 44206 } else { 44207 this.mask = mask; 44208 } 44209 } 44210 } 44211 PDFImage.buildImage = function (_ref2) { 44212 var handler = _ref2.handler, 44213 xref = _ref2.xref, 44214 res = _ref2.res, 44215 image = _ref2.image, 44216 _ref2$isInline = _ref2.isInline, 44217 isInline = _ref2$isInline === undefined ? false : _ref2$isInline, 44218 _ref2$nativeDecoder = _ref2.nativeDecoder, 44219 nativeDecoder = _ref2$nativeDecoder === undefined ? null : _ref2$nativeDecoder, 44220 pdfFunctionFactory = _ref2.pdfFunctionFactory;
vendor: 11,371 bytes, lines 44221-44541
44221 44222 var imagePromise = handleImageData(image, nativeDecoder); 44223 var smaskPromise; 44224 var maskPromise; 44225 var smask = image.dict.get('SMask'); 44226 var mask = image.dict.get('Mask'); 44227 if (smask) { 44228 smaskPromise = handleImageData(smask, nativeDecoder); 44229 maskPromise = Promise.resolve(null); 44230 } else { 44231 smaskPromise = Promise.resolve(null); 44232 if (mask) { 44233 if ((0, _primitives.isStream)(mask)) { 44234 maskPromise = handleImageData(mask, nativeDecoder); 44235 } else if (Array.isArray(mask)) { 44236 maskPromise = Promise.resolve(mask); 44237 } else { 44238 (0, _util.warn)('Unsupported mask format.'); 44239 maskPromise = Promise.resolve(null); 44240 } 44241 } else { 44242 maskPromise = Promise.resolve(null); 44243 } 44244 } 44245 return Promise.all([imagePromise, smaskPromise, maskPromise]).then(function (_ref3) { 44246 var _ref4 = _slicedToArray(_ref3, 3), 44247 imageData = _ref4[0], 44248 smaskData = _ref4[1], 44249 maskData = _ref4[2]; 44250 44251 return new PDFImage({ 44252 xref: xref, 44253 res: res, 44254 image: imageData, 44255 isInline: isInline, 44256 smask: smaskData, 44257 mask: maskData, 44258 pdfFunctionFactory: pdfFunctionFactory 44259 }); 44260 }); 44261 }; 44262 PDFImage.createMask = function (_ref5) { 44263 var imgArray = _ref5.imgArray, 44264 width = _ref5.width, 44265 height = _ref5.height, 44266 imageIsFromDecodeStream = _ref5.imageIsFromDecodeStream, 44267 inverseDecode = _ref5.inverseDecode; 44268 44269 var computedLength = (width + 7 >> 3) * height; 44270 var actualLength = imgArray.byteLength; 44271 var haveFullData = computedLength === actualLength; 44272 var data, i; 44273 if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) { 44274 data = imgArray; 44275 } else if (!inverseDecode) { 44276 data = new Uint8Array(actualLength); 44277 data.set(imgArray); 44278 } else { 44279 data = new Uint8Array(computedLength); 44280 data.set(imgArray); 44281 for (i = actualLength; i < computedLength; i++) { 44282 data[i] = 0xff; 44283 } 44284 } 44285 if (inverseDecode) { 44286 for (i = 0; i < actualLength; i++) { 44287 data[i] ^= 0xFF; 44288 } 44289 } 44290 return { 44291 data: data, 44292 width: width, 44293 height: height 44294 }; 44295 }; 44296 PDFImage.prototype = { 44297 get drawWidth() { 44298 return Math.max(this.width, this.smask && this.smask.width || 0, this.mask && this.mask.width || 0); 44299 }, 44300 get drawHeight() { 44301 return Math.max(this.height, this.smask && this.smask.height || 0, this.mask && this.mask.height || 0); 44302 }, 44303 decodeBuffer: function decodeBuffer(buffer) { 44304 var bpc = this.bpc; 44305 var numComps = this.numComps; 44306 var decodeAddends = this.decodeAddends; 44307 var decodeCoefficients = this.decodeCoefficients; 44308 var max = (1 << bpc) - 1; 44309 var i, ii; 44310 if (bpc === 1) { 44311 for (i = 0, ii = buffer.length; i < ii; i++) { 44312 buffer[i] = +!buffer[i]; 44313 } 44314 return; 44315 } 44316 var index = 0; 44317 for (i = 0, ii = this.width * this.height; i < ii; i++) { 44318 for (var j = 0; j < numComps; j++) { 44319 buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], decodeCoefficients[j], max); 44320 index++; 44321 } 44322 } 44323 }, 44324 getComponents: function getComponents(buffer) { 44325 var bpc = this.bpc; 44326 if (bpc === 8) { 44327 return buffer; 44328 } 44329 var width = this.width; 44330 var height = this.height; 44331 var numComps = this.numComps; 44332 var length = width * height * numComps; 44333 var bufferPos = 0; 44334 var output = bpc <= 8 ? new Uint8Array(length) : bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length); 44335 var rowComps = width * numComps; 44336 var max = (1 << bpc) - 1; 44337 var i = 0, 44338 ii, 44339 buf; 44340 if (bpc === 1) { 44341 var mask, loop1End, loop2End; 44342 for (var j = 0; j < height; j++) { 44343 loop1End = i + (rowComps & ~7); 44344 loop2End = i + rowComps; 44345 while (i < loop1End) { 44346 buf = buffer[bufferPos++]; 44347 output[i] = buf >> 7 & 1; 44348 output[i + 1] = buf >> 6 & 1; 44349 output[i + 2] = buf >> 5 & 1; 44350 output[i + 3] = buf >> 4 & 1; 44351 output[i + 4] = buf >> 3 & 1; 44352 output[i + 5] = buf >> 2 & 1; 44353 output[i + 6] = buf >> 1 & 1; 44354 output[i + 7] = buf & 1; 44355 i += 8; 44356 } 44357 if (i < loop2End) { 44358 buf = buffer[bufferPos++]; 44359 mask = 128; 44360 while (i < loop2End) { 44361 output[i++] = +!!(buf & mask); 44362 mask >>= 1; 44363 } 44364 } 44365 } 44366 } else { 44367 var bits = 0; 44368 buf = 0; 44369 for (i = 0, ii = length; i < ii; ++i) { 44370 if (i % rowComps === 0) { 44371 buf = 0; 44372 bits = 0; 44373 } 44374 while (bits < bpc) { 44375 buf = buf << 8 | buffer[bufferPos++]; 44376 bits += 8; 44377 } 44378 var remainingBits = bits - bpc; 44379 var value = buf >> remainingBits; 44380 output[i] = value < 0 ? 0 : value > max ? max : value; 44381 buf = buf & (1 << remainingBits) - 1; 44382 bits = remainingBits; 44383 } 44384 } 44385 return output; 44386 }, 44387 fillOpacity: function fillOpacity(rgbaBuf, width, height, actualHeight, image) { 44388 var smask = this.smask; 44389 var mask = this.mask; 44390 var alphaBuf, sw, sh, i, ii, j; 44391 if (smask) { 44392 sw = smask.width; 44393 sh = smask.height; 44394 alphaBuf = new Uint8Array(sw * sh); 44395 smask.fillGrayBuffer(alphaBuf); 44396 if (sw !== width || sh !== height) { 44397 alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height); 44398 } 44399 } else if (mask) { 44400 if (mask instanceof PDFImage) { 44401 sw = mask.width; 44402 sh = mask.height; 44403 alphaBuf = new Uint8Array(sw * sh); 44404 mask.numComps = 1; 44405 mask.fillGrayBuffer(alphaBuf); 44406 for (i = 0, ii = sw * sh; i < ii; ++i) { 44407 alphaBuf[i] = 255 - alphaBuf[i]; 44408 } 44409 if (sw !== width || sh !== height) { 44410 alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height); 44411 } 44412 } else if (Array.isArray(mask)) { 44413 alphaBuf = new Uint8Array(width * height); 44414 var numComps = this.numComps; 44415 for (i = 0, ii = width * height; i < ii; ++i) { 44416 var opacity = 0; 44417 var imageOffset = i * numComps; 44418 for (j = 0; j < numComps; ++j) { 44419 var color = image[imageOffset + j]; 44420 var maskOffset = j * 2; 44421 if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { 44422 opacity = 255; 44423 break; 44424 } 44425 } 44426 alphaBuf[i] = opacity; 44427 } 44428 } else { 44429 throw new _util.FormatError('Unknown mask format.'); 44430 } 44431 } 44432 if (alphaBuf) { 44433 for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { 44434 rgbaBuf[j] = alphaBuf[i]; 44435 } 44436 } else { 44437 for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { 44438 rgbaBuf[j] = 255; 44439 } 44440 } 44441 }, 44442 undoPreblend: function undoPreblend(buffer, width, height) { 44443 var matte = this.smask && this.smask.matte; 44444 if (!matte) { 44445 return; 44446 } 44447 var matteRgb = this.colorSpace.getRgb(matte, 0); 44448 var matteR = matteRgb[0]; 44449 var matteG = matteRgb[1]; 44450 var matteB = matteRgb[2]; 44451 var length = width * height * 4; 44452 var r, g, b; 44453 for (var i = 0; i < length; i += 4) { 44454 var alpha = buffer[i + 3]; 44455 if (alpha === 0) { 44456 buffer[i] = 255; 44457 buffer[i + 1] = 255; 44458 buffer[i + 2] = 255; 44459 continue; 44460 } 44461 var k = 255 / alpha; 44462 r = (buffer[i] - matteR) * k + matteR; 44463 g = (buffer[i + 1] - matteG) * k + matteG; 44464 b = (buffer[i + 2] - matteB) * k + matteB; 44465 buffer[i] = r <= 0 ? 0 : r >= 255 ? 255 : r | 0; 44466 buffer[i + 1] = g <= 0 ? 0 : g >= 255 ? 255 : g | 0; 44467 buffer[i + 2] = b <= 0 ? 0 : b >= 255 ? 255 : b | 0; 44468 } 44469 }, 44470 createImageData: function createImageData() { 44471 var forceRGBA = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 44472 44473 var drawWidth = this.drawWidth; 44474 var drawHeight = this.drawHeight; 44475 var imgData = { 44476 width: drawWidth, 44477 height: drawHeight 44478 }; 44479 var numComps = this.numComps; 44480 var originalWidth = this.width; 44481 var originalHeight = this.height; 44482 var bpc = this.bpc; 44483 var rowBytes = originalWidth * numComps * bpc + 7 >> 3; 44484 var imgArray; 44485 if (!forceRGBA) { 44486 var kind; 44487 if (this.colorSpace.name === 'DeviceGray' && bpc === 1) { 44488 kind = _util.ImageKind.GRAYSCALE_1BPP; 44489 } else if (this.colorSpace.name === 'DeviceRGB' && bpc === 8 && !this.needsDecode) { 44490 kind = _util.ImageKind.RGB_24BPP; 44491 } 44492 if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) { 44493 imgData.kind = kind; 44494 imgArray = this.getImageBytes(originalHeight * rowBytes); 44495 if (this.image instanceof _stream.DecodeStream) { 44496 imgData.data = imgArray; 44497 } else { 44498 var newArray = new Uint8Array(imgArray.length); 44499 newArray.set(imgArray); 44500 imgData.data = newArray; 44501 } 44502 if (this.needsDecode) { 44503 (0, _util.assert)(kind === _util.ImageKind.GRAYSCALE_1BPP); 44504 var buffer = imgData.data; 44505 for (var i = 0, ii = buffer.length; i < ii; i++) { 44506 buffer[i] ^= 0xff; 44507 } 44508 } 44509 return imgData; 44510 } 44511 if (this.image instanceof _jpeg_stream.JpegStream && !this.smask && !this.mask) { 44512 var imageLength = originalHeight * rowBytes; 44513 switch (this.colorSpace.name) { 44514 case 'DeviceGray': 44515 imageLength *= 3; 44516 case 'DeviceRGB': 44517 case 'DeviceCMYK': 44518 imgData.kind = _util.ImageKind.RGB_24BPP; 44519 imgData.data = this.getImageBytes(imageLength, drawWidth, drawHeight, true); 44520 return imgData; 44521 } 44522 } 44523 } 44524 imgArray = this.getImageBytes(originalHeight * rowBytes); 44525 var actualHeight = 0 | imgArray.length / rowBytes * drawHeight / originalHeight; 44526 var comps = this.getComponents(imgArray); 44527 var alpha01, maybeUndoPreblend; 44528 if (!forceRGBA && !this.smask && !this.mask) { 44529 imgData.kind = _util.ImageKind.RGB_24BPP; 44530 imgData.data = new Uint8Array(drawWidth * drawHeight * 3); 44531 alpha01 = 0; 44532 maybeUndoPreblend = false; 44533 } else { 44534 imgData.kind = _util.ImageKind.RGBA_32BPP; 44535 imgData.data = new Uint8Array(drawWidth * drawHeight * 4); 44536 alpha01 = 1; 44537 maybeUndoPreblend = true; 44538 this.fillOpacity(imgData.data, drawWidth, drawHeight, actualHeight, comps); 44539 } 44540 if (this.needsDecode) { 44541 this.decodeBuffer(comps);
44542 } 44543 this.colorSpace.fillRgb(imgData.data, originalWidth, originalHeight, drawWidth, drawHeight, actualHeight, bpc, comps, alpha01); 44544 if (maybeUndoPreblend) { 44545 this.undoPreblend(imgData.data, drawWidth, actualHeight); 44546 } 44547 return imgData; 44548 }, 44549 fillGrayBuffer: function fillGrayBuffer(buffer) { 44550 var numComps = this.numComps; 44551 if (numComps !== 1) { 44552 throw new _util.FormatError('Reading gray scale from a color image: ' + numComps); 44553 } 44554 var width = this.width; 44555 var height = this.height; 44556 var bpc = this.bpc; 44557 var rowBytes = width * numComps * bpc + 7 >> 3; 44558 var imgArray = this.getImageBytes(height * rowBytes); 44559 var comps = this.getComponents(imgArray); 44560 var i, length; 44561 if (bpc === 1) { 44562 length = width * height; 44563 if (this.needsDecode) { 44564 for (i = 0; i < length; ++i) { 44565 buffer[i] = comps[i] - 1 & 255; 44566 } 44567 } else { 44568 for (i = 0; i < length; ++i) { 44569 buffer[i] = -comps[i] & 255; 44570 } 44571 } 44572 return; 44573 } 44574 if (this.needsDecode) { 44575 this.decodeBuffer(comps); 44576 } 44577 length = width * height; 44578 var scale = 255 / ((1 << bpc) - 1); 44579 for (i = 0; i < length; ++i) { 44580 buffer[i] = scale * comps[i] | 0; 44581 } 44582 }, 44583 getImageBytes: function getImageBytes(length, drawWidth, drawHeight) { 44584 var forceRGB = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; 44585 44586 this.image.reset(); 44587 this.image.drawWidth = drawWidth || this.width; 44588 this.image.drawHeight = drawHeight || this.height; 44589 this.image.forceRGB = !!forceRGB; 44590 return this.image.getBytes(length); 44591 } 44592 }; 44593 return PDFImage; 44594}();
44595exports.PDFImage = PDFImage; 44596 44597/***/ }) 44598/******/ ]); 44599}); 44600//# sourceMappingURL=pdf.worker.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.