vendor: 3,772 bytes, lines 1-101
1/* Copyright 2017 Mozilla Foundation 2 * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16(function webpackUniversalModuleDefinition(root, factory) { 17 if(typeof exports === 'object' && typeof module === 'object') 18 module.exports = factory(); 19 else if(typeof define === 'function' && define.amd) 20 define("pdfjs-dist/build/pdf.worker", [], factory); 21 else if(typeof exports === 'object') 22 exports["pdfjs-dist/build/pdf.worker"] = factory(); 23 else 24 root["pdfjs-dist/build/pdf.worker"] = root.pdfjsDistBuildPdfWorker = factory(); 25})(this, function() { 26return /******/ (function(modules) { // webpackBootstrap 27/******/ // The module cache 28/******/ var installedModules = {}; 29/******/ 30/******/ // The require function 31/******/ function __w_pdfjs_require__(moduleId) { 32/******/ 33/******/ // Check if module is in cache 34/******/ if(installedModules[moduleId]) { 35/******/ return installedModules[moduleId].exports; 36/******/ } 37/******/ // Create a new module (and put it into the cache) 38/******/ var module = installedModules[moduleId] = { 39/******/ i: moduleId, 40/******/ l: false, 41/******/ exports: {} 42/******/ }; 43/******/ 44/******/ // Execute the module function 45/******/ modules[moduleId].call(module.exports, module, module.exports, __w_pdfjs_require__); 46/******/ 47/******/ // Flag the module as loaded 48/******/ module.l = true; 49/******/ 50/******/ // Return the exports of the module 51/******/ return module.exports; 52/******/ } 53/******/ 54/******/ 55/******/ // expose the modules object (__webpack_modules__) 56/******/ __w_pdfjs_require__.m = modules; 57/******/ 58/******/ // expose the module cache 59/******/ __w_pdfjs_require__.c = installedModules; 60/******/ 61/******/ // define getter function for harmony exports 62/******/ __w_pdfjs_require__.d = function(exports, name, getter) { 63/******/ if(!__w_pdfjs_require__.o(exports, name)) { 64/******/ Object.defineProperty(exports, name, { 65/******/ configurable: false, 66/******/ enumerable: true, 67/******/ get: getter 68/******/ }); 69/******/ } 70/******/ }; 71/******/ 72/******/ // getDefaultExport function for compatibility with non-harmony modules 73/******/ __w_pdfjs_require__.n = function(module) { 74/******/ var getter = module && module.__esModule ? 75/******/ function getDefault() { return module['default']; } : 76/******/ function getModuleExports() { return module; }; 77/******/ __w_pdfjs_require__.d(getter, 'a', getter); 78/******/ return getter; 79/******/ }; 80/******/ 81/******/ // Object.prototype.hasOwnProperty.call 82/******/ __w_pdfjs_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 83/******/ 84/******/ // __webpack_public_path__ 85/******/ __w_pdfjs_require__.p = ""; 86/******/ 87/******/ // Load entry module and return exports 88/******/ return __w_pdfjs_require__(__w_pdfjs_require__.s = 72); 89/******/ }) 90/************************************************************************/ 91/******/ ([ 92/* 0 */ 93/***/ (function(module, exports, __w_pdfjs_require__) { 94 95"use strict"; 96 97 98Object.defineProperty(exports, "__esModule", { 99 value: true 100}); 101exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exp
101orts.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.isNodeJS = 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.StatTimer = 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; 102 103var _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; }; 104 105__w_pdfjs_require__(74); 106 107var _streams_polyfill = __w_pdfjs_require__(107); 108 109var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; 110var NativeImageDecoding = { 111 NONE: 'none', 112 DECODE: 'decode', 113 DISPLAY: 'display' 114}; 115var TextRenderingMode = { 116 FILL: 0, 117 STROKE: 1, 118 FILL_STROKE: 2, 119 INVISIBLE: 3, 120 FILL_ADD_TO_PATH: 4, 121 STROKE_ADD_TO_PATH: 5, 122 FILL_STROKE_ADD_TO_PATH: 6, 123 ADD_TO_PATH: 7, 124 FILL_STROKE_MASK: 3, 125 ADD_TO_PATH_FLAG: 4 126}; 127var ImageKind = { 128 GRAYSCALE_1BPP: 1, 129 RGB_24BPP: 2, 130 RGBA_32BPP: 3 131}; 132var AnnotationType = { 133 TEXT: 1, 134 LINK: 2, 135 FREETEXT: 3, 136 LINE: 4, 137 SQUARE: 5, 138 CIRCLE: 6, 139 POLYGON: 7, 140 POLYLINE: 8, 141 HIGHLIGHT: 9, 142 UNDERLINE: 10, 143 SQUIGGLY: 11, 144 STRIKEOUT: 12, 145 STAMP: 13, 146 CARET: 14, 147 INK: 15, 148 POPUP: 16, 149 FILEATTACHMENT: 17, 150 SOUND: 18, 151 MOVIE: 19, 152 WIDGET: 20, 153 SCREEN: 21, 154 PRINTERMARK: 22, 155 TRAPNET: 23, 156 WATERMARK: 24, 157 THREED: 25, 158 REDACT: 26 159}; 160var AnnotationFlag = { 161 INVISIBLE: 0x01, 162 HIDDEN: 0x02, 163 PRINT: 0x04, 164 NOZOOM: 0x08, 165 NOROTATE: 0x10, 166 NOVIEW: 0x20, 167 READONLY: 0x40, 168 LOCKED: 0x80, 169 TOGGLENOVIEW: 0x100, 170 LOCKEDCONTENTS: 0x200 171}; 172var AnnotationFieldFlag = { 173 READONLY: 0x0000001, 174 REQUIRED: 0x0000002, 175 NOEXPORT: 0x0000004, 176 MULTILINE: 0x0001000, 177 PASSWORD: 0x0002000, 178 NOTOGGLETOOFF: 0x0004000, 179 RADIO: 0x0008000, 180 PUSHBUTTON: 0x0010000, 181 COMBO: 0x0020000, 182 EDIT: 0x0040000, 183 SORT: 0x0080000, 184 FILESELECT: 0x0100000, 185 MULTISELECT: 0x0200000, 186 DONOTSPELLCHECK: 0x0400000, 187 DONOTSCROLL: 0x0800000, 188 COMB: 0x1000000, 189 RICHTEXT: 0x2000000, 190 RADIOSINUNISON: 0x2000000, 191 COMMITONSELCHANGE: 0x4000000 192}; 193var AnnotationBorderStyleType = { 194 SOLID: 1, 195 DASHED: 2, 196 BEVELED: 3, 197 INSET: 4, 198 UNDERLINE: 5 199}; 200var StreamType = { 201 UNKNOWN: 0, 202 FLATE: 1, 203 LZW: 2, 204 DCT: 3, 205 JPX: 4, 206 JBIG: 5, 207 A85: 6, 208 AHX: 7, 209 CCF: 8, 210 RL: 9 211}; 212var FontType = { 213 UNKNOWN: 0, 214 TYPE1: 1, 215 TYPE1C: 2, 216 CIDFONTTYPE0: 3, 217 CIDFONTTYPE0C: 4, 218 TRUETYPE: 5, 219 CIDFONTTYPE2: 6, 220 TYPE3: 7, 221 OPENTYPE: 8, 222 TYPE0: 9, 223 MMTYPE1: 10 224}; 225var VERBOSITY_LEVELS = { 226 errors: 0, 227 warnings: 1, 228 infos: 5 229}; 230var CMapCompressionType = { 231 NONE: 0, 232 BINARY: 1, 233 STREAM: 2 234}; 235var OPS = { 236 dependency: 1, 237 setLineWidth: 2, 238 setLineCap: 3, 239 setLineJoin: 4, 240 setMiterLimit: 5, 241 setDash: 6, 242 setRenderingIntent: 7,
243 setFlatness: 8, 244 setGState: 9, 245 save: 10, 246 restore: 11, 247 transform: 12, 248 moveTo: 13, 249 lineTo: 14, 250 curveTo: 15, 251 curveTo2: 16, 252 curveTo3: 17, 253 closePath: 18, 254 rectangle: 19, 255 stroke: 20, 256 closeStroke: 21, 257 fill: 22, 258 eoFill: 23, 259 fillStroke: 24, 260 eoFillStroke: 25, 261 closeFillStroke: 26, 262 closeEOFillStroke: 27, 263 endPath: 28, 264 clip: 29, 265 eoClip: 30, 266 beginText: 31, 267 endText: 32, 268 setCharSpacing: 33, 269 setWordSpacing: 34, 270 setHScale: 35, 271 setLeading: 36, 272 setFont: 37, 273 setTextRenderingMode: 38, 274 setTextRise: 39, 275 moveText: 40, 276 setLeadingMoveText: 41, 277 setTextMatrix: 42, 278 nextLine: 43, 279 showText: 44, 280 showSpacedText: 45, 281 nextLineShowText: 46, 282 nextLineSetSpacingShowText: 47, 283 setCharWidth: 48, 284 setCharWidthAndBounds: 49, 285 setStrokeColorSpace: 50, 286 setFillColorSpace: 51, 287 setStrokeColor: 52, 288 setStrokeColorN: 53, 289 setFillColor: 54, 290 setFillColorN: 55, 291 setStrokeGray: 56, 292 setFillGray: 57, 293 setStrokeRGBColor: 58, 294 setFillRGBColor: 59, 295 setStrokeCMYKColor: 60, 296 setFillCMYKColor: 61, 297 shadingFill: 62, 298 beginInlineImage: 63, 299 beginImageData: 64, 300 endInlineImage: 65, 301 paintXObject: 66, 302 markPoint: 67, 303 markPointProps: 68, 304 beginMarkedContent: 69, 305 beginMarkedContentProps: 70, 306 endMarkedContent: 71, 307 beginCompat: 72, 308 endCompat: 73, 309 paintFormXObjectBegin: 74, 310 paintFormXObjectEnd: 75, 311 beginGroup: 76, 312 endGroup: 77, 313 beginAnnotations: 78, 314 endAnnotations: 79, 315 beginAnnotation: 80, 316 endAnnotation: 81, 317 paintJpegXObject: 82, 318 paintImageMaskXObject: 83, 319 paintImageMaskXObjectGroup: 84, 320 paintImageXObject: 85, 321 paintInlineImageXObject: 86, 322 paintInlineImageXObjectGroup: 87, 323 paintImageXObjectRepeat: 88, 324 paintImageMaskXObjectRepeat: 89, 325 paintSolidColorImageMask: 90, 326 constructPath: 91 327}; 328var verbosity = VERBOSITY_LEVELS.warnings; 329function setVerbosityLevel(level) { 330 verbosity = level; 331} 332function getVerbosityLevel() { 333 return verbosity; 334} 335function info(msg) { 336 if (verbosity >= VERBOSITY_LEVELS.infos) { 337 console.log('Info: ' + msg); 338 } 339} 340function warn(msg) { 341 if (verbosity >= VERBOSITY_LEVELS.warnings) { 342 console.log('Warning: ' + msg); 343 } 344} 345function deprecated(details) { 346 console.log('Deprecated API usage: ' + details); 347} 348function unreachable(msg) { 349 throw new Error(msg); 350} 351function assert(cond, msg) { 352 if (!cond) { 353 unreachable(msg); 354 } 355} 356var UNSUPPORTED_FEATURES = { 357 unknown: 'unknown', 358 forms: 'forms', 359 javaScript: 'javaScript', 360 smask: 'smask', 361 shadingPattern: 'shadingPattern', 362 font: 'font' 363}; 364function isSameOrigin(baseUrl, otherUrl) { 365 try { 366 var base = new URL(baseUrl); 367 if (!base.origin || base.origin === 'null') { 368 return false; 369 } 370 } catch (e) { 371 return false; 372 } 373 var other = new URL(otherUrl, base); 374 return base.origin === other.origin; 375} 376function isValidProtocol(url) { 377 if (!url) { 378 return false; 379 } 380 switch (url.protocol) { 381 case 'http:': 382 case 'https:': 383 case 'ftp:': 384 case 'mailto:': 385 case 'tel:': 386 return true; 387 default: 388 return false; 389 } 390} 391function createValidAbsoluteUrl(url, baseUrl) { 392 if (!url) { 393 return null; 394 } 395 try { 396 var absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url); 397 if (isValidProtocol(absoluteUrl)) { 398 return absoluteUrl; 399 } 400 } catch (ex) {} 401 return null; 402} 403function shadow(obj, prop, value) { 404 Object.defineProperty(obj, prop, { 405 value: value, 406 enumerable: true, 407 configurable: true, 408 writable: false 409 }); 410 return value; 411} 412function getLookupTableFactory(initializer) { 413 var lookup; 414 return function () { 415 if (initializer) { 416 lookup = Object.create(null); 417 initializer(lookup); 418 initializer = null; 419 } 420 return lookup; 421 }; 422} 423var PasswordResponses = { 424 NEED_PASSWORD: 1, 425 INCORRECT_PASSWORD: 2 426}; 427var PasswordException = function PasswordExceptionClosure() { 428 function PasswordException(msg, code) { 429 this.name = 'PasswordException'; 430 this.message = msg; 431 this.code = code; 432 } 433 PasswordException.prototype = new Error(); 434 PasswordException.constructor = PasswordException; 435 return PasswordException; 436}(); 437var UnknownErrorException = function UnknownErrorExceptionClosure() { 438 function UnknownErrorException(msg, details) { 439 this.name = 'UnknownErrorException'; 440 this.message = msg; 441 this.details = details; 442 } 443 UnknownErrorException.prototype = new Error(); 444 UnknownErrorException.constructor = UnknownErrorException; 445 return UnknownErrorException; 446}(); 447var InvalidPDFException = function InvalidPDFExceptionClosure() { 448 function InvalidPDFException(msg) { 449 this.name = 'InvalidPDFException'; 450 this.message = msg; 451 } 452 InvalidPDFException.prototype = new Error(); 453 InvalidPDFException.constructor = InvalidPDFException; 454 return InvalidPDFException; 455}(); 456var MissingPDFException = function MissingPDFExceptionClosure() { 457 function MissingPDFException(msg) { 458 this.name = 'MissingPDFException'; 459 this.message = msg; 460 } 461 MissingPDFException.prototype = new Error(); 462 MissingPDFException.constructor = MissingPDFException; 463 return MissingPDFException; 464}(); 465var UnexpectedResponseException = function UnexpectedResponseExceptionClosure() { 466 function UnexpectedResponseException(msg, status) { 467 this.name = 'UnexpectedResponseException'; 468 this.message = msg; 469 this.status = status; 470 } 471 UnexpectedResponseException.prototype = new Error(); 472 UnexpectedResponseException.constructor = UnexpectedResponseException; 473 return UnexpectedResponseException; 474}(); 475var NotImplementedException = function NotImplementedExceptionClosure() { 476 function NotImplementedException(msg) { 477 this.message = msg; 478 } 479 NotImplementedException.prototype = new Error(); 480 NotImplementedException.prototype.name = 'NotImplementedException'; 481 NotImplementedException.constructor = NotImplementedException; 482 return NotImplementedException; 483}(); 484var MissingDataException = function MissingDataExceptionClosure() { 485 function MissingDataException(begin, end) { 486 this.begin = begin; 487 this.end = end; 488 this.message = 'Missing data [' + begin + ', ' + end + ')'; 489 } 490 MissingDataException.prototype = new Error(); 491 MissingDataException.prototype.name = 'MissingDataException'; 492 MissingDataException.constructor = MissingDataException; 493 return MissingDataException; 494}(); 495var XRefParseException = function XRefParseExceptionClosure() { 496 function XRefParseException(msg) { 497 this.message = msg; 498 } 499 XRefParseException.prototype = new Error(); 500 XRefParseException.prototype.name = 'XRefParseException'; 501 XRefParseException.constructor = XRefParseException; 502 return XRefParseException; 503}(); 504var FormatError = function FormatErrorClosure() { 505 function FormatError(msg) { 506 this.message = msg; 507 } 508 FormatError.prototype = new Error(); 509 FormatError.prototype.name = 'FormatError'; 510 FormatError.constructor = FormatError; 511 return FormatError; 512}(); 513var AbortException = function AbortExceptionClosure() { 514 function AbortException(msg) { 515 this.name = 'AbortException'; 516 this.message = msg; 517 } 518 AbortException.prototype = new Error(); 519 AbortException.constructor = AbortException; 520 return AbortException; 521}(); 522var NullCharactersRegExp = /\x00/g; 523function removeNullCharacters(str) { 524 if (typeof str !== 'string') { 525 warn('The argument for removeNullCharacters must be a string.'); 526 return str; 527 } 528 return str.replace(NullCharactersRegExp, ''); 529} 530function bytesToString(bytes) { 531 assert(bytes !== null && (typeof bytes === 'undefined' ? 'undefined' : _typeof(bytes)) === 'object' && bytes.length !== undefined, 'Invalid argument for bytesToString'); 532 var length = bytes.length; 533 var MAX_ARGUMENT_COUNT = 8192; 534 if (length < MAX_ARGUMENT_COUNT) { 535 return String.fromCharCode.apply(null, bytes); 536 } 537 var strBuf = []; 538 for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) { 539 var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); 540 var chunk = bytes.subarray(i, chunkEnd); 541 strBuf.push(String.fromCharCode.apply(null, chunk)); 542 } 543 return strBuf.join(''); 544} 545function stringToBytes(str) { 546 assert(typeof str === 'string', 'Invalid argument for stringToBytes'); 547 var length = str.length; 548 var bytes = new Uint8Array(length); 549 for (var i = 0; i < length; ++i) { 550 bytes[i] = str.charCodeAt(i) & 0xFF; 551 } 552 return bytes; 553} 554function arrayByteLength(arr) { 555 if (arr.length !== undefined) { 556 return arr.length; 557 } 558 assert(arr.byteLength !== undefined); 559 return arr.byteLength; 560} 561function arraysToBytes(arr) { 562 if (arr.length === 1 && arr[0] instanceof Uint8Array) { 563 return arr[0]; 564 } 565 var resultLength = 0; 566 var i, 567 ii = arr.length; 568 var item, itemLength; 569 for (i = 0; i < ii; i++) { 570 item = arr[i]; 571 itemLength = arrayByteLength(item); 572 resultLength += itemLength; 573 } 574 var pos = 0; 575 var data = new Uint8Array(resultLength); 576 for (i = 0; i < ii; i++) { 577 item = arr[i]; 578 if (!(item instanceof Uint8Array)) { 579 if (typeof item === 'string') { 580 item = stringToBytes(item); 581 } else { 582 item = new Uint8Array(item); 583 } 584 } 585 itemLength = item.byteLength; 586 data.set(item, pos); 587 pos += itemLength; 588 } 589 return data; 590} 591function string32(value) { 592 return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); 593} 594function log2(x) { 595 var n = 1, 596 i = 0; 597 while (x > n) { 598 n <<= 1; 599 i++; 600 } 601 return i; 602} 603function readInt8(data, start) { 604 return data[start] << 24 >> 24; 605} 606function readUint16(data, offset) { 607 return data[offset] << 8 | data[offset + 1]; 608} 609function readUint32(data, offset) { 610 return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0; 611} 612function isLittleEndian() { 613 var buffer8 = new Uint8Array(4); 614 buffer8[0] = 1; 615 var view32 = new Uint32Array(buffer8.buffer, 0, 1); 616 return view32[0] === 1; 617} 618function isEvalSupported() { 619 try { 620 new Function(''); 621 return true; 622 } catch (e) { 623 return false;
vendor: 2,949 bytes, lines 624-692
624 } 625} 626var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; 627var Util = function UtilClosure() { 628 function Util() {} 629 var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')']; 630 Util.makeCssRgb = function Util_makeCssRgb(r, g, b) { 631 rgbBuf[1] = r; 632 rgbBuf[3] = g; 633 rgbBuf[5] = b; 634 return rgbBuf.join(''); 635 }; 636 Util.transform = function Util_transform(m1, m2) { 637 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]]; 638 }; 639 Util.applyTransform = function Util_applyTransform(p, m) { 640 var xt = p[0] * m[0] + p[1] * m[2] + m[4]; 641 var yt = p[0] * m[1] + p[1] * m[3] + m[5]; 642 return [xt, yt]; 643 }; 644 Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { 645 var d = m[0] * m[3] - m[1] * m[2]; 646 var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; 647 var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; 648 return [xt, yt]; 649 }; 650 Util.getAxialAlignedBoundingBox = function Util_getAxialAlignedBoundingBox(r, m) { 651 var p1 = Util.applyTransform(r, m); 652 var p2 = Util.applyTransform(r.slice(2, 4), m); 653 var p3 = Util.applyTransform([r[0], r[3]], m); 654 var p4 = Util.applyTransform([r[2], r[1]], m); 655 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])]; 656 }; 657 Util.inverseTransform = function Util_inverseTransform(m) { 658 var d = m[0] * m[3] - m[1] * m[2]; 659 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]; 660 }; 661 Util.apply3dTransform = function Util_apply3dTransform(m, v) { 662 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]]; 663 }; 664 Util.singularValueDecompose2dScale = function Util_singularValueDecompose2dScale(m) { 665 var transpose = [m[0], m[2], m[1], m[3]]; 666 var a = m[0] * transpose[0] + m[1] * transpose[2]; 667 var b = m[0] * transpose[1] + m[1] * transpose[3]; 668 var c = m[2] * transpose[0] + m[3] * transpose[2]; 669 var d = m[2] * transpose[1] + m[3] * transpose[3]; 670 var first = (a + d) / 2; 671 var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2; 672 var sx = first + second || 1; 673 var sy = first - second || 1; 674 return [Math.sqrt(sx), Math.sqrt(sy)]; 675 }; 676 Util.normalizeRect = function Util_normalizeRect(rect) { 677 var r = rect.slice(0); 678 if (rect[0] > rect[2]) { 679 r[0] = rect[2]; 680 r[2] = rect[0]; 681 } 682 if (rect[1] > rect[3]) { 683 r[1] = rect[3]; 684 r[3] = rect[1]; 685 } 686 return r; 687 }; 688 Util.intersect = function Util_intersect(rect1, rect2) { 689 function compare(a, b) { 690 return a - b; 691 } 692 var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare),
vendor: 7,100 bytes, lines 693-879
693 orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare), 694 result = []; 695 rect1 = Util.normalizeRect(rect1); 696 rect2 = Util.normalizeRect(rect2); 697 if (orderedX[0] === rect1[0] && orderedX[1] === rect2[0] || orderedX[0] === rect2[0] && orderedX[1] === rect1[0]) { 698 result[0] = orderedX[1]; 699 result[2] = orderedX[2]; 700 } else { 701 return false; 702 } 703 if (orderedY[0] === rect1[1] && orderedY[1] === rect2[1] || orderedY[0] === rect2[1] && orderedY[1] === rect1[1]) { 704 result[1] = orderedY[1]; 705 result[3] = orderedY[2]; 706 } else { 707 return false; 708 } 709 return result; 710 }; 711 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']; 712 Util.toRoman = function Util_toRoman(number, lowerCase) { 713 assert(Number.isInteger(number) && number > 0, 'The number should be a positive integer.'); 714 var pos, 715 romanBuf = []; 716 while (number >= 1000) { 717 number -= 1000; 718 romanBuf.push('M'); 719 } 720 pos = number / 100 | 0; 721 number %= 100; 722 romanBuf.push(ROMAN_NUMBER_MAP[pos]); 723 pos = number / 10 | 0; 724 number %= 10; 725 romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]); 726 romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); 727 var romanStr = romanBuf.join(''); 728 return lowerCase ? romanStr.toLowerCase() : romanStr; 729 }; 730 Util.appendToArray = function Util_appendToArray(arr1, arr2) { 731 Array.prototype.push.apply(arr1, arr2); 732 }; 733 Util.prependToArray = function Util_prependToArray(arr1, arr2) { 734 Array.prototype.unshift.apply(arr1, arr2); 735 }; 736 Util.extendObj = function extendObj(obj1, obj2) { 737 for (var key in obj2) { 738 obj1[key] = obj2[key]; 739 } 740 }; 741 Util.getInheritableProperty = function Util_getInheritableProperty(dict, name, getArray) { 742 while (dict && !dict.has(name)) { 743 dict = dict.get('Parent'); 744 } 745 if (!dict) { 746 return null; 747 } 748 return getArray ? dict.getArray(name) : dict.get(name); 749 }; 750 Util.inherit = function Util_inherit(sub, base, prototype) { 751 sub.prototype = Object.create(base.prototype); 752 sub.prototype.constructor = sub; 753 for (var prop in prototype) { 754 sub.prototype[prop] = prototype[prop]; 755 } 756 }; 757 Util.loadScript = function Util_loadScript(src, callback) { 758 var script = document.createElement('script'); 759 var loaded = false; 760 script.setAttribute('src', src); 761 if (callback) { 762 script.onload = function () { 763 if (!loaded) { 764 callback(); 765 } 766 loaded = true; 767 }; 768 } 769 document.getElementsByTagName('head')[0].appendChild(script); 770 }; 771 return Util; 772}(); 773var PageViewport = function PageViewportClosure() { 774 function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) { 775 this.viewBox = viewBox; 776 this.scale = scale; 777 this.rotation = rotation; 778 this.offsetX = offsetX; 779 this.offsetY = offsetY; 780 var centerX = (viewBox[2] + viewBox[0]) / 2; 781 var centerY = (viewBox[3] + viewBox[1]) / 2; 782 var rotateA, rotateB, rotateC, rotateD; 783 rotation = rotation % 360; 784 rotation = rotation < 0 ? rotation + 360 : rotation; 785 switch (rotation) { 786 case 180: 787 rotateA = -1; 788 rotateB = 0; 789 rotateC = 0; 790 rotateD = 1; 791 break; 792 case 90: 793 rotateA = 0; 794 rotateB = 1; 795 rotateC = 1; 796 rotateD = 0; 797 break; 798 case 270: 799 rotateA = 0; 800 rotateB = -1; 801 rotateC = -1; 802 rotateD = 0; 803 break; 804 default: 805 rotateA = 1; 806 rotateB = 0; 807 rotateC = 0; 808 rotateD = -1; 809 break; 810 } 811 if (dontFlip) { 812 rotateC = -rotateC; 813 rotateD = -rotateD; 814 } 815 var offsetCanvasX, offsetCanvasY; 816 var width, height; 817 if (rotateA === 0) { 818 offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; 819 offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; 820 width = Math.abs(viewBox[3] - viewBox[1]) * scale; 821 height = Math.abs(viewBox[2] - viewBox[0]) * scale; 822 } else { 823 offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; 824 offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; 825 width = Math.abs(viewBox[2] - viewBox[0]) * scale; 826 height = Math.abs(viewBox[3] - viewBox[1]) * scale; 827 } 828 this.transform = [rotateA * scale, rotateB * scale, rotateC * scale, rotateD * scale, offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY]; 829 this.width = width; 830 this.height = height; 831 this.fontScale = scale; 832 } 833 PageViewport.prototype = { 834 clone: function PageViewPort_clone(args) { 835 args = args || {}; 836 var scale = 'scale' in args ? args.scale : this.scale; 837 var rotation = 'rotation' in args ? args.rotation : this.rotation; 838 return new PageViewport(this.viewBox.slice(), scale, rotation, this.offsetX, this.offsetY, args.dontFlip); 839 }, 840 convertToViewportPoint: function PageViewport_convertToViewportPoint(x, y) { 841 return Util.applyTransform([x, y], this.transform); 842 }, 843 convertToViewportRectangle: function PageViewport_convertToViewportRectangle(rect) { 844 var tl = Util.applyTransform([rect[0], rect[1]], this.transform); 845 var br = Util.applyTransform([rect[2], rect[3]], this.transform); 846 return [tl[0], tl[1], br[0], br[1]]; 847 }, 848 convertToPdfPoint: function PageViewport_convertToPdfPoint(x, y) { 849 return Util.applyInverseTransform([x, y], this.transform); 850 } 851 }; 852 return PageViewport; 853}(); 854var 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]; 855function stringToPDFString(str) { 856 var i, 857 n = str.length, 858 strBuf = []; 859 if (str[0] === '\xFE' && str[1] === '\xFF') { 860 for (i = 2; i < n; i += 2) { 861 strBuf.push(String.fromCharCode(str.charCodeAt(i) << 8 | str.charCodeAt(i + 1))); 862 } 863 } else { 864 for (i = 0; i < n; ++i) { 865 var code = PDFStringTranslateTable[str.charCodeAt(i)]; 866 strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); 867 } 868 } 869 return strBuf.join(''); 870} 871function stringToUTF8String(str) { 872 return decodeURIComponent(escape(str)); 873} 874function utf8StringToString(str) { 875 return unescape(encodeURIComponent(str)); 876} 877function isEmptyObj(obj) { 878 for (var key in obj) { 879 return false;
880 } 881 return true; 882} 883function isBool(v) { 884 return typeof v === 'boolean'; 885} 886function isNum(v) { 887 return typeof v === 'number'; 888} 889function isString(v) { 890 return typeof v === 'string'; 891} 892function isArrayBuffer(v) { 893 return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' && v !== null && v.byteLength !== undefined; 894} 895function isSpace(ch) { 896 return ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A; 897} 898function isNodeJS() { 899 return (typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process + '' === '[object process]'; 900} 901function createPromiseCapability() { 902 var capability = {}; 903 capability.promise = new Promise(function (resolve, reject) { 904 capability.resolve = resolve; 905 capability.reject = reject; 906 }); 907 return capability; 908} 909var StatTimer = function StatTimerClosure() { 910 function rpad(str, pad, length) { 911 while (str.length < length) { 912 str += pad; 913 } 914 return str; 915 } 916 function StatTimer() { 917 this.started = Object.create(null); 918 this.times = []; 919 this.enabled = true; 920 } 921 StatTimer.prototype = { 922 time: function StatTimer_time(name) { 923 if (!this.enabled) { 924 return; 925 } 926 if (name in this.started) { 927 warn('Timer is already running for ' + name); 928 } 929 this.started[name] = Date.now(); 930 }, 931 timeEnd: function StatTimer_timeEnd(name) { 932 if (!this.enabled) { 933 return; 934 } 935 if (!(name in this.started)) { 936 warn('Timer has not been started for ' + name); 937 } 938 this.times.push({ 939 'name': name, 940 'start': this.started[name], 941 'end': Date.now() 942 }); 943 delete this.started[name]; 944 }, 945 toString: function StatTimer_toString() { 946 var i, ii; 947 var times = this.times; 948 var out = ''; 949 var longest = 0; 950 for (i = 0, ii = times.length; i < ii; ++i) { 951 var name = times[i]['name']; 952 if (name.length > longest) { 953 longest = name.length; 954 } 955 } 956 for (i = 0, ii = times.length; i < ii; ++i) { 957 var span = times[i]; 958 var duration = span.end - span.start; 959 out += rpad(span['name'], ' ', longest) + ' ' + duration + 'ms\n'; 960 } 961 return out; 962 } 963 }; 964 return StatTimer; 965}(); 966var createBlob = function createBlob(data, contentType) { 967 if (typeof Blob !== 'undefined') { 968 return new Blob([data], { type: contentType }); 969 } 970 throw new Error('The "Blob" constructor is not supported.'); 971}; 972var createObjectURL = function createObjectURLClosure() { 973 var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; 974 return function createObjectURL(data, contentType) { 975 var forceDataSchema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 976 977 if (!forceDataSchema && URL.createObjectURL) { 978 var blob = createBlob(data, contentType); 979 return URL.createObjectURL(blob); 980 } 981 var buffer = 'data:' + contentType + ';base64,'; 982 for (var i = 0, ii = data.length; i < ii; i += 3) { 983 var b1 = data[i] & 0xFF; 984 var b2 = data[i + 1] & 0xFF; 985 var b3 = data[i + 2] & 0xFF; 986 var d1 = b1 >> 2, 987 d2 = (b1 & 3) << 4 | b2 >> 4; 988 var d3 = i + 1 < ii ? (b2 & 0xF) << 2 | b3 >> 6 : 64; 989 var d4 = i + 2 < ii ? b3 & 0x3F : 64; 990 buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; 991 } 992 return buffer; 993 }; 994}(); 995function resolveCall(fn, args) { 996 var thisArg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; 997 998 if (!fn) { 999 return Promise.resolve(undefined); 1000 } 1001 return new Promise(function (resolve, reject) { 1002 resolve(fn.apply(thisArg, args)); 1003 }); 1004} 1005function wrapReason(reason) { 1006 if ((typeof reason === 'undefined' ? 'undefined' : _typeof(reason)) !== 'object') { 1007 return reason; 1008 } 1009 switch (reason.name) { 1010 case 'AbortException': 1011 return new AbortException(reason.message); 1012 case 'MissingPDFException': 1013 return new MissingPDFException(reason.message); 1014 case 'UnexpectedResponseException': 1015 return new UnexpectedResponseException(reason.message, reason.status); 1016 default: 1017 return new UnknownErrorException(reason.message, reason.details); 1018 } 1019} 1020function makeReasonSerializable(reason) { 1021 if (!(reason instanceof Error) || reason instanceof AbortException || reason instanceof MissingPDFException || reason instanceof UnexpectedResponseException || reason instanceof UnknownErrorException) { 1022 return reason; 1023 } 1024 return new UnknownErrorException(reason.message, reason.toString()); 1025} 1026function resolveOrReject(capability, success, reason) { 1027 if (success) { 1028 capability.resolve(); 1029 } else { 1030 capability.reject(reason); 1031 } 1032} 1033function finalize(promise) { 1034 return Promise.resolve(promise).catch(function () {}); 1035} 1036function MessageHandler(sourceName, targetName, comObj) { 1037 var _this = this; 1038 1039 this.sourceName = sourceName; 1040 this.targetName = targetName; 1041 this.comObj = comObj; 1042 this.callbackId = 1; 1043 this.streamId = 1; 1044 this.postMessageTransfers = true; 1045 this.streamSinks = Object.create(null); 1046 this.streamControllers = Object.create(null); 1047 var callbacksCapabilities = this.callbacksCapabilities = Object.create(null); 1048 var ah = this.actionHandler = Object.create(null); 1049 this._onComObjOnMessage = function (event) { 1050 var data = event.data; 1051 if (data.targetName !== _this.sourceName) { 1052 return; 1053 } 1054 if (data.stream) { 1055 _this._processStreamMessage(data); 1056 } else if (data.isReply) { 1057 var callbackId = data.callbackId; 1058 if (data.callbackId in callbacksCapabilities) { 1059 var callback = callbacksCapabilities[callbackId]; 1060 delete callbacksCapabilities[callbackId]; 1061 if ('error' in data) { 1062 callback.reject(wrapReason(data.error)); 1063 } else { 1064 callback.resolve(data.data); 1065 } 1066 } else { 1067 throw new Error('Cannot resolve callback ' + callbackId); 1068 } 1069 } else if (data.action in ah) { 1070 var action = ah[data.action]; 1071 if (data.callbackId) { 1072 var _sourceName = _this.sourceName; 1073 var _targetName = data.sourceName; 1074 Promise.resolve().then(function () { 1075 return action[0].call(action[1], data.data); 1076 }).then(function (result) { 1077 comObj.postMessage({ 1078 sourceName: _sourceName, 1079 targetName: _targetName, 1080 isReply: true, 1081 callbackId: data.callbackId, 1082 data: result 1083 }); 1084 }, function (reason) { 1085 comObj.postMessage({ 1086 sourceName: _sourceName, 1087 targetName: _targetName, 1088 isReply: true, 1089 callbackId: data.callbackId, 1090 error: makeReasonSerializable(reason) 1091 }); 1092 }); 1093 } else if (data.streamId) { 1094 _this._createStreamSink(data); 1095 } else { 1096 action[0].call(action[1], data.data); 1097 } 1098 } else { 1099 throw new Error('Unknown action from worker: ' + data.action); 1100 } 1101 }; 1102 comObj.addEventListener('message', this._onComObjOnMessage); 1103} 1104MessageHandler.prototype = { 1105 on: function on(actionName, handler, scope) { 1106 var ah = this.actionHandler; 1107 if (ah[actionName]) { 1108 throw new Error('There is already an actionName called "' + actionName + '"'); 1109 } 1110 ah[actionName] = [handler, scope]; 1111 }, 1112 send: function send(actionName, data, transfers) { 1113 var message = { 1114 sourceName: this.sourceName, 1115 targetName: this.targetName, 1116 action: actionName, 1117 data: data 1118 }; 1119 this.postMessage(message, transfers); 1120 },
1121 sendWithPromise: function sendWithPromise(actionName, data, transfers) { 1122 var callbackId = this.callbackId++; 1123 var message = { 1124 sourceName: this.sourceName, 1125 targetName: this.targetName, 1126 action: actionName, 1127 data: data, 1128 callbackId: callbackId 1129 }; 1130 var capability = createPromiseCapability(); 1131 this.callbacksCapabilities[callbackId] = capability; 1132 try { 1133 this.postMessage(message, transfers); 1134 } catch (e) { 1135 capability.reject(e); 1136 } 1137 return capability.promise; 1138 }, 1139 sendWithStream: function sendWithStream(actionName, data, queueingStrategy, transfers) { 1140 var _this2 = this; 1141 1142 var streamId = this.streamId++; 1143 var sourceName = this.sourceName; 1144 var targetName = this.targetName; 1145 return new _streams_polyfill.ReadableStream({ 1146 start: function start(controller) { 1147 var startCapability = createPromiseCapability(); 1148 _this2.streamControllers[streamId] = { 1149 controller: controller, 1150 startCall: startCapability, 1151 isClosed: false 1152 }; 1153 _this2.postMessage({ 1154 sourceName: sourceName, 1155 targetName: targetName, 1156 action: actionName, 1157 streamId: streamId, 1158 data: data, 1159 desiredSize: controller.desiredSize 1160 }); 1161 return startCapability.promise; 1162 }, 1163 pull: function pull(controller) { 1164 var pullCapability = createPromiseCapability(); 1165 _this2.streamControllers[streamId].pullCall = pullCapability; 1166 _this2.postMessage({ 1167 sourceName: sourceName, 1168 targetName: targetName, 1169 stream: 'pull', 1170 streamId: streamId, 1171 desiredSize: controller.desiredSize 1172 }); 1173 return pullCapability.promise; 1174 }, 1175 cancel: function cancel(reason) { 1176 var cancelCapability = createPromiseCapability(); 1177 _this2.streamControllers[streamId].cancelCall = cancelCapability; 1178 _this2.streamControllers[streamId].isClosed = true; 1179 _this2.postMessage({ 1180 sourceName: sourceName, 1181 targetName: targetName, 1182 stream: 'cancel', 1183 reason: reason, 1184 streamId: streamId 1185 }); 1186 return cancelCapability.promise; 1187 } 1188 }, queueingStrategy); 1189 }, 1190 _createStreamSink: function _createStreamSink(data) { 1191 var _this3 = this; 1192 1193 var self = this; 1194 var action = this.actionHandler[data.action]; 1195 var streamId = data.streamId; 1196 var desiredSize = data.desiredSize; 1197 var sourceName = this.sourceName; 1198 var targetName = data.sourceName; 1199 var capability = createPromiseCapability(); 1200 var sendStreamRequest = function sendStreamRequest(_ref) { 1201 var stream = _ref.stream, 1202 chunk = _ref.chunk, 1203 transfers = _ref.transfers, 1204 success = _ref.success, 1205 reason = _ref.reason; 1206 1207 _this3.postMessage({ 1208 sourceName: sourceName, 1209 targetName: targetName, 1210 stream: stream, 1211 streamId: streamId, 1212 chunk: chunk, 1213 success: success, 1214 reason: reason 1215 }, transfers); 1216 }; 1217 var streamSink = { 1218 enqueue: function enqueue(chunk) { 1219 var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; 1220 var transfers = arguments[2]; 1221 1222 if (this.isCancelled) { 1223 return; 1224 } 1225 var lastDesiredSize = this.desiredSize; 1226 this.desiredSize -= size; 1227 if (lastDesiredSize > 0 && this.desiredSize <= 0) { 1228 this.sinkCapability = createPromiseCapability(); 1229 this.ready = this.sinkCapability.promise; 1230 } 1231 sendStreamRequest({ 1232 stream: 'enqueue', 1233 chunk: chunk, 1234 transfers: transfers 1235 }); 1236 }, 1237 close: function close() { 1238 if (this.isCancelled) { 1239 return; 1240 } 1241 this.isCancelled = true; 1242 sendStreamRequest({ stream: 'close' }); 1243 delete self.streamSinks[streamId]; 1244 }, 1245 error: function error(reason) { 1246 if (this.isCancelled) { 1247 return; 1248 } 1249 this.isCancelled = true;
vendor: 8,490 bytes, lines 1250-1487
1250 sendStreamRequest({ 1251 stream: 'error', 1252 reason: reason 1253 }); 1254 }, 1255 1256 sinkCapability: capability, 1257 onPull: null, 1258 onCancel: null, 1259 isCancelled: false, 1260 desiredSize: desiredSize, 1261 ready: null 1262 }; 1263 streamSink.sinkCapability.resolve(); 1264 streamSink.ready = streamSink.sinkCapability.promise; 1265 this.streamSinks[streamId] = streamSink; 1266 resolveCall(action[0], [data.data, streamSink], action[1]).then(function () { 1267 sendStreamRequest({ 1268 stream: 'start_complete', 1269 success: true 1270 }); 1271 }, function (reason) { 1272 sendStreamRequest({ 1273 stream: 'start_complete', 1274 success: false, 1275 reason: reason 1276 }); 1277 }); 1278 }, 1279 _processStreamMessage: function _processStreamMessage(data) { 1280 var _this4 = this; 1281 1282 var sourceName = this.sourceName; 1283 var targetName = data.sourceName; 1284 var streamId = data.streamId; 1285 var sendStreamResponse = function sendStreamResponse(_ref2) { 1286 var stream = _ref2.stream, 1287 success = _ref2.success, 1288 reason = _ref2.reason; 1289 1290 _this4.comObj.postMessage({ 1291 sourceName: sourceName, 1292 targetName: targetName, 1293 stream: stream, 1294 success: success, 1295 streamId: streamId, 1296 reason: reason 1297 }); 1298 }; 1299 var deleteStreamController = function deleteStreamController() { 1300 Promise.all([_this4.streamControllers[data.streamId].startCall, _this4.streamControllers[data.streamId].pullCall, _this4.streamControllers[data.streamId].cancelCall].map(function (capability) { 1301 return capability && finalize(capability.promise); 1302 })).then(function () { 1303 delete _this4.streamControllers[data.streamId]; 1304 }); 1305 }; 1306 switch (data.stream) { 1307 case 'start_complete': 1308 resolveOrReject(this.streamControllers[data.streamId].startCall, data.success, wrapReason(data.reason)); 1309 break; 1310 case 'pull_complete': 1311 resolveOrReject(this.streamControllers[data.streamId].pullCall, data.success, wrapReason(data.reason)); 1312 break; 1313 case 'pull': 1314 if (!this.streamSinks[data.streamId]) { 1315 sendStreamResponse({ 1316 stream: 'pull_complete', 1317 success: true 1318 }); 1319 break; 1320 } 1321 if (this.streamSinks[data.streamId].desiredSize <= 0 && data.desiredSize > 0) { 1322 this.streamSinks[data.streamId].sinkCapability.resolve(); 1323 } 1324 this.streamSinks[data.streamId].desiredSize = data.desiredSize; 1325 resolveCall(this.streamSinks[data.streamId].onPull).then(function () { 1326 sendStreamResponse({ 1327 stream: 'pull_complete', 1328 success: true 1329 }); 1330 }, function (reason) { 1331 sendStreamResponse({ 1332 stream: 'pull_complete', 1333 success: false, 1334 reason: reason 1335 }); 1336 }); 1337 break; 1338 case 'enqueue': 1339 assert(this.streamControllers[data.streamId], 'enqueue should have stream controller'); 1340 if (!this.streamControllers[data.streamId].isClosed) { 1341 this.streamControllers[data.streamId].controller.enqueue(data.chunk); 1342 } 1343 break; 1344 case 'close': 1345 assert(this.streamControllers[data.streamId], 'close should have stream controller'); 1346 if (this.streamControllers[data.streamId].isClosed) { 1347 break; 1348 } 1349 this.streamControllers[data.streamId].isClosed = true; 1350 this.streamControllers[data.streamId].controller.close(); 1351 deleteStreamController(); 1352 break; 1353 case 'error': 1354 assert(this.streamControllers[data.streamId], 'error should have stream controller'); 1355 this.streamControllers[data.streamId].controller.error(wrapReason(data.reason)); 1356 deleteStreamController(); 1357 break; 1358 case 'cancel_complete': 1359 resolveOrReject(this.streamControllers[data.streamId].cancelCall, data.success, wrapReason(data.reason)); 1360 deleteStreamController(); 1361 break; 1362 case 'cancel': 1363 if (!this.streamSinks[data.streamId]) { 1364 break; 1365 } 1366 resolveCall(this.streamSinks[data.streamId].onCancel, [wrapReason(data.reason)]).then(function () { 1367 sendStreamResponse({ 1368 stream: 'cancel_complete', 1369 success: true 1370 }); 1371 }, function (reason) { 1372 sendStreamResponse({ 1373 stream: 'cancel_complete', 1374 success: false, 1375 reason: reason 1376 }); 1377 }); 1378 this.streamSinks[data.streamId].sinkCapability.reject(wrapReason(data.reason)); 1379 this.streamSinks[data.streamId].isCancelled = true; 1380 delete this.streamSinks[data.streamId]; 1381 break; 1382 default: 1383 throw new Error('Unexpected stream case'); 1384 } 1385 }, 1386 postMessage: function postMessage(message, transfers) { 1387 if (transfers && this.postMessageTransfers) { 1388 this.comObj.postMessage(message, transfers); 1389 } else { 1390 this.comObj.postMessage(message); 1391 } 1392 }, 1393 destroy: function destroy() { 1394 this.comObj.removeEventListener('message', this._onComObjOnMessage); 1395 } 1396}; 1397function loadJpegStream(id, imageUrl, objs) { 1398 var img = new Image(); 1399 img.onload = function loadJpegStream_onloadClosure() { 1400 objs.resolve(id, img); 1401 }; 1402 img.onerror = function loadJpegStream_onerrorClosure() { 1403 objs.resolve(id, null); 1404 warn('Error during JPEG image loading'); 1405 }; 1406 img.src = imageUrl; 1407} 1408exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX; 1409exports.IDENTITY_MATRIX = IDENTITY_MATRIX; 1410exports.OPS = OPS; 1411exports.VERBOSITY_LEVELS = VERBOSITY_LEVELS; 1412exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; 1413exports.AnnotationBorderStyleType = AnnotationBorderStyleType; 1414exports.AnnotationFieldFlag = AnnotationFieldFlag; 1415exports.AnnotationFlag = AnnotationFlag; 1416exports.AnnotationType = AnnotationType; 1417exports.FontType = FontType; 1418exports.ImageKind = ImageKind; 1419exports.CMapCompressionType = CMapCompressionType; 1420exports.AbortException = AbortException; 1421exports.InvalidPDFException = InvalidPDFException; 1422exports.MessageHandler = MessageHandler; 1423exports.MissingDataException = MissingDataException; 1424exports.MissingPDFException = MissingPDFException; 1425exports.NativeImageDecoding = NativeImageDecoding; 1426exports.NotImplementedException = NotImplementedException; 1427exports.PageViewport = PageViewport; 1428exports.PasswordException = PasswordException; 1429exports.PasswordResponses = PasswordResponses; 1430exports.StatTimer = StatTimer; 1431exports.StreamType = StreamType; 1432exports.TextRenderingMode = TextRenderingMode; 1433exports.UnexpectedResponseException = UnexpectedResponseException; 1434exports.UnknownErrorException = UnknownErrorException; 1435exports.Util = Util; 1436exports.XRefParseException = XRefParseException; 1437exports.FormatError = FormatError; 1438exports.arrayByteLength = arrayByteLength; 1439exports.arraysToBytes = arraysToBytes; 1440exports.assert = assert; 1441exports.bytesToString = bytesToString; 1442exports.createBlob = createBlob; 1443exports.createPromiseCapability = createPromiseCapability; 1444exports.createObjectURL = createObjectURL; 1445exports.deprecated = deprecated; 1446exports.getLookupTableFactory = getLookupTableFactory; 1447exports.getVerbosityLevel = getVerbosityLevel; 1448exports.info = info; 1449exports.isArrayBuffer = isArrayBuffer; 1450exports.isBool = isBool; 1451exports.isEmptyObj = isEmptyObj; 1452exports.isNum = isNum; 1453exports.isString = isString; 1454exports.isSpace = isSpace; 1455exports.isNodeJS = isNodeJS; 1456exports.isSameOrigin = isSameOrigin; 1457exports.createValidAbsoluteUrl = createValidAbsoluteUrl; 1458exports.isLittleEndian = isLittleEndian; 1459exports.isEvalSupported = isEvalSupported; 1460exports.loadJpegStream = loadJpegStream; 1461exports.log2 = log2; 1462exports.readInt8 = readInt8; 1463exports.readUint16 = readUint16; 1464exports.readUint32 = readUint32; 1465exports.removeNullCharacters = removeNullCharacters; 1466exports.ReadableStream = _streams_polyfill.ReadableStream; 1467exports.setVerbosityLevel = setVerbosityLevel; 1468exports.shadow = shadow; 1469exports.string32 = string32; 1470exports.stringToBytes = stringToBytes; 1471exports.stringToPDFString = stringToPDFString; 1472exports.stringToUTF8String = stringToUTF8String; 1473exports.utf8StringToString = utf8StringToString; 1474exports.warn = warn; 1475exports.unreachable = unreachable; 1476 1477/***/ }), 1478/* 1 */ 1479/***/ (function(module, exports, __w_pdfjs_require__) { 1480 1481"use strict"; 1482 1483 1484var store = __w_pdfjs_require__(51)('wks'); 1485var uid = __w_pdfjs_require__(14); 1486var _Symbol = __w_pdfjs_require__(3).Symbol; 1487var USE_SYMBOL = typeof _Symbol == 'function';
1488var $exports = module.exports = function (name) { 1489 return store[name] || (store[name] = USE_SYMBOL && _Symbol[name] || (USE_SYMBOL ? _Symbol : uid)('Symbol.' + name)); 1490}; 1491$exports.store = store; 1492 1493/***/ }), 1494/* 2 */ 1495/***/ (function(module, exports, __w_pdfjs_require__) { 1496 1497"use strict"; 1498 1499 1500Object.defineProperty(exports, "__esModule", { 1501 value: true 1502}); 1503 1504var _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; }; 1505 1506var EOF = {}; 1507var Name = function NameClosure() { 1508 function Name(name) { 1509 this.name = name; 1510 } 1511 Name.prototype = {}; 1512 var nameCache = Object.create(null); 1513 Name.get = function Name_get(name) { 1514 var nameValue = nameCache[name]; 1515 return nameValue ? nameValue : nameCache[name] = new Name(name); 1516 }; 1517 return Name; 1518}(); 1519var Cmd = function CmdClosure() { 1520 function Cmd(cmd) { 1521 this.cmd = cmd; 1522 } 1523 Cmd.prototype = {}; 1524 var cmdCache = Object.create(null); 1525 Cmd.get = function Cmd_get(cmd) { 1526 var cmdValue = cmdCache[cmd]; 1527 return cmdValue ? cmdValue : cmdCache[cmd] = new Cmd(cmd); 1528 }; 1529 return Cmd; 1530}(); 1531var Dict = function DictClosure() { 1532 var nonSerializable = function nonSerializableClosure() { 1533 return nonSerializable; 1534 }; 1535 function Dict(xref) { 1536 this._map = Object.create(null); 1537 this.xref = xref; 1538 this.objId = null; 1539 this.suppressEncryption = false; 1540 this.__nonSerializable__ = nonSerializable; 1541 } 1542 Dict.prototype = { 1543 assignXref: function Dict_assignXref(newXref) { 1544 this.xref = newXref; 1545 }, 1546 get: function Dict_get(key1, key2, key3) { 1547 var value; 1548 var xref = this.xref, 1549 suppressEncryption = this.suppressEncryption; 1550 if (typeof (value = this._map[key1]) !== 'undefined' || key1 in this._map || typeof key2 === 'undefined') { 1551 return xref ? xref.fetchIfRef(value, suppressEncryption) : value; 1552 } 1553 if (typeof (value = this._map[key2]) !== 'undefined' || key2 in this._map || typeof key3 === 'undefined') { 1554 return xref ? xref.fetchIfRef(value, suppressEncryption) : value; 1555 } 1556 value = this._map[key3] || null; 1557 return xref ? xref.fetchIfRef(value, suppressEncryption) : value; 1558 }, 1559 getAsync: function Dict_getAsync(key1, key2, key3) { 1560 var value; 1561 var xref = this.xref, 1562 suppressEncryption = this.suppressEncryption; 1563 if (typeof (value = this._map[key1]) !== 'undefined' || key1 in this._map || typeof key2 === 'undefined') { 1564 if (xref) { 1565 return xref.fetchIfRefAsync(value, suppressEncryption); 1566 } 1567 return Promise.resolve(value); 1568 } 1569 if (typeof (value = this._map[key2]) !== 'undefined' || key2 in this._map || typeof key3 === 'undefined') { 1570 if (xref) { 1571 return xref.fetchIfRefAsync(value, suppressEncryption); 1572 } 1573 return Promise.resolve(value); 1574 } 1575 value = this._map[key3] || null; 1576 if (xref) { 1577 return xref.fetchIfRefAsync(value, suppressEncryption); 1578 } 1579 return Promise.resolve(value); 1580 }, 1581 getArray: function Dict_getArray(key1, key2, key3) { 1582 var value = this.get(key1, key2, key3); 1583 var xref = this.xref, 1584 suppressEncryption = this.suppressEncryption; 1585 if (!Array.isArray(value) || !xref) { 1586 return value; 1587 } 1588 value = value.slice(); 1589 for (var i = 0, ii = value.length; i < ii; i++) { 1590 if (!isRef(value[i])) { 1591 continue; 1592 } 1593 value[i] = xref.fetch(value[i], suppressEncryption); 1594 } 1595 return value; 1596 }, 1597 getRaw: function Dict_getRaw(key) { 1598 return this._map[key]; 1599 }, 1600 getKeys: function Dict_getKeys() { 1601 return Object.keys(this._map); 1602 }, 1603 set: function Dict_set(key, value) { 1604 this._map[key] = value; 1605 }, 1606 has: function Dict_has(key) { 1607 return key in this._map; 1608 }, 1609 forEach: function Dict_forEach(callback) { 1610 for (var key in this._map) { 1611 callback(key, this.get(key)); 1612 } 1613 } 1614 }; 1615 Dict.empty = new Dict(null); 1616 Dict.merge = function (xref, dictArray) { 1617 var mergedDict = new Dict(xref); 1618 for (var i = 0, ii = dictArray.length; i < ii; i++) { 1619 var dict = dictArray[i]; 1620 if (!isDict(dict)) { 1621 continue; 1622 } 1623 for (var keyName in dict._map) { 1624 if (mergedDict._map[keyName] !== undefined) { 1625 continue; 1626 } 1627 mergedDict._map[keyName] = dict._map[keyName]; 1628 } 1629 } 1630 return mergedDict; 1631 }; 1632 return Dict; 1633}(); 1634var Ref = function RefClosure() { 1635 function Ref(num, gen) { 1636 this.num = num; 1637 this.gen = gen; 1638 } 1639 Ref.prototype = { 1640 toString: function Ref_toString() { 1641 var str = this.num + 'R'; 1642 if (this.gen !== 0) { 1643 str += this.gen; 1644 } 1645 return str; 1646 } 1647 }; 1648 return Ref; 1649}(); 1650var RefSet = function RefSetClosure() { 1651 function RefSet() { 1652 this.dict = Object.create(null); 1653 } 1654 RefSet.prototype = { 1655 has: function RefSet_has(ref) { 1656 return ref.toString() in this.dict; 1657 }, 1658 put: function RefSet_put(ref) { 1659 this.dict[ref.toString()] = true; 1660 }, 1661 remove: function RefSet_remove(ref) { 1662 delete this.dict[ref.toString()]; 1663 } 1664 }; 1665 return RefSet; 1666}(); 1667var RefSetCache = function RefSetCacheClosure() { 1668 function RefSetCache() { 1669 this.dict = Object.create(null); 1670 } 1671 RefSetCache.prototype = { 1672 get: function RefSetCache_get(ref) { 1673 return this.dict[ref.toString()]; 1674 }, 1675 has: function RefSetCache_has(ref) { 1676 return ref.toString() in this.dict; 1677 }, 1678 put: function RefSetCache_put(ref, obj) { 1679 this.dict[ref.toString()] = obj; 1680 }, 1681 putAlias: function RefSetCache_putAlias(ref, aliasRef) { 1682 this.dict[ref.toString()] = this.get(aliasRef); 1683 },
1684 forEach: function RefSetCache_forEach(fn, thisArg) { 1685 for (var i in this.dict) { 1686 fn.call(thisArg, this.dict[i]); 1687 } 1688 }, 1689 clear: function RefSetCache_clear() { 1690 this.dict = Object.create(null); 1691 } 1692 }; 1693 return RefSetCache; 1694}(); 1695function isEOF(v) { 1696 return v === EOF; 1697} 1698function isName(v, name) { 1699 return v instanceof Name && (name === undefined || v.name === name); 1700} 1701function isCmd(v, cmd) { 1702 return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); 1703} 1704function isDict(v, type) { 1705 return v instanceof Dict && (type === undefined || isName(v.get('Type'), type)); 1706} 1707function isRef(v) { 1708 return v instanceof Ref; 1709} 1710function isRefsEqual(v1, v2) { 1711 return v1.num === v2.num && v1.gen === v2.gen; 1712} 1713function isStream(v) { 1714 return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' && v !== null && v.getBytes !== undefined; 1715} 1716exports.EOF = EOF; 1717exports.Cmd = Cmd; 1718exports.Dict = Dict; 1719exports.Name = Name; 1720exports.Ref = Ref; 1721exports.RefSet = RefSet; 1722exports.RefSetCache = RefSetCache; 1723exports.isEOF = isEOF; 1724exports.isCmd = isCmd; 1725exports.isDict = isDict; 1726exports.isName = isName; 1727exports.isRef = isRef; 1728exports.isRefsEqual = isRefsEqual; 1729exports.isStream = isStream; 1730 1731/***/ }), 1732/* 3 */ 1733/***/ (function(module, exports, __w_pdfjs_require__) { 1734 1735"use strict"; 1736 1737 1738var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); 1739if (typeof __g == 'number') __g = global; 1740 1741/***/ }), 1742/* 4 */ 1743/***/ (function(module, exports, __w_pdfjs_require__) { 1744 1745"use strict"; 1746 1747 1748var _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; }; 1749 1750module.exports = function (it) { 1751 return (typeof it === 'undefined' ? 'undefined' : _typeof(it)) === 'object' ? it !== null : typeof it === 'function'; 1752}; 1753 1754/***/ }), 1755/* 5 */ 1756/***/ (function(module, exports, __w_pdfjs_require__) { 1757 1758"use strict"; 1759 1760 1761Object.defineProperty(exports, "__esModule", { 1762 value: true 1763}); 1764exports.LZWStream = exports.StringStream = exports.StreamsSequenceStream = exports.Stream = exports.RunLengthStream = exports.PredictorStream = exports.NullStream = exports.JpxStream = exports.JpegStream = exports.Jbig2Stream = exports.FlateStream = exports.DecodeStream = exports.DecryptStream = exports.CCITTFaxStream = exports.AsciiHexStream = exports.Ascii85Stream = undefined; 1765 1766var _util = __w_pdfjs_require__(0); 1767 1768var _primitives = __w_pdfjs_require__(2); 1769 1770var _jbig = __w_pdfjs_require__(111); 1771 1772var _jpg = __w_pdfjs_require__(112); 1773 1774var _jpx = __w_pdfjs_require__(65); 1775 1776var Stream = function StreamClosure() { 1777 function Stream(arrayBuffer, start, length, dict) { 1778 this.bytes = arrayBuffer instanceof Uint8Array ? arrayBuffer : new Uint8Array(arrayBuffer); 1779 this.start = start || 0; 1780 this.pos = this.start; 1781 this.end = start + length || this.bytes.length; 1782 this.dict = dict; 1783 } 1784 Stream.prototype = { 1785 get length() { 1786 return this.end - this.start; 1787 }, 1788 get isEmpty() { 1789 return this.length === 0; 1790 }, 1791 getByte: function Stream_getByte() { 1792 if (this.pos >= this.end) { 1793 return -1; 1794 } 1795 return this.bytes[this.pos++]; 1796 }, 1797 getUint16: function Stream_getUint16() { 1798 var b0 = this.getByte(); 1799 var b1 = this.getByte(); 1800 if (b0 === -1 || b1 === -1) { 1801 return -1; 1802 } 1803 return (b0 << 8) + b1; 1804 }, 1805 getInt32: function Stream_getInt32() { 1806 var b0 = this.getByte(); 1807 var b1 = this.getByte(); 1808 var b2 = this.getByte(); 1809 var b3 = this.getByte(); 1810 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 1811 }, 1812 getBytes: function Stream_getBytes(length) { 1813 var bytes = this.bytes; 1814 var pos = this.pos; 1815 var strEnd = this.end; 1816 if (!length) { 1817 return bytes.subarray(pos, strEnd); 1818 } 1819 var end = pos + length; 1820 if (end > strEnd) { 1821 end = strEnd; 1822 } 1823 this.pos = end; 1824 return bytes.subarray(pos, end); 1825 }, 1826 peekByte: function Stream_peekByte() { 1827 var peekedByte = this.getByte(); 1828 this.pos--; 1829 return peekedByte; 1830 }, 1831 peekBytes: function Stream_peekBytes(length) { 1832 var bytes = this.getBytes(length); 1833 this.pos -= bytes.length; 1834 return bytes; 1835 }, 1836 skip: function Stream_skip(n) { 1837 if (!n) { 1838 n = 1; 1839 } 1840 this.pos += n; 1841 }, 1842 reset: function Stream_reset() { 1843 this.pos = this.start; 1844 }, 1845 moveStart: function Stream_moveStart() { 1846 this.start = this.pos; 1847 }, 1848 makeSubStream: function Stream_makeSubStream(start, length, dict) { 1849 return new Stream(this.bytes.buffer, start, length, dict); 1850 } 1851 }; 1852 return Stream; 1853}(); 1854var StringStream = function StringStreamClosure() { 1855 function StringStream(str) { 1856 var length = str.length; 1857 var bytes = new Uint8Array(length); 1858 for (var n = 0; n < length; ++n) { 1859 bytes[n] = str.charCodeAt(n); 1860 } 1861 Stream.call(this, bytes); 1862 } 1863 StringStream.prototype = Stream.prototype; 1864 return StringStream; 1865}(); 1866var DecodeStream = function DecodeStreamClosure() { 1867 var emptyBuffer = new Uint8Array(0); 1868 function DecodeStream(maybeMinBufferLength) { 1869 this.pos = 0; 1870 this.bufferLength = 0; 1871 this.eof = false;
vendor: 4,927 bytes, lines 1872-2017
1872 this.buffer = emptyBuffer; 1873 this.minBufferLength = 512; 1874 if (maybeMinBufferLength) { 1875 while (this.minBufferLength < maybeMinBufferLength) { 1876 this.minBufferLength *= 2; 1877 } 1878 } 1879 } 1880 DecodeStream.prototype = { 1881 get isEmpty() { 1882 while (!this.eof && this.bufferLength === 0) { 1883 this.readBlock(); 1884 } 1885 return this.bufferLength === 0; 1886 }, 1887 ensureBuffer: function DecodeStream_ensureBuffer(requested) { 1888 var buffer = this.buffer; 1889 if (requested <= buffer.byteLength) { 1890 return buffer; 1891 } 1892 var size = this.minBufferLength; 1893 while (size < requested) { 1894 size *= 2; 1895 } 1896 var buffer2 = new Uint8Array(size); 1897 buffer2.set(buffer); 1898 return this.buffer = buffer2; 1899 }, 1900 getByte: function DecodeStream_getByte() { 1901 var pos = this.pos; 1902 while (this.bufferLength <= pos) { 1903 if (this.eof) { 1904 return -1; 1905 } 1906 this.readBlock(); 1907 } 1908 return this.buffer[this.pos++]; 1909 }, 1910 getUint16: function DecodeStream_getUint16() { 1911 var b0 = this.getByte(); 1912 var b1 = this.getByte(); 1913 if (b0 === -1 || b1 === -1) { 1914 return -1; 1915 } 1916 return (b0 << 8) + b1; 1917 }, 1918 getInt32: function DecodeStream_getInt32() { 1919 var b0 = this.getByte(); 1920 var b1 = this.getByte(); 1921 var b2 = this.getByte(); 1922 var b3 = this.getByte(); 1923 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 1924 }, 1925 getBytes: function DecodeStream_getBytes(length) { 1926 var end, 1927 pos = this.pos; 1928 if (length) { 1929 this.ensureBuffer(pos + length); 1930 end = pos + length; 1931 while (!this.eof && this.bufferLength < end) { 1932 this.readBlock(); 1933 } 1934 var bufEnd = this.bufferLength; 1935 if (end > bufEnd) { 1936 end = bufEnd; 1937 } 1938 } else { 1939 while (!this.eof) { 1940 this.readBlock(); 1941 } 1942 end = this.bufferLength; 1943 } 1944 this.pos = end; 1945 return this.buffer.subarray(pos, end); 1946 }, 1947 peekByte: function DecodeStream_peekByte() { 1948 var peekedByte = this.getByte(); 1949 this.pos--; 1950 return peekedByte; 1951 }, 1952 peekBytes: function DecodeStream_peekBytes(length) { 1953 var bytes = this.getBytes(length); 1954 this.pos -= bytes.length; 1955 return bytes; 1956 }, 1957 makeSubStream: function DecodeStream_makeSubStream(start, length, dict) { 1958 var end = start + length; 1959 while (this.bufferLength <= end && !this.eof) { 1960 this.readBlock(); 1961 } 1962 return new Stream(this.buffer, start, length, dict); 1963 }, 1964 skip: function DecodeStream_skip(n) { 1965 if (!n) { 1966 n = 1; 1967 } 1968 this.pos += n; 1969 }, 1970 reset: function DecodeStream_reset() { 1971 this.pos = 0; 1972 }, 1973 getBaseStreams: function DecodeStream_getBaseStreams() { 1974 if (this.str && this.str.getBaseStreams) { 1975 return this.str.getBaseStreams(); 1976 } 1977 return []; 1978 } 1979 }; 1980 return DecodeStream; 1981}(); 1982var StreamsSequenceStream = function StreamsSequenceStreamClosure() { 1983 function StreamsSequenceStream(streams) { 1984 this.streams = streams; 1985 DecodeStream.call(this, null); 1986 } 1987 StreamsSequenceStream.prototype = Object.create(DecodeStream.prototype); 1988 StreamsSequenceStream.prototype.readBlock = function streamSequenceStreamReadBlock() { 1989 var streams = this.streams; 1990 if (streams.length === 0) { 1991 this.eof = true; 1992 return; 1993 } 1994 var stream = streams.shift(); 1995 var chunk = stream.getBytes(); 1996 var bufferLength = this.bufferLength; 1997 var newLength = bufferLength + chunk.length; 1998 var buffer = this.ensureBuffer(newLength); 1999 buffer.set(chunk, bufferLength); 2000 this.bufferLength = newLength; 2001 }; 2002 StreamsSequenceStream.prototype.getBaseStreams = function StreamsSequenceStream_getBaseStreams() { 2003 var baseStreams = []; 2004 for (var i = 0, ii = this.streams.length; i < ii; i++) { 2005 var stream = this.streams[i]; 2006 if (stream.getBaseStreams) { 2007 _util.Util.appendToArray(baseStreams, stream.getBaseStreams()); 2008 } 2009 } 2010 return baseStreams; 2011 }; 2012 return StreamsSequenceStream; 2013}(); 2014var FlateStream = function FlateStreamClosure() { 2015 var codeLenCodeMap = new Int32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); 2016 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]); 2017 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]);
2018 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,141 bytes, lines 2018-2164
20180x900f7, 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]; 2019 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]; 2020 function FlateStream(str, maybeLength) { 2021 this.str = str; 2022 this.dict = str.dict; 2023 var cmf = str.getByte(); 2024 var flg = str.getByte(); 2025 if (cmf === -1 || flg === -1) { 2026 throw new _util.FormatError('Invalid header in flate stream: ' + cmf + ', ' + flg); 2027 } 2028 if ((cmf & 0x0f) !== 0x08) { 2029 throw new _util.FormatError('Unknown compression method in flate stream: ' + cmf + ', ' + flg); 2030 } 2031 if (((cmf << 8) + flg) % 31 !== 0) { 2032 throw new _util.FormatError('Bad FCHECK in flate stream: ' + cmf + ', ' + flg); 2033 } 2034 if (flg & 0x20) { 2035 throw new _util.FormatError('FDICT bit set in flate stream: ' + cmf + ', ' + flg); 2036 } 2037 this.codeSize = 0; 2038 this.codeBuf = 0; 2039 DecodeStream.call(this, maybeLength); 2040 } 2041 FlateStream.prototype = Object.create(DecodeStream.prototype); 2042 FlateStream.prototype.getBits = function FlateStream_getBits(bits) { 2043 var str = this.str; 2044 var codeSize = this.codeSize; 2045 var codeBuf = this.codeBuf; 2046 var b; 2047 while (codeSize < bits) { 2048 if ((b = str.getByte()) === -1) { 2049 throw new _util.FormatError('Bad encoding in flate stream'); 2050 } 2051 codeBuf |= b << codeSize; 2052 codeSize += 8; 2053 } 2054 b = codeBuf & (1 << bits) - 1; 2055 this.codeBuf = codeBuf >> bits; 2056 this.codeSize = codeSize -= bits; 2057 return b; 2058 }; 2059 FlateStream.prototype.getCode = function FlateStream_getCode(table) { 2060 var str = this.str; 2061 var codes = table[0]; 2062 var maxLen = table[1]; 2063 var codeSize = this.codeSize; 2064 var codeBuf = this.codeBuf; 2065 var b; 2066 while (codeSize < maxLen) { 2067 if ((b = str.getByte()) === -1) { 2068 break; 2069 } 2070 codeBuf |= b << codeSize; 2071 codeSize += 8; 2072 } 2073 var code = codes[codeBuf & (1 << maxLen) - 1]; 2074 var codeLen = code >> 16; 2075 var codeVal = code & 0xffff; 2076 if (codeLen < 1 || codeSize < codeLen) { 2077 throw new _util.FormatError('Bad encoding in flate stream'); 2078 } 2079 this.codeBuf = codeBuf >> codeLen; 2080 this.codeSize = codeSize - codeLen; 2081 return codeVal; 2082 }; 2083 FlateStream.prototype.generateHuffmanTable = function flateStreamGenerateHuffmanTable(lengths) { 2084 var n = lengths.length; 2085 var maxLen = 0; 2086 var i; 2087 for (i = 0; i < n; ++i) { 2088 if (lengths[i] > maxLen) { 2089 maxLen = lengths[i]; 2090 } 2091 } 2092 var size = 1 << maxLen; 2093 var codes = new Int32Array(size); 2094 for (var len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) { 2095 for (var val = 0; val < n; ++val) { 2096 if (lengths[val] === len) { 2097 var code2 = 0; 2098 var t = code; 2099 for (i = 0; i < len; ++i) { 2100 code2 = code2 << 1 | t & 1; 2101 t >>= 1; 2102 } 2103 for (i = code2; i < size; i += skip) { 2104 codes[i] = len << 16 | val; 2105 } 2106 ++code; 2107 } 2108 } 2109 } 2110 return [codes, maxLen]; 2111 }; 2112 FlateStream.prototype.readBlock = function FlateStream_readBlock() { 2113 var buffer, len; 2114 var str = this.str; 2115 var hdr = this.getBits(3); 2116 if (hdr & 1) { 2117 this.eof = true; 2118 } 2119 hdr >>= 1; 2120 if (hdr === 0) { 2121 var b; 2122 if ((b = str.getByte()) === -1) { 2123 throw new _util.FormatError('Bad block header in flate stream'); 2124 } 2125 var blockLen = b; 2126 if ((b = str.getByte()) === -1) { 2127 throw new _util.FormatError('Bad block header in flate stream'); 2128 } 2129 blockLen |= b << 8; 2130 if ((b = str.getByte()) === -1) { 2131 throw new _util.FormatError('Bad block header in flate stream'); 2132 } 2133 var check = b; 2134 if ((b = str.getByte()) === -1) { 2135 throw new _util.FormatError('Bad block header in flate stream'); 2136 } 2137 check |= b << 8; 2138 if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) { 2139 throw new _util.FormatError('Bad uncompressed block length in flate stream'); 2140 } 2141 this.codeBuf = 0; 2142 this.codeSize = 0; 2143 var bufferLength = this.bufferLength; 2144 buffer = this.ensureBuffer(bufferLength + blockLen); 2145 var end = bufferLength + blockLen; 2146 this.bufferLength = end; 2147 if (blockLen === 0) { 2148 if (str.peekByte() === -1) { 2149 this.eof = true; 2150 } 2151 } else { 2152 for (var n = bufferLength; n < end; ++n) { 2153 if ((b = str.getByte()) === -1) { 2154 this.eof = true; 2155 break; 2156 } 2157 buffer[n] = b; 2158 } 2159 } 2160 return; 2161 } 2162 var litCodeTable; 2163 var distCodeTable; 2164 if (hdr === 1) {
vendor: 9,676 bytes, lines 2165-2472
2165 litCodeTable = fixedLitCodeTab; 2166 distCodeTable = fixedDistCodeTab; 2167 } else if (hdr === 2) { 2168 var numLitCodes = this.getBits(5) + 257; 2169 var numDistCodes = this.getBits(5) + 1; 2170 var numCodeLenCodes = this.getBits(4) + 4; 2171 var codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length); 2172 var i; 2173 for (i = 0; i < numCodeLenCodes; ++i) { 2174 codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3); 2175 } 2176 var codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths); 2177 len = 0; 2178 i = 0; 2179 var codes = numLitCodes + numDistCodes; 2180 var codeLengths = new Uint8Array(codes); 2181 var bitsLength, bitsOffset, what; 2182 while (i < codes) { 2183 var code = this.getCode(codeLenCodeTab); 2184 if (code === 16) { 2185 bitsLength = 2; 2186 bitsOffset = 3; 2187 what = len; 2188 } else if (code === 17) { 2189 bitsLength = 3; 2190 bitsOffset = 3; 2191 what = len = 0; 2192 } else if (code === 18) { 2193 bitsLength = 7; 2194 bitsOffset = 11; 2195 what = len = 0; 2196 } else { 2197 codeLengths[i++] = len = code; 2198 continue; 2199 } 2200 var repeatLength = this.getBits(bitsLength) + bitsOffset; 2201 while (repeatLength-- > 0) { 2202 codeLengths[i++] = what; 2203 } 2204 } 2205 litCodeTable = this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes)); 2206 distCodeTable = this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes)); 2207 } else { 2208 throw new _util.FormatError('Unknown block type in flate stream'); 2209 } 2210 buffer = this.buffer; 2211 var limit = buffer ? buffer.length : 0; 2212 var pos = this.bufferLength; 2213 while (true) { 2214 var code1 = this.getCode(litCodeTable); 2215 if (code1 < 256) { 2216 if (pos + 1 >= limit) { 2217 buffer = this.ensureBuffer(pos + 1); 2218 limit = buffer.length; 2219 } 2220 buffer[pos++] = code1; 2221 continue; 2222 } 2223 if (code1 === 256) { 2224 this.bufferLength = pos; 2225 return; 2226 } 2227 code1 -= 257; 2228 code1 = lengthDecode[code1]; 2229 var code2 = code1 >> 16; 2230 if (code2 > 0) { 2231 code2 = this.getBits(code2); 2232 } 2233 len = (code1 & 0xffff) + code2; 2234 code1 = this.getCode(distCodeTable); 2235 code1 = distDecode[code1]; 2236 code2 = code1 >> 16; 2237 if (code2 > 0) { 2238 code2 = this.getBits(code2); 2239 } 2240 var dist = (code1 & 0xffff) + code2; 2241 if (pos + len >= limit) { 2242 buffer = this.ensureBuffer(pos + len); 2243 limit = buffer.length; 2244 } 2245 for (var k = 0; k < len; ++k, ++pos) { 2246 buffer[pos] = buffer[pos - dist]; 2247 } 2248 } 2249 }; 2250 return FlateStream; 2251}(); 2252var PredictorStream = function PredictorStreamClosure() { 2253 function PredictorStream(str, maybeLength, params) { 2254 if (!(0, _primitives.isDict)(params)) { 2255 return str; 2256 } 2257 var predictor = this.predictor = params.get('Predictor') || 1; 2258 if (predictor <= 1) { 2259 return str; 2260 } 2261 if (predictor !== 2 && (predictor < 10 || predictor > 15)) { 2262 throw new _util.FormatError('Unsupported predictor: ' + predictor); 2263 } 2264 if (predictor === 2) { 2265 this.readBlock = this.readBlockTiff; 2266 } else { 2267 this.readBlock = this.readBlockPng; 2268 } 2269 this.str = str; 2270 this.dict = str.dict; 2271 var colors = this.colors = params.get('Colors') || 1; 2272 var bits = this.bits = params.get('BitsPerComponent') || 8; 2273 var columns = this.columns = params.get('Columns') || 1; 2274 this.pixBytes = colors * bits + 7 >> 3; 2275 this.rowBytes = columns * colors * bits + 7 >> 3; 2276 DecodeStream.call(this, maybeLength); 2277 return this; 2278 } 2279 PredictorStream.prototype = Object.create(DecodeStream.prototype); 2280 PredictorStream.prototype.readBlockTiff = function predictorStreamReadBlockTiff() { 2281 var rowBytes = this.rowBytes; 2282 var bufferLength = this.bufferLength; 2283 var buffer = this.ensureBuffer(bufferLength + rowBytes); 2284 var bits = this.bits; 2285 var colors = this.colors; 2286 var rawBytes = this.str.getBytes(rowBytes); 2287 this.eof = !rawBytes.length; 2288 if (this.eof) { 2289 return; 2290 } 2291 var inbuf = 0, 2292 outbuf = 0; 2293 var inbits = 0, 2294 outbits = 0; 2295 var pos = bufferLength; 2296 var i; 2297 if (bits === 1 && colors === 1) { 2298 for (i = 0; i < rowBytes; ++i) { 2299 var c = rawBytes[i] ^ inbuf; 2300 c ^= c >> 1; 2301 c ^= c >> 2; 2302 c ^= c >> 4; 2303 inbuf = (c & 1) << 7; 2304 buffer[pos++] = c; 2305 } 2306 } else if (bits === 8) { 2307 for (i = 0; i < colors; ++i) { 2308 buffer[pos++] = rawBytes[i]; 2309 } 2310 for (; i < rowBytes; ++i) { 2311 buffer[pos] = buffer[pos - colors] + rawBytes[i]; 2312 pos++; 2313 } 2314 } else if (bits === 16) { 2315 var bytesPerPixel = colors * 2; 2316 for (i = 0; i < bytesPerPixel; ++i) { 2317 buffer[pos++] = rawBytes[i]; 2318 } 2319 for (; i < rowBytes; i += 2) { 2320 var sum = ((rawBytes[i] & 0xFF) << 8) + (rawBytes[i + 1] & 0xFF) + ((buffer[pos - bytesPerPixel] & 0xFF) << 8) + (buffer[pos - bytesPerPixel + 1] & 0xFF); 2321 buffer[pos++] = sum >> 8 & 0xFF; 2322 buffer[pos++] = sum & 0xFF; 2323 } 2324 } else { 2325 var compArray = new Uint8Array(colors + 1); 2326 var bitMask = (1 << bits) - 1; 2327 var j = 0, 2328 k = bufferLength; 2329 var columns = this.columns; 2330 for (i = 0; i < columns; ++i) { 2331 for (var kk = 0; kk < colors; ++kk) { 2332 if (inbits < bits) { 2333 inbuf = inbuf << 8 | rawBytes[j++] & 0xFF; 2334 inbits += 8; 2335 } 2336 compArray[kk] = compArray[kk] + (inbuf >> inbits - bits) & bitMask; 2337 inbits -= bits; 2338 outbuf = outbuf << bits | compArray[kk]; 2339 outbits += bits; 2340 if (outbits >= 8) { 2341 buffer[k++] = outbuf >> outbits - 8 & 0xFF; 2342 outbits -= 8; 2343 } 2344 } 2345 } 2346 if (outbits > 0) { 2347 buffer[k++] = (outbuf << 8 - outbits) + (inbuf & (1 << 8 - outbits) - 1); 2348 } 2349 } 2350 this.bufferLength += rowBytes; 2351 }; 2352 PredictorStream.prototype.readBlockPng = function predictorStreamReadBlockPng() { 2353 var rowBytes = this.rowBytes; 2354 var pixBytes = this.pixBytes; 2355 var predictor = this.str.getByte(); 2356 var rawBytes = this.str.getBytes(rowBytes); 2357 this.eof = !rawBytes.length; 2358 if (this.eof) { 2359 return; 2360 } 2361 var bufferLength = this.bufferLength; 2362 var buffer = this.ensureBuffer(bufferLength + rowBytes); 2363 var prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength); 2364 if (prevRow.length === 0) { 2365 prevRow = new Uint8Array(rowBytes); 2366 } 2367 var i, 2368 j = bufferLength, 2369 up, 2370 c; 2371 switch (predictor) { 2372 case 0: 2373 for (i = 0; i < rowBytes; ++i) { 2374 buffer[j++] = rawBytes[i]; 2375 } 2376 break; 2377 case 1: 2378 for (i = 0; i < pixBytes; ++i) { 2379 buffer[j++] = rawBytes[i]; 2380 } 2381 for (; i < rowBytes; ++i) { 2382 buffer[j] = buffer[j - pixBytes] + rawBytes[i] & 0xFF; 2383 j++; 2384 } 2385 break; 2386 case 2: 2387 for (i = 0; i < rowBytes; ++i) { 2388 buffer[j++] = prevRow[i] + rawBytes[i] & 0xFF; 2389 } 2390 break; 2391 case 3: 2392 for (i = 0; i < pixBytes; ++i) { 2393 buffer[j++] = (prevRow[i] >> 1) + rawBytes[i]; 2394 } 2395 for (; i < rowBytes; ++i) { 2396 buffer[j] = (prevRow[i] + buffer[j - pixBytes] >> 1) + rawBytes[i] & 0xFF; 2397 j++; 2398 } 2399 break; 2400 case 4: 2401 for (i = 0; i < pixBytes; ++i) { 2402 up = prevRow[i]; 2403 c = rawBytes[i]; 2404 buffer[j++] = up + c; 2405 } 2406 for (; i < rowBytes; ++i) { 2407 up = prevRow[i]; 2408 var upLeft = prevRow[i - pixBytes]; 2409 var left = buffer[j - pixBytes]; 2410 var p = left + up - upLeft; 2411 var pa = p - left; 2412 if (pa < 0) { 2413 pa = -pa; 2414 } 2415 var pb = p - up; 2416 if (pb < 0) { 2417 pb = -pb; 2418 } 2419 var pc = p - upLeft; 2420 if (pc < 0) { 2421 pc = -pc; 2422 } 2423 c = rawBytes[i]; 2424 if (pa <= pb && pa <= pc) { 2425 buffer[j++] = left + c; 2426 } else if (pb <= pc) { 2427 buffer[j++] = up + c; 2428 } else { 2429 buffer[j++] = upLeft + c; 2430 } 2431 } 2432 break; 2433 default: 2434 throw new _util.FormatError('Unsupported predictor: ' + predictor); 2435 } 2436 this.bufferLength += rowBytes; 2437 }; 2438 return PredictorStream; 2439}(); 2440var JpegStream = function JpegStreamClosure() { 2441 function JpegStream(stream, maybeLength, dict, params) { 2442 var ch; 2443 while ((ch = stream.getByte()) !== -1) { 2444 if (ch === 0xFF) { 2445 stream.skip(-1); 2446 break; 2447 } 2448 } 2449 this.stream = stream; 2450 this.maybeLength = maybeLength; 2451 this.dict = dict; 2452 this.params = params; 2453 DecodeStream.call(this, maybeLength); 2454 } 2455 JpegStream.prototype = Object.create(DecodeStream.prototype); 2456 Object.defineProperty(JpegStream.prototype, 'bytes', { 2457 get: function JpegStream_bytes() { 2458 return (0, _util.shadow)(this, 'bytes', this.stream.getBytes(this.maybeLength)); 2459 }, 2460 configurable: true 2461 }); 2462 JpegStream.prototype.ensureBuffer = function JpegStream_ensureBuffer(req) { 2463 if (this.bufferLength) { 2464 return; 2465 } 2466 var jpegImage = new _jpg.JpegImage(); 2467 var decodeArr = this.dict.getArray('Decode', 'D'); 2468 if (this.forceRGB && Array.isArray(decodeArr)) { 2469 var bitsPerComponent = this.dict.get('BitsPerComponent') || 8; 2470 var decodeArrLength = decodeArr.length; 2471 var transform = new Int32Array(decodeArrLength); 2472 var transformNeeded = false;
2473 var maxValue = (1 << bitsPerComponent) - 1; 2474 for (var i = 0; i < decodeArrLength; i += 2) { 2475 transform[i] = (decodeArr[i + 1] - decodeArr[i]) * 256 | 0; 2476 transform[i + 1] = decodeArr[i] * maxValue | 0; 2477 if (transform[i] !== 256 || transform[i + 1] !== 0) { 2478 transformNeeded = true; 2479 } 2480 } 2481 if (transformNeeded) { 2482 jpegImage.decodeTransform = transform; 2483 } 2484 } 2485 if ((0, _primitives.isDict)(this.params)) { 2486 var colorTransform = this.params.get('ColorTransform'); 2487 if (Number.isInteger(colorTransform)) { 2488 jpegImage.colorTransform = colorTransform; 2489 } 2490 } 2491 jpegImage.parse(this.bytes); 2492 var data = jpegImage.getData(this.drawWidth, this.drawHeight, this.forceRGB); 2493 this.buffer = data; 2494 this.bufferLength = data.length; 2495 this.eof = true; 2496 }; 2497 JpegStream.prototype.getBytes = function JpegStream_getBytes(length) { 2498 this.ensureBuffer(); 2499 return this.buffer; 2500 }; 2501 JpegStream.prototype.getIR = function JpegStream_getIR(forceDataSchema) { 2502 return (0, _util.createObjectURL)(this.bytes, 'image/jpeg', forceDataSchema); 2503 }; 2504 return JpegStream; 2505}(); 2506var JpxStream = function JpxStreamClosure() { 2507 function JpxStream(stream, maybeLength, dict, params) { 2508 this.stream = stream; 2509 this.maybeLength = maybeLength; 2510 this.dict = dict; 2511 this.params = params; 2512 DecodeStream.call(this, maybeLength); 2513 } 2514 JpxStream.prototype = Object.create(DecodeStream.prototype); 2515 Object.defineProperty(JpxStream.prototype, 'bytes', { 2516 get: function JpxStream_bytes() { 2517 return (0, _util.shadow)(this, 'bytes', this.stream.getBytes(this.maybeLength)); 2518 }, 2519 configurable: true 2520 }); 2521 JpxStream.prototype.ensureBuffer = function JpxStream_ensureBuffer(req) { 2522 if (this.bufferLength) { 2523 return; 2524 } 2525 var jpxImage = new _jpx.JpxImage(); 2526 jpxImage.parse(this.bytes); 2527 var width = jpxImage.width; 2528 var height = jpxImage.height; 2529 var componentsCount = jpxImage.componentsCount; 2530 var tileCount = jpxImage.tiles.length; 2531 if (tileCount === 1) { 2532 this.buffer = jpxImage.tiles[0].items; 2533 } else { 2534 var data = new Uint8ClampedArray(width * height * componentsCount); 2535 for (var k = 0; k < tileCount; k++) { 2536 var tileComponents = jpxImage.tiles[k]; 2537 var tileWidth = tileComponents.width; 2538 var tileHeight = tileComponents.height; 2539 var tileLeft = tileComponents.left; 2540 var tileTop = tileComponents.top; 2541 var src = tileComponents.items; 2542 var srcPosition = 0; 2543 var dataPosition = (width * tileTop + tileLeft) * componentsCount; 2544 var imgRowSize = width * componentsCount; 2545 var tileRowSize = tileWidth * componentsCount; 2546 for (var j = 0; j < tileHeight; j++) { 2547 var rowBytes = src.subarray(srcPosition, srcPosition + tileRowSize); 2548 data.set(rowBytes, dataPosition); 2549 srcPosition += tileRowSize; 2550 dataPosition += imgRowSize; 2551 } 2552 } 2553 this.buffer = data; 2554 } 2555 this.bufferLength = this.buffer.length; 2556 this.eof = true; 2557 }; 2558 return JpxStream; 2559}(); 2560var Jbig2Stream = function Jbig2StreamClosure() { 2561 function Jbig2Stream(stream, maybeLength, dict, params) { 2562 this.stream = stream; 2563 this.maybeLength = maybeLength; 2564 this.dict = dict; 2565 this.params = params; 2566 DecodeStream.call(this, maybeLength); 2567 } 2568 Jbig2Stream.prototype = Object.create(DecodeStream.prototype); 2569 Object.defineProperty(Jbig2Stream.prototype, 'bytes', { 2570 get: function Jbig2Stream_bytes() { 2571 return (0, _util.shadow)(this, 'bytes', this.stream.getBytes(this.maybeLength)); 2572 }, 2573 configurable: true 2574 }); 2575 Jbig2Stream.prototype.ensureBuffer = function Jbig2Stream_ensureBuffer(req) { 2576 if (this.bufferLength) { 2577 return; 2578 } 2579 var jbig2Image = new _jbig.Jbig2Image(); 2580 var chunks = []; 2581 if ((0, _primitives.isDict)(this.params)) { 2582 var globalsStream = this.params.get('JBIG2Globals'); 2583 if ((0, _primitives.isStream)(globalsStream)) { 2584 var globals = globalsStream.getBytes(); 2585 chunks.push({ 2586 data: globals, 2587 start: 0, 2588 end: globals.length 2589 }); 2590 } 2591 } 2592 chunks.push({ 2593 data: this.bytes, 2594 start: 0, 2595 end: this.bytes.length 2596 }); 2597 var data = jbig2Image.parseChunks(chunks); 2598 var dataLength = data.length; 2599 for (var i = 0; i < dataLength; i++) { 2600 data[i] ^= 0xFF; 2601 } 2602 this.buffer = data; 2603 this.bufferLength = dataLength; 2604 this.eof = true; 2605 }; 2606 return Jbig2Stream; 2607}(); 2608var DecryptStream = function DecryptStreamClosure() { 2609 function DecryptStream(str, maybeLength, decrypt) { 2610 this.str = str; 2611 this.dict = str.dict; 2612 this.decrypt = decrypt; 2613 this.nextChunk = null; 2614 this.initialized = false;
vendor: 5,679 bytes, lines 2615-2810
2615 DecodeStream.call(this, maybeLength); 2616 } 2617 var chunkSize = 512; 2618 DecryptStream.prototype = Object.create(DecodeStream.prototype); 2619 DecryptStream.prototype.readBlock = function DecryptStream_readBlock() { 2620 var chunk; 2621 if (this.initialized) { 2622 chunk = this.nextChunk; 2623 } else { 2624 chunk = this.str.getBytes(chunkSize); 2625 this.initialized = true; 2626 } 2627 if (!chunk || chunk.length === 0) { 2628 this.eof = true; 2629 return; 2630 } 2631 this.nextChunk = this.str.getBytes(chunkSize); 2632 var hasMoreData = this.nextChunk && this.nextChunk.length > 0; 2633 var decrypt = this.decrypt; 2634 chunk = decrypt(chunk, !hasMoreData); 2635 var bufferLength = this.bufferLength; 2636 var i, 2637 n = chunk.length; 2638 var buffer = this.ensureBuffer(bufferLength + n); 2639 for (i = 0; i < n; i++) { 2640 buffer[bufferLength++] = chunk[i]; 2641 } 2642 this.bufferLength = bufferLength; 2643 }; 2644 return DecryptStream; 2645}(); 2646var Ascii85Stream = function Ascii85StreamClosure() { 2647 function Ascii85Stream(str, maybeLength) { 2648 this.str = str; 2649 this.dict = str.dict; 2650 this.input = new Uint8Array(5); 2651 if (maybeLength) { 2652 maybeLength = 0.8 * maybeLength; 2653 } 2654 DecodeStream.call(this, maybeLength); 2655 } 2656 Ascii85Stream.prototype = Object.create(DecodeStream.prototype); 2657 Ascii85Stream.prototype.readBlock = function Ascii85Stream_readBlock() { 2658 var TILDA_CHAR = 0x7E; 2659 var Z_LOWER_CHAR = 0x7A; 2660 var EOF = -1; 2661 var str = this.str; 2662 var c = str.getByte(); 2663 while ((0, _util.isSpace)(c)) { 2664 c = str.getByte(); 2665 } 2666 if (c === EOF || c === TILDA_CHAR) { 2667 this.eof = true; 2668 return; 2669 } 2670 var bufferLength = this.bufferLength, 2671 buffer; 2672 var i; 2673 if (c === Z_LOWER_CHAR) { 2674 buffer = this.ensureBuffer(bufferLength + 4); 2675 for (i = 0; i < 4; ++i) { 2676 buffer[bufferLength + i] = 0; 2677 } 2678 this.bufferLength += 4; 2679 } else { 2680 var input = this.input; 2681 input[0] = c; 2682 for (i = 1; i < 5; ++i) { 2683 c = str.getByte(); 2684 while ((0, _util.isSpace)(c)) { 2685 c = str.getByte(); 2686 } 2687 input[i] = c; 2688 if (c === EOF || c === TILDA_CHAR) { 2689 break; 2690 } 2691 } 2692 buffer = this.ensureBuffer(bufferLength + i - 1); 2693 this.bufferLength += i - 1; 2694 if (i < 5) { 2695 for (; i < 5; ++i) { 2696 input[i] = 0x21 + 84; 2697 } 2698 this.eof = true; 2699 } 2700 var t = 0; 2701 for (i = 0; i < 5; ++i) { 2702 t = t * 85 + (input[i] - 0x21); 2703 } 2704 for (i = 3; i >= 0; --i) { 2705 buffer[bufferLength + i] = t & 0xFF; 2706 t >>= 8; 2707 } 2708 } 2709 }; 2710 return Ascii85Stream; 2711}(); 2712var AsciiHexStream = function AsciiHexStreamClosure() { 2713 function AsciiHexStream(str, maybeLength) { 2714 this.str = str; 2715 this.dict = str.dict; 2716 this.firstDigit = -1; 2717 if (maybeLength) { 2718 maybeLength = 0.5 * maybeLength; 2719 } 2720 DecodeStream.call(this, maybeLength); 2721 } 2722 AsciiHexStream.prototype = Object.create(DecodeStream.prototype); 2723 AsciiHexStream.prototype.readBlock = function AsciiHexStream_readBlock() { 2724 var UPSTREAM_BLOCK_SIZE = 8000; 2725 var bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); 2726 if (!bytes.length) { 2727 this.eof = true; 2728 return; 2729 } 2730 var maxDecodeLength = bytes.length + 1 >> 1; 2731 var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); 2732 var bufferLength = this.bufferLength; 2733 var firstDigit = this.firstDigit; 2734 for (var i = 0, ii = bytes.length; i < ii; i++) { 2735 var ch = bytes[i], 2736 digit; 2737 if (ch >= 0x30 && ch <= 0x39) { 2738 digit = ch & 0x0F; 2739 } else if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { 2740 digit = (ch & 0x0F) + 9; 2741 } else if (ch === 0x3E) { 2742 this.eof = true; 2743 break; 2744 } else { 2745 continue; 2746 } 2747 if (firstDigit < 0) { 2748 firstDigit = digit; 2749 } else { 2750 buffer[bufferLength++] = firstDigit << 4 | digit; 2751 firstDigit = -1; 2752 } 2753 } 2754 if (firstDigit >= 0 && this.eof) { 2755 buffer[bufferLength++] = firstDigit << 4; 2756 firstDigit = -1; 2757 } 2758 this.firstDigit = firstDigit; 2759 this.bufferLength = bufferLength; 2760 }; 2761 return AsciiHexStream; 2762}(); 2763var RunLengthStream = function RunLengthStreamClosure() { 2764 function RunLengthStream(str, maybeLength) { 2765 this.str = str; 2766 this.dict = str.dict; 2767 DecodeStream.call(this, maybeLength); 2768 } 2769 RunLengthStream.prototype = Object.create(DecodeStream.prototype); 2770 RunLengthStream.prototype.readBlock = function RunLengthStream_readBlock() { 2771 var repeatHeader = this.str.getBytes(2); 2772 if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { 2773 this.eof = true; 2774 return; 2775 } 2776 var buffer; 2777 var bufferLength = this.bufferLength; 2778 var n = repeatHeader[0]; 2779 if (n < 128) { 2780 buffer = this.ensureBuffer(bufferLength + n + 1); 2781 buffer[bufferLength++] = repeatHeader[1]; 2782 if (n > 0) { 2783 var source = this.str.getBytes(n); 2784 buffer.set(source, bufferLength); 2785 bufferLength += n; 2786 } 2787 } else { 2788 n = 257 - n; 2789 var b = repeatHeader[1]; 2790 buffer = this.ensureBuffer(bufferLength + n + 1); 2791 for (var i = 0; i < n; i++) { 2792 buffer[bufferLength++] = b; 2793 } 2794 } 2795 this.bufferLength = bufferLength; 2796 }; 2797 return RunLengthStream; 2798}(); 2799var CCITTFaxStream = function CCITTFaxStreamClosure() { 2800 var ccittEOL = -2; 2801 var ccittEOF = -1; 2802 var twoDimPass = 0; 2803 var twoDimHoriz = 1; 2804 var twoDimVert0 = 2; 2805 var twoDimVertR1 = 3; 2806 var twoDimVertL1 = 4; 2807 var twoDimVertR2 = 5; 2808 var twoDimVertL2 = 6; 2809 var twoDimVertR3 = 7; 2810 var twoDimVertL3 = 8;
2811 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]]; 2812 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]]; 2813 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: 8,845 bytes, lines 2814-2969
2814 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]]; 2815 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]]; 2816 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]]; 2817 function CCITTFaxStream(str, maybeLength, params) { 2818 this.str = str; 2819 this.dict = str.dict; 2820 if (!(0, _primitives.isDict)(params)) { 2821 params = _primitives.Dict.empty; 2822 } 2823 this.encoding = params.get('K') || 0; 2824 this.eoline = params.get('EndOfLine') || false; 2825 this.byteAlign = params.get('EncodedByteAlign') || false; 2826 this.columns = params.get('Columns') || 1728; 2827 this.rows = params.get('Rows') || 0; 2828 var eoblock = params.get('EndOfBlock'); 2829 if (eoblock === null || eoblock === undefined) { 2830 eoblock = true; 2831 } 2832 this.eoblock = eoblock; 2833 this.black = params.get('BlackIs1') || false; 2834 this.codingLine = new Uint32Array(this.columns + 1); 2835 this.refLine = new Uint32Array(this.columns + 2); 2836 this.codingLine[0] = this.columns; 2837 this.codingPos = 0; 2838 this.row = 0; 2839 this.nextLine2D = this.encoding < 0; 2840 this.inputBits = 0; 2841 this.inputBuf = 0; 2842 this.outputBits = 0; 2843 this.rowsDone = false; 2844 var code1; 2845 while ((code1 = this.lookBits(12)) === 0) { 2846 this.eatBits(1); 2847 } 2848 if (code1 === 1) { 2849 this.eatBits(12); 2850 } 2851 if (this.encoding > 0) { 2852 this.nextLine2D = !this.lookBits(1); 2853 this.eatBits(1); 2854 } 2855 DecodeStream.call(this, maybeLength); 2856 } 2857 CCITTFaxStream.prototype = Object.create(DecodeStream.prototype); 2858 CCITTFaxStream.prototype.readBlock = function CCITTFaxStream_readBlock() { 2859 while (!this.eof) { 2860 var c = this.lookChar(); 2861 this.ensureBuffer(this.bufferLength + 1); 2862 this.buffer[this.bufferLength++] = c; 2863 } 2864 }; 2865 CCITTFaxStream.prototype.addPixels = function ccittFaxStreamAddPixels(a1, blackPixels) { 2866 var codingLine = this.codingLine; 2867 var codingPos = this.codingPos; 2868 if (a1 > codingLine[codingPos]) { 2869 if (a1 > this.columns) { 2870 (0, _util.info)('row is wrong length'); 2871 this.err = true; 2872 a1 = this.columns; 2873 } 2874 if (codingPos & 1 ^ blackPixels) { 2875 ++codingPos; 2876 } 2877 codingLine[codingPos] = a1; 2878 } 2879 this.codingPos = codingPos; 2880 }; 2881 CCITTFaxStream.prototype.addPixelsNeg = function ccittFaxStreamAddPixelsNeg(a1, blackPixels) { 2882 var codingLine = this.codingLine; 2883 var codingPos = this.codingPos; 2884 if (a1 > codingLine[codingPos]) { 2885 if (a1 > this.columns) { 2886 (0, _util.info)('row is wrong length'); 2887 this.err = true; 2888 a1 = this.columns; 2889 } 2890 if (codingPos & 1 ^ blackPixels) { 2891 ++codingPos; 2892 } 2893 codingLine[codingPos] = a1; 2894 } else if (a1 < codingLine[codingPos]) { 2895 if (a1 < 0) { 2896 (0, _util.info)('invalid code'); 2897 this.err = true; 2898 a1 = 0; 2899 } 2900 while (codingPos > 0 && a1 < codingLine[codingPos - 1]) { 2901 --codingPos; 2902 } 2903 codingLine[codingPos] = a1; 2904 } 2905 this.codingPos = codingPos; 2906 }; 2907 CCITTFaxStream.prototype.lookChar = function CCITTFaxStream_lookChar() { 2908 var refLine = this.refLine; 2909 var codingLine = this.codingLine; 2910 var columns = this.columns; 2911 var refPos, blackPixels, bits, i; 2912 if (this.outputBits === 0) { 2913 if (this.rowsDone) { 2914 this.eof = true; 2915 } 2916 if (this.eof) { 2917 return null; 2918 } 2919 this.err = false; 2920 var code1, code2, code3; 2921 if (this.nextLine2D) { 2922 for (i = 0; codingLine[i] < columns; ++i) { 2923 refLine[i] = codingLine[i]; 2924 } 2925 refLine[i++] = columns; 2926 refLine[i] = columns; 2927 codingLine[0] = 0; 2928 this.codingPos = 0; 2929 refPos = 0; 2930 blackPixels = 0; 2931 while (codingLine[this.codingPos] < columns) { 2932 code1 = this.getTwoDimCode(); 2933 switch (code1) { 2934 case twoDimPass: 2935 this.addPixels(refLine[refPos + 1], blackPixels); 2936 if (refLine[refPos + 1] < columns) { 2937 refPos += 2; 2938 } 2939 break; 2940 case twoDimHoriz: 2941 code1 = code2 = 0; 2942 if (blackPixels) { 2943 do { 2944 code1 += code3 = this.getBlackCode(); 2945 } while (code3 >= 64); 2946 do { 2947 code2 += code3 = this.getWhiteCode(); 2948 } while (code3 >= 64); 2949 } else { 2950 do { 2951 code1 += code3 = this.getWhiteCode(); 2952 } while (code3 >= 64); 2953 do { 2954 code2 += code3 = this.getBlackCode(); 2955 } while (code3 >= 64); 2956 } 2957 this.addPixels(codingLine[this.codingPos] + code1, blackPixels); 2958 if (codingLine[this.codingPos] < columns) { 2959 this.addPixels(codingLine[this.codingPos] + code2, blackPixels ^ 1); 2960 } 2961 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 2962 refPos += 2; 2963 } 2964 break; 2965 case twoDimVertR3: 2966 this.addPixels(refLine[refPos] + 3, blackPixels); 2967 blackPixels ^= 1; 2968 if (codingLine[this.codingPos] < columns) { 2969 ++refPos;
vendor: 5,753 bytes, lines 2970-3147
2970 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 2971 refPos += 2; 2972 } 2973 } 2974 break; 2975 case twoDimVertR2: 2976 this.addPixels(refLine[refPos] + 2, blackPixels); 2977 blackPixels ^= 1; 2978 if (codingLine[this.codingPos] < columns) { 2979 ++refPos; 2980 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 2981 refPos += 2; 2982 } 2983 } 2984 break; 2985 case twoDimVertR1: 2986 this.addPixels(refLine[refPos] + 1, blackPixels); 2987 blackPixels ^= 1; 2988 if (codingLine[this.codingPos] < columns) { 2989 ++refPos; 2990 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 2991 refPos += 2; 2992 } 2993 } 2994 break; 2995 case twoDimVert0: 2996 this.addPixels(refLine[refPos], blackPixels); 2997 blackPixels ^= 1; 2998 if (codingLine[this.codingPos] < columns) { 2999 ++refPos; 3000 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 3001 refPos += 2; 3002 } 3003 } 3004 break; 3005 case twoDimVertL3: 3006 this.addPixelsNeg(refLine[refPos] - 3, blackPixels); 3007 blackPixels ^= 1; 3008 if (codingLine[this.codingPos] < columns) { 3009 if (refPos > 0) { 3010 --refPos; 3011 } else { 3012 ++refPos; 3013 } 3014 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 3015 refPos += 2; 3016 } 3017 } 3018 break; 3019 case twoDimVertL2: 3020 this.addPixelsNeg(refLine[refPos] - 2, blackPixels); 3021 blackPixels ^= 1; 3022 if (codingLine[this.codingPos] < columns) { 3023 if (refPos > 0) { 3024 --refPos; 3025 } else { 3026 ++refPos; 3027 } 3028 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 3029 refPos += 2; 3030 } 3031 } 3032 break; 3033 case twoDimVertL1: 3034 this.addPixelsNeg(refLine[refPos] - 1, blackPixels); 3035 blackPixels ^= 1; 3036 if (codingLine[this.codingPos] < columns) { 3037 if (refPos > 0) { 3038 --refPos; 3039 } else { 3040 ++refPos; 3041 } 3042 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 3043 refPos += 2; 3044 } 3045 } 3046 break; 3047 case ccittEOF: 3048 this.addPixels(columns, 0); 3049 this.eof = true; 3050 break; 3051 default: 3052 (0, _util.info)('bad 2d code'); 3053 this.addPixels(columns, 0); 3054 this.err = true; 3055 } 3056 } 3057 } else { 3058 codingLine[0] = 0; 3059 this.codingPos = 0; 3060 blackPixels = 0; 3061 while (codingLine[this.codingPos] < columns) { 3062 code1 = 0; 3063 if (blackPixels) { 3064 do { 3065 code1 += code3 = this.getBlackCode(); 3066 } while (code3 >= 64); 3067 } else { 3068 do { 3069 code1 += code3 = this.getWhiteCode(); 3070 } while (code3 >= 64); 3071 } 3072 this.addPixels(codingLine[this.codingPos] + code1, blackPixels); 3073 blackPixels ^= 1; 3074 } 3075 } 3076 var gotEOL = false; 3077 if (this.byteAlign) { 3078 this.inputBits &= ~7; 3079 } 3080 if (!this.eoblock && this.row === this.rows - 1) { 3081 this.rowsDone = true; 3082 } else { 3083 code1 = this.lookBits(12); 3084 if (this.eoline) { 3085 while (code1 !== ccittEOF && code1 !== 1) { 3086 this.eatBits(1); 3087 code1 = this.lookBits(12); 3088 } 3089 } else { 3090 while (code1 === 0) { 3091 this.eatBits(1); 3092 code1 = this.lookBits(12); 3093 } 3094 } 3095 if (code1 === 1) { 3096 this.eatBits(12); 3097 gotEOL = true; 3098 } else if (code1 === ccittEOF) { 3099 this.eof = true; 3100 } 3101 } 3102 if (!this.eof && this.encoding > 0 && !this.rowsDone) { 3103 this.nextLine2D = !this.lookBits(1); 3104 this.eatBits(1); 3105 } 3106 if (this.eoblock && gotEOL && this.byteAlign) { 3107 code1 = this.lookBits(12); 3108 if (code1 === 1) { 3109 this.eatBits(12); 3110 if (this.encoding > 0) { 3111 this.lookBits(1); 3112 this.eatBits(1); 3113 } 3114 if (this.encoding >= 0) { 3115 for (i = 0; i < 4; ++i) { 3116 code1 = this.lookBits(12); 3117 if (code1 !== 1) { 3118 (0, _util.info)('bad rtc code: ' + code1); 3119 } 3120 this.eatBits(12); 3121 if (this.encoding > 0) { 3122 this.lookBits(1); 3123 this.eatBits(1); 3124 } 3125 } 3126 } 3127 this.eof = true; 3128 } 3129 } else if (this.err && this.eoline) { 3130 while (true) { 3131 code1 = this.lookBits(13); 3132 if (code1 === ccittEOF) { 3133 this.eof = true; 3134 return null; 3135 } 3136 if (code1 >> 1 === 1) { 3137 break; 3138 } 3139 this.eatBits(1); 3140 } 3141 this.eatBits(12); 3142 if (this.encoding > 0) { 3143 this.eatBits(1); 3144 this.nextLine2D = !(code1 & 1); 3145 } 3146 } 3147 if (codingLine[0] > 0) {
vendor: 7,240 bytes, lines 3148-3391
3148 this.outputBits = codingLine[this.codingPos = 0]; 3149 } else { 3150 this.outputBits = codingLine[this.codingPos = 1]; 3151 } 3152 this.row++; 3153 } 3154 var c; 3155 if (this.outputBits >= 8) { 3156 c = this.codingPos & 1 ? 0 : 0xFF; 3157 this.outputBits -= 8; 3158 if (this.outputBits === 0 && codingLine[this.codingPos] < columns) { 3159 this.codingPos++; 3160 this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; 3161 } 3162 } else { 3163 bits = 8; 3164 c = 0; 3165 do { 3166 if (this.outputBits > bits) { 3167 c <<= bits; 3168 if (!(this.codingPos & 1)) { 3169 c |= 0xFF >> 8 - bits; 3170 } 3171 this.outputBits -= bits; 3172 bits = 0; 3173 } else { 3174 c <<= this.outputBits; 3175 if (!(this.codingPos & 1)) { 3176 c |= 0xFF >> 8 - this.outputBits; 3177 } 3178 bits -= this.outputBits; 3179 this.outputBits = 0; 3180 if (codingLine[this.codingPos] < columns) { 3181 this.codingPos++; 3182 this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; 3183 } else if (bits > 0) { 3184 c <<= bits; 3185 bits = 0; 3186 } 3187 } 3188 } while (bits); 3189 } 3190 if (this.black) { 3191 c ^= 0xFF; 3192 } 3193 return c; 3194 }; 3195 CCITTFaxStream.prototype.findTableCode = function ccittFaxStreamFindTableCode(start, end, table, limit) { 3196 var limitValue = limit || 0; 3197 for (var i = start; i <= end; ++i) { 3198 var code = this.lookBits(i); 3199 if (code === ccittEOF) { 3200 return [true, 1, false]; 3201 } 3202 if (i < end) { 3203 code <<= end - i; 3204 } 3205 if (!limitValue || code >= limitValue) { 3206 var p = table[code - limitValue]; 3207 if (p[0] === i) { 3208 this.eatBits(i); 3209 return [true, p[1], true]; 3210 } 3211 } 3212 } 3213 return [false, 0, false]; 3214 }; 3215 CCITTFaxStream.prototype.getTwoDimCode = function ccittFaxStreamGetTwoDimCode() { 3216 var code = 0; 3217 var p; 3218 if (this.eoblock) { 3219 code = this.lookBits(7); 3220 p = twoDimTable[code]; 3221 if (p && p[0] > 0) { 3222 this.eatBits(p[0]); 3223 return p[1]; 3224 } 3225 } else { 3226 var result = this.findTableCode(1, 7, twoDimTable); 3227 if (result[0] && result[2]) { 3228 return result[1]; 3229 } 3230 } 3231 (0, _util.info)('Bad two dim code'); 3232 return ccittEOF; 3233 }; 3234 CCITTFaxStream.prototype.getWhiteCode = function ccittFaxStreamGetWhiteCode() { 3235 var code = 0; 3236 var p; 3237 if (this.eoblock) { 3238 code = this.lookBits(12); 3239 if (code === ccittEOF) { 3240 return 1; 3241 } 3242 if (code >> 5 === 0) { 3243 p = whiteTable1[code]; 3244 } else { 3245 p = whiteTable2[code >> 3]; 3246 } 3247 if (p[0] > 0) { 3248 this.eatBits(p[0]); 3249 return p[1]; 3250 } 3251 } else { 3252 var result = this.findTableCode(1, 9, whiteTable2); 3253 if (result[0]) { 3254 return result[1]; 3255 } 3256 result = this.findTableCode(11, 12, whiteTable1); 3257 if (result[0]) { 3258 return result[1]; 3259 } 3260 } 3261 (0, _util.info)('bad white code'); 3262 this.eatBits(1); 3263 return 1; 3264 }; 3265 CCITTFaxStream.prototype.getBlackCode = function ccittFaxStreamGetBlackCode() { 3266 var code, p; 3267 if (this.eoblock) { 3268 code = this.lookBits(13); 3269 if (code === ccittEOF) { 3270 return 1; 3271 } 3272 if (code >> 7 === 0) { 3273 p = blackTable1[code]; 3274 } else if (code >> 9 === 0 && code >> 7 !== 0) { 3275 p = blackTable2[(code >> 1) - 64]; 3276 } else { 3277 p = blackTable3[code >> 7]; 3278 } 3279 if (p[0] > 0) { 3280 this.eatBits(p[0]); 3281 return p[1]; 3282 } 3283 } else { 3284 var result = this.findTableCode(2, 6, blackTable3); 3285 if (result[0]) { 3286 return result[1]; 3287 } 3288 result = this.findTableCode(7, 12, blackTable2, 64); 3289 if (result[0]) { 3290 return result[1]; 3291 } 3292 result = this.findTableCode(10, 13, blackTable1); 3293 if (result[0]) { 3294 return result[1]; 3295 } 3296 } 3297 (0, _util.info)('bad black code'); 3298 this.eatBits(1); 3299 return 1; 3300 }; 3301 CCITTFaxStream.prototype.lookBits = function CCITTFaxStream_lookBits(n) { 3302 var c; 3303 while (this.inputBits < n) { 3304 if ((c = this.str.getByte()) === -1) { 3305 if (this.inputBits === 0) { 3306 return ccittEOF; 3307 } 3308 return this.inputBuf << n - this.inputBits & 0xFFFF >> 16 - n; 3309 } 3310 this.inputBuf = this.inputBuf << 8 | c; 3311 this.inputBits += 8; 3312 } 3313 return this.inputBuf >> this.inputBits - n & 0xFFFF >> 16 - n; 3314 }; 3315 CCITTFaxStream.prototype.eatBits = function CCITTFaxStream_eatBits(n) { 3316 if ((this.inputBits -= n) < 0) { 3317 this.inputBits = 0; 3318 } 3319 }; 3320 return CCITTFaxStream; 3321}(); 3322var LZWStream = function LZWStreamClosure() { 3323 function LZWStream(str, maybeLength, earlyChange) { 3324 this.str = str; 3325 this.dict = str.dict; 3326 this.cachedData = 0; 3327 this.bitsCached = 0; 3328 var maxLzwDictionarySize = 4096; 3329 var lzwState = { 3330 earlyChange: earlyChange, 3331 codeLength: 9, 3332 nextCode: 258, 3333 dictionaryValues: new Uint8Array(maxLzwDictionarySize), 3334 dictionaryLengths: new Uint16Array(maxLzwDictionarySize), 3335 dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize), 3336 currentSequence: new Uint8Array(maxLzwDictionarySize), 3337 currentSequenceLength: 0 3338 }; 3339 for (var i = 0; i < 256; ++i) { 3340 lzwState.dictionaryValues[i] = i; 3341 lzwState.dictionaryLengths[i] = 1; 3342 } 3343 this.lzwState = lzwState; 3344 DecodeStream.call(this, maybeLength); 3345 } 3346 LZWStream.prototype = Object.create(DecodeStream.prototype); 3347 LZWStream.prototype.readBits = function LZWStream_readBits(n) { 3348 var bitsCached = this.bitsCached; 3349 var cachedData = this.cachedData; 3350 while (bitsCached < n) { 3351 var c = this.str.getByte(); 3352 if (c === -1) { 3353 this.eof = true; 3354 return null; 3355 } 3356 cachedData = cachedData << 8 | c; 3357 bitsCached += 8; 3358 } 3359 this.bitsCached = bitsCached -= n; 3360 this.cachedData = cachedData; 3361 this.lastCode = null; 3362 return cachedData >>> bitsCached & (1 << n) - 1; 3363 }; 3364 LZWStream.prototype.readBlock = function LZWStream_readBlock() { 3365 var blockSize = 512; 3366 var estimatedDecodedSize = blockSize * 2, 3367 decodedSizeDelta = blockSize; 3368 var i, j, q; 3369 var lzwState = this.lzwState; 3370 if (!lzwState) { 3371 return; 3372 } 3373 var earlyChange = lzwState.earlyChange; 3374 var nextCode = lzwState.nextCode; 3375 var dictionaryValues = lzwState.dictionaryValues; 3376 var dictionaryLengths = lzwState.dictionaryLengths; 3377 var dictionaryPrevCodes = lzwState.dictionaryPrevCodes; 3378 var codeLength = lzwState.codeLength; 3379 var prevCode = lzwState.prevCode; 3380 var currentSequence = lzwState.currentSequence; 3381 var currentSequenceLength = lzwState.currentSequenceLength; 3382 var decodedLength = 0; 3383 var currentBufferLength = this.bufferLength; 3384 var buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); 3385 for (i = 0; i < blockSize; i++) { 3386 var code = this.readBits(codeLength); 3387 var hasPrev = currentSequenceLength > 0; 3388 if (code < 256) { 3389 currentSequence[0] = code; 3390 currentSequenceLength = 1; 3391 } else if (code >= 258) {
3392 if (code < nextCode) { 3393 currentSequenceLength = dictionaryLengths[code]; 3394 for (j = currentSequenceLength - 1, q = code; j >= 0; j--) { 3395 currentSequence[j] = dictionaryValues[q]; 3396 q = dictionaryPrevCodes[q]; 3397 } 3398 } else { 3399 currentSequence[currentSequenceLength++] = currentSequence[0]; 3400 } 3401 } else if (code === 256) { 3402 codeLength = 9; 3403 nextCode = 258; 3404 currentSequenceLength = 0; 3405 continue; 3406 } else { 3407 this.eof = true; 3408 delete this.lzwState; 3409 break; 3410 } 3411 if (hasPrev) { 3412 dictionaryPrevCodes[nextCode] = prevCode; 3413 dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1; 3414 dictionaryValues[nextCode] = currentSequence[0]; 3415 nextCode++; 3416 codeLength = nextCode + earlyChange & nextCode + earlyChange - 1 ? codeLength : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0; 3417 } 3418 prevCode = code; 3419 decodedLength += currentSequenceLength; 3420 if (estimatedDecodedSize < decodedLength) { 3421 do { 3422 estimatedDecodedSize += decodedSizeDelta; 3423 } while (estimatedDecodedSize < decodedLength); 3424 buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); 3425 } 3426 for (j = 0; j < currentSequenceLength; j++) { 3427 buffer[currentBufferLength++] = currentSequence[j]; 3428 } 3429 } 3430 lzwState.nextCode = nextCode; 3431 lzwState.codeLength = codeLength; 3432 lzwState.prevCode = prevCode; 3433 lzwState.currentSequenceLength = currentSequenceLength; 3434 this.bufferLength = currentBufferLength; 3435 }; 3436 return LZWStream; 3437}(); 3438var NullStream = function NullStreamClosure() { 3439 function NullStream() { 3440 Stream.call(this, new Uint8Array(0)); 3441 } 3442 NullStream.prototype = Stream.prototype; 3443 return NullStream; 3444}(); 3445exports.Ascii85Stream = Ascii85Stream; 3446exports.AsciiHexStream = AsciiHexStream; 3447exports.CCITTFaxStream = CCITTFaxStream; 3448exports.DecryptStream = DecryptStream; 3449exports.DecodeStream = DecodeStream; 3450exports.FlateStream = FlateStream; 3451exports.Jbig2Stream = Jbig2Stream; 3452exports.JpegStream = JpegStream; 3453exports.JpxStream = JpxStream; 3454exports.NullStream = NullStream; 3455exports.PredictorStream = PredictorStream; 3456exports.RunLengthStream = RunLengthStream; 3457exports.Stream = Stream; 3458exports.StreamsSequenceStream = StreamsSequenceStream; 3459exports.StringStream = StringStream; 3460exports.LZWStream = LZWStream; 3461 3462/***/ }), 3463/* 6 */ 3464/***/ (function(module, exports, __w_pdfjs_require__) { 3465 3466"use strict"; 3467 3468 3469var dP = __w_pdfjs_require__(12); 3470var createDesc = __w_pdfjs_require__(23); 3471module.exports = __w_pdfjs_require__(8) ? function (object, key, value) { 3472 return dP.f(object, key, createDesc(1, value)); 3473} : function (object, key, value) { 3474 object[key] = value; 3475 return object; 3476}; 3477 3478/***/ }), 3479/* 7 */ 3480/***/ (function(module, exports, __w_pdfjs_require__) { 3481 3482"use strict"; 3483 3484 3485var hasOwnProperty = {}.hasOwnProperty; 3486module.exports = function (it, key) { 3487 return hasOwnProperty.call(it, key); 3488}; 3489 3490/***/ }), 3491/* 8 */ 3492/***/ (function(module, exports, __w_pdfjs_require__) { 3493 3494"use strict"; 3495 3496 3497module.exports = !__w_pdfjs_require__(9)(function () { 3498 return Object.defineProperty({}, 'a', { 3499 get: function get() { 3500 return 7; 3501 } 3502 }).a != 7; 3503}); 3504 3505/***/ }), 3506/* 9 */ 3507/***/ (function(module, exports, __w_pdfjs_require__) { 3508 3509"use strict"; 3510 3511 3512module.exports = function (exec) { 3513 try { 3514 return !!exec(); 3515 } catch (e) { 3516 return true; 3517 } 3518}; 3519 3520/***/ }), 3521/* 10 */ 3522/***/ (function(module, exports, __w_pdfjs_require__) { 3523 3524"use strict"; 3525 3526 3527var isObject = __w_pdfjs_require__(4); 3528module.exports = function (it) { 3529 if (!isObject(it)) throw TypeError(it + ' is not an object!'); 3530 return it; 3531}; 3532 3533/***/ }), 3534/* 11 */ 3535/***/ (function(module, exports, __w_pdfjs_require__) { 3536 3537"use strict"; 3538 3539 3540var toInteger = __w_pdfjs_require__(20); 3541var min = Math.min; 3542module.exports = function (it) { 3543 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; 3544}; 3545 3546/***/ }), 3547/* 12 */ 3548/***/ (function(module, exports, __w_pdfjs_require__) { 3549 3550"use strict"; 3551 3552 3553var anObject = __w_pdfjs_require__(10); 3554var IE8_DOM_DEFINE = __w_pdfjs_require__(43); 3555var toPrimitive = __w_pdfjs_require__(31); 3556var dP = Object.defineProperty; 3557exports.f = __w_pdfjs_require__(8) ? Object.defineProperty : function defineProperty(O, P, Attributes) { 3558 anObject(O); 3559 P = toPrimitive(P, true); 3560 anObject(Attributes); 3561 if (IE8_DOM_DEFINE) try { 3562 return dP(O, P, Attributes); 3563 } catch (e) {} 3564 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); 3565 if ('value' in Attributes) O[P] = Attributes.value; 3566 return O; 3567}; 3568 3569/***/ }), 3570/* 13 */ 3571/***/ (function(module, exports, __w_pdfjs_require__) { 3572 3573"use strict"; 3574 3575 3576var global = __w_pdfjs_require__(3); 3577var hide = __w_pdfjs_require__(6); 3578var has = __w_pdfjs_require__(7); 3579var SRC = __w_pdfjs_require__(14)('src'); 3580var TO_STRING = 'toString'; 3581var $toString = Function[TO_STRING]; 3582var TPL = ('' + $toString).split(TO_STRING); 3583__w_pdfjs_require__(19).inspectSource = function (it) { 3584 return $toString.call(it); 3585}; 3586(module.exports = function (O, key, val, safe) { 3587 var isFunction = typeof val == 'function'; 3588 if (isFunction) has(val, 'name') || hide(val, 'name', key); 3589 if (O[key] === val) return; 3590 if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); 3591 if (O === global) { 3592 O[key] = val; 3593 } else if (!safe) { 3594 delete O[key]; 3595 hide(O, key, val); 3596 } else if (O[key]) { 3597 O[key] = val; 3598 } else { 3599 hide(O, key, val); 3600 } 3601})(Function.prototype, TO_STRING, function toString() { 3602 return typeof this == 'function' && this[SRC] || $toString.call(this); 3603}); 3604 3605/***/ }), 3606/* 14 */ 3607/***/ (function(module, exports, __w_pdfjs_require__) { 3608 3609"use strict"; 3610 3611 3612var id = 0; 3613var px = Math.random(); 3614module.exports = function (key) { 3615 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); 3616}; 3617 3618/***/ }), 3619/* 15 */ 3620/***/ (function(module, exports, __w_pdfjs_require__) { 3621 3622"use strict"; 3623 3624 3625var aFunction = __w_pdfjs_require__(32); 3626module.exports = function (fn, that, length) { 3627 aFunction(fn); 3628 if (that === undefined) return fn; 3629 switch (length) { 3630 case 1: 3631 return function (a) {
vendor: 4,407 bytes, lines 3632-3798
3632 return fn.call(that, a); 3633 }; 3634 case 2: 3635 return function (a, b) { 3636 return fn.call(that, a, b); 3637 }; 3638 case 3: 3639 return function (a, b, c) { 3640 return fn.call(that, a, b, c); 3641 }; 3642 } 3643 return function () { 3644 return fn.apply(that, arguments); 3645 }; 3646}; 3647 3648/***/ }), 3649/* 16 */ 3650/***/ (function(module, exports, __w_pdfjs_require__) { 3651 3652"use strict"; 3653 3654 3655var defined = __w_pdfjs_require__(49); 3656module.exports = function (it) { 3657 return Object(defined(it)); 3658}; 3659 3660/***/ }), 3661/* 17 */ 3662/***/ (function(module, exports, __w_pdfjs_require__) { 3663 3664"use strict"; 3665 3666 3667module.exports = {}; 3668 3669/***/ }), 3670/* 18 */ 3671/***/ (function(module, exports, __w_pdfjs_require__) { 3672 3673"use strict"; 3674 3675 3676var global = __w_pdfjs_require__(3); 3677var core = __w_pdfjs_require__(19); 3678var hide = __w_pdfjs_require__(6); 3679var redefine = __w_pdfjs_require__(13); 3680var ctx = __w_pdfjs_require__(15); 3681var PROTOTYPE = 'prototype'; 3682var $export = function $export(type, name, source) { 3683 var IS_FORCED = type & $export.F; 3684 var IS_GLOBAL = type & $export.G; 3685 var IS_STATIC = type & $export.S; 3686 var IS_PROTO = type & $export.P; 3687 var IS_BIND = type & $export.B; 3688 var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; 3689 var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); 3690 var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); 3691 var key, own, out, exp; 3692 if (IS_GLOBAL) source = name; 3693 for (key in source) { 3694 own = !IS_FORCED && target && target[key] !== undefined; 3695 out = (own ? target : source)[key]; 3696 exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; 3697 if (target) redefine(target, key, out, type & $export.U); 3698 if (exports[key] != out) hide(exports, key, exp); 3699 if (IS_PROTO && expProto[key] != out) expProto[key] = out; 3700 } 3701}; 3702global.core = core; 3703$export.F = 1; 3704$export.G = 2; 3705$export.S = 4; 3706$export.P = 8; 3707$export.B = 16; 3708$export.W = 32; 3709$export.U = 64; 3710$export.R = 128; 3711module.exports = $export; 3712 3713/***/ }), 3714/* 19 */ 3715/***/ (function(module, exports, __w_pdfjs_require__) { 3716 3717"use strict"; 3718 3719 3720var core = module.exports = { version: '2.5.1' }; 3721if (typeof __e == 'number') __e = core; 3722 3723/***/ }), 3724/* 20 */ 3725/***/ (function(module, exports, __w_pdfjs_require__) { 3726 3727"use strict"; 3728 3729 3730var ceil = Math.ceil; 3731var floor = Math.floor; 3732module.exports = function (it) { 3733 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); 3734}; 3735 3736/***/ }), 3737/* 21 */ 3738/***/ (function(module, exports, __w_pdfjs_require__) { 3739 3740"use strict"; 3741 3742 3743Object.defineProperty(exports, "__esModule", { 3744 value: true 3745}); 3746exports.ColorSpace = undefined; 3747 3748var _util = __w_pdfjs_require__(0); 3749 3750var _primitives = __w_pdfjs_require__(2); 3751 3752var ColorSpace = function ColorSpaceClosure() { 3753 function resizeRgbImage(src, bpc, w1, h1, w2, h2, alpha01, dest) { 3754 var COMPONENTS = 3; 3755 alpha01 = alpha01 !== 1 ? 0 : alpha01; 3756 var xRatio = w1 / w2; 3757 var yRatio = h1 / h2; 3758 var i, 3759 j, 3760 py, 3761 newIndex = 0, 3762 oldIndex; 3763 var xScaled = new Uint16Array(w2); 3764 var w1Scanline = w1 * COMPONENTS; 3765 for (i = 0; i < w2; i++) { 3766 xScaled[i] = Math.floor(i * xRatio) * COMPONENTS; 3767 } 3768 for (i = 0; i < h2; i++) { 3769 py = Math.floor(i * yRatio) * w1Scanline; 3770 for (j = 0; j < w2; j++) { 3771 oldIndex = py + xScaled[j]; 3772 dest[newIndex++] = src[oldIndex++]; 3773 dest[newIndex++] = src[oldIndex++]; 3774 dest[newIndex++] = src[oldIndex++]; 3775 newIndex += alpha01; 3776 } 3777 } 3778 } 3779 function ColorSpace() { 3780 throw new Error('should not call ColorSpace constructor'); 3781 } 3782 ColorSpace.prototype = { 3783 getRgb: function ColorSpace_getRgb(src, srcOffset) { 3784 var rgb = new Uint8Array(3); 3785 this.getRgbItem(src, srcOffset, rgb, 0); 3786 return rgb; 3787 }, 3788 getRgbItem: function ColorSpace_getRgbItem(src, srcOffset, dest, destOffset) { 3789 throw new Error('Should not call ColorSpace.getRgbItem'); 3790 }, 3791 getRgbBuffer: function ColorSpace_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 3792 throw new Error('Should not call ColorSpace.getRgbBuffer'); 3793 }, 3794 getOutputLength: function ColorSpace_getOutputLength(inputLength, alpha01) { 3795 throw new Error('Should not call ColorSpace.getOutputLength'); 3796 }, 3797 isPassthrough: function ColorSpace_isPassthrough(bits) { 3798 return false;
vendor: 8,737 bytes, lines 3799-4030
3799 }, 3800 fillRgb: function ColorSpace_fillRgb(dest, originalWidth, originalHeight, width, height, actualHeight, bpc, comps, alpha01) { 3801 var count = originalWidth * originalHeight; 3802 var rgbBuf = null; 3803 var numComponentColors = 1 << bpc; 3804 var needsResizing = originalHeight !== height || originalWidth !== width; 3805 var i, ii; 3806 if (this.isPassthrough(bpc)) { 3807 rgbBuf = comps; 3808 } else if (this.numComps === 1 && count > numComponentColors && this.name !== 'DeviceGray' && this.name !== 'DeviceRGB') { 3809 var allColors = bpc <= 8 ? new Uint8Array(numComponentColors) : new Uint16Array(numComponentColors); 3810 var key; 3811 for (i = 0; i < numComponentColors; i++) { 3812 allColors[i] = i; 3813 } 3814 var colorMap = new Uint8Array(numComponentColors * 3); 3815 this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, 0); 3816 var destPos, rgbPos; 3817 if (!needsResizing) { 3818 destPos = 0; 3819 for (i = 0; i < count; ++i) { 3820 key = comps[i] * 3; 3821 dest[destPos++] = colorMap[key]; 3822 dest[destPos++] = colorMap[key + 1]; 3823 dest[destPos++] = colorMap[key + 2]; 3824 destPos += alpha01; 3825 } 3826 } else { 3827 rgbBuf = new Uint8Array(count * 3); 3828 rgbPos = 0; 3829 for (i = 0; i < count; ++i) { 3830 key = comps[i] * 3; 3831 rgbBuf[rgbPos++] = colorMap[key]; 3832 rgbBuf[rgbPos++] = colorMap[key + 1]; 3833 rgbBuf[rgbPos++] = colorMap[key + 2]; 3834 } 3835 } 3836 } else { 3837 if (!needsResizing) { 3838 this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, alpha01); 3839 } else { 3840 rgbBuf = new Uint8Array(count * 3); 3841 this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, 0); 3842 } 3843 } 3844 if (rgbBuf) { 3845 if (needsResizing) { 3846 resizeRgbImage(rgbBuf, bpc, originalWidth, originalHeight, width, height, alpha01, dest); 3847 } else { 3848 rgbPos = 0; 3849 destPos = 0; 3850 for (i = 0, ii = width * actualHeight; i < ii; i++) { 3851 dest[destPos++] = rgbBuf[rgbPos++]; 3852 dest[destPos++] = rgbBuf[rgbPos++]; 3853 dest[destPos++] = rgbBuf[rgbPos++]; 3854 destPos += alpha01; 3855 } 3856 } 3857 } 3858 }, 3859 usesZeroToOneRange: true 3860 }; 3861 ColorSpace.parse = function (cs, xref, res, pdfFunctionFactory) { 3862 var IR = ColorSpace.parseToIR(cs, xref, res, pdfFunctionFactory); 3863 return ColorSpace.fromIR(IR, pdfFunctionFactory); 3864 }; 3865 ColorSpace.fromIR = function (IR, pdfFunctionFactory) { 3866 var name = Array.isArray(IR) ? IR[0] : IR; 3867 var whitePoint, blackPoint, gamma; 3868 switch (name) { 3869 case 'DeviceGrayCS': 3870 return this.singletons.gray; 3871 case 'DeviceRgbCS': 3872 return this.singletons.rgb; 3873 case 'DeviceCmykCS': 3874 return this.singletons.cmyk; 3875 case 'CalGrayCS': 3876 whitePoint = IR[1]; 3877 blackPoint = IR[2]; 3878 gamma = IR[3]; 3879 return new CalGrayCS(whitePoint, blackPoint, gamma); 3880 case 'CalRGBCS': 3881 whitePoint = IR[1]; 3882 blackPoint = IR[2]; 3883 gamma = IR[3]; 3884 var matrix = IR[4]; 3885 return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); 3886 case 'PatternCS': 3887 var basePatternCS = IR[1]; 3888 if (basePatternCS) { 3889 basePatternCS = ColorSpace.fromIR(basePatternCS, pdfFunctionFactory); 3890 } 3891 return new PatternCS(basePatternCS); 3892 case 'IndexedCS': 3893 var baseIndexedCS = IR[1]; 3894 var hiVal = IR[2]; 3895 var lookup = IR[3]; 3896 return new IndexedCS(ColorSpace.fromIR(baseIndexedCS, pdfFunctionFactory), hiVal, lookup); 3897 case 'AlternateCS': 3898 var numComps = IR[1]; 3899 var alt = IR[2]; 3900 var tintFnIR = IR[3]; 3901 return new AlternateCS(numComps, ColorSpace.fromIR(alt, pdfFunctionFactory), pdfFunctionFactory.createFromIR(tintFnIR)); 3902 case 'LabCS': 3903 whitePoint = IR[1]; 3904 blackPoint = IR[2]; 3905 var range = IR[3]; 3906 return new LabCS(whitePoint, blackPoint, range); 3907 default: 3908 throw new _util.FormatError('Unknown colorspace name: ' + name); 3909 } 3910 }; 3911 ColorSpace.parseToIR = function (cs, xref, res, pdfFunctionFactory) { 3912 if ((0, _primitives.isName)(cs)) { 3913 var colorSpaces = res.get('ColorSpace'); 3914 if ((0, _primitives.isDict)(colorSpaces)) { 3915 var refcs = colorSpaces.get(cs.name); 3916 if (refcs) { 3917 cs = refcs; 3918 } 3919 } 3920 } 3921 cs = xref.fetchIfRef(cs); 3922 if ((0, _primitives.isName)(cs)) { 3923 switch (cs.name) { 3924 case 'DeviceGray': 3925 case 'G': 3926 return 'DeviceGrayCS'; 3927 case 'DeviceRGB': 3928 case 'RGB': 3929 return 'DeviceRgbCS'; 3930 case 'DeviceCMYK': 3931 case 'CMYK': 3932 return 'DeviceCmykCS'; 3933 case 'Pattern': 3934 return ['PatternCS', null]; 3935 default: 3936 throw new _util.FormatError('unrecognized colorspace ' + cs.name); 3937 } 3938 } 3939 if (Array.isArray(cs)) { 3940 var mode = xref.fetchIfRef(cs[0]).name; 3941 var numComps, params, alt, whitePoint, blackPoint, gamma; 3942 switch (mode) { 3943 case 'DeviceGray': 3944 case 'G': 3945 return 'DeviceGrayCS'; 3946 case 'DeviceRGB': 3947 case 'RGB': 3948 return 'DeviceRgbCS'; 3949 case 'DeviceCMYK': 3950 case 'CMYK': 3951 return 'DeviceCmykCS'; 3952 case 'CalGray': 3953 params = xref.fetchIfRef(cs[1]); 3954 whitePoint = params.getArray('WhitePoint'); 3955 blackPoint = params.getArray('BlackPoint'); 3956 gamma = params.get('Gamma'); 3957 return ['CalGrayCS', whitePoint, blackPoint, gamma]; 3958 case 'CalRGB': 3959 params = xref.fetchIfRef(cs[1]); 3960 whitePoint = params.getArray('WhitePoint'); 3961 blackPoint = params.getArray('BlackPoint'); 3962 gamma = params.getArray('Gamma'); 3963 var matrix = params.getArray('Matrix'); 3964 return ['CalRGBCS', whitePoint, blackPoint, gamma, matrix]; 3965 case 'ICCBased': 3966 var stream = xref.fetchIfRef(cs[1]); 3967 var dict = stream.dict; 3968 numComps = dict.get('N'); 3969 alt = dict.get('Alternate'); 3970 if (alt) { 3971 var altIR = ColorSpace.parseToIR(alt, xref, res, pdfFunctionFactory); 3972 var altCS = ColorSpace.fromIR(altIR, pdfFunctionFactory); 3973 if (altCS.numComps === numComps) { 3974 return altIR; 3975 } 3976 (0, _util.warn)('ICCBased color space: Ignoring incorrect /Alternate entry.'); 3977 } 3978 if (numComps === 1) { 3979 return 'DeviceGrayCS'; 3980 } else if (numComps === 3) { 3981 return 'DeviceRgbCS'; 3982 } else if (numComps === 4) { 3983 return 'DeviceCmykCS'; 3984 } 3985 break; 3986 case 'Pattern': 3987 var basePatternCS = cs[1] || null; 3988 if (basePatternCS) { 3989 basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res, pdfFunctionFactory); 3990 } 3991 return ['PatternCS', basePatternCS]; 3992 case 'Indexed': 3993 case 'I': 3994 var baseIndexedCS = ColorSpace.parseToIR(cs[1], xref, res, pdfFunctionFactory); 3995 var hiVal = xref.fetchIfRef(cs[2]) + 1; 3996 var lookup = xref.fetchIfRef(cs[3]); 3997 if ((0, _primitives.isStream)(lookup)) { 3998 lookup = lookup.getBytes(); 3999 } 4000 return ['IndexedCS', baseIndexedCS, hiVal, lookup]; 4001 case 'Separation': 4002 case 'DeviceN': 4003 var name = xref.fetchIfRef(cs[1]); 4004 numComps = Array.isArray(name) ? name.length : 1; 4005 alt = ColorSpace.parseToIR(cs[2], xref, res, pdfFunctionFactory); 4006 var tintFnIR = pdfFunctionFactory.createIR(xref.fetchIfRef(cs[3])); 4007 return ['AlternateCS', numComps, alt, tintFnIR]; 4008 case 'Lab': 4009 params = xref.fetchIfRef(cs[1]); 4010 whitePoint = params.getArray('WhitePoint'); 4011 blackPoint = params.getArray('BlackPoint'); 4012 var range = params.getArray('Range'); 4013 return ['LabCS', whitePoint, blackPoint, range]; 4014 default: 4015 throw new _util.FormatError('unimplemented color space object "' + mode + '"'); 4016 } 4017 } 4018 throw new _util.FormatError('unrecognized color space object: "' + cs + '"'); 4019 }; 4020 ColorSpace.isDefaultDecode = function ColorSpace_isDefaultDecode(decode, n) { 4021 if (!Array.isArray(decode)) { 4022 return true; 4023 } 4024 if (n * 2 !== decode.length) { 4025 (0, _util.warn)('The decode map is not the correct length'); 4026 return true; 4027 } 4028 for (var i = 0, ii = decode.length; i < ii; i += 2) { 4029 if (decode[i] !== 0 || decode[i + 1] !== 1) { 4030 return false;
4031 } 4032 } 4033 return true; 4034 }; 4035 ColorSpace.singletons = { 4036 get gray() { 4037 return (0, _util.shadow)(this, 'gray', new DeviceGrayCS()); 4038 }, 4039 get rgb() { 4040 return (0, _util.shadow)(this, 'rgb', new DeviceRgbCS()); 4041 }, 4042 get cmyk() { 4043 return (0, _util.shadow)(this, 'cmyk', new DeviceCmykCS()); 4044 } 4045 }; 4046 return ColorSpace; 4047}(); 4048var AlternateCS = function AlternateCSClosure() { 4049 function AlternateCS(numComps, base, tintFn) { 4050 this.name = 'Alternate'; 4051 this.numComps = numComps; 4052 this.defaultColor = new Float32Array(numComps); 4053 for (var i = 0; i < numComps; ++i) { 4054 this.defaultColor[i] = 1; 4055 } 4056 this.base = base; 4057 this.tintFn = tintFn; 4058 this.tmpBuf = new Float32Array(base.numComps); 4059 } 4060 AlternateCS.prototype = { 4061 getRgb: ColorSpace.prototype.getRgb, 4062 getRgbItem: function AlternateCS_getRgbItem(src, srcOffset, dest, destOffset) { 4063 var tmpBuf = this.tmpBuf; 4064 this.tintFn(src, srcOffset, tmpBuf, 0); 4065 this.base.getRgbItem(tmpBuf, 0, dest, destOffset); 4066 }, 4067 getRgbBuffer: function AlternateCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 4068 var tintFn = this.tintFn; 4069 var base = this.base; 4070 var scale = 1 / ((1 << bits) - 1); 4071 var baseNumComps = base.numComps; 4072 var usesZeroToOneRange = base.usesZeroToOneRange; 4073 var isPassthrough = (base.isPassthrough(8) || !usesZeroToOneRange) && alpha01 === 0; 4074 var pos = isPassthrough ? destOffset : 0; 4075 var baseBuf = isPassthrough ? dest : new Uint8Array(baseNumComps * count); 4076 var numComps = this.numComps; 4077 var scaled = new Float32Array(numComps); 4078 var tinted = new Float32Array(baseNumComps); 4079 var i, j; 4080 for (i = 0; i < count; i++) { 4081 for (j = 0; j < numComps; j++) { 4082 scaled[j] = src[srcOffset++] * scale; 4083 } 4084 tintFn(scaled, 0, tinted, 0); 4085 if (usesZeroToOneRange) { 4086 for (j = 0; j < baseNumComps; j++) { 4087 baseBuf[pos++] = tinted[j] * 255; 4088 } 4089 } else { 4090 base.getRgbItem(tinted, 0, baseBuf, pos); 4091 pos += baseNumComps; 4092 } 4093 } 4094 if (!isPassthrough) { 4095 base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01); 4096 } 4097 }, 4098 getOutputLength: function AlternateCS_getOutputLength(inputLength, alpha01) { 4099 return this.base.getOutputLength(inputLength * this.base.numComps / this.numComps, alpha01); 4100 }, 4101 isPassthrough: ColorSpace.prototype.isPassthrough, 4102 fillRgb: ColorSpace.prototype.fillRgb, 4103 isDefaultDecode: function AlternateCS_isDefaultDecode(decodeMap) { 4104 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 4105 }, 4106 usesZeroToOneRange: true 4107 }; 4108 return AlternateCS; 4109}(); 4110var PatternCS = function PatternCSClosure() { 4111 function PatternCS(baseCS) { 4112 this.name = 'Pattern'; 4113 this.base = baseCS; 4114 } 4115 PatternCS.prototype = {}; 4116 return PatternCS; 4117}(); 4118var IndexedCS = function IndexedCSClosure() { 4119 function IndexedCS(base, highVal, lookup) { 4120 this.name = 'Indexed'; 4121 this.numComps = 1; 4122 this.defaultColor = new Uint8Array(this.numComps); 4123 this.base = base; 4124 this.highVal = highVal; 4125 var baseNumComps = base.numComps; 4126 var length = baseNumComps * highVal; 4127 if ((0, _primitives.isStream)(lookup)) { 4128 this.lookup = new Uint8Array(length); 4129 var bytes = lookup.getBytes(length); 4130 this.lookup.set(bytes); 4131 } else if ((0, _util.isString)(lookup)) { 4132 this.lookup = new Uint8Array(length); 4133 for (var i = 0; i < length; ++i) { 4134 this.lookup[i] = lookup.charCodeAt(i); 4135 } 4136 } else if (lookup instanceof Uint8Array || lookup instanceof Array) { 4137 this.lookup = lookup; 4138 } else { 4139 throw new _util.FormatError('Unrecognized lookup table: ' + lookup); 4140 } 4141 } 4142 IndexedCS.prototype = { 4143 getRgb: ColorSpace.prototype.getRgb, 4144 getRgbItem: function IndexedCS_getRgbItem(src, srcOffset, dest, destOffset) { 4145 var numComps = this.base.numComps; 4146 var start = src[srcOffset] * numComps; 4147 this.base.getRgbBuffer(this.lookup, start, 1, dest, destOff
4147set, 8, 0); 4148 }, 4149 getRgbBuffer: function IndexedCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 4150 var base = this.base; 4151 var numComps = base.numComps; 4152 var outputDelta = base.getOutputLength(numComps, alpha01); 4153 var lookup = this.lookup; 4154 for (var i = 0; i < count; ++i) { 4155 var lookupPos = src[srcOffset++] * numComps; 4156 base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01); 4157 destOffset += outputDelta; 4158 } 4159 }, 4160 getOutputLength: function IndexedCS_getOutputLength(inputLength, alpha01) { 4161 return this.base.getOutputLength(inputLength * this.base.numComps, alpha01); 4162 }, 4163 isPassthrough: ColorSpace.prototype.isPassthrough, 4164 fillRgb: ColorSpace.prototype.fillRgb, 4165 isDefaultDecode: function IndexedCS_isDefaultDecode(decodeMap) { 4166 return true; 4167 }, 4168 usesZeroToOneRange: true 4169 }; 4170 return IndexedCS; 4171}(); 4172var DeviceGrayCS = function DeviceGrayCSClosure() { 4173 function DeviceGrayCS() { 4174 this.name = 'DeviceGray'; 4175 this.numComps = 1; 4176 this.defaultColor = new Float32Array(this.numComps); 4177 } 4178 DeviceGrayCS.prototype = { 4179 getRgb: ColorSpace.prototype.getRgb, 4180 getRgbItem: function DeviceGrayCS_getRgbItem(src, srcOffset, dest, destOffset) { 4181 var c = src[srcOffset] * 255 | 0; 4182 c = c < 0 ? 0 : c > 255 ? 255 : c; 4183 dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c; 4184 }, 4185 getRgbBuffer: function DeviceGrayCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 4186 var scale = 255 / ((1 << bits) - 1); 4187 var j = srcOffset, 4188 q = destOffset; 4189 for (var i = 0; i < count; ++i) { 4190 var c = scale * src[j++] | 0; 4191 dest[q++] = c; 4192 dest[q++] = c; 4193 dest[q++] = c; 4194 q += alpha01; 4195 } 4196 }, 4197 getOutputLength: function DeviceGrayCS_getOutputLength(inputLength, alpha01) { 4198 return inputLength * (3 + alpha01); 4199 }, 4200 isPassthrough: ColorSpace.prototype.isPassthrough, 4201 fillRgb: ColorSpace.prototype.fillRgb, 4202 isDefaultDecode: function DeviceGrayCS_isDefaultDecode(decodeMap) { 4203 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 4204 }, 4205 usesZeroToOneRange: true 4206 }; 4207 return DeviceGrayCS; 4208}(); 4209var DeviceRgbCS = function DeviceRgbCSClosure() { 4210 function DeviceRgbCS() { 4211 this.name = 'DeviceRGB'; 4212 this.numComps = 3; 4213 this.defaultColor = new Float32Array(this.numComps); 4214 } 4215 DeviceRgbCS.prototype = { 4216 getRgb: ColorSpace.prototype.getRgb, 4217 getRgbItem: function DeviceRgbCS_getRgbItem(src, srcOffset, dest, destOffset) { 4218 var r = src[srcOffset] * 255 | 0; 4219 var g = src[srcOffset + 1] * 255 | 0; 4220 var b = src[srcOffset + 2] * 255 | 0; 4221 dest[destOffset] = r < 0 ? 0 : r > 255 ? 255 : r; 4222 dest[destOffset + 1] = g < 0 ? 0 : g > 255 ? 255 : g; 4223 dest[destOffset + 2] = b < 0 ? 0 : b > 255 ? 255 : b; 4224 }, 4225 getRgbBuffer: function DeviceRgbCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 4226 if (bits === 8 && alpha01 === 0) { 4227 dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset); 4228 return; 4229 } 4230 var scale = 255 / ((1 << bits) - 1); 4231 var j = srcOffset, 4232 q = destOffset; 4233 for (var i = 0; i < count; ++i) { 4234 dest[q++] = scale * src[j++] | 0; 4235 dest[q++] = scale * src[j++] | 0; 4236 dest[q++] = scale * src[j++] | 0; 4237 q += alpha01; 4238 } 4239 }, 4240 getOutputLength: function DeviceRgbCS_getOutputLength(inputLength, alpha01) { 4241 return inputLength * (3 + alpha01) / 3 | 0; 4242 }, 4243 isPassthrough: function DeviceRgbCS_isPassthrough(bits) { 4244 return bits === 8; 4245 }, 4246 fillRgb: ColorSpace.prototype.fillRgb, 4247 isDefaultDecode: function DeviceRgbCS_isDefaultDecode(decodeMap) { 4248 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 4249 }, 4250 usesZeroToOneRange: true 4251 }; 4252 return DeviceRgbCS; 4253}(); 4254var DeviceCmykCS = function DeviceCmykCSClosure() { 4255 function convertToRgb(src, srcOffset, srcScale, dest, destOffset) { 4256 var c = src[srcOffset + 0] * srcScale; 4257 var m = src[srcOffset + 1] * srcScale; 4258 var y = src[srcOffset + 2] * srcScale; 4259 var k = src[srcOffset + 3] * srcScale; 4260 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,159 bytes, lines 4261-4346
4261 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; 4262 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; 4263 dest[destOffset] = r > 255 ? 255 : r < 0 ? 0 : r; 4264 dest[destOffset + 1] = g > 255 ? 255 : g < 0 ? 0 : g; 4265 dest[destOffset + 2] = b > 255 ? 255 : b < 0 ? 0 : b; 4266 } 4267 function DeviceCmykCS() { 4268 this.name = 'DeviceCMYK'; 4269 this.numComps = 4; 4270 this.defaultColor = new Float32Array(this.numComps); 4271 this.defaultColor[3] = 1; 4272 } 4273 DeviceCmykCS.prototype = { 4274 getRgb: ColorSpace.prototype.getRgb, 4275 getRgbItem: function DeviceCmykCS_getRgbItem(src, srcOffset, dest, destOffset) { 4276 convertToRgb(src, srcOffset, 1, dest, destOffset); 4277 }, 4278 getRgbBuffer: function DeviceCmykCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 4279 var scale = 1 / ((1 << bits) - 1); 4280 for (var i = 0; i < count; i++) { 4281 convertToRgb(src, srcOffset, scale, dest, destOffset); 4282 srcOffset += 4; 4283 destOffset += 3 + alpha01; 4284 } 4285 }, 4286 getOutputLength: function DeviceCmykCS_getOutputLength(inputLength, alpha01) { 4287 return inputLength / 4 * (3 + alpha01) | 0; 4288 }, 4289 isPassthrough: ColorSpace.prototype.isPassthrough, 4290 fillRgb: ColorSpace.prototype.fillRgb, 4291 isDefaultDecode: function DeviceCmykCS_isDefaultDecode(decodeMap) { 4292 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 4293 }, 4294 usesZeroToOneRange: true 4295 }; 4296 return DeviceCmykCS; 4297}(); 4298var CalGrayCS = function CalGrayCSClosure() { 4299 function CalGrayCS(whitePoint, blackPoint, gamma) { 4300 this.name = 'CalGray'; 4301 this.numComps = 1; 4302 this.defaultColor = new Float32Array(this.numComps); 4303 if (!whitePoint) { 4304 throw new _util.FormatError('WhitePoint missing - required for color space CalGray'); 4305 } 4306 blackPoint = blackPoint || [0, 0, 0]; 4307 gamma = gamma || 1; 4308 this.XW = whitePoint[0]; 4309 this.YW = whitePoint[1]; 4310 this.ZW = whitePoint[2]; 4311 this.XB = blackPoint[0]; 4312 this.YB = blackPoint[1]; 4313 this.ZB = blackPoint[2]; 4314 this.G = gamma; 4315 if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { 4316 throw new _util.FormatError('Invalid WhitePoint components for ' + this.name + ', no fallback available'); 4317 } 4318 if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { 4319 (0, _util.info)('Invalid BlackPoint for ' + this.name + ', falling back to default'); 4320 this.XB = this.YB = this.ZB = 0; 4321 } 4322 if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) { 4323 (0, _util.warn)(this.name + ', BlackPoint: XB: ' + this.XB + ', YB: ' + this.YB + ', ZB: ' + this.ZB + ', only default values are supported.'); 4324 } 4325 if (this.G < 1) { 4326 (0, _util.info)('Invalid Gamma: ' + this.G + ' for ' + this.name + ', falling back to default'); 4327 this.G = 1; 4328 } 4329 } 4330 function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { 4331 var A = src[srcOffset] * scale; 4332 var AG = Math.pow(A, cs.G); 4333 var L = cs.YW * AG; 4334 var val = Math.max(295.8 * Math.pow(L, 0.333333333333333333) - 40.8, 0) | 0; 4335 dest[destOffset] = val; 4336 dest[destOffset + 1] = val; 4337 dest[destOffset + 2] = val; 4338 } 4339 CalGrayCS.prototype = { 4340 getRgb: ColorSpace.prototype.getRgb, 4341 getRgbItem: function CalGrayCS_getRgbItem(src, srcOffset, dest, destOffset) { 4342 convertToRgb(this, src, srcOffset, dest, destOffset, 1); 4343 }, 4344 getRgbBuffer: function CalGrayCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 4345 var scale = 1 / ((1 << bits) - 1); 4346 for (var i = 0; i < count; ++i) {
vendor: 4,650 bytes, lines 4347-4454
4347 convertToRgb(this, src, srcOffset, dest, destOffset, scale); 4348 srcOffset += 1; 4349 destOffset += 3 + alpha01; 4350 } 4351 }, 4352 getOutputLength: function CalGrayCS_getOutputLength(inputLength, alpha01) { 4353 return inputLength * (3 + alpha01); 4354 }, 4355 isPassthrough: ColorSpace.prototype.isPassthrough, 4356 fillRgb: ColorSpace.prototype.fillRgb, 4357 isDefaultDecode: function CalGrayCS_isDefaultDecode(decodeMap) { 4358 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 4359 }, 4360 usesZeroToOneRange: true 4361 }; 4362 return CalGrayCS; 4363}(); 4364var CalRGBCS = function CalRGBCSClosure() { 4365 var BRADFORD_SCALE_MATRIX = new Float32Array([0.8951, 0.2664, -0.1614, -0.7502, 1.7135, 0.0367, 0.0389, -0.0685, 1.0296]); 4366 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]); 4367 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]); 4368 var FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]); 4369 var tempNormalizeMatrix = new Float32Array(3); 4370 var tempConvertMatrix1 = new Float32Array(3); 4371 var tempConvertMatrix2 = new Float32Array(3); 4372 var DECODE_L_CONSTANT = Math.pow((8 + 16) / 116, 3) / 8.0; 4373 function CalRGBCS(whitePoint, blackPoint, gamma, matrix) { 4374 this.name = 'CalRGB'; 4375 this.numComps = 3; 4376 this.defaultColor = new Float32Array(this.numComps); 4377 if (!whitePoint) { 4378 throw new _util.FormatError('WhitePoint missing - required for color space CalRGB'); 4379 } 4380 blackPoint = blackPoint || new Float32Array(3); 4381 gamma = gamma || new Float32Array([1, 1, 1]); 4382 matrix = matrix || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); 4383 var XW = whitePoint[0]; 4384 var YW = whitePoint[1]; 4385 var ZW = whitePoint[2]; 4386 this.whitePoint = whitePoint; 4387 var XB = blackPoint[0]; 4388 var YB = blackPoint[1]; 4389 var ZB = blackPoint[2]; 4390 this.blackPoint = blackPoint; 4391 this.GR = gamma[0]; 4392 this.GG = gamma[1]; 4393 this.GB = gamma[2]; 4394 this.MXA = matrix[0]; 4395 this.MYA = matrix[1]; 4396 this.MZA = matrix[2]; 4397 this.MXB = matrix[3]; 4398 this.MYB = matrix[4]; 4399 this.MZB = matrix[5]; 4400 this.MXC = matrix[6]; 4401 this.MYC = matrix[7]; 4402 this.MZC = matrix[8]; 4403 if (XW < 0 || ZW < 0 || YW !== 1) { 4404 throw new _util.FormatError('Invalid WhitePoint components for ' + this.name + ', no fallback available'); 4405 } 4406 if (XB < 0 || YB < 0 || ZB < 0) { 4407 (0, _util.info)('Invalid BlackPoint for ' + this.name + ' [' + XB + ', ' + YB + ', ' + ZB + '], falling back to default'); 4408 this.blackPoint = new Float32Array(3); 4409 } 4410 if (this.GR < 0 || this.GG < 0 || this.GB < 0) { 4411 (0, _util.info)('Invalid Gamma [' + this.GR + ', ' + this.GG + ', ' + this.GB + '] for ' + this.name + ', falling back to default'); 4412 this.GR = this.GG = this.GB = 1; 4413 } 4414 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) { 4415 (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'); 4416 this.MXA = this.MYB = this.MZC = 1; 4417 this.MXB = this.MYA = this.MZA = this.MXC = this.MYC = this.MZB = 0; 4418 } 4419 } 4420 function matrixProduct(a, b, result) { 4421 result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; 4422 result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2]; 4423 result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2]; 4424 } 4425 function convertToFlat(sourceWhitePoint, LMS, result) { 4426 result[0] = LMS[0] * 1 / sourceWhitePoint[0]; 4427 result[1] = LMS[1] * 1 / sourceWhitePoint[1]; 4428 result[2] = LMS[2] * 1 / sourceWhitePoint[2]; 4429 } 4430 function convertToD65(sourceWhitePoint, LMS, result) { 4431 var D65X = 0.95047; 4432 var D65Y = 1; 4433 var D65Z = 1.08883; 4434 result[0] = LMS[0] * D65X / sourceWhitePoint[0]; 4435 result[1] = LMS[1] * D65Y / sourceWhitePoint[1]; 4436 result[2] = LMS[2] * D65Z / sourceWhitePoint[2]; 4437 } 4438 function sRGBTransferFunction(color) { 4439 if (color <= 0.0031308) { 4440 return adjustToRange(0, 1, 12.92 * color); 4441 } 4442 return adjustToRange(0, 1, (1 + 0.055) * Math.pow(color, 1 / 2.4) - 0.055); 4443 } 4444 function adjustToRange(min, max, value) { 4445 return Math.max(min, Math.min(max, value)); 4446 } 4447 function decodeL(L) { 4448 if (L < 0) { 4449 return -decodeL(-L); 4450 } 4451 if (L > 8.0) { 4452 return Math.pow((L + 16) / 116, 3); 4453 } 4454 return L * DECODE_L_CONSTANT;
vendor: 5,552 bytes, lines 4455-4601
4455 } 4456 function compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) { 4457 if (sourceBlackPoint[0] === 0 && sourceBlackPoint[1] === 0 && sourceBlackPoint[2] === 0) { 4458 result[0] = XYZ_Flat[0]; 4459 result[1] = XYZ_Flat[1]; 4460 result[2] = XYZ_Flat[2]; 4461 return; 4462 } 4463 var zeroDecodeL = decodeL(0); 4464 var X_DST = zeroDecodeL; 4465 var X_SRC = decodeL(sourceBlackPoint[0]); 4466 var Y_DST = zeroDecodeL; 4467 var Y_SRC = decodeL(sourceBlackPoint[1]); 4468 var Z_DST = zeroDecodeL; 4469 var Z_SRC = decodeL(sourceBlackPoint[2]); 4470 var X_Scale = (1 - X_DST) / (1 - X_SRC); 4471 var X_Offset = 1 - X_Scale; 4472 var Y_Scale = (1 - Y_DST) / (1 - Y_SRC); 4473 var Y_Offset = 1 - Y_Scale; 4474 var Z_Scale = (1 - Z_DST) / (1 - Z_SRC); 4475 var Z_Offset = 1 - Z_Scale; 4476 result[0] = XYZ_Flat[0] * X_Scale + X_Offset; 4477 result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset; 4478 result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset; 4479 } 4480 function normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) { 4481 if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) { 4482 result[0] = XYZ_In[0]; 4483 result[1] = XYZ_In[1]; 4484 result[2] = XYZ_In[2]; 4485 return; 4486 } 4487 var LMS = result; 4488 matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); 4489 var LMS_Flat = tempNormalizeMatrix; 4490 convertToFlat(sourceWhitePoint, LMS, LMS_Flat); 4491 matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_Flat, result); 4492 } 4493 function normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) { 4494 var LMS = result; 4495 matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); 4496 var LMS_D65 = tempNormalizeMatrix; 4497 convertToD65(sourceWhitePoint, LMS, LMS_D65); 4498 matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_D65, result); 4499 } 4500 function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { 4501 var A = adjustToRange(0, 1, src[srcOffset] * scale); 4502 var B = adjustToRange(0, 1, src[srcOffset + 1] * scale); 4503 var C = adjustToRange(0, 1, src[srcOffset + 2] * scale); 4504 var AGR = Math.pow(A, cs.GR); 4505 var BGG = Math.pow(B, cs.GG); 4506 var CGB = Math.pow(C, cs.GB); 4507 var X = cs.MXA * AGR + cs.MXB * BGG + cs.MXC * CGB; 4508 var Y = cs.MYA * AGR + cs.MYB * BGG + cs.MYC * CGB; 4509 var Z = cs.MZA * AGR + cs.MZB * BGG + cs.MZC * CGB; 4510 var XYZ = tempConvertMatrix1; 4511 XYZ[0] = X; 4512 XYZ[1] = Y; 4513 XYZ[2] = Z; 4514 var XYZ_Flat = tempConvertMatrix2; 4515 normalizeWhitePointToFlat(cs.whitePoint, XYZ, XYZ_Flat); 4516 var XYZ_Black = tempConvertMatrix1; 4517 compensateBlackPoint(cs.blackPoint, XYZ_Flat, XYZ_Black); 4518 var XYZ_D65 = tempConvertMatrix2; 4519 normalizeWhitePointToD65(FLAT_WHITEPOINT_MATRIX, XYZ_Black, XYZ_D65); 4520 var SRGB = tempConvertMatrix1; 4521 matrixProduct(SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB); 4522 var sR = sRGBTransferFunction(SRGB[0]); 4523 var sG = sRGBTransferFunction(SRGB[1]); 4524 var sB = sRGBTransferFunction(SRGB[2]); 4525 dest[destOffset] = Math.round(sR * 255); 4526 dest[destOffset + 1] = Math.round(sG * 255); 4527 dest[destOffset + 2] = Math.round(sB * 255); 4528 } 4529 CalRGBCS.prototype = { 4530 getRgb: ColorSpace.prototype.getRgb, 4531 getRgbItem: function CalRGBCS_getRgbItem(src, srcOffset, dest, destOffset) { 4532 convertToRgb(this, src, srcOffset, dest, destOffset, 1); 4533 }, 4534 getRgbBuffer: function CalRGBCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 4535 var scale = 1 / ((1 << bits) - 1); 4536 for (var i = 0; i < count; ++i) { 4537 convertToRgb(this, src, srcOffset, dest, destOffset, scale); 4538 srcOffset += 3; 4539 destOffset += 3 + alpha01; 4540 } 4541 }, 4542 getOutputLength: function CalRGBCS_getOutputLength(inputLength, alpha01) { 4543 return inputLength * (3 + alpha01) / 3 | 0; 4544 }, 4545 isPassthrough: ColorSpace.prototype.isPassthrough, 4546 fillRgb: ColorSpace.prototype.fillRgb, 4547 isDefaultDecode: function CalRGBCS_isDefaultDecode(decodeMap) { 4548 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 4549 }, 4550 usesZeroToOneRange: true 4551 }; 4552 return CalRGBCS; 4553}(); 4554var LabCS = function LabCSClosure() { 4555 function LabCS(whitePoint, blackPoint, range) { 4556 this.name = 'Lab'; 4557 this.numComps = 3; 4558 this.defaultColor = new Float32Array(this.numComps); 4559 if (!whitePoint) { 4560 throw new _util.FormatError('WhitePoint missing - required for color space Lab'); 4561 } 4562 blackPoint = blackPoint || [0, 0, 0]; 4563 range = range || [-100, 100, -100, 100]; 4564 this.XW = whitePoint[0]; 4565 this.YW = whitePoint[1]; 4566 this.ZW = whitePoint[2]; 4567 this.amin = range[0]; 4568 this.amax = range[1]; 4569 this.bmin = range[2]; 4570 this.bmax = range[3]; 4571 this.XB = blackPoint[0]; 4572 this.YB = blackPoint[1]; 4573 this.ZB = blackPoint[2]; 4574 if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { 4575 throw new _util.FormatError('Invalid WhitePoint components, no fallback available'); 4576 } 4577 if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { 4578 (0, _util.info)('Invalid BlackPoint, falling back to default'); 4579 this.XB = this.YB = this.ZB = 0; 4580 } 4581 if (this.amin > this.amax || this.bmin > this.bmax) { 4582 (0, _util.info)('Invalid Range, falling back to defaults'); 4583 this.amin = -100; 4584 this.amax = 100; 4585 this.bmin = -100; 4586 this.bmax = 100; 4587 } 4588 } 4589 function fn_g(x) { 4590 var result; 4591 if (x >= 6 / 29) { 4592 result = x * x * x; 4593 } else { 4594 result = 108 / 841 * (x - 4 / 29); 4595 } 4596 return result; 4597 } 4598 function decode(value, high1, low2, high2) { 4599 return low2 + value * (high2 - low2) / high1; 4600 } 4601 function convertToRgb(cs, src, srcOffset, maxVal, dest, destOff
vendor: 9,800 bytes, lines 4601-4671
4601set) { 4602 var Ls = src[srcOffset]; 4603 var as = src[srcOffset + 1]; 4604 var bs = src[srcOffset + 2]; 4605 if (maxVal !== false) { 4606 Ls = decode(Ls, maxVal, 0, 100); 4607 as = decode(as, maxVal, cs.amin, cs.amax); 4608 bs = decode(bs, maxVal, cs.bmin, cs.bmax); 4609 } 4610 as = as > cs.amax ? cs.amax : as < cs.amin ? cs.amin : as; 4611 bs = bs > cs.bmax ? cs.bmax : bs < cs.bmin ? cs.bmin : bs; 4612 var M = (Ls + 16) / 116; 4613 var L = M + as / 500; 4614 var N = M - bs / 200; 4615 var X = cs.XW * fn_g(L); 4616 var Y = cs.YW * fn_g(M); 4617 var Z = cs.ZW * fn_g(N); 4618 var r, g, b; 4619 if (cs.ZW < 1) { 4620 r = X * 3.1339 + Y * -1.6170 + Z * -0.4906; 4621 g = X * -0.9785 + Y * 1.9160 + Z * 0.0333; 4622 b = X * 0.0720 + Y * -0.2290 + Z * 1.4057; 4623 } else { 4624 r = X * 3.2406 + Y * -1.5372 + Z * -0.4986; 4625 g = X * -0.9689 + Y * 1.8758 + Z * 0.0415; 4626 b = X * 0.0557 + Y * -0.2040 + Z * 1.0570; 4627 } 4628 dest[destOffset] = r <= 0 ? 0 : r >= 1 ? 255 : Math.sqrt(r) * 255 | 0; 4629 dest[destOffset + 1] = g <= 0 ? 0 : g >= 1 ? 255 : Math.sqrt(g) * 255 | 0; 4630 dest[destOffset + 2] = b <= 0 ? 0 : b >= 1 ? 255 : Math.sqrt(b) * 255 | 0; 4631 } 4632 LabCS.prototype = { 4633 getRgb: ColorSpace.prototype.getRgb, 4634 getRgbItem: function LabCS_getRgbItem(src, srcOffset, dest, destOffset) { 4635 convertToRgb(this, src, srcOffset, false, dest, destOffset); 4636 }, 4637 getRgbBuffer: function LabCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 4638 var maxVal = (1 << bits) - 1; 4639 for (var i = 0; i < count; i++) { 4640 convertToRgb(this, src, srcOffset, maxVal, dest, destOffset); 4641 srcOffset += 3; 4642 destOffset += 3 + alpha01; 4643 } 4644 }, 4645 getOutputLength: function LabCS_getOutputLength(inputLength, alpha01) { 4646 return inputLength * (3 + alpha01) / 3 | 0; 4647 }, 4648 isPassthrough: ColorSpace.prototype.isPassthrough, 4649 fillRgb: ColorSpace.prototype.fillRgb, 4650 isDefaultDecode: function LabCS_isDefaultDecode(decodeMap) { 4651 return true; 4652 }, 4653 usesZeroToOneRange: false 4654 }; 4655 return LabCS; 4656}(); 4657exports.ColorSpace = ColorSpace; 4658 4659/***/ }), 4660/* 22 */ 4661/***/ (function(module, exports, __w_pdfjs_require__) { 4662 4663"use strict"; 4664 4665 4666Object.defineProperty(exports, "__esModule", { 4667 value: true 4668}); 4669var 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']; 4670var 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']; 4671var 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
4671ntered', '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']; 4672var 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']; 4673var 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,727 bytes, lines 4673-4783
4673de', 'oslash', 'ugrave', 'uacute', 'ucircumflex', 'udieresis', 'yacute', 'thorn', 'ydieresis']; 4674var 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']; 4675var 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']; 4676function getEncoding(encodingName) { 4677 switch (encodingName) { 4678 case 'WinAnsiEncoding': 4679 return WinAnsiEncoding; 4680 case 'StandardEncoding': 4681 return StandardEncoding; 4682 case 'MacRomanEncoding': 4683 return MacRomanEncoding; 4684 case 'SymbolSetEncoding': 4685 return SymbolSetEncoding; 4686 case 'ZapfDingbatsEncoding': 4687 return ZapfDingbatsEncoding; 4688 case 'ExpertEncoding': 4689 return ExpertEncoding; 4690 case 'MacExpertEncoding': 4691 return MacExpertEncoding; 4692 default: 4693 return null; 4694 } 4695} 4696exports.WinAnsiEncoding = WinAnsiEncoding; 4697exports.StandardEncoding = StandardEncoding; 4698exports.MacRomanEncoding = MacRomanEncoding; 4699exports.SymbolSetEncoding = SymbolSetEncoding; 4700exports.ZapfDingbatsEncoding = ZapfDingbatsEncoding; 4701exports.ExpertEncoding = ExpertEncoding; 4702exports.getEncoding = getEncoding; 4703 4704/***/ }), 4705/* 23 */ 4706/***/ (function(module, exports, __w_pdfjs_require__) { 4707 4708"use strict"; 4709 4710 4711module.exports = function (bitmap, value) { 4712 return { 4713 enumerable: !(bitmap & 1), 4714 configurable: !(bitmap & 2), 4715 writable: !(bitmap & 4), 4716 value: value 4717 }; 4718}; 4719 4720/***/ }), 4721/* 24 */ 4722/***/ (function(module, exports, __w_pdfjs_require__) { 4723 4724"use strict"; 4725 4726 4727var redefine = __w_pdfjs_require__(13); 4728module.exports = function (target, src, safe) { 4729 for (var key in src) { 4730 redefine(target, key, src[key], safe); 4731 }return target; 4732}; 4733 4734/***/ }), 4735/* 25 */ 4736/***/ (function(module, exports, __w_pdfjs_require__) { 4737 4738"use strict"; 4739 4740 4741module.exports = function (it, Constructor, name, forbiddenField) { 4742 if (!(it instanceof Constructor) || forbiddenField !== undefined && forbiddenField in it) { 4743 throw TypeError(name + ': incorrect invocation!'); 4744 } 4745 return it; 4746}; 4747 4748/***/ }), 4749/* 26 */ 4750/***/ (function(module, exports, __w_pdfjs_require__) { 4751 4752"use strict"; 4753 4754 4755var IObject = __w_pdfjs_require__(33); 4756var defined = __w_pdfjs_require__(49); 4757module.exports = function (it) { 4758 return IObject(defined(it)); 4759}; 4760 4761/***/ }), 4762/* 27 */ 4763/***/ (function(module, exports, __w_pdfjs_require__) { 4764 4765"use strict"; 4766 4767 4768var toInteger = __w_pdfjs_require__(20); 4769var max = Math.max; 4770var min = Math.min; 4771module.exports = function (index, length) { 4772 index = toInteger(index); 4773 return index < 0 ? max(index + length, 0) : min(index, length); 4774}; 4775 4776/***/ }), 4777/* 28 */ 4778/***/ (function(module, exports, __w_pdfjs_require__) { 4779 4780"use strict"; 4781 4782 4783var def = __w_pdfjs_require__(12).f;
4784var has = __w_pdfjs_require__(7); 4785var TAG = __w_pdfjs_require__(1)('toStringTag'); 4786module.exports = function (it, tag, stat) { 4787 if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { 4788 configurable: true, 4789 value: tag 4790 }); 4791}; 4792 4793/***/ }), 4794/* 29 */ 4795/***/ (function(module, exports, __w_pdfjs_require__) { 4796 4797"use strict"; 4798 4799 4800Object.defineProperty(exports, "__esModule", { 4801 value: true 4802}); 4803exports.Parser = exports.Linearization = exports.Lexer = undefined; 4804 4805var _stream = __w_pdfjs_require__(5); 4806 4807var _util = __w_pdfjs_require__(0); 4808 4809var _primitives = __w_pdfjs_require__(2); 4810 4811var MAX_LENGTH_TO_CACHE = 1000; 4812var Parser = function ParserClosure() { 4813 function Parser(lexer, allowStreams, xref, recoveryMode) { 4814 this.lexer = lexer; 4815 this.allowStreams = allowStreams; 4816 this.xref = xref; 4817 this.recoveryMode = recoveryMode || false; 4818 this.imageCache = Object.create(null); 4819 this.refill(); 4820 } 4821 Parser.prototype = { 4822 refill: function Parser_refill() { 4823 this.buf1 = this.lexer.getObj(); 4824 this.buf2 = this.lexer.getObj(); 4825 }, 4826 shift: function Parser_shift() { 4827 if ((0, _primitives.isCmd)(this.buf2, 'ID')) { 4828 this.buf1 = this.buf2; 4829 this.buf2 = null; 4830 } else { 4831 this.buf1 = this.buf2; 4832 this.buf2 = this.lexer.getObj(); 4833 } 4834 }, 4835 tryShift: function Parser_tryShift() { 4836 try { 4837 this.shift(); 4838 return true; 4839 } catch (e) { 4840 if (e instanceof _util.MissingDataException) { 4841 throw e; 4842 } 4843 return false; 4844 } 4845 }, 4846 getObj: function Parser_getObj(cipherTransform) { 4847 var buf1 = this.buf1; 4848 this.shift(); 4849 if (buf1 instanceof _primitives.Cmd) { 4850 switch (buf1.cmd) { 4851 case 'BI': 4852 return this.makeInlineImage(cipherTransform); 4853 case '[': 4854 var array = []; 4855 while (!(0, _primitives.isCmd)(this.buf1, ']') && !(0, _primitives.isEOF)(this.buf1)) { 4856 array.push(this.getObj(cipherTransform)); 4857 } 4858 if ((0, _primitives.isEOF)(this.buf1)) { 4859 if (!this.recoveryMode) { 4860 throw new _util.FormatError('End of file inside array'); 4861 } 4862 return array; 4863 } 4864 this.shift(); 4865 return array; 4866 case '<<': 4867 var dict = new _primitives.Dict(this.xref); 4868 while (!(0, _primitives.isCmd)(this.buf1, '>>') && !(0, _primitives.isEOF)(this.buf1)) { 4869 if (!(0, _primitives.isName)(this.buf1)) { 4870 (0, _util.info)('Malformed dictionary: key must be a name object'); 4871 this.shift(); 4872 continue; 4873 } 4874 var key = this.buf1.name; 4875 this.shift(); 4876 if ((0, _primitives.isEOF)(this.buf1)) { 4877 break; 4878 } 4879 dict.set(key, this.getObj(cipherTransform)); 4880 } 4881 if ((0, _primitives.isEOF)(this.buf1)) { 4882 if (!this.recoveryMode) { 4883 throw new _util.FormatError('End of file inside dictionary'); 4884 } 4885 return dict; 4886 } 4887 if ((0, _primitives.isCmd)(this.buf2, 'stream')) { 4888 return this.allowStreams ? this.makeStream(dict, cipherTransform) : dict; 4889 } 4890 this.shift(); 4891 return dict; 4892 default: 4893 return buf1; 4894 } 4895 } 4896 if (Number.isInteger(buf1)) { 4897 var num = buf1; 4898 if (Number.isInteger(this.buf1) && (0, _primitives.isCmd)(this.buf2, 'R')) { 4899 var ref = new _primitives.Ref(num, this.buf1); 4900 this.shift(); 4901 this.shift(); 4902 return ref; 4903 } 4904 return num; 4905 } 4906 if ((0, _util.isString)(buf1)) { 4907 var str = buf1; 4908 if (cipherTransform) { 4909 str = cipherTransform.decryptString(str); 4910 } 4911 return str; 4912 } 4913 return buf1; 4914 }, 4915 findDefaultInlineStreamEnd: function findDefaultInlineStreamEnd(stream) { 4916 var E = 0x45, 4917 I = 0x49, 4918 SPACE = 0x20, 4919 LF = 0xA, 4920 CR = 0xD; 4921 var n = 10, 4922 NUL = 0x0; 4923 var startPos = stream.pos, 4924 state = 0, 4925 ch = void 0, 4926 maybeEIPos = void 0; 4927 while ((ch = stream.getByte()) !== -1) { 4928 if (state === 0) { 4929 state = ch === E ? 1 : 0; 4930 } else if (state === 1) { 4931 state = ch === I ? 2 : 0; 4932 } else { 4933 (0, _util.assert)(state === 2); 4934 if (ch === SPACE || ch === LF || ch === CR) { 4935 maybeEIPos = stream.pos; 4936 var followingBytes = stream.peekBytes(n); 4937 for (var i = 0, ii = followingBytes.length; i < ii; i++) { 4938 ch = followingBytes[i]; 4939 if (ch === NUL && followingBytes[i + 1] !== NUL) { 4940 continue; 4941 } 4942 if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7F)) { 4943 state = 0; 4944 break; 4945 } 4946 } 4947 if (state === 2) { 4948 break; 4949 } 4950 } else { 4951 state = 0; 4952 } 4953 } 4954 } 4955 if (ch === -1) { 4956 (0, _util.warn)('findDefaultInlineStreamEnd: ' + 'Reached the end of the stream without finding a valid EI marker'); 4957 if (maybeEIPos) {
4958 (0, _util.warn)('... trying to recover by using the last "EI" occurrence.'); 4959 stream.skip(-(stream.pos - maybeEIPos)); 4960 } 4961 } 4962 return stream.pos - 4 - startPos; 4963 }, 4964 4965 findDCTDecodeInlineStreamEnd: function Parser_findDCTDecodeInlineStreamEnd(stream) { 4966 var startPos = stream.pos, 4967 foundEOI = false, 4968 b, 4969 markerLength, 4970 length; 4971 while ((b = stream.getByte()) !== -1) { 4972 if (b !== 0xFF) { 4973 continue; 4974 } 4975 switch (stream.getByte()) { 4976 case 0x00: 4977 break; 4978 case 0xFF: 4979 stream.skip(-1); 4980 break; 4981 case 0xD9: 4982 foundEOI = true; 4983 break; 4984 case 0xC0: 4985 case 0xC1: 4986 case 0xC2: 4987 case 0xC3: 4988 case 0xC5: 4989 case 0xC6: 4990 case 0xC7: 4991 case 0xC9: 4992 case 0xCA: 4993 case 0xCB: 4994 case 0xCD: 4995 case 0xCE: 4996 case 0xCF: 4997 case 0xC4: 4998 case 0xCC: 4999 case 0xDA: 5000 case 0xDB: 5001 case 0xDC: 5002 case 0xDD: 5003 case 0xDE: 5004 case 0xDF: 5005 case 0xE0: 5006 case 0xE1: 5007 case 0xE2: 5008 case 0xE3: 5009 case 0xE4: 5010 case 0xE5: 5011 case 0xE6: 5012 case 0xE7: 5013 case 0xE8: 5014 case 0xE9: 5015 case 0xEA: 5016 case 0xEB: 5017 case 0xEC: 5018 case 0xED: 5019 case 0xEE: 5020 case 0xEF: 5021 case 0xFE: 5022 markerLength = stream.getUint16(); 5023 if (markerLength > 2) { 5024 stream.skip(markerLength - 2); 5025 } else { 5026 stream.skip(-2); 5027 } 5028 break; 5029 } 5030 if (foundEOI) { 5031 break; 5032 } 5033 } 5034 length = stream.pos - startPos; 5035 if (b === -1) { 5036 (0, _util.warn)('Inline DCTDecode image stream: ' + 'EOI marker not found, searching for /EI/ instead.'); 5037 stream.skip(-length); 5038 return this.findDefaultInlineStreamEnd(stream); 5039 } 5040 this.inlineStreamSkipEI(stream); 5041 return length; 5042 }, 5043 findASCII85DecodeInlineStreamEnd: function Parser_findASCII85DecodeInlineStreamEnd(stream) { 5044 var TILDE = 0x7E, 5045 GT = 0x3E; 5046 var startPos = stream.pos, 5047 ch, 5048 length; 5049 while ((ch = stream.getByte()) !== -1) { 5050 if (ch === TILDE && stream.peekByte() === GT) { 5051 stream.skip(); 5052 break; 5053 } 5054 } 5055 length = stream.pos - startPos; 5056 if (ch === -1) { 5057 (0, _util.warn)('Inline ASCII85Decode image stream: ' + 'EOD marker not found, searching for /EI/ instead.'); 5058 stream.skip(-length); 5059 return this.findDefaultInlineStreamEnd(stream); 5060 } 5061 this.inlineStreamSkipEI(stream); 5062 return length; 5063 }, 5064 findASCIIHexDecodeInlineStreamEnd: function Parser_findASCIIHexDecodeInlineStreamEnd(stream) { 5065 var GT = 0x3E; 5066 var startPos = stream.pos, 5067 ch, 5068 length; 5069 while ((ch = stream.getByte()) !== -1) { 5070 if (ch === GT) { 5071 break; 5072 } 5073 } 5074 length = stream.pos - startPos; 5075 if (ch === -1) { 5076 (0, _util.warn)('Inline ASCIIHexDecode image stream: ' + 'EOD marker not found, searching for /EI/ instead.'); 5077 stream.skip(-length); 5078 return this.findDefaultInlineStreamEnd(stream); 5079 } 5080 this.inlineStreamSkipEI(stream); 5081 return length; 5082 }, 5083 inlineStreamSkipEI: function Parser_inlineStreamSkipEI(stream) { 5084 var E = 0x45, 5085 I = 0x49; 5086 var state = 0, 5087 ch; 5088 while ((ch = stream.getByte()) !== -1) { 5089 if (state === 0) { 5090 state = ch === E ? 1 : 0; 5091 } else if (state === 1) { 5092 state = ch === I ? 2 : 0; 5093 } else if (state === 2) { 5094 break; 5095 } 5096 } 5097 }, 5098 makeInlineImage: function Parser_makeInlineImage(cipherTransform) { 5099 var lexer = this.lexer; 5100 var stream = lexer.stream; 5101 var dict = new _primitives.Dict(this.xref); 5102 while (!(0, _primitives.isCmd)(this.buf1, 'ID') && !(0, _primitives.isEOF)(this.buf1)) { 5103 if (!(0, _primitives.isName)(this.buf1)) { 5104 throw new _util.FormatError('Dictionary key must be a name object'); 5105 } 5106 var key = this.buf1.name; 5107 this.shift(); 5108 if ((0, _primitives.isEOF)(this.buf1)) { 5109 break; 5110 } 5111 dict.set(key, this.getObj(cipherTransform)); 5112 } 5113 var filter = dict.get('Filter', 'F'), 5114 filterName; 5115 if ((0, _primitives.isName)(filter)) { 5116 filterName = filter.name; 5117 } else if (Array.isArray(filter)) { 5118 var filterZero = this.xref.fetchIfRef(filter[0]); 5119 if ((0, _primitives.isName)(filterZero)) { 5120 filterName = filterZero.name; 5121 } 5122 } 5123 var startPos = stream.pos, 5124 length, 5125 i, 5126 ii; 5127 if (filterName === 'DCTDecode' || filterName === 'DCT') { 5128 length = this.findDCTDecodeInlineStreamEnd(stream); 5129 } else if (filterName === 'ASCII85Decode' || filterName === 'A85') { 5130 length = this.findASCII85DecodeInlineStreamEnd(stream); 5131 } else if (filterName === 'ASCIIHexDecode' || filterName === 'AHx') { 5132 length = this.findASCIIHexDecodeInlineStreamEnd(stream); 5133 } else { 5134 length = this.findDefaultInlineStreamEnd(stream); 5135 } 5136 var imageStream = stream.makeSubStream(startPos, length, dict); 5137 var adler32; 5138 if (length < MAX_LENGTH_TO_CACHE) { 5139 var imageBytes = imageStream.getBytes(); 5140 imageStream.reset(); 5141 var a = 1; 5142 var b = 0; 5143 for (i = 0, ii = imageBytes.length; i < ii; ++i) { 5144 a += imageBytes[i] & 0xff;
5145 b += a; 5146 } 5147 adler32 = b % 65521 << 16 | a % 65521; 5148 var cacheEntry = this.imageCache[adler32]; 5149 if (cacheEntry !== undefined) { 5150 this.buf2 = _primitives.Cmd.get('EI'); 5151 this.shift(); 5152 cacheEntry.reset(); 5153 return cacheEntry; 5154 } 5155 } 5156 if (cipherTransform) { 5157 imageStream = cipherTransform.createStream(imageStream, length); 5158 } 5159 imageStream = this.filter(imageStream, dict, length); 5160 imageStream.dict = dict; 5161 if (adler32 !== undefined) { 5162 imageStream.cacheKey = 'inline_' + length + '_' + adler32; 5163 this.imageCache[adler32] = imageStream; 5164 } 5165 this.buf2 = _primitives.Cmd.get('EI'); 5166 this.shift(); 5167 return imageStream; 5168 }, 5169 makeStream: function Parser_makeStream(dict, cipherTransform) { 5170 var lexer = this.lexer; 5171 var stream = lexer.stream; 5172 lexer.skipToNextLine(); 5173 var pos = stream.pos - 1; 5174 var length = dict.get('Length'); 5175 if (!Number.isInteger(length)) { 5176 (0, _util.info)('Bad ' + length + ' attribute in stream'); 5177 length = 0; 5178 } 5179 stream.pos = pos + length; 5180 lexer.nextChar(); 5181 if (this.tryShift() && (0, _primitives.isCmd)(this.buf2, 'endstream')) { 5182 this.shift(); 5183 } else { 5184 stream.pos = pos; 5185 var SCAN_BLOCK_SIZE = 2048; 5186 var ENDSTREAM_SIGNATURE_LENGTH = 9; 5187 var ENDSTREAM_SIGNATURE = [0x65, 0x6E, 0x64, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6D]; 5188 var skipped = 0, 5189 found = false, 5190 i, 5191 j; 5192 while (stream.pos < stream.end) { 5193 var scanBytes = stream.peekBytes(SCAN_BLOCK_SIZE); 5194 var scanLength = scanBytes.length - ENDSTREAM_SIGNATURE_LENGTH; 5195 if (scanLength <= 0) { 5196 break; 5197 } 5198 found = false; 5199 i = 0; 5200 while (i < scanLength) { 5201 j = 0; 5202 while (j < ENDSTREAM_SIGNATURE_LENGTH && scanBytes[i + j] === ENDSTREAM_SIGNATURE[j]) { 5203 j++; 5204 } 5205 if (j >= ENDSTREAM_SIGNATURE_LENGTH) { 5206 found = true; 5207 break; 5208 } 5209 i++; 5210 } 5211 if (found) { 5212 skipped += i; 5213 stream.pos += i; 5214 break; 5215 } 5216 skipped += scanLength; 5217 stream.pos += scanLength; 5218 } 5219 if (!found) { 5220 throw new _util.FormatError('Missing endstream'); 5221 } 5222 length = skipped; 5223 lexer.nextChar(); 5224 this.shift(); 5225 this.shift(); 5226 } 5227 this.shift(); 5228 stream = stream.makeSubStream(pos, length, dict); 5229 if (cipherTransform) { 5230 stream = cipherTransform.createStream(stream, length); 5231 } 5232 stream = this.filter(stream, dict, length); 5233 stream.dict = dict; 5234 return stream; 5235 }, 5236 filter: function Parser_filter(stream, dict, length) { 5237 var filter = dict.get('Filter', 'F'); 5238 var params = dict.get('DecodeParms', 'DP'); 5239 if ((0, _primitives.isName)(filter)) { 5240 if (Array.isArray(params)) { 5241 (0, _util.warn)('/DecodeParms should not contain an Array, ' + 'when /Filter contains a Name.'); 5242 } 5243 return this.makeFilter(stream, filter.name, length, params); 5244 } 5245 var maybeLength = length; 5246 if (Array.isArray(filter)) { 5247 var filterArray = filter; 5248 var paramsArray = params; 5249 for (var i = 0, ii = filterArray.length; i < ii; ++i) { 5250 filter = this.xref.fetchIfRef(filterArray[i]); 5251 if (!(0, _primitives.isName)(filter)) { 5252 throw new _util.FormatError('Bad filter name: ' + filter); 5253 } 5254 params = null; 5255 if (Array.isArray(paramsArray) && i in paramsArray) { 5256 params = this.xref.fetchIfRef(paramsArray[i]); 5257 } 5258 stream = this.makeFilter(stream, filter.name, maybeLength, params); 5259 maybeLength = null; 5260 } 5261 } 5262 return stream; 5263 }, 5264 makeFilter: function Parser_makeFilter(stream, name, maybeLength, params) { 5265 if (maybeLength === 0) {
5266 (0, _util.warn)('Empty "' + name + '" stream.'); 5267 return new _stream.NullStream(stream); 5268 } 5269 try { 5270 var xrefStreamStats = this.xref.stats.streamTypes; 5271 if (name === 'FlateDecode' || name === 'Fl') { 5272 xrefStreamStats[_util.StreamType.FLATE] = true; 5273 if (params) { 5274 return new _stream.PredictorStream(new _stream.FlateStream(stream, maybeLength), maybeLength, params); 5275 } 5276 return new _stream.FlateStream(stream, maybeLength); 5277 } 5278 if (name === 'LZWDecode' || name === 'LZW') { 5279 xrefStreamStats[_util.StreamType.LZW] = true; 5280 var earlyChange = 1; 5281 if (params) { 5282 if (params.has('EarlyChange')) { 5283 earlyChange = params.get('EarlyChange'); 5284 } 5285 return new _stream.PredictorStream(new _stream.LZWStream(stream, maybeLength, earlyChange), maybeLength, params); 5286 } 5287 return new _stream.LZWStream(stream, maybeLength, earlyChange); 5288 } 5289 if (name === 'DCTDecode' || name === 'DCT') { 5290 xrefStreamStats[_util.StreamType.DCT] = true; 5291 return new _stream.JpegStream(stream, maybeLength, stream.dict, params); 5292 } 5293 if (name === 'JPXDecode' || name === 'JPX') { 5294 xrefStreamStats[_util.StreamType.JPX] = true; 5295 return new _stream.JpxStream(stream, maybeLength, stream.dict, params); 5296 } 5297 if (name === 'ASCII85Decode' || name === 'A85') { 5298 xrefStreamStats[_util.StreamType.A85] = true; 5299 return new _stream.Ascii85Stream(stream, maybeLength); 5300 } 5301 if (name === 'ASCIIHexDecode' || name === 'AHx') { 5302 xrefStreamStats[_util.StreamType.AHX] = true; 5303 return new _stream.AsciiHexStream(stream, maybeLength); 5304 } 5305 if (name === 'CCITTFaxDecode' || name === 'CCF') { 5306 xrefStreamStats[_util.StreamType.CCF] = true; 5307 return new _stream.CCITTFaxStream(stream, maybeLength, params); 5308 } 5309 if (name === 'RunLengthDecode' || name === 'RL') { 5310 xrefStreamStats[_util.StreamType.RL] = true; 5311 return new _stream.RunLengthStream(stream, maybeLength); 5312 } 5313 if (name === 'JBIG2Decode') { 5314 xrefStreamStats[_util.StreamType.JBIG] = true; 5315 return new _stream.Jbig2Stream(stream, maybeLength, stream.dict, params); 5316 } 5317 (0, _util.warn)('filter "' + name + '" not supported yet'); 5318 return stream; 5319 } catch (ex) { 5320 if (ex instanceof _util.MissingDataException) { 5321 throw ex; 5322 } 5323 (0, _util.warn)('Invalid stream: \"' + ex + '\"'); 5324 return new _stream.NullStream(stream); 5325 } 5326 } 5327 }; 5328 return Parser; 5329}(); 5330var Lexer = function LexerClosure() { 5331 function Lexer(stream, knownCommands) { 5332 this.stream = stream; 5333 this.nextChar(); 5334 this.strBuf = []; 5335 this.knownCommands = knownCommands; 5336 } 5337 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]; 5338 function toHexDigit(ch) { 5339 if (ch >= 0x30 && ch <= 0x39) { 5340 return ch & 0x0F; 5341 } 5342 if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { 5343 return (ch & 0x0F) + 9; 5344 } 5345 return -1; 5346 } 5347 Lexer.prototype = { 5348 nextChar: function Lexer_nextChar() { 5349 return this.currentChar = this.stream.getByte(); 5350 }, 5351 peekChar: function Lexer_peekChar() { 5352 return this.stream.peekByte(); 5353 }, 5354 getNumber: function Lexer_getNumber() { 5355 var ch = this.currentChar; 5356 var eNotation = false;
vendor: 10,702 bytes, lines 5357-5718
5357 var divideBy = 0; 5358 var sign = 1; 5359 if (ch === 0x2D) { 5360 sign = -1; 5361 ch = this.nextChar(); 5362 if (ch === 0x2D) { 5363 ch = this.nextChar(); 5364 } 5365 } else if (ch === 0x2B) { 5366 ch = this.nextChar(); 5367 } 5368 if (ch === 0x2E) { 5369 divideBy = 10; 5370 ch = this.nextChar(); 5371 } 5372 if (ch === 0x0A || ch === 0x0D) { 5373 do { 5374 ch = this.nextChar(); 5375 } while (ch === 0x0A || ch === 0x0D); 5376 } 5377 if (ch < 0x30 || ch > 0x39) { 5378 throw new _util.FormatError('Invalid number: ' + String.fromCharCode(ch) + ' (charCode ' + ch + ')'); 5379 } 5380 var baseValue = ch - 0x30; 5381 var powerValue = 0; 5382 var powerValueSign = 1; 5383 while ((ch = this.nextChar()) >= 0) { 5384 if (0x30 <= ch && ch <= 0x39) { 5385 var currentDigit = ch - 0x30; 5386 if (eNotation) { 5387 powerValue = powerValue * 10 + currentDigit; 5388 } else { 5389 if (divideBy !== 0) { 5390 divideBy *= 10; 5391 } 5392 baseValue = baseValue * 10 + currentDigit; 5393 } 5394 } else if (ch === 0x2E) { 5395 if (divideBy === 0) { 5396 divideBy = 1; 5397 } else { 5398 break; 5399 } 5400 } else if (ch === 0x2D) { 5401 (0, _util.warn)('Badly formatted number'); 5402 } else if (ch === 0x45 || ch === 0x65) { 5403 ch = this.peekChar(); 5404 if (ch === 0x2B || ch === 0x2D) { 5405 powerValueSign = ch === 0x2D ? -1 : 1; 5406 this.nextChar(); 5407 } else if (ch < 0x30 || ch > 0x39) { 5408 break; 5409 } 5410 eNotation = true; 5411 } else { 5412 break; 5413 } 5414 } 5415 if (divideBy !== 0) { 5416 baseValue /= divideBy; 5417 } 5418 if (eNotation) { 5419 baseValue *= Math.pow(10, powerValueSign * powerValue); 5420 } 5421 return sign * baseValue; 5422 }, 5423 getString: function Lexer_getString() { 5424 var numParen = 1; 5425 var done = false; 5426 var strBuf = this.strBuf; 5427 strBuf.length = 0; 5428 var ch = this.nextChar(); 5429 while (true) { 5430 var charBuffered = false; 5431 switch (ch | 0) { 5432 case -1: 5433 (0, _util.warn)('Unterminated string'); 5434 done = true; 5435 break; 5436 case 0x28: 5437 ++numParen; 5438 strBuf.push('('); 5439 break; 5440 case 0x29: 5441 if (--numParen === 0) { 5442 this.nextChar(); 5443 done = true; 5444 } else { 5445 strBuf.push(')'); 5446 } 5447 break; 5448 case 0x5C: 5449 ch = this.nextChar(); 5450 switch (ch) { 5451 case -1: 5452 (0, _util.warn)('Unterminated string'); 5453 done = true; 5454 break; 5455 case 0x6E: 5456 strBuf.push('\n'); 5457 break; 5458 case 0x72: 5459 strBuf.push('\r'); 5460 break; 5461 case 0x74: 5462 strBuf.push('\t'); 5463 break; 5464 case 0x62: 5465 strBuf.push('\b'); 5466 break; 5467 case 0x66: 5468 strBuf.push('\f'); 5469 break; 5470 case 0x5C: 5471 case 0x28: 5472 case 0x29: 5473 strBuf.push(String.fromCharCode(ch)); 5474 break; 5475 case 0x30: 5476 case 0x31: 5477 case 0x32: 5478 case 0x33: 5479 case 0x34: 5480 case 0x35: 5481 case 0x36: 5482 case 0x37: 5483 var x = ch & 0x0F; 5484 ch = this.nextChar(); 5485 charBuffered = true; 5486 if (ch >= 0x30 && ch <= 0x37) { 5487 x = (x << 3) + (ch & 0x0F); 5488 ch = this.nextChar(); 5489 if (ch >= 0x30 && ch <= 0x37) { 5490 charBuffered = false; 5491 x = (x << 3) + (ch & 0x0F); 5492 } 5493 } 5494 strBuf.push(String.fromCharCode(x)); 5495 break; 5496 case 0x0D: 5497 if (this.peekChar() === 0x0A) { 5498 this.nextChar(); 5499 } 5500 break; 5501 case 0x0A: 5502 break; 5503 default: 5504 strBuf.push(String.fromCharCode(ch)); 5505 break; 5506 } 5507 break; 5508 default: 5509 strBuf.push(String.fromCharCode(ch)); 5510 break; 5511 } 5512 if (done) { 5513 break; 5514 } 5515 if (!charBuffered) { 5516 ch = this.nextChar(); 5517 } 5518 } 5519 return strBuf.join(''); 5520 }, 5521 getName: function Lexer_getName() { 5522 var ch, previousCh; 5523 var strBuf = this.strBuf; 5524 strBuf.length = 0; 5525 while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { 5526 if (ch === 0x23) { 5527 ch = this.nextChar(); 5528 if (specialChars[ch]) { 5529 (0, _util.warn)('Lexer_getName: ' + 'NUMBER SIGN (#) should be followed by a hexadecimal number.'); 5530 strBuf.push('#'); 5531 break; 5532 } 5533 var x = toHexDigit(ch); 5534 if (x !== -1) { 5535 previousCh = ch; 5536 ch = this.nextChar(); 5537 var x2 = toHexDigit(ch); 5538 if (x2 === -1) { 5539 (0, _util.warn)('Lexer_getName: Illegal digit (' + String.fromCharCode(ch) + ') in hexadecimal number.'); 5540 strBuf.push('#', String.fromCharCode(previousCh)); 5541 if (specialChars[ch]) { 5542 break; 5543 } 5544 strBuf.push(String.fromCharCode(ch)); 5545 continue; 5546 } 5547 strBuf.push(String.fromCharCode(x << 4 | x2)); 5548 } else { 5549 strBuf.push('#', String.fromCharCode(ch)); 5550 } 5551 } else { 5552 strBuf.push(String.fromCharCode(ch)); 5553 } 5554 } 5555 if (strBuf.length > 127) { 5556 (0, _util.warn)('name token is longer than allowed by the spec: ' + strBuf.length); 5557 } 5558 return _primitives.Name.get(strBuf.join('')); 5559 }, 5560 getHexString: function Lexer_getHexString() { 5561 var strBuf = this.strBuf; 5562 strBuf.length = 0; 5563 var ch = this.currentChar; 5564 var isFirstHex = true; 5565 var firstDigit; 5566 var secondDigit; 5567 while (true) { 5568 if (ch < 0) { 5569 (0, _util.warn)('Unterminated hex string'); 5570 break; 5571 } else if (ch === 0x3E) { 5572 this.nextChar(); 5573 break; 5574 } else if (specialChars[ch] === 1) { 5575 ch = this.nextChar(); 5576 continue; 5577 } else { 5578 if (isFirstHex) { 5579 firstDigit = toHexDigit(ch); 5580 if (firstDigit === -1) { 5581 (0, _util.warn)('Ignoring invalid character "' + ch + '" in hex string'); 5582 ch = this.nextChar(); 5583 continue; 5584 } 5585 } else { 5586 secondDigit = toHexDigit(ch); 5587 if (secondDigit === -1) { 5588 (0, _util.warn)('Ignoring invalid character "' + ch + '" in hex string'); 5589 ch = this.nextChar(); 5590 continue; 5591 } 5592 strBuf.push(String.fromCharCode(firstDigit << 4 | secondDigit)); 5593 } 5594 isFirstHex = !isFirstHex; 5595 ch = this.nextChar(); 5596 } 5597 } 5598 return strBuf.join(''); 5599 }, 5600 getObj: function Lexer_getObj() { 5601 var comment = false; 5602 var ch = this.currentChar; 5603 while (true) { 5604 if (ch < 0) { 5605 return _primitives.EOF; 5606 } 5607 if (comment) { 5608 if (ch === 0x0A || ch === 0x0D) { 5609 comment = false; 5610 } 5611 } else if (ch === 0x25) { 5612 comment = true; 5613 } else if (specialChars[ch] !== 1) { 5614 break; 5615 } 5616 ch = this.nextChar(); 5617 } 5618 switch (ch | 0) { 5619 case 0x30: 5620 case 0x31: 5621 case 0x32: 5622 case 0x33: 5623 case 0x34: 5624 case 0x35: 5625 case 0x36: 5626 case 0x37: 5627 case 0x38: 5628 case 0x39: 5629 case 0x2B: 5630 case 0x2D: 5631 case 0x2E: 5632 return this.getNumber(); 5633 case 0x28: 5634 return this.getString(); 5635 case 0x2F: 5636 return this.getName(); 5637 case 0x5B: 5638 this.nextChar(); 5639 return _primitives.Cmd.get('['); 5640 case 0x5D: 5641 this.nextChar(); 5642 return _primitives.Cmd.get(']'); 5643 case 0x3C: 5644 ch = this.nextChar(); 5645 if (ch === 0x3C) { 5646 this.nextChar(); 5647 return _primitives.Cmd.get('<<'); 5648 } 5649 return this.getHexString(); 5650 case 0x3E: 5651 ch = this.nextChar(); 5652 if (ch === 0x3E) { 5653 this.nextChar(); 5654 return _primitives.Cmd.get('>>'); 5655 } 5656 return _primitives.Cmd.get('>'); 5657 case 0x7B: 5658 this.nextChar(); 5659 return _primitives.Cmd.get('{'); 5660 case 0x7D: 5661 this.nextChar(); 5662 return _primitives.Cmd.get('}'); 5663 case 0x29: 5664 this.nextChar(); 5665 throw new _util.FormatError('Illegal character: ' + ch); 5666 } 5667 var str = String.fromCharCode(ch); 5668 var knownCommands = this.knownCommands; 5669 var knownCommandFound = knownCommands && knownCommands[str] !== undefined; 5670 while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { 5671 var possibleCommand = str + String.fromCharCode(ch); 5672 if (knownCommandFound && knownCommands[possibleCommand] === undefined) { 5673 break; 5674 } 5675 if (str.length === 128) { 5676 throw new _util.FormatError('Command token too long: ' + str.length); 5677 } 5678 str = possibleCommand; 5679 knownCommandFound = knownCommands && knownCommands[str] !== undefined; 5680 } 5681 if (str === 'true') { 5682 return true; 5683 } 5684 if (str === 'false') { 5685 return false; 5686 } 5687 if (str === 'null') { 5688 return null; 5689 } 5690 return _primitives.Cmd.get(str); 5691 }, 5692 skipToNextLine: function Lexer_skipToNextLine() { 5693 var ch = this.currentChar; 5694 while (ch >= 0) { 5695 if (ch === 0x0D) { 5696 ch = this.nextChar(); 5697 if (ch === 0x0A) { 5698 this.nextChar(); 5699 } 5700 break; 5701 } else if (ch === 0x0A) { 5702 this.nextChar(); 5703 break; 5704 } 5705 ch = this.nextChar(); 5706 } 5707 } 5708 }; 5709 return Lexer; 5710}(); 5711var Linearization = { 5712 create: function LinearizationCreate(stream) { 5713 function getInt(name, allowZeroValue) { 5714 var obj = linDict.get(name); 5715 if (Number.isInteger(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) { 5716 return obj; 5717 } 5718 throw new Error('The "' + name + '" parameter in the linearization ' + 'dictionary is invali
5718d.'); 5719 } 5720 function getHints() { 5721 var hints = linDict.get('H'), 5722 hintsLength, 5723 item; 5724 if (Array.isArray(hints) && ((hintsLength = hints.length) === 2 || hintsLength === 4)) { 5725 for (var index = 0; index < hintsLength; index++) { 5726 if (!(Number.isInteger(item = hints[index]) && item > 0)) { 5727 throw new Error('Hint (' + index + ') in the linearization dictionary is invalid.'); 5728 } 5729 } 5730 return hints; 5731 } 5732 throw new Error('Hint array in the linearization dictionary is invalid.'); 5733 } 5734 var parser = new Parser(new Lexer(stream), false, null); 5735 var obj1 = parser.getObj(); 5736 var obj2 = parser.getObj(); 5737 var obj3 = parser.getObj(); 5738 var linDict = parser.getObj(); 5739 var obj, length; 5740 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)) { 5741 return null; 5742 } else if ((length = getInt('L')) !== stream.length) { 5743 throw new Error('The "L" parameter in the linearization dictionary ' + 'does not equal the stream length.'); 5744 } 5745 return { 5746 length: length, 5747 hints: getHints(), 5748 objectNumberFirst: getInt('O'), 5749 endFirst: getInt('E'), 5750 numPages: getInt('N'), 5751 mainXRefEntriesOffset: getInt('T'), 5752 pageFirst: linDict.has('P') ? getInt('P', true) : 0 5753 }; 5754 } 5755}; 5756exports.Lexer = Lexer; 5757exports.Linearization = Linearization; 5758exports.Parser = Parser; 5759 5760/***/ }), 5761/* 30 */ 5762/***/ (function(module, exports, __w_pdfjs_require__) { 5763 5764"use strict"; 5765 5766 5767module.exports = false; 5768 5769/***/ }), 5770/* 31 */ 5771/***/ (function(module, exports, __w_pdfjs_require__) { 5772 5773"use strict"; 5774 5775 5776var isObject = __w_pdfjs_require__(4); 5777module.exports = function (it, S) { 5778 if (!isObject(it)) return it; 5779 var fn, val; 5780 if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; 5781 if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; 5782 if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; 5783 throw TypeError("Can't convert object to primitive value"); 5784}; 5785 5786/***/ }), 5787/* 32 */ 5788/***/ (function(module, exports, __w_pdfjs_require__) { 5789 5790"use strict"; 5791 5792 5793module.exports = function (it) { 5794 if (typeof it != 'function') throw TypeError(it + ' is not a function!'); 5795 return it; 5796}; 5797 5798/***/ }), 5799/* 33 */ 5800/***/ (function(module, exports, __w_pdfjs_require__) { 5801 5802"use strict"; 5803 5804 5805var cof = __w_pdfjs_require__(34); 5806module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { 5807 return cof(it) == 'String' ? it.split('') : Object(it); 5808}; 5809 5810/***/ }), 5811/* 34 */ 5812/***/ (function(module, exports, __w_pdfjs_require__) { 5813 5814"use strict"; 5815 5816 5817var toString = {}.toString; 5818module.exports = function (it) { 5819 return toString.call(it).slice(8, -1); 5820}; 5821 5822/***/ }), 5823/* 35 */ 5824/***/ (function(module, exports, __w_pdfjs_require__) { 5825 5826"use strict"; 5827 5828 5829var shared = __w_pdfjs_require__(51)('keys'); 5830var uid = __w_pdfjs_require__(14); 5831module.exports = function (key) {
vendor: 9,038 bytes, lines 5832-6153
5832 return shared[key] || (shared[key] = uid(key)); 5833}; 5834 5835/***/ }), 5836/* 36 */ 5837/***/ (function(module, exports, __w_pdfjs_require__) { 5838 5839"use strict"; 5840 5841 5842module.exports = 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'.split(','); 5843 5844/***/ }), 5845/* 37 */ 5846/***/ (function(module, exports, __w_pdfjs_require__) { 5847 5848"use strict"; 5849 5850 5851var cof = __w_pdfjs_require__(34); 5852var TAG = __w_pdfjs_require__(1)('toStringTag'); 5853var ARG = cof(function () { 5854 return arguments; 5855}()) == 'Arguments'; 5856var tryGet = function tryGet(it, key) { 5857 try { 5858 return it[key]; 5859 } catch (e) {} 5860}; 5861module.exports = function (it) { 5862 var O, T, B; 5863 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; 5864}; 5865 5866/***/ }), 5867/* 38 */ 5868/***/ (function(module, exports, __w_pdfjs_require__) { 5869 5870"use strict"; 5871 5872 5873var $keys = __w_pdfjs_require__(48); 5874var enumBugKeys = __w_pdfjs_require__(36); 5875module.exports = Object.keys || function keys(O) { 5876 return $keys(O, enumBugKeys); 5877}; 5878 5879/***/ }), 5880/* 39 */ 5881/***/ (function(module, exports, __w_pdfjs_require__) { 5882 5883"use strict"; 5884 5885 5886var ctx = __w_pdfjs_require__(15); 5887var IObject = __w_pdfjs_require__(33); 5888var toObject = __w_pdfjs_require__(16); 5889var toLength = __w_pdfjs_require__(11); 5890var asc = __w_pdfjs_require__(82); 5891module.exports = function (TYPE, $create) { 5892 var IS_MAP = TYPE == 1; 5893 var IS_FILTER = TYPE == 2; 5894 var IS_SOME = TYPE == 3; 5895 var IS_EVERY = TYPE == 4; 5896 var IS_FIND_INDEX = TYPE == 6; 5897 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; 5898 var create = $create || asc; 5899 return function ($this, callbackfn, that) { 5900 var O = toObject($this); 5901 var self = IObject(O); 5902 var f = ctx(callbackfn, that, 3); 5903 var length = toLength(self.length); 5904 var index = 0; 5905 var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; 5906 var val, res; 5907 for (; length > index; index++) { 5908 if (NO_HOLES || index in self) { 5909 val = self[index]; 5910 res = f(val, index, O); 5911 if (TYPE) { 5912 if (IS_MAP) result[index] = res;else if (res) switch (TYPE) { 5913 case 3: 5914 return true; 5915 case 5: 5916 return val; 5917 case 6: 5918 return index; 5919 case 2: 5920 result.push(val); 5921 } else if (IS_EVERY) return false; 5922 } 5923 } 5924 }return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; 5925 }; 5926}; 5927 5928/***/ }), 5929/* 40 */ 5930/***/ (function(module, exports, __w_pdfjs_require__) { 5931 5932"use strict"; 5933 5934 5935var _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; }; 5936 5937var META = __w_pdfjs_require__(14)('meta'); 5938var isObject = __w_pdfjs_require__(4); 5939var has = __w_pdfjs_require__(7); 5940var setDesc = __w_pdfjs_require__(12).f; 5941var id = 0; 5942var isExtensible = Object.isExtensible || function () { 5943 return true; 5944}; 5945var FREEZE = !__w_pdfjs_require__(9)(function () { 5946 return isExtensible(Object.preventExtensions({})); 5947}); 5948var setMeta = function setMeta(it) { 5949 setDesc(it, META, { 5950 value: { 5951 i: 'O' + ++id, 5952 w: {} 5953 } 5954 }); 5955}; 5956var fastKey = function fastKey(it, create) { 5957 if (!isObject(it)) return (typeof it === 'undefined' ? 'undefined' : _typeof(it)) == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; 5958 if (!has(it, META)) { 5959 if (!isExtensible(it)) return 'F'; 5960 if (!create) return 'E'; 5961 setMeta(it); 5962 } 5963 return it[META].i; 5964}; 5965var getWeak = function getWeak(it, create) { 5966 if (!has(it, META)) { 5967 if (!isExtensible(it)) return true; 5968 if (!create) return false; 5969 setMeta(it); 5970 } 5971 return it[META].w; 5972}; 5973var onFreeze = function onFreeze(it) { 5974 if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); 5975 return it; 5976}; 5977var meta = module.exports = { 5978 KEY: META, 5979 NEED: false, 5980 fastKey: fastKey, 5981 getWeak: getWeak, 5982 onFreeze: onFreeze 5983}; 5984 5985/***/ }), 5986/* 41 */ 5987/***/ (function(module, exports, __w_pdfjs_require__) { 5988 5989"use strict"; 5990 5991 5992var ctx = __w_pdfjs_require__(15); 5993var call = __w_pdfjs_require__(99); 5994var isArrayIter = __w_pdfjs_require__(53); 5995var anObject = __w_pdfjs_require__(10); 5996var toLength = __w_pdfjs_require__(11); 5997var getIterFn = __w_pdfjs_require__(56); 5998var BREAK = {}; 5999var RETURN = {}; 6000var _exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { 6001 var iterFn = ITERATOR ? function () { 6002 return iterable; 6003 } : getIterFn(iterable); 6004 var f = ctx(fn, that, entries ? 2 : 1); 6005 var index = 0; 6006 var length, step, iterator, result; 6007 if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); 6008 if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { 6009 result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); 6010 if (result === BREAK || result === RETURN) return result; 6011 } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { 6012 result = call(iterator, f, step.value, entries); 6013 if (result === BREAK || result === RETURN) return result; 6014 } 6015}; 6016_exports.BREAK = BREAK; 6017_exports.RETURN = RETURN; 6018 6019/***/ }), 6020/* 42 */ 6021/***/ (function(module, exports, __w_pdfjs_require__) { 6022 6023var getLookupTableFactory = __w_pdfjs_require__(0).getLookupTableFactory; 6024var getGlyphsUnicode = getLookupTableFactory(function (t) { 6025 t['A'] = 0x0041; 6026 t['AE'] = 0x00C6; 6027 t['AEacute'] = 0x01FC; 6028 t['AEmacron'] = 0x01E2; 6029 t['AEsmall'] = 0xF7E6; 6030 t['Aacute'] = 0x00C1; 6031 t['Aacutesmall'] = 0xF7E1; 6032 t['Abreve'] = 0x0102; 6033 t['Abreveacute'] = 0x1EAE; 6034 t['Abrevecyrillic'] = 0x04D0; 6035 t['Abrevedotbelow'] = 0x1EB6; 6036 t['Abrevegrave'] = 0x1EB0; 6037 t['Abrevehookabove'] = 0x1EB2; 6038 t['Abrevetilde'] = 0x1EB4; 6039 t['Acaron'] = 0x01CD; 6040 t['Acircle'] = 0x24B6; 6041 t['Acircumflex'] = 0x00C2; 6042 t['Acircumflexacute'] = 0x1EA4; 6043 t['Acircumflexdotbelow'] = 0x1EAC; 6044 t['Acircumflexgrave'] = 0x1EA6; 6045 t['Acircumflexhookabove'] = 0x1EA8; 6046 t['Acircumflexsmall'] = 0xF7E2; 6047 t['Acircumflextilde'] = 0x1EAA; 6048 t['Acute'] = 0xF6C9; 6049 t['Acutesmall'] = 0xF7B4; 6050 t['Acyrillic'] = 0x0410; 6051 t['Adblgrave'] = 0x0200; 6052 t['Adieresis'] = 0x00C4; 6053 t['Adieresiscyrillic'] = 0x04D2; 6054 t['Adieresismacron'] = 0x01DE; 6055 t['Adieresissmall'] = 0xF7E4; 6056 t['Adotbelow'] = 0x1EA0; 6057 t['Adotmacron'] = 0x01E0; 6058 t['Agrave'] = 0x00C0; 6059 t['Agravesmall'] = 0xF7E0; 6060 t['Ahookabove'] = 0x1EA2; 6061 t['Aiecyrillic'] = 0x04D4; 6062 t['Ainvertedbreve'] = 0x0202; 6063 t['Alpha'] = 0x0391; 6064 t['Alphatonos'] = 0x0386; 6065 t['Amacron'] = 0x0100; 6066 t['Amonospace'] = 0xFF21; 6067 t['Aogonek'] = 0x0104; 6068 t['Aring'] = 0x00C5; 6069 t['Aringacute'] = 0x01FA; 6070 t['Aringbelow'] = 0x1E00; 6071 t['Aringsmall'] = 0xF7E5; 6072 t['Asmall'] = 0xF761; 6073 t['Atilde'] = 0x00C3; 6074 t['Atildesmall'] = 0xF7E3; 6075 t['Aybarmenian'] = 0x0531; 6076 t['B'] = 0x0042; 6077 t['Bcircle'] = 0x24B7; 6078 t['Bdotaccent'] = 0x1E02; 6079 t['Bdotbelow'] = 0x1E04; 6080 t['Becyrillic'] = 0x0411; 6081 t['Benarmenian'] = 0x0532; 6082 t['Beta'] = 0x0392; 6083 t['Bhook'] = 0x0181; 6084 t['Blinebelow'] = 0x1E06; 6085 t['Bmonospace'] = 0xFF22; 6086 t['Brevesmall'] = 0xF6F4; 6087 t['Bsmall'] = 0xF762; 6088 t['Btopbar'] = 0x0182; 6089 t['C'] = 0x0043; 6090 t['Caarmenian'] = 0x053E; 6091 t['Cacute'] = 0x0106; 6092 t['Caron'] = 0xF6CA; 6093 t['Caronsmall'] = 0xF6F5; 6094 t['Ccaron'] = 0x010C; 6095 t['Ccedilla'] = 0x00C7; 6096 t['Ccedillaacute'] = 0x1E08; 6097 t['Ccedillasmall'] = 0xF7E7; 6098 t['Ccircle'] = 0x24B8; 6099 t['Ccircumflex'] = 0x0108; 6100 t['Cdot'] = 0x010A; 6101 t['Cdotaccent'] = 0x010A; 6102 t['Cedillasmall'] = 0xF7B8; 6103 t['Chaarmenian'] = 0x0549; 6104 t['Cheabkhasiancyrillic'] = 0x04BC; 6105 t['Checyrillic'] = 0x0427; 6106 t['Chedescenderabkhasiancyrillic'] = 0x04BE; 6107 t['Chedescendercyrillic'] = 0x04B6; 6108 t['Chedieresiscyrillic'] = 0x04F4; 6109 t['Cheharmenian'] = 0x0543; 6110 t['Chekhakassiancyrillic'] = 0x04CB; 6111 t['Cheverticalstrokecyrillic'] = 0x04B8; 6112 t['Chi'] = 0x03A7; 6113 t['Chook'] = 0x0187; 6114 t['Circumflexsmall'] = 0xF6F6; 6115 t['Cmonospace'] = 0xFF23; 6116 t['Coarmenian'] = 0x0551; 6117 t['Csmall'] = 0xF763; 6118 t['D'] = 0x0044; 6119 t['DZ'] = 0x01F1; 6120 t['DZcaron'] = 0x01C4; 6121 t['Daarmenian'] = 0x0534; 6122 t['Dafrican'] = 0x0189; 6123 t['Dcaron'] = 0x010E; 6124 t['Dcedilla'] = 0x1E10; 6125 t['Dcircle'] = 0x24B9; 6126 t['Dcircumflexbelow'] = 0x1E12; 6127 t['Dcroat'] = 0x0110; 6128 t['Ddotaccent'] = 0x1E0A; 6129 t['Ddotbelow'] = 0x1E0C; 6130 t['Decyrillic'] = 0x0414; 6131 t['Deicoptic'] = 0x03EE; 6132 t['Delta'] = 0x2206; 6133 t['Deltagreek'] = 0x0394; 6134 t['Dhook'] = 0x018A; 6135 t['Dieresis'] = 0xF6CB; 6136 t['DieresisAcute'] = 0xF6CC; 6137 t['DieresisGrave'] = 0xF6CD; 6138 t['Dieresissmall'] = 0xF7A8; 6139 t['Digammagreek'] = 0x03DC; 6140 t['Djecyrillic'] = 0x0402; 6141 t['Dlinebelow'] = 0x1E0E; 6142 t['Dmonospace'] = 0xFF24; 6143 t['Dotaccentsmall'] = 0xF6F7; 6144 t['Dslash'] = 0x0110; 6145 t['Dsmall'] = 0xF764; 6146 t['Dtopbar'] = 0x018B; 6147 t['Dz'] = 0x01F2; 6148 t['Dzcaron'] = 0x01C5; 6149 t['Dzeabkhasiancyrillic'] = 0x04E0; 6150 t['Dzecyrillic'] = 0x0405; 6151 t['Dzhecyrillic'] = 0x040F; 6152 t['E'] = 0x0045; 6153 t['Eacute'] = 0x00C9;
6154 t['Eacutesmall'] = 0xF7E9; 6155 t['Ebreve'] = 0x0114; 6156 t['Ecaron'] = 0x011A; 6157 t['Ecedillabreve'] = 0x1E1C; 6158 t['Echarmenian'] = 0x0535; 6159 t['Ecircle'] = 0x24BA; 6160 t['Ecircumflex'] = 0x00CA; 6161 t['Ecircumflexacute'] = 0x1EBE; 6162 t['Ecircumflexbelow'] = 0x1E18; 6163 t['Ecircumflexdotbelow'] = 0x1EC6; 6164 t['Ecircumflexgrave'] = 0x1EC0; 6165 t['Ecircumflexhookabove'] = 0x1EC2; 6166 t['Ecircumflexsmall'] = 0xF7EA; 6167 t['Ecircumflextilde'] = 0x1EC4; 6168 t['Ecyrillic'] = 0x0404; 6169 t['Edblgrave'] = 0x0204; 6170 t['Edieresis'] = 0x00CB; 6171 t['Edieresissmall'] = 0xF7EB; 6172 t['Edot'] = 0x0116; 6173 t['Edotaccent'] = 0x0116; 6174 t['Edotbelow'] = 0x1EB8; 6175 t['Efcyrillic'] = 0x0424; 6176 t['Egrave'] = 0x00C8; 6177 t['Egravesmall'] = 0xF7E8; 6178 t['Eharmenian'] = 0x0537; 6179 t['Ehookabove'] = 0x1EBA; 6180 t['Eightroman'] = 0x2167; 6181 t['Einvertedbreve'] = 0x0206; 6182 t['Eiotifiedcyrillic'] = 0x0464; 6183 t['Elcyrillic'] = 0x041B; 6184 t['Elevenroman'] = 0x216A; 6185 t['Emacron'] = 0x0112; 6186 t['Emacronacute'] = 0x1E16; 6187 t['Emacrongrave'] = 0x1E14; 6188 t['Emcyrillic'] = 0x041C; 6189 t['Emonospace'] = 0xFF25; 6190 t['Encyrillic'] = 0x041D; 6191 t['Endescendercyrillic'] = 0x04A2; 6192 t['Eng'] = 0x014A; 6193 t['Enghecyrillic'] = 0x04A4; 6194 t['Enhookcyrillic'] = 0x04C7; 6195 t['Eogonek'] = 0x0118; 6196 t['Eopen'] = 0x0190; 6197 t['Epsilon'] = 0x0395; 6198 t['Epsilontonos'] = 0x0388; 6199 t['Ercyrillic'] = 0x0420; 6200 t['Ereversed'] = 0x018E; 6201 t['Ereversedcyrillic'] = 0x042D; 6202 t['Escyrillic'] = 0x0421; 6203 t['Esdescendercyrillic'] = 0x04AA; 6204 t['Esh'] = 0x01A9; 6205 t['Esmall'] = 0xF765; 6206 t['Eta'] = 0x0397; 6207 t['Etarmenian'] = 0x0538;
6208 t['Etatonos'] = 0x0389; 6209 t['Eth'] = 0x00D0; 6210 t['Ethsmall'] = 0xF7F0; 6211 t['Etilde'] = 0x1EBC; 6212 t['Etildebelow'] = 0x1E1A; 6213 t['Euro'] = 0x20AC; 6214 t['Ezh'] = 0x01B7; 6215 t['Ezhcaron'] = 0x01EE; 6216 t['Ezhreversed'] = 0x01B8; 6217 t['F'] = 0x0046; 6218 t['Fcircle'] = 0x24BB; 6219 t['Fdotaccent'] = 0x1E1E; 6220 t['Feharmenian'] = 0x0556; 6221 t['Feicoptic'] = 0x03E4; 6222 t['Fhook'] = 0x0191; 6223 t['Fitacyrillic'] = 0x0472; 6224 t['Fiveroman'] = 0x2164; 6225 t['Fmonospace'] = 0xFF26; 6226 t['Fourroman'] = 0x2163; 6227 t['Fsmall'] = 0xF766; 6228 t['G'] = 0x0047; 6229 t['GBsquare'] = 0x3387; 6230 t['Gacute'] = 0x01F4; 6231 t['Gamma'] = 0x0393; 6232 t['Gammaafrican'] = 0x0194; 6233 t['Gangiacoptic'] = 0x03EA; 6234 t['Gbreve'] = 0x011E; 6235 t['Gcaron'] = 0x01E6; 6236 t['Gcedilla'] = 0x0122; 6237 t['Gcircle'] = 0x24BC; 6238 t['Gcircumflex'] = 0x011C; 6239 t['Gcommaaccent'] = 0x0122; 6240 t['Gdot'] = 0x0120; 6241 t['Gdotaccent'] = 0x0120; 6242 t['Gecyrillic'] = 0x0413; 6243 t['Ghadarmenian'] = 0x0542; 6244 t['Ghemiddlehookcyrillic'] = 0x0494; 6245 t['Ghestrokecyrillic'] = 0x0492; 6246 t['Gheupturncyrillic'] = 0x0490; 6247 t['Ghook'] = 0x0193; 6248 t['Gimarmenian'] = 0x0533; 6249 t['Gjecyrillic'] = 0x0403; 6250 t['Gmacron'] = 0x1E20; 6251 t['Gmonospace'] = 0xFF27; 6252 t['Grave'] = 0xF6CE; 6253 t['Gravesmall'] = 0xF760; 6254 t['Gsmall'] = 0xF767; 6255 t['Gsmallhook'] = 0x029B; 6256 t['Gstroke'] = 0x01E4; 6257 t['H'] = 0x0048; 6258 t['H18533'] = 0x25CF; 6259 t['H18543'] = 0x25AA; 6260 t['H18551'] = 0x25AB; 6261 t['H22073'] = 0x25A1; 6262 t['HPsquare'] = 0x33CB; 6263 t['Haabkhasiancyrillic'] = 0x04A8; 6264 t['Hadescendercyrillic'] = 0x04B2; 6265 t['Hardsigncyrillic'] = 0x042A; 6266 t['Hbar'] = 0x0126; 6267 t['Hbrevebelow'] = 0x1E2A; 6268 t['Hcedilla'] = 0x1E28; 6269 t['Hcircle'] = 0x24BD; 6270 t['Hcircumflex'] = 0x0124; 6271 t['Hdieresis'] = 0x1E26; 6272 t['Hdotaccent'] = 0x1E22; 6273 t['Hdotbelow'] = 0x1E24; 6274 t['Hmonospace'] = 0xFF28; 6275 t['Hoarmenian'] = 0x0540; 6276 t['Horicoptic'] = 0x03E8; 6277 t['Hsmall'] = 0xF768; 6278 t['Hungarumlaut'] = 0xF6CF; 6279 t['Hungarumlautsmall'] = 0xF6F8; 6280 t['Hzsquare'] = 0x3390; 6281 t['I'] = 0x0049; 6282 t['IAcyrillic'] = 0x042F; 6283 t['IJ'] = 0x0132; 6284 t['IUcyrillic'] = 0x042E; 6285 t['Iacute'] = 0x00CD; 6286 t['Iacutesmall'] = 0xF7ED; 6287 t['Ibreve'] = 0x012C; 6288 t['Icaron'] = 0x01CF; 6289 t['Icircle'] = 0x24BE; 6290 t['Icircumflex'] = 0x00CE; 6291 t['Icircumflexsmall'] = 0xF7EE; 6292 t['Icyrillic'] = 0x0406; 6293 t['Idblgrave'] = 0x0208; 6294 t['Idieresis'] = 0x00CF; 6295 t['Idieresisacute'] = 0x1E2E; 6296 t['Idieresiscyrillic'] = 0x04E4; 6297 t['Idieresissmall'] = 0xF7EF; 6298 t['Idot'] = 0x0130; 6299 t['Idotaccent'] = 0x0130; 6300 t['Idotbelow'] = 0x1ECA; 6301 t['Iebrevecyrillic'] = 0x04D6; 6302 t['Iecyrillic'] = 0x0415; 6303 t['Ifraktur'] = 0x2111; 6304 t['Igrave'] = 0x00CC; 6305 t['Igravesmall'] = 0xF7EC; 6306 t['Ihookabove'] = 0x1EC8; 6307 t['Iicyrillic'] = 0x0418; 6308 t['Iinvertedbreve'] = 0x020A; 6309 t['Iishortcyrillic'] = 0x0419; 6310 t['Imacron'] = 0x012A; 6311 t['Imacroncyrillic'] = 0x04E2; 6312 t['Imonospace'] = 0xFF29; 6313 t['Iniarmenian'] = 0x053B; 6314 t['Iocyrillic'] = 0x0401; 6315 t['Iogonek'] = 0x012E; 6316 t['Iota'] = 0x0399; 6317 t['Iotaafrican'] = 0x0196; 6318 t['Iotadieresis'] = 0x03AA; 6319 t['Iotatonos'] = 0x038A; 6320 t['Ismall'] = 0xF769; 6321 t['Istroke'] = 0x0197; 6322 t['Itilde'] = 0x0128; 6323 t['Itildebelow'] = 0x1E2C; 6324 t['Izhitsacyrillic'] = 0x0474; 6325 t['Izhitsadblgravecyrillic'] = 0x0476; 6326 t['J'] = 0x004A; 6327 t['Jaarmenian'] = 0x0541; 6328 t['Jcircle'] = 0x24BF; 6329 t['Jcircumflex'] = 0x0134; 6330 t['Jecyrillic'] = 0x0408; 6331 t['Jheharmenian'] = 0x054B; 6332 t['Jmonospace'] = 0xFF2A; 6333 t['Jsmall'] = 0xF76A; 6334 t['K'] = 0x004B; 6335 t['KBsquare'] = 0x3385; 6336 t['KKsquare'] = 0x33CD; 6337 t['Kabashkircyrillic'] = 0x04A0; 6338 t['Kacute'] = 0x1E30; 6339 t['Kacyrillic'] = 0x041A; 6340 t['Kadescendercyrillic'] = 0x049A; 6341 t['Kahookcyrillic'] = 0x04C3;
6342 t['Kappa'] = 0x039A; 6343 t['Kastrokecyrillic'] = 0x049E; 6344 t['Kaverticalstrokecyrillic'] = 0x049C; 6345 t['Kcaron'] = 0x01E8; 6346 t['Kcedilla'] = 0x0136; 6347 t['Kcircle'] = 0x24C0; 6348 t['Kcommaaccent'] = 0x0136; 6349 t['Kdotbelow'] = 0x1E32; 6350 t['Keharmenian'] = 0x0554; 6351 t['Kenarmenian'] = 0x053F; 6352 t['Khacyrillic'] = 0x0425; 6353 t['Kheicoptic'] = 0x03E6; 6354 t['Khook'] = 0x0198; 6355 t['Kjecyrillic'] = 0x040C; 6356 t['Klinebelow'] = 0x1E34; 6357 t['Kmonospace'] = 0xFF2B; 6358 t['Koppacyrillic'] = 0x0480; 6359 t['Koppagreek'] = 0x03DE; 6360 t['Ksicyrillic'] = 0x046E; 6361 t['Ksmall'] = 0xF76B; 6362 t['L'] = 0x004C; 6363 t['LJ'] = 0x01C7; 6364 t['LL'] = 0xF6BF; 6365 t['Lacute'] = 0x0139; 6366 t['Lambda'] = 0x039B; 6367 t['Lcaron'] = 0x013D; 6368 t['Lcedilla'] = 0x013B; 6369 t['Lcircle'] = 0x24C1; 6370 t['Lcircumflexbelow'] = 0x1E3C; 6371 t['Lcommaaccent'] = 0x013B; 6372 t['Ldot'] = 0x013F; 6373 t['Ldotaccent'] = 0x013F; 6374 t['Ldotbelow'] = 0x1E36; 6375 t['Ldotbelowmacron'] = 0x1E38; 6376 t['Liwnarmenian'] = 0x053C; 6377 t['Lj'] = 0x01C8; 6378 t['Ljecyrillic'] = 0x0409; 6379 t['Llinebelow'] = 0x1E3A; 6380 t['Lmonospace'] = 0xFF2C; 6381 t['Lslash'] = 0x0141; 6382 t['Lslashsmall'] = 0xF6F9; 6383 t['Lsmall'] = 0xF76C; 6384 t['M'] = 0x004D; 6385 t['MBsquare'] = 0x3386; 6386 t['Macron'] = 0xF6D0; 6387 t['Macronsmall'] = 0xF7AF; 6388 t['Macute'] = 0x1E3E; 6389 t['Mcircle'] = 0x24C2; 6390 t['Mdotaccent'] = 0x1E40; 6391 t['Mdotbelow'] = 0x1E42; 6392 t['Menarmenian'] = 0x0544; 6393 t['Mmonospace'] = 0xFF2D; 6394 t['Msmall'] = 0xF76D; 6395 t['Mturned'] = 0x019C; 6396 t['Mu'] = 0x039C; 6397 t['N'] = 0x004E; 6398 t['NJ'] = 0x01CA; 6399 t['Nacute'] = 0x0143; 6400 t['Ncaron'] = 0x0147; 6401 t['Ncedilla'] = 0x0145; 6402 t['Ncircle'] = 0x24C3; 6403 t['Ncircumflexbelow'] = 0x1E4A; 6404 t['Ncommaaccent'] = 0x0145; 6405 t['Ndotaccent'] = 0x1E44; 6406 t['Ndotbelow'] = 0x1E46; 6407 t['Nhookleft'] = 0x019D; 6408 t['Nineroman'] = 0x2168; 6409 t['Nj'] = 0x01CB; 6410 t['Njecyrillic'] = 0x040A; 6411 t['Nlinebelow'] = 0x1E48; 6412 t['Nmonospace'] = 0xFF2E; 6413 t['Nowarmenian'] = 0x0546; 6414 t['Nsmall'] = 0xF76E; 6415 t['Ntilde'] = 0x00D1; 6416 t['Ntildesmall'] = 0xF7F1; 6417 t['Nu'] = 0x039D; 6418 t['O'] = 0x004F; 6419 t['OE'] = 0x0152; 6420 t['OEsmall'] = 0xF6FA; 6421 t['Oacute'] = 0x00D3; 6422 t['Oacutesmall'] = 0xF7F3; 6423 t['Obarredcyrillic'] = 0x04E8; 6424 t['Obarreddieresiscyrillic'] = 0x04EA; 6425 t['Obreve'] = 0x014E; 6426 t['Ocaron'] = 0x01D1; 6427 t['Ocenteredtilde'] = 0x019F; 6428 t['Ocircle'] = 0x24C4; 6429 t['Ocircumflex'] = 0x00D4; 6430 t['Ocircumflexacute'] = 0x1ED0; 6431 t['Ocircumflexdotbelow'] = 0x1ED8; 6432 t['Ocircumflexgrave'] = 0x1ED2; 6433 t['Ocircumflexhookabove'] = 0x1ED4; 6434 t['Ocircumflexsmall'] = 0xF7F4; 6435 t['Ocircumflextilde'] = 0x1ED6; 6436 t['Ocyrillic'] = 0x041E; 6437 t['Odblacute'] = 0x0150; 6438 t['Odblgrave'] = 0x020C; 6439 t['Odieresis'] = 0x00D6; 6440 t['Odieresiscyrillic'] = 0x04E6; 6441 t['Odieresissmall'] = 0xF7F6; 6442 t['Odotbelow'] = 0x1ECC; 6443 t['Ogoneksmall'] = 0xF6FB; 6444 t['Ograve'] = 0x00D2; 6445 t['Ogravesmall'] = 0xF7F2; 6446 t['Oharmenian'] = 0x0555; 6447 t['Ohm'] = 0x2126; 6448 t['Ohookabove'] = 0x1ECE; 6449 t['Ohorn'] = 0x01A0; 6450 t['Ohornacute'] = 0x1EDA; 6451 t['Ohorndotbelow'] = 0x1EE2; 6452 t['Ohorngrave'] = 0x1EDC; 6453 t['Ohornhookabove'] = 0x1EDE; 6454 t['Ohorntilde'] = 0x1EE0; 6455 t['Ohungarumlaut'] = 0x0150; 6456 t['Oi'] = 0x01A2; 6457 t['Oinvertedbreve'] = 0x020E; 6458 t['Omacron'] = 0x014C; 6459 t['Omacronacute'] = 0x1E52; 6460 t['Omacrongrave'] = 0x1E50; 6461 t['Omega'] = 0x2126; 6462 t['Omegacyrillic'] = 0x0460; 6463 t['Omegagreek'] = 0x03A9; 6464 t['Omegaroundcyrillic'] = 0x047A; 6465 t['Omegatitlocyrillic'] = 0x047C; 6466 t['Omegatonos'] = 0x038F; 6467 t['Omicron'] = 0x039F; 6468 t['Omicrontonos'] = 0x038C; 6469 t['Omonospace'] = 0xFF2F; 6470 t['Oneroman'] = 0x2160; 6471 t['Oogonek'] = 0x01EA; 6472 t['Oogonekmacron'] = 0x01EC; 6473 t['Oopen'] = 0x0186; 6474 t['Oslash'] = 0x00D8; 6475 t['Oslashacute'] = 0x01FE; 6476 t['Oslashsmall'] = 0xF7F8; 6477 t['Osmall'] = 0xF76F; 6478 t['Ostrokeacute'] = 0x01FE; 6479 t['Otcyrillic'] = 0x047E; 6480 t['Otilde'] = 0x00D5; 6481 t['Otildeacute'] = 0x1E4C; 6482 t['Otildedieresis'] = 0x1E4E; 6483 t['Otildesmall'] = 0xF7F5; 6484 t['P'] = 0x0050; 6485 t['Pacute'] = 0x1E54; 6486 t['Pcircle'] = 0x24C5; 6487 t['Pdotaccent'] = 0x1E56; 6488 t['Pecyrillic'] = 0x041F; 6489 t['Peharmenian'] = 0x054A; 6490 t['Pemiddlehookcyrillic'] = 0x04A6; 6491 t['Phi'] = 0x03A6; 6492 t['Phook'] = 0x01A4; 6493 t['Pi'] = 0x03A0; 6494 t['Piwrarmenian'] = 0x0553; 6495 t['Pmonospace'] = 0xFF30; 6496 t['Psi'] = 0x03A8; 6497 t['Psicyrillic'] = 0x0470; 6498 t['Psmall'] = 0xF770; 6499 t['Q'] = 0x0051; 6500 t['Qcircle'] = 0x24C6; 6501 t['Qmonospace'] = 0xFF31; 6502 t['Qsmall'] = 0xF771; 6503 t['R'] = 0x0052; 6504 t['Raarmenian'] = 0x054C; 6505 t['Racute'] = 0x0154; 6506 t['Rcaron'] = 0x0158; 6507 t['Rcedilla'] = 0x0156; 6508 t['Rcircle'] = 0x24C7; 6509 t['Rcommaaccent'] = 0x0156; 6510 t['Rdblgrave'] = 0x0210; 6511 t['Rdotaccent'] = 0x1E58; 6512 t['Rdotbelow'] = 0x1E5A; 6513 t['Rdotbelowmacron'] = 0x1E5C; 6514 t['Reharmenian'] = 0x0550; 6515 t['Rfraktur'] = 0x211C; 6516 t['Rho'] = 0x03A1; 6517 t['Ringsmall'] = 0xF6FC; 6518 t['Rinvertedbreve'] = 0x0212; 6519 t['Rlinebelow'] = 0x1E5E; 6520 t['Rmonospace'] = 0xFF32; 6521 t['Rsmall'] = 0xF772; 6522 t['Rsmallinverted'] = 0x0281; 6523 t['Rsmallinvertedsuperior'] = 0x02B6; 6524 t['S'] = 0x0053; 6525 t['SF010000'] = 0x250C; 6526 t['SF020000'] = 0x2514; 6527 t['SF030000'] = 0x2510; 6528 t['SF040000'] = 0x2518; 6529 t['SF050000'] = 0x253C; 6530 t['SF060000'] = 0x252C; 6531 t['SF070000'] = 0x2534; 6532 t['SF080000'] = 0x251C; 6533 t['SF090000'] = 0x2524; 6534 t['SF100000'] = 0x2500; 6535 t['SF110000'] = 0x2502; 6536 t['SF190000'] = 0x2561; 6537 t['SF200000'] = 0x2562; 6538 t['SF210000'] = 0x2556; 6539 t['SF220000'] = 0x2555; 6540 t['SF230000'] = 0x2563; 6541 t['SF240000'] = 0x2551; 6542 t['SF250000'] = 0x2557; 6543 t['SF260000'] = 0x255D; 6544 t['SF270000'] = 0x255C; 6545 t['SF280000'] = 0x255B; 6546 t['SF360000'] = 0x255E; 6547 t['SF370000'] = 0x255F; 6548 t['SF380000'] = 0x255A; 6549 t['SF390000'] = 0x2554; 6550 t['SF400000'] = 0x2569; 6551 t['SF410000'] = 0x2566; 6552 t['SF420000'] = 0x2560; 6553 t['SF430000'] = 0x2550; 6554 t['SF440000'] = 0x256C; 6555 t['SF450000'] = 0x2567; 6556 t['SF460000'] = 0x2568; 6557 t['SF470000'] = 0x2564; 6558 t['SF480000'] = 0x2565; 6559 t['SF490000'] = 0x2559; 6560 t['SF500000'] = 0x2558; 6561 t['SF510000'] = 0x2552; 6562 t['SF520000'] = 0x2553; 6563 t['SF530000'] = 0x256B; 6564 t['SF540000'] = 0x256A; 6565 t['Sacute'] = 0x015A; 6566 t['Sacutedotaccent'] = 0x1E64; 6567 t['Sampigreek'] = 0x03E0; 6568 t['Scaron'] = 0x0160; 6569 t['Scarondotaccent'] = 0x1E66; 6570 t['Scaronsmall'] = 0xF6FD; 6571 t['Scedilla'] = 0x015E; 6572 t['Schwa'] = 0x018F; 6573 t['Schwacyrillic'] = 0x04D8; 6574 t['Schwadieresiscyrillic'] = 0x04DA; 6575 t['Scircle'] = 0x24C8; 6576 t['Scircumflex'] = 0x015C; 6577 t['Scommaaccent'] = 0x0218; 6578 t['Sdotaccent'] = 0x1E60; 6579 t['Sdotbelow'] = 0x1E62; 6580 t['Sdotbelowdotaccent'] = 0x1E68; 6581 t['Seharmenian'] = 0x054D; 6582 t['Sevenroman'] = 0x2166; 6583 t['Shaarmenian'] = 0x0547; 6584 t['Shacyrillic'] = 0x0428; 6585 t['Shchacyrillic'] = 0x0429; 6586 t['Sheicoptic'] = 0x03E2; 6587 t['Shhacyrillic'] = 0x04BA; 6588 t['Shimacoptic'] = 0x03EC;
6589 t['Sigma'] = 0x03A3; 6590 t['Sixroman'] = 0x2165; 6591 t['Smonospace'] = 0xFF33; 6592 t['Softsigncyrillic'] = 0x042C; 6593 t['Ssmall'] = 0xF773; 6594 t['Stigmagreek'] = 0x03DA; 6595 t['T'] = 0x0054; 6596 t['Tau'] = 0x03A4; 6597 t['Tbar'] = 0x0166; 6598 t['Tcaron'] = 0x0164; 6599 t['Tcedilla'] = 0x0162; 6600 t['Tcircle'] = 0x24C9; 6601 t['Tcircumflexbelow'] = 0x1E70; 6602 t['Tcommaaccent'] = 0x0162; 6603 t['Tdotaccent'] = 0x1E6A; 6604 t['Tdotbelow'] = 0x1E6C; 6605 t['Tecyrillic'] = 0x0422; 6606 t['Tedescendercyrillic'] = 0x04AC; 6607 t['Tenroman'] = 0x2169; 6608 t['Tetsecyrillic'] = 0x04B4; 6609 t['Theta'] = 0x0398; 6610 t['Thook'] = 0x01AC; 6611 t['Thorn'] = 0x00DE; 6612 t['Thornsmall'] = 0xF7FE; 6613 t['Threeroman'] = 0x2162; 6614 t['Tildesmall'] = 0xF6FE; 6615 t['Tiwnarmenian'] = 0x054F; 6616 t['Tlinebelow'] = 0x1E6E; 6617 t['Tmonospace'] = 0xFF34; 6618 t['Toarmenian'] = 0x0539; 6619 t['Tonefive'] = 0x01BC; 6620 t['Tonesix'] = 0x0184; 6621 t['Tonetwo'] = 0x01A7; 6622 t['Tretroflexhook'] = 0x01AE; 6623 t['Tsecyrillic'] = 0x0426; 6624 t['Tshecyrillic'] = 0x040B; 6625 t['Tsmall'] = 0xF774; 6626 t['Twelveroman'] = 0x216B; 6627 t['Tworoman'] = 0x2161; 6628 t['U'] = 0x0055; 6629 t['Uacute'] = 0x00DA; 6630 t['Uacutesmall'] = 0xF7FA; 6631 t['Ubreve'] = 0x016C; 6632 t['Ucaron'] = 0x01D3; 6633 t['Ucircle'] = 0x24CA; 6634 t['Ucircumflex'] = 0x00DB; 6635 t['Ucircumflexbelow'] = 0x1E76; 6636 t['Ucircumflexsmall'] = 0xF7FB; 6637 t['Ucyrillic'] = 0x0423; 6638 t['Udblacute'] = 0x0170; 6639 t['Udblgrave'] = 0x0214; 6640 t['Udieresis'] = 0x00DC; 6641 t['Udieresisacute'] = 0x01D7; 6642 t['Udieresisbelow'] = 0x1E72; 6643 t['Udieresiscaron'] = 0x01D9; 6644 t['Udieresiscyrillic'] = 0x04F0; 6645 t['Udieresisgrave'] = 0x01DB; 6646 t['Udieresismacron'] = 0x01D5; 6647 t['Udieresissmall'] = 0xF7FC; 6648 t['Udotbelow'] = 0x1EE4; 6649 t['Ugrave'] = 0x00D9; 6650 t['Ugravesmall'] = 0xF7F9; 6651 t['Uhookabove'] = 0x1EE6; 6652 t['Uhorn'] = 0x01AF; 6653 t['Uhornacute'] = 0x1EE8; 6654 t['Uhorndotbelow'] = 0x1EF0; 6655 t['Uhorngrave'] = 0x1EEA; 6656 t['Uhornhookabove'] = 0x1EEC; 6657 t['Uhorntilde'] = 0x1EEE; 6658 t['Uhungarumlaut'] = 0x0170; 6659 t['Uhungarumlautcyrillic'] = 0x04F2; 6660 t['Uinvertedbreve'] = 0x0216; 6661 t['Ukcyrillic'] = 0x0478; 6662 t['Umacron'] = 0x016A; 6663 t['Umacroncyrillic'] = 0x04EE; 6664 t['Umacrondieresis'] = 0x1E7A; 6665 t['Umonospace'] = 0xFF35; 6666 t['Uogonek'] = 0x0172; 6667 t['Upsilon'] = 0x03A5; 6668 t['Upsilon1'] = 0x03D2; 6669 t['Upsilonacutehooksymbolgreek'] = 0x03D3; 6670 t['Upsilonafrican'] = 0x01B1; 6671 t['Upsilondieresis'] = 0x03AB; 6672 t['Upsilondieresishooksymbolgreek'] = 0x03D4; 6673 t['Upsilonhooksymbol'] = 0x03D2; 6674 t['Upsilontonos'] = 0x038E; 6675 t['Uring'] = 0x016E; 6676 t['Ushortcyrillic'] = 0x040E; 6677 t['Usmall'] = 0xF775; 6678 t['Ustraightcyrillic'] = 0x04AE; 6679 t['Ustraightstrokecyrillic'] = 0x04B0; 6680 t['Utilde'] = 0x0168; 6681 t['Utildeacute'] = 0x1E78; 6682 t['Utildebelow'] = 0x1E74; 6683 t['V'] = 0x0056; 6684 t['Vcircle'] = 0x24CB; 6685 t['Vdotbelow'] = 0x1E7E; 6686 t['Vecyrillic'] = 0x0412; 6687 t['Vewarmenian'] = 0x054E; 6688 t['Vhook'] = 0x01B2; 6689 t['Vmonospace'] = 0xFF36; 6690 t['Voarmenian'] = 0x0548; 6691 t['Vsmall'] = 0xF776; 6692 t['Vtilde'] = 0x1E7C; 6693 t['W'] = 0x0057; 6694 t['Wacute'] = 0x1E82; 6695 t['Wcircle'] = 0x24CC; 6696 t['Wcircumflex'] = 0x0174; 6697 t['Wdieresis'] = 0x1E84; 6698 t['Wdotaccent'] = 0x1E86; 6699 t['Wdotbelow'] = 0x1E88; 6700 t['Wgrave'] = 0x1E80; 6701 t['Wmonospace'] = 0xFF37; 6702 t['Wsmall'] = 0xF777; 6703 t['X'] = 0x0058; 6704 t['Xcircle'] = 0x24CD; 6705 t['Xdieresis'] = 0x1E8C; 6706 t['Xdotaccent'] = 0x1E8A; 6707 t['Xeharmenian'] = 0x053D; 6708 t['Xi'] = 0x039E; 6709 t['Xmonospace'] = 0xFF38; 6710 t['Xsmall'] = 0xF778; 6711 t['Y'] = 0x0059; 6712 t['Yacute'] = 0x00DD; 6713 t['Yacutesmall'] = 0xF7FD; 6714 t['Yatcyrillic'] = 0x0462; 6715 t['Ycircle'] = 0x24CE; 6716 t['Ycircumflex'] = 0x0176; 6717 t['Ydieresis'] = 0x0178; 6718 t['Ydieresissmall'] = 0xF7FF; 6719 t['Ydotaccent'] = 0x1E8E; 6720 t['Ydotbelow'] = 0x1EF4; 6721 t['Yericyrillic'] = 0x042B; 6722 t['Yerudieresiscyrillic'] = 0x04F8; 6723 t['Ygrave'] = 0x1EF2; 6724 t['Yhook'] = 0x01B3; 6725 t['Yhookabove'] = 0x1EF6; 6726 t['Yiarmenian'] = 0x0545; 6727 t['Yicyrillic'] = 0x0407; 6728 t['Yiwnarmenian'] = 0x0552; 6729 t['Ymonospace'] = 0xFF39; 6730 t['Ysmall'] = 0xF779; 6731 t['Ytilde'] = 0x1EF8; 6732 t['Yusbigcyrillic'] = 0x046A; 6733 t['Yusbigiotifiedcyrillic'] = 0x046C; 6734 t['Yuslittlecyrillic'] = 0x0466; 6735 t['Yuslittleiotifiedcyrillic'] = 0x0468; 6736 t['Z'] = 0x005A; 6737 t['Zaarmenian'] = 0x0536; 6738 t['Zacute'] = 0x0179; 6739 t['Zcaron'] = 0x017D; 6740 t['Zcaronsmall'] = 0xF6FF; 6741 t['Zcircle'] = 0x24CF; 6742 t['Zcircumflex'] = 0x1E90; 6743 t['Zdot'] = 0x017B; 6744 t['Zdotaccent'] = 0x017B; 6745 t['Zdotbelow'] = 0x1E92; 6746 t['Zecyrillic'] = 0x0417; 6747 t['Zedescendercyrillic'] = 0x0498; 6748 t['Zedieresiscyrillic'] = 0x04DE; 6749 t['Zeta'] = 0x0396; 6750 t['Zhearmenian'] = 0x053A; 6751 t['Zhebrevecyrillic'] = 0x04C1; 6752 t['Zhecyrillic'] = 0x0416; 6753 t['Zhedescendercyrillic'] = 0x0496; 6754 t['Zhedieresiscyrillic'] = 0x04DC; 6755 t['Zlinebelow'] = 0x1E94; 6756 t['Zmonospace'] = 0xFF3A; 6757 t['Zsmall'] = 0xF77A; 6758 t['Zstroke'] = 0x01B5; 6759 t['a'] = 0x0061; 6760 t['aabengali'] = 0x0986; 6761 t['aacute'] = 0x00E1; 6762 t['aadeva'] = 0x0906; 6763 t['aagujarati'] = 0x0A86; 6764 t['aagurmukhi'] = 0x0A06; 6765 t['aamatragurmukhi'] = 0x0A3E; 6766 t['aarusquare'] = 0x3303; 6767 t['aavowelsignbengali'] = 0x09BE; 6768 t['aavowelsigndeva'] = 0x093E; 6769 t['aavowelsigngujarati'] = 0x0ABE; 6770 t['abbreviationmarkarmenian'] = 0x055F; 6771 t['abbreviationsigndeva'] = 0x0970; 6772 t['abengali'] = 0x0985; 6773 t['abopomofo'] = 0x311A; 6774 t['abreve'] = 0x0103; 6775 t['abreveacute'] = 0x1EAF; 6776 t['abrevecyrillic'] = 0x04D1; 6777 t['abrevedotbelow'] = 0x1EB7; 6778 t['abrevegrave'] = 0x1EB1; 6779 t['abrevehookabove'] = 0x1EB3; 6780 t['abrevetilde'] = 0x1EB5; 6781 t['acaron'] = 0x01CE; 6782 t['acircle'] = 0x24D0; 6783 t['acircumflex'] = 0x00E2; 6784 t['acircumflexacute'] = 0x1EA5; 6785 t['acircumflexdotbelow'] = 0x1EAD; 6786 t['acircumflexgrave'] = 0x1EA7; 6787 t['acircumflexhookabove'] = 0x1EA9; 6788 t['acircumflextilde'] = 0x1EAB; 6789 t['acute'] = 0x00B4; 6790 t['acutebelowcmb'] = 0x0317; 6791 t['acutecmb'] = 0x0301; 6792 t['acutecomb'] = 0x0301; 6793 t['acutedeva'] = 0x0954; 6794 t['acutelowmod'] = 0x02CF; 6795 t['acutetonecmb'] = 0x0341; 6796 t['acyrillic'] = 0x0430; 6797 t['adblgrave'] = 0x0201; 6798 t['addakgurmukhi'] = 0x0A71; 6799 t['adeva'] = 0x0905; 6800 t['adieresis'] = 0x00E4; 6801 t['adieresiscyrillic'] = 0x04D3; 6802 t['adieresismacron'] = 0x01DF; 6803 t['adotbelow'] = 0x1EA1; 6804 t['adotmacron'] = 0x01E1; 6805 t['ae'] = 0x00E6; 6806 t['aeacute'] = 0x01FD; 6807 t['aekorean'] = 0x3150; 6808 t['aemacron'] = 0x01E3; 6809 t['afii00208'] = 0x2015; 6810 t['afii08941'] = 0x20A4; 6811 t['afii10017'] = 0x0410; 6812 t['afii10018'] = 0x0411; 6813 t['afii10019'] = 0x0412; 6814 t['afii10020'] = 0x0413;
6815 t['afii10021'] = 0x0414; 6816 t['afii10022'] = 0x0415; 6817 t['afii10023'] = 0x0401; 6818 t['afii10024'] = 0x0416; 6819 t['afii10025'] = 0x0417; 6820 t['afii10026'] = 0x0418; 6821 t['afii10027'] = 0x0419; 6822 t['afii10028'] = 0x041A; 6823 t['afii10029'] = 0x041B; 6824 t['afii10030'] = 0x041C; 6825 t['afii10031'] = 0x041D; 6826 t['afii10032'] = 0x041E; 6827 t['afii10033'] = 0x041F; 6828 t['afii10034'] = 0x0420; 6829 t['afii10035'] = 0x0421; 6830 t['afii10036'] = 0x0422; 6831 t['afii10037'] = 0x0423; 6832 t['afii10038'] = 0x0424; 6833 t['afii10039'] = 0x0425; 6834 t['afii10040'] = 0x0426; 6835 t['afii10041'] = 0x0427; 6836 t['afii10042'] = 0x0428; 6837 t['afii10043'] = 0x0429; 6838 t['afii10044'] = 0x042A; 6839 t['afii10045'] = 0x042B; 6840 t['afii10046'] = 0x042C; 6841 t['afii10047'] = 0x042D; 6842 t['afii10048'] = 0x042E; 6843 t['afii10049'] = 0x042F; 6844 t['afii10050'] = 0x0490; 6845 t['afii10051'] = 0x0402; 6846 t['afii10052'] = 0x0403; 6847 t['afii10053'] = 0x0404; 6848 t['afii10054'] = 0x0405; 6849 t['afii10055'] = 0x0406; 6850 t['afii10056'] = 0x0407; 6851 t['afii10057'] = 0x0408; 6852 t['afii10058'] = 0x0409; 6853 t['afii10059'] = 0x040A; 6854 t['afii10060'] = 0x040B; 6855 t['afii10061'] = 0x040C; 6856 t['afii10062'] = 0x040E; 6857 t['afii10063'] = 0xF6C4; 6858 t['afii10064'] = 0xF6C5; 6859 t['afii10065'] = 0x0430; 6860 t['afii10066'] = 0x0431; 6861 t['afii10067'] = 0x0432; 6862 t['afii10068'] = 0x0433; 6863 t['afii10069'] = 0x0434; 6864 t['afii10070'] = 0x0435; 6865 t['afii10071'] = 0x0451; 6866 t['afii10072'] = 0x0436; 6867 t['afii10073'] = 0x0437; 6868 t['afii10074'] = 0x0438; 6869 t['afii10075'] = 0x0439; 6870 t['afii10076'] = 0x043A; 6871 t['afii10077'] = 0x043B; 6872 t['afii10078'] = 0x043C; 6873 t['afii10079'] = 0x043D; 6874 t['afii10080'] = 0x043E; 6875 t['afii10081'] = 0x043F; 6876 t['afii10082'] = 0x0440; 6877 t['afii10083'] = 0x0441; 6878 t['afii10084'] = 0x0442; 6879 t['afii10085'] = 0x0443; 6880 t['afii10086'] = 0x0444; 6881 t['afii10087'] = 0x0445; 6882 t['afii10088'] = 0x0446; 6883 t['afii10089'] = 0x0447; 6884 t['afii10090'] = 0x0448; 6885 t['afii10091'] = 0x0449; 6886 t['afii10092'] = 0x044A; 6887 t['afii10093'] = 0x044B; 6888 t['afii10094'] = 0x044C; 6889 t['afii10095'] = 0x044D; 6890 t['afii10096'] = 0x044E; 6891 t['afii10097'] = 0x044F; 6892 t['afii10098'] = 0x0491; 6893 t['afii10099'] = 0x0452; 6894 t['afii10100'] = 0x0453; 6895 t['afii10101'] = 0x0454; 6896 t['afii10102'] = 0x0455; 6897 t['afii10103'] = 0x0456; 6898 t['afii10104'] = 0x0457; 6899 t['afii10105'] = 0x0458; 6900 t['afii10106'] = 0x0459; 6901 t['afii10107'] = 0x045A; 6902 t['afii10108'] = 0x045B; 6903 t['afii10109'] = 0x045C; 6904 t['afii10110'] = 0x045E; 6905 t['afii10145'] = 0x040F; 6906 t['afii10146'] = 0x0462; 6907 t['afii10147'] = 0x0472; 6908 t['afii10148'] = 0x0474; 6909 t['afii10192'] = 0xF6C6; 6910 t['afii10193'] = 0x045F; 6911 t['afii10194'] = 0x0463; 6912 t['afii10195'] = 0x0473; 6913 t['afii10196'] = 0x0475; 6914 t['afii10831'] = 0xF6C7; 6915 t['afii10832'] = 0xF6C8; 6916 t['afii10846'] = 0x04D9; 6917 t['afii299'] = 0x200E; 6918 t['afii300'] = 0x200F; 6919 t['afii301'] = 0x200D; 6920 t['afii57381'] = 0x066A; 6921 t['afii57388'] = 0x060C; 6922 t['afii57392'] = 0x0660; 6923 t['afii57393'] = 0x0661; 6924 t['afii57394'] = 0x0662; 6925 t['afii57395'] = 0x0663; 6926 t['afii57396'] = 0x0664; 6927 t['afii57397'] = 0x0665; 6928 t['afii57398'] = 0x0666; 6929 t['afii57399'] = 0x0667; 6930 t['afii57400'] = 0x0668; 6931 t['afii57401'] = 0x0669; 6932 t['afii57403'] = 0x061B; 6933 t['afii57407'] = 0x061F; 6934 t['afii57409'] = 0x0621; 6935 t['afii57410'] = 0x0622; 6936 t['afii57411'] = 0x0623; 6937 t['afii57412'] = 0x0624; 6938 t['afii57413'] = 0x0625; 6939 t['afii57414'] = 0x0626; 6940 t['afii57415'] = 0x0627; 6941 t['afii57416'] = 0x0628; 6942 t['afii57417'] = 0x0629; 6943 t['afii57418'] = 0x062A; 6944 t['afii57419'] = 0x062B; 6945 t['afii57420'] = 0x062C; 6946 t['afii57421'] = 0x062D; 6947 t['afii57422'] = 0x062E; 6948 t['afii57423'] = 0x062F; 6949 t['afii57424'] = 0x0630; 6950 t['afii57425'] = 0x0631; 6951 t['afii57426'] = 0x0632; 6952 t['afii57427'] = 0x0633; 6953 t['afii57428'] = 0x0634; 6954 t['afii57429'] = 0x0635; 6955 t['afii57430'] = 0x0636; 6956 t['afii57431'] = 0x0637; 6957 t['afii57432'] = 0x0638; 6958 t['afii57433'] = 0x0639; 6959 t['afii57434'] = 0x063A; 6960 t['afii57440'] = 0x0640; 6961 t['afii57441'] = 0x0641; 6962 t['afii57442'] = 0x0642; 6963 t['afii57443'] = 0x0643; 6964 t['afii57444'] = 0x0644; 6965 t['afii57445'] = 0x0645; 6966 t['afii57446'] = 0x0646; 6967 t['afii57448'] = 0x0648; 6968 t['afii57449'] = 0x0649; 6969 t['afii57450'] = 0x064A; 6970 t['afii57451'] = 0x064B; 6971 t['afii57452'] = 0x064C; 6972 t['afii57453'] = 0x064D; 6973 t['afii57454'] = 0x064E; 6974 t['afii57455'] = 0x064F; 6975 t['afii57456'] = 0x0650; 6976 t['afii57457'] = 0x0651; 6977 t['afii57458'] = 0x0652; 6978 t['afii57470'] = 0x0647; 6979 t['afii57505'] = 0x06A4; 6980 t['afii57506'] = 0x067E; 6981 t['afii57507'] = 0x0686; 6982 t['afii57508'] = 0x0698; 6983 t['afii57509'] = 0x06AF; 6984 t['afii57511'] = 0x0679; 6985 t['afii57512'] = 0x0688; 6986 t['afii57513'] = 0x0691; 6987 t['afii57514'] = 0x06BA; 6988 t['afii57519'] = 0x06D2; 6989 t['afii57534'] = 0x06D5; 6990 t['afii57636'] = 0x20AA; 6991 t['afii57645'] = 0x05BE; 6992 t['afii57658'] = 0x05C3; 6993 t['afii57664'] = 0x05D0; 6994 t['afii57665'] = 0x05D1; 6995 t['afii57666'] = 0x05D2; 6996 t['afii57667'] = 0x05D3; 6997 t['afii57668'] = 0x05D4; 6998 t['afii57669'] = 0x05D5; 6999 t['afii57670'] = 0x05D6; 7000 t['afii57671'] = 0x05D7; 7001 t['afii57672'] = 0x05D8; 7002 t['afii57673'] = 0x05D9; 7003 t['afii57674'] = 0x05DA; 7004 t['afii57675'] = 0x05DB; 7005 t['afii57676'] = 0x05DC; 7006 t['afii57677'] = 0x05DD; 7007 t['afii57678'] = 0x05DE; 7008 t['afii57679'] = 0x05DF; 7009 t['afii57680'] = 0x05E0; 7010 t['afii57681'] = 0x05E1; 7011 t['afii57682'] = 0x05E2; 7012 t['afii57683'] = 0x05E3; 7013 t['afii57684'] = 0x05E4; 7014 t['afii57685'] = 0x05E5; 7015 t['afii57686'] = 0x05E6; 7016 t['afii57687'] = 0x05E7; 7017 t['afii57688'] = 0x05E8; 7018 t['afii57689'] = 0x05E9; 7019 t['afii57690'] = 0x05EA; 7020 t['afii57694'] = 0xFB2A; 7021 t['afii57695'] = 0xFB2B; 7022 t['afii57700'] = 0xFB4B; 7023 t['afii57705'] = 0xFB1F; 7024 t['afii57716'] = 0x05F0; 7025 t['afii57717'] = 0x05F1; 7026 t['afii57718'] = 0x05F2; 7027 t['afii57723'] = 0xFB35; 7028 t['afii57793'] = 0x05B4; 7029 t['afii57794'] = 0x05B5; 7030 t['afii57795'] = 0x05B6; 7031 t['afii57796'] = 0x05BB; 7032 t['afii57797'] = 0x05B8; 7033 t['afii57798'] = 0x05B7; 7034 t['afii57799'] = 0x05B0; 7035 t['afii57800'] = 0x05B2; 7036 t['afii57801'] = 0x05B1; 7037 t['afii57802'] = 0x05B3; 7038 t['afii57803'] = 0x05C2; 7039 t['afii57804'] = 0x05C1; 7040 t['afii57806'] = 0x05B9; 7041 t['afii57807'] = 0x05BC; 7042 t['afii57839'] = 0x05BD; 7043 t['afii57841'] = 0x05BF; 7044 t['afii57842'] = 0x05C0; 7045 t['afii57929'] = 0x02BC; 7046 t['afii61248'] = 0x2105; 7047 t['afii61289'] = 0x2113; 7048 t['afii61352'] = 0x2116; 7049 t['afii61573'] = 0x202C; 7050 t['afii61574'] = 0x202D; 7051 t['afii61575'] = 0x202E; 7052 t['afii61664'] = 0x200C; 7053 t['afii63167'] = 0x066D; 7054 t['afii64937'] = 0x02BD; 7055 t['agrave'] = 0x00E0; 7056 t['agujarati'] = 0x0A85; 7057 t['agurmukhi'] = 0x0A05; 7058 t['ahiragana'] = 0x3042;
7059 t['ahookabove'] = 0x1EA3; 7060 t['aibengali'] = 0x0990; 7061 t['aibopomofo'] = 0x311E; 7062 t['aideva'] = 0x0910; 7063 t['aiecyrillic'] = 0x04D5; 7064 t['aigujarati'] = 0x0A90; 7065 t['aigurmukhi'] = 0x0A10; 7066 t['aimatragurmukhi'] = 0x0A48; 7067 t['ainarabic'] = 0x0639; 7068 t['ainfinalarabic'] = 0xFECA; 7069 t['aininitialarabic'] = 0xFECB; 7070 t['ainmedialarabic'] = 0xFECC; 7071 t['ainvertedbreve'] = 0x0203; 7072 t['aivowelsignbengali'] = 0x09C8; 7073 t['aivowelsigndeva'] = 0x0948; 7074 t['aivowelsigngujarati'] = 0x0AC8; 7075 t['akatakana'] = 0x30A2; 7076 t['akatakanahalfwidth'] = 0xFF71; 7077 t['akorean'] = 0x314F; 7078 t['alef'] = 0x05D0; 7079 t['alefarabic'] = 0x0627; 7080 t['alefdageshhebrew'] = 0xFB30; 7081 t['aleffinalarabic'] = 0xFE8E; 7082 t['alefhamzaabovearabic'] = 0x0623; 7083 t['alefhamzaabovefinalarabic'] = 0xFE84; 7084 t['alefhamzabelowarabic'] = 0x0625; 7085 t['alefhamzabelowfinalarabic'] = 0xFE88; 7086 t['alefhebrew'] = 0x05D0; 7087 t['aleflamedhebrew'] = 0xFB4F; 7088 t['alefmaddaabovearabic'] = 0x0622; 7089 t['alefmaddaabovefinalarabic'] = 0xFE82; 7090 t['alefmaksuraarabic'] = 0x0649; 7091 t['alefmaksurafinalarabic'] = 0xFEF0; 7092 t['alefmaksurainitialarabic'] = 0xFEF3; 7093 t['alefmaksuramedialarabic'] = 0xFEF4; 7094 t['alefpatahhebrew'] = 0xFB2E; 7095 t['alefqamatshebrew'] = 0xFB2F; 7096 t['aleph'] = 0x2135; 7097 t['allequal'] = 0x224C; 7098 t['alpha'] = 0x03B1; 7099 t['alphatonos'] = 0x03AC; 7100 t['amacron'] = 0x0101; 7101 t['amonospace'] = 0xFF41; 7102 t['ampersand'] = 0x0026; 7103 t['ampersandmonospace'] = 0xFF06; 7104 t['ampersandsmall'] = 0xF726; 7105 t['amsquare'] = 0x33C2; 7106 t['anbopomofo'] = 0x3122; 7107 t['angbopomofo'] = 0x3124; 7108 t['angbracketleft'] = 0x3008; 7109 t['angbracketright'] = 0x3009; 7110 t['angkhankhuthai'] = 0x0E5A; 7111 t['angle'] = 0x2220; 7112 t['anglebracketleft'] = 0x3008; 7113 t['anglebracketleftvertical'] = 0xFE3F; 7114 t['anglebracketright'] = 0x3009; 7115 t['anglebracketrightvertical'] = 0xFE40; 7116 t['angleleft'] = 0x2329; 7117 t['angleright'] = 0x232A; 7118 t['angstrom'] = 0x212B; 7119 t['anoteleia'] = 0x0387; 7120 t['anudattadeva'] = 0x0952; 7121 t['anusvarabengali'] = 0x0982; 7122 t['anusvaradeva'] = 0x0902; 7123 t['anusvaragujarati'] = 0x0A82; 7124 t['aogonek'] = 0x0105; 7125 t['apaatosquare'] = 0x3300; 7126 t['aparen'] = 0x249C; 7127 t['apostrophearmenian'] = 0x055A; 7128 t['apostrophemod'] = 0x02BC; 7129 t['apple'] = 0xF8FF; 7130 t['approaches'] = 0x2250; 7131 t['approxequal'] = 0x2248; 7132 t['approxequalorimage'] = 0x2252; 7133 t['approximatelyequal'] = 0x2245; 7134 t['araeaekorean'] = 0x318E; 7135 t['araeakorean'] = 0x318D; 7136 t['arc'] = 0x2312; 7137 t['arighthalfring'] = 0x1E9A; 7138 t['aring'] = 0x00E5; 7139 t['aringacute'] = 0x01FB; 7140 t['aringbelow'] = 0x1E01; 7141 t['arrowboth'] = 0x2194; 7142 t['arrowdashdown'] = 0x21E3; 7143 t['arrowdashleft'] = 0x21E0; 7144 t['arrowdashright'] = 0x21E2; 7145 t['arrowdashup'] = 0x21E1; 7146 t['arrowdblboth'] = 0x21D4; 7147 t['arrowdbldown'] = 0x21D3; 7148 t['arrowdblleft'] = 0x21D0; 7149 t['arrowdblright'] = 0x21D2; 7150 t['arrowdblup'] = 0x21D1; 7151 t['arrowdown'] = 0x2193; 7152 t['arrowdownleft'] = 0x2199; 7153 t['arrowdownright'] = 0x2198; 7154 t['arrowdownwhite'] = 0x21E9; 7155 t['arrowheaddownmod'] = 0x02C5; 7156 t['arrowheadleftmod'] = 0x02C2; 7157 t['arrowheadrightmod'] = 0x02C3; 7158 t['arrowheadupmod'] = 0x02C4; 7159 t['arrowhorizex'] = 0xF8E7; 7160 t['arrowleft'] = 0x2190; 7161 t['arrowleftdbl'] = 0x21D0; 7162 t['arrowleftdblstroke'] = 0x21CD; 7163 t['arrowleftoverright'] = 0x21C6; 7164 t['arrowleftwhite'] = 0x21E6; 7165 t['arrowright'] = 0x2192; 7166 t['arrowrightdblstroke'] = 0x21CF; 7167 t['arrowrightheavy'] = 0x279E; 7168 t['arrowrightoverleft'] = 0x21C4; 7169 t['arrowrightwhite'] = 0x21E8; 7170 t['arrowtableft'] = 0x21E4; 7171 t['arrowtabright'] = 0x21E5; 7172 t['arrowup'] = 0x2191; 7173 t['arrowupdn'] = 0x2195; 7174 t['arrowupdnbse'] = 0x21A8; 7175 t['arrowupdownbase'] = 0x21A8; 7176 t['arrowupleft'] = 0x2196; 7177 t['arrowupleftofdown'] = 0x21C5; 7178 t['arrowupright'] = 0x2197; 7179 t['arrowupwhite'] = 0x21E7; 7180 t['arrowvertex'] = 0xF8E6; 7181 t['asciicircum'] = 0x005E; 7182 t['asciicircummonospace'] = 0xFF3E; 7183 t['asciitilde'] = 0x007E; 7184 t['asciitildemonospace'] = 0xFF5E; 7185 t['ascript'] = 0x0251; 7186 t['ascriptturned'] = 0x0252; 7187 t['asmallhiragana'] = 0x3041; 7188 t['asmallkatakana'] = 0x30A1; 7189 t['asmallkatakanahalfwidth'] = 0xFF67; 7190 t['asterisk'] = 0x002A; 7191 t['asteriskaltonearabic'] = 0x066D; 7192 t['asteriskarabic'] = 0x066D; 7193 t['asteriskmath'] = 0x2217; 7194 t['asteriskmonospace'] = 0xFF0A; 7195 t['asterisksmall'] = 0xFE61; 7196 t['asterism'] = 0x2042; 7197 t['asuperior'] = 0xF6E9;
7198 t['asymptoticallyequal'] = 0x2243; 7199 t['at'] = 0x0040; 7200 t['atilde'] = 0x00E3; 7201 t['atmonospace'] = 0xFF20; 7202 t['atsmall'] = 0xFE6B; 7203 t['aturned'] = 0x0250; 7204 t['aubengali'] = 0x0994; 7205 t['aubopomofo'] = 0x3120; 7206 t['audeva'] = 0x0914; 7207 t['augujarati'] = 0x0A94; 7208 t['augurmukhi'] = 0x0A14; 7209 t['aulengthmarkbengali'] = 0x09D7; 7210 t['aumatragurmukhi'] = 0x0A4C; 7211 t['auvowelsignbengali'] = 0x09CC; 7212 t['auvowelsigndeva'] = 0x094C; 7213 t['auvowelsigngujarati'] = 0x0ACC; 7214 t['avagrahadeva'] = 0x093D; 7215 t['aybarmenian'] = 0x0561; 7216 t['ayin'] = 0x05E2; 7217 t['ayinaltonehebrew'] = 0xFB20; 7218 t['ayinhebrew'] = 0x05E2; 7219 t['b'] = 0x0062; 7220 t['babengali'] = 0x09AC; 7221 t['backslash'] = 0x005C; 7222 t['backslashmonospace'] = 0xFF3C; 7223 t['badeva'] = 0x092C; 7224 t['bagujarati'] = 0x0AAC; 7225 t['bagurmukhi'] = 0x0A2C; 7226 t['bahiragana'] = 0x3070; 7227 t['bahtthai'] = 0x0E3F; 7228 t['bakatakana'] = 0x30D0; 7229 t['bar'] = 0x007C; 7230 t['barmonospace'] = 0xFF5C; 7231 t['bbopomofo'] = 0x3105; 7232 t['bcircle'] = 0x24D1; 7233 t['bdotaccent'] = 0x1E03; 7234 t['bdotbelow'] = 0x1E05; 7235 t['beamedsixteenthnotes'] = 0x266C; 7236 t['because'] = 0x2235; 7237 t['becyrillic'] = 0x0431; 7238 t['beharabic'] = 0x0628; 7239 t['behfinalarabic'] = 0xFE90; 7240 t['behinitialarabic'] = 0xFE91; 7241 t['behiragana'] = 0x3079; 7242 t['behmedialarabic'] = 0xFE92; 7243 t['behmeeminitialarabic'] = 0xFC9F; 7244 t['behmeemisolatedarabic'] = 0xFC08; 7245 t['behnoonfinalarabic'] = 0xFC6D; 7246 t['bekatakana'] = 0x30D9; 7247 t['benarmenian'] = 0x0562; 7248 t['bet'] = 0x05D1; 7249 t['beta'] = 0x03B2; 7250 t['betasymbolgreek'] = 0x03D0; 7251 t['betdagesh'] = 0xFB31; 7252 t['betdageshhebrew'] = 0xFB31; 7253 t['bethebrew'] = 0x05D1; 7254 t['betrafehebrew'] = 0xFB4C; 7255 t['bhabengali'] = 0x09AD; 7256 t['bhadeva'] = 0x092D; 7257 t['bhagujarati'] = 0x0AAD; 7258 t['bhagurmukhi'] = 0x0A2D; 7259 t['bhook'] = 0x0253; 7260 t['bihiragana'] = 0x3073; 7261 t['bikatakana'] = 0x30D3; 7262 t['bilabialclick'] = 0x0298; 7263 t['bindigurmukhi'] = 0x0A02; 7264 t['birusquare'] = 0x3331; 7265 t['blackcircle'] = 0x25CF; 7266 t['blackdiamond'] = 0x25C6; 7267 t['blackdownpointingtriangle'] = 0x25BC; 7268 t['blackleftpointingpointer'] = 0x25C4; 7269 t['blackleftpointingtriangle'] = 0x25C0; 7270 t['blacklenticularbracketleft'] = 0x3010; 7271 t['blacklenticularbracketleftvertical'] = 0xFE3B; 7272 t['blacklenticularbracketright'] = 0x3011; 7273 t['blacklenticularbracketrightvertical'] = 0xFE3C; 7274 t['blacklowerlefttriangle'] = 0x25E3; 7275 t['blacklowerrighttriangle'] = 0x25E2; 7276 t['blackrectangle'] = 0x25AC; 7277 t['blackrightpointingpointer'] = 0x25BA; 7278 t['blackrightpointingtriangle'] = 0x25B6; 7279 t['blacksmallsquare'] = 0x25AA; 7280 t['blacksmilingface'] = 0x263B; 7281 t['blacksquare'] = 0x25A0; 7282 t['blackstar'] = 0x2605; 7283 t['blackupperlefttriangle'] = 0x25E4; 7284 t['blackupperrighttriangle'] = 0x25E5; 7285 t['blackuppointingsmalltriangle'] = 0x25B4; 7286 t['blackuppointingtriangle'] = 0x25B2; 7287 t['blank'] = 0x2423; 7288 t['blinebelow'] = 0x1E07; 7289 t['block'] = 0x2588; 7290 t['bmonospace'] = 0xFF42; 7291 t['bobaimaithai'] = 0x0E1A; 7292 t['bohiragana'] = 0x307C; 7293 t['bokatakana'] = 0x30DC; 7294 t['bparen'] = 0x249D; 7295 t['bqsquare'] = 0x33C3; 7296 t['braceex'] = 0xF8F4; 7297 t['braceleft'] = 0x007B; 7298 t['braceleftbt'] = 0xF8F3; 7299 t['braceleftmid'] = 0xF8F2; 7300 t['braceleftmonospace'] = 0xFF5B; 7301 t['braceleftsmall'] = 0xFE5B; 7302 t['bracelefttp'] = 0xF8F1; 7303 t['braceleftvertical'] = 0xFE37; 7304 t['braceright'] = 0x007D; 7305 t['bracerightbt'] = 0xF8FE; 7306 t['bracerightmid'] = 0xF8FD; 7307 t['bracerightmonospace'] = 0xFF5D; 7308 t['bracerightsmall'] = 0xFE5C; 7309 t['bracerighttp'] = 0xF8FC; 7310 t['bracerightvertical'] = 0xFE38; 7311 t['bracketleft'] = 0x005B; 7312 t['bracketleftbt'] = 0xF8F0; 7313 t['bracketleftex'] = 0xF8EF; 7314 t['bracketleftmonospace'] = 0xFF3B; 7315 t['bracketlefttp'] = 0xF8EE; 7316 t['bracketright'] = 0x005D; 7317 t['bracketrightbt'] = 0xF8FB; 7318 t['bracketrightex'] = 0xF8FA; 7319 t['bracketrightmonospace'] = 0xFF3D; 7320 t['bracketrighttp'] = 0xF8F9; 7321 t['breve'] = 0x02D8; 7322 t['brevebelowcmb'] = 0x032E; 7323 t['brevecmb'] = 0x0306; 7324 t['breveinvertedbelowcmb'] = 0x032F; 7325 t['breveinvertedcmb'] = 0x0311; 7326 t['breveinverteddoublecmb'] = 0x0361; 7327 t['bridgebelowcmb'] = 0x032A; 7328 t['bridgeinvertedbelowcmb'] = 0x033A; 7329 t['brokenbar'] = 0x00A6; 7330 t['bstroke'] = 0x0180; 7331 t['bsuperior'] = 0xF6EA; 7332 t['btopbar'] = 0x0183; 7333 t['buhiragana'] = 0x3076; 7334 t['bukatakana'] = 0x30D6; 7335 t['bullet'] = 0x2022; 7336 t['bulletinverse'] = 0x25D8; 7337 t['bulletoperator'] = 0x2219; 7338 t['bullseye'] = 0x25CE; 7339 t['c'] = 0x0063; 7340 t['caarmenian'] = 0x056E; 7341 t['cabengali'] = 0x099A; 7342 t['cacute'] = 0x0107; 7343 t['cadeva'] = 0x091A; 7344 t['cagujarati'] = 0x0A9A; 7345 t['cagurmukhi'] = 0x0A1A; 7346 t['calsquare'] = 0x3388; 7347 t['candrabindubengali'] = 0x0981; 7348 t['candrabinducmb'] = 0x0310; 7349 t['candrabindudeva'] = 0x0901; 7350 t['candrabindugujarati'] = 0x0A81;
7351 t['capslock'] = 0x21EA; 7352 t['careof'] = 0x2105; 7353 t['caron'] = 0x02C7; 7354 t['caronbelowcmb'] = 0x032C; 7355 t['caroncmb'] = 0x030C; 7356 t['carriagereturn'] = 0x21B5; 7357 t['cbopomofo'] = 0x3118; 7358 t['ccaron'] = 0x010D; 7359 t['ccedilla'] = 0x00E7; 7360 t['ccedillaacute'] = 0x1E09; 7361 t['ccircle'] = 0x24D2; 7362 t['ccircumflex'] = 0x0109; 7363 t['ccurl'] = 0x0255; 7364 t['cdot'] = 0x010B; 7365 t['cdotaccent'] = 0x010B; 7366 t['cdsquare'] = 0x33C5; 7367 t['cedilla'] = 0x00B8; 7368 t['cedillacmb'] = 0x0327; 7369 t['cent'] = 0x00A2; 7370 t['centigrade'] = 0x2103; 7371 t['centinferior'] = 0xF6DF; 7372 t['centmonospace'] = 0xFFE0; 7373 t['centoldstyle'] = 0xF7A2; 7374 t['centsuperior'] = 0xF6E0; 7375 t['chaarmenian'] = 0x0579; 7376 t['chabengali'] = 0x099B; 7377 t['chadeva'] = 0x091B; 7378 t['chagujarati'] = 0x0A9B; 7379 t['chagurmukhi'] = 0x0A1B; 7380 t['chbopomofo'] = 0x3114; 7381 t['cheabkhasiancyrillic'] = 0x04BD; 7382 t['checkmark'] = 0x2713; 7383 t['checyrillic'] = 0x0447; 7384 t['chedescenderabkhasiancyrillic'] = 0x04BF; 7385 t['chedescendercyrillic'] = 0x04B7; 7386 t['chedieresiscyrillic'] = 0x04F5; 7387 t['cheharmenian'] = 0x0573; 7388 t['chekhakassiancyrillic'] = 0x04CC; 7389 t['cheverticalstrokecyrillic'] = 0x04B9; 7390 t['chi'] = 0x03C7; 7391 t['chieuchacirclekorean'] = 0x3277; 7392 t['chieuchaparenkorean'] = 0x3217; 7393 t['chieuchcirclekorean'] = 0x3269; 7394 t['chieuchkorean'] = 0x314A; 7395 t['chieuchparenkorean'] = 0x3209; 7396 t['chochangthai'] = 0x0E0A; 7397 t['chochanthai'] = 0x0E08; 7398 t['chochingthai'] = 0x0E09; 7399 t['chochoethai'] = 0x0E0C; 7400 t['chook'] = 0x0188; 7401 t['cieucacirclekorean'] = 0x3276; 7402 t['cieucaparenkorean'] = 0x3216; 7403 t['cieuccirclekorean'] = 0x3268; 7404 t['cieuckorean'] = 0x3148; 7405 t['cieucparenkorean'] = 0x3208; 7406 t['cieucuparenkorean'] = 0x321C; 7407 t['circle'] = 0x25CB; 7408 t['circlecopyrt'] = 0x00A9; 7409 t['circlemultiply'] = 0x2297; 7410 t['circleot'] = 0x2299; 7411 t['circleplus'] = 0x2295; 7412 t['circlepostalmark'] = 0x3036; 7413 t['circlewithlefthalfblack'] = 0x25D0; 7414 t['circlewithrighthalfblack'] = 0x25D1; 7415 t['circumflex'] = 0x02C6; 7416 t['circumflexbelowcmb'] = 0x032D; 7417 t['circumflexcmb'] = 0x0302; 7418 t['clear'] = 0x2327; 7419 t['clickalveolar'] = 0x01C2; 7420 t['clickdental'] = 0x01C0; 7421 t['clicklateral'] = 0x01C1; 7422 t['clickretroflex'] = 0x01C3; 7423 t['club'] = 0x2663; 7424 t['clubsuitblack'] = 0x2663; 7425 t['clubsuitwhite'] = 0x2667; 7426 t['cmcubedsquare'] = 0x33A4; 7427 t['cmonospace'] = 0xFF43; 7428 t['cmsquaredsquare'] = 0x33A0; 7429 t['coarmenian'] = 0x0581; 7430 t['colon'] = 0x003A; 7431 t['colonmonetary'] = 0x20A1; 7432 t['colonmonospace'] = 0xFF1A; 7433 t['colonsign'] = 0x20A1; 7434 t['colonsmall'] = 0xFE55; 7435 t['colontriangularhalfmod'] = 0x02D1; 7436 t['colontriangularmod'] = 0x02D0; 7437 t['comma'] = 0x002C; 7438 t['commaabovecmb'] = 0x0313; 7439 t['commaaboverightcmb'] = 0x0315; 7440 t['commaaccent'] = 0xF6C3; 7441 t['commaarabic'] = 0x060C; 7442 t['commaarmenian'] = 0x055D; 7443 t['commainferior'] = 0xF6E1; 7444 t['commamonospace'] = 0xFF0C; 7445 t['commareversedabovecmb'] = 0x0314; 7446 t['commareversedmod'] = 0x02BD; 7447 t['commasmall'] = 0xFE50; 7448 t['commasuperior'] = 0xF6E2; 7449 t['commaturnedabovecmb'] = 0x0312; 7450 t['commaturnedmod'] = 0x02BB; 7451 t['compass'] = 0x263C; 7452 t['congruent'] = 0x2245; 7453 t['contourintegral'] = 0x222E; 7454 t['control'] = 0x2303; 7455 t['controlACK'] = 0x0006; 7456 t['controlBEL'] = 0x0007; 7457 t['controlBS'] = 0x0008; 7458 t['controlCAN'] = 0x0018; 7459 t['controlCR'] = 0x000D; 7460 t['controlDC1'] = 0x0011; 7461 t['controlDC2'] = 0x0012; 7462 t['controlDC3'] = 0x0013; 7463 t['controlDC4'] = 0x0014; 7464 t['controlDEL'] = 0x007F; 7465 t['controlDLE'] = 0x0010; 7466 t['controlEM'] = 0x0019; 7467 t['controlENQ'] = 0x0005; 7468 t['controlEOT'] = 0x0004; 7469 t['controlESC'] = 0x001B; 7470 t['controlETB'] = 0x0017; 7471 t['controlETX'] = 0x0003; 7472 t['controlFF'] = 0x000C; 7473 t['controlFS'] = 0x001C; 7474 t['controlGS'] = 0x001D; 7475 t['controlHT'] = 0x0009; 7476 t['controlLF'] = 0x000A; 7477 t['controlNAK'] = 0x0015; 7478 t['controlNULL'] = 0x0000; 7479 t['controlRS'] = 0x001E; 7480 t['controlSI'] = 0x000F; 7481 t['controlSO'] = 0x000E; 7482 t['controlSOT'] = 0x0002; 7483 t['controlSTX'] = 0x0001; 7484 t['controlSUB'] = 0x001A; 7485 t['controlSYN'] = 0x0016; 7486 t['controlUS'] = 0x001F; 7487 t['controlVT'] = 0x000B; 7488 t['copyright'] = 0x00A9; 7489 t['copyrightsans'] = 0xF8E9; 7490 t['copyrightserif'] = 0xF6D9; 7491 t['cornerbracketleft'] = 0x300C; 7492 t['cornerbracketlefthalfwidth'] = 0xFF62; 7493 t['cornerbracketleftvertical'] = 0xFE41; 7494 t['cornerbracketright'] = 0x300D; 7495 t['cornerbracketrighthalfwidth'] = 0xFF63; 7496 t['cornerbracketrightvertical'] = 0xFE42; 7497 t['corporationsquare'] = 0x337F; 7498 t['cosquare'] = 0x33C7; 7499 t['coverkgsquare'] = 0x33C6; 7500 t['cparen'] = 0x249E; 7501 t['cruzeiro'] = 0x20A2; 7502 t['cstretched'] = 0x0297; 7503 t['curlyand'] = 0x22CF; 7504 t['curlyor'] = 0x22CE; 7505 t['currency'] = 0x00A4; 7506 t['cyrBreve'] = 0xF6D1; 7507 t['cyrFlex'] = 0xF6D2; 7508 t['cyrbreve'] = 0xF6D4; 7509 t['cyrflex'] = 0xF6D5; 7510 t['d'] = 0x0064; 7511 t['daarmenian'] = 0x0564; 7512 t['dabengali'] = 0x09A6; 7513 t['dadarabic'] = 0x0636; 7514 t['dadeva'] = 0x0926; 7515 t['dadfinalarabic'] = 0xFEBE; 7516 t['dadinitialarabic'] = 0xFEBF; 7517 t['dadmedialarabic'] = 0xFEC0; 7518 t['dagesh'] = 0x05BC; 7519 t['dageshhebrew'] = 0x05BC; 7520 t['dagger'] = 0x2020; 7521 t['daggerdbl'] = 0x2021; 7522 t['dagujarati'] = 0x0AA6; 7523 t['dagurmukhi'] = 0x0A26; 7524 t['dahiragana'] = 0x3060; 7525 t['dakatakana'] = 0x30C0; 7526 t['dalarabic'] = 0x062F; 7527 t['dalet'] = 0x05D3; 7528 t['daletdagesh'] = 0xFB33; 7529 t['daletdageshhebrew'] = 0xFB33; 7530 t['dalethebrew'] = 0x05D3; 7531 t['dalfinalarabic'] = 0xFEAA; 7532 t['dammaarabic'] = 0x064F; 7533 t['dammalowarabic'] = 0x064F; 7534 t['dammatanaltonearabic'] = 0x064C; 7535 t['dammatanarabic'] = 0x064C; 7536 t['danda'] = 0x0964; 7537 t['dargahebrew'] = 0x05A7; 7538 t['dargalefthebrew'] = 0x05A7; 7539 t['dasiapneumatacyrilliccmb'] = 0x0485; 7540 t['dblGrave'] = 0xF6D3; 7541 t['dblanglebracketleft'] = 0x300A; 7542 t['dblanglebracketleftvertical'] = 0xFE3D; 7543 t['dblanglebracketright'] = 0x300B; 7544 t['dblanglebracketrightvertical'] = 0xFE3E; 7545 t['dblarchinvertedbelowcmb'] = 0x032B; 7546 t['dblarrowleft'] = 0x21D4; 7547 t['dblarrowright'] = 0x21D2; 7548 t['dbldanda'] = 0x0965; 7549 t['dblgrave'] = 0xF6D6; 7550 t['dblgravecmb'] = 0x030F; 7551 t['dblintegral'] = 0x222C; 7552 t['dbllowline'] = 0x2017; 7553 t['dbllowlinecmb'] = 0x0333; 7554 t['dbloverlinecmb'] = 0x033F; 7555 t['dblprimemod'] = 0x02BA; 7556 t['dblverticalbar'] = 0x2016; 7557 t['dblverticallineabovecmb'] = 0x030E; 7558 t['dbopomofo'] = 0x3109; 7559 t['dbsquare'] = 0x33C8; 7560 t['dcaron'] = 0x010F; 7561 t['dcedilla'] = 0x1E11; 7562 t['dcircle'] = 0x24D3; 7563 t['dcircumflexbelow'] = 0x1E13; 7564 t['dcroat'] = 0x0111; 7565 t['ddabengali'] = 0x09A1; 7566 t['ddadeva'] = 0x0921; 7567 t['ddagujarati'] = 0x0AA1; 7568 t['ddagurmukhi'] = 0x0A21; 7569 t['ddalarabic'] = 0x0688; 7570 t['ddalfinalarabic'] = 0xFB89; 7571 t['dddhadeva'] = 0x095C; 7572 t['ddhabengali'] = 0x09A2; 7573 t['ddhadeva'] = 0x0922; 7574 t['ddhagujarati'] = 0x0AA2; 7575 t['ddhagurmukhi'] = 0x0A22; 7576 t['ddotaccent'] = 0x1E0B; 7577 t['ddotbelow'] = 0x1E0D; 7578 t['decimalseparatorarabic'] = 0x066B; 7579 t['decimalseparatorpersian'] = 0x066B; 7580 t['decyrillic'] = 0x0434; 7581 t['degree'] = 0x00B0; 7582 t['dehihebrew'] = 0x05AD; 7583 t['dehiragana'] = 0x3067; 7584 t['deicoptic'] = 0x03EF; 7585 t['dekatakana'] = 0x30C7; 7586 t['deleteleft'] = 0x232B; 7587 t['deleteright'] = 0x2326; 7588 t['delta'] = 0x03B4; 7589 t['deltaturned'] = 0x018D; 7590 t['denominatorminusonenumeratorbengali'] = 0x09F8; 7591 t['dezh'] = 0x02A4; 7592 t['dhabengali'] = 0x09A7; 7593 t['dhadeva'] = 0x0927; 7594 t['dhagujarati'] = 0x0AA7; 7595 t['dhagurmukhi'] = 0x0A27; 7596 t['dhook'] = 0x0257;
7597 t['dialytikatonos'] = 0x0385; 7598 t['dialytikatonoscmb'] = 0x0344; 7599 t['diamond'] = 0x2666; 7600 t['diamondsuitwhite'] = 0x2662; 7601 t['dieresis'] = 0x00A8; 7602 t['dieresisacute'] = 0xF6D7; 7603 t['dieresisbelowcmb'] = 0x0324; 7604 t['dieresiscmb'] = 0x0308; 7605 t['dieresisgrave'] = 0xF6D8; 7606 t['dieresistonos'] = 0x0385; 7607 t['dihiragana'] = 0x3062; 7608 t['dikatakana'] = 0x30C2; 7609 t['dittomark'] = 0x3003; 7610 t['divide'] = 0x00F7; 7611 t['divides'] = 0x2223; 7612 t['divisionslash'] = 0x2215; 7613 t['djecyrillic'] = 0x0452; 7614 t['dkshade'] = 0x2593; 7615 t['dlinebelow'] = 0x1E0F; 7616 t['dlsquare'] = 0x3397; 7617 t['dmacron'] = 0x0111; 7618 t['dmonospace'] = 0xFF44; 7619 t['dnblock'] = 0x2584; 7620 t['dochadathai'] = 0x0E0E; 7621 t['dodekthai'] = 0x0E14; 7622 t['dohiragana'] = 0x3069; 7623 t['dokatakana'] = 0x30C9; 7624 t['dollar'] = 0x0024; 7625 t['dollarinferior'] = 0xF6E3; 7626 t['dollarmonospace'] = 0xFF04; 7627 t['dollaroldstyle'] = 0xF724; 7628 t['dollarsmall'] = 0xFE69; 7629 t['dollarsuperior'] = 0xF6E4; 7630 t['dong'] = 0x20AB; 7631 t['dorusquare'] = 0x3326; 7632 t['dotaccent'] = 0x02D9; 7633 t['dotaccentcmb'] = 0x0307; 7634 t['dotbelowcmb'] = 0x0323; 7635 t['dotbelowcomb'] = 0x0323; 7636 t['dotkatakana'] = 0x30FB; 7637 t['dotlessi'] = 0x0131; 7638 t['dotlessj'] = 0xF6BE; 7639 t['dotlessjstrokehook'] = 0x0284; 7640 t['dotmath'] = 0x22C5; 7641 t['dottedcircle'] = 0x25CC; 7642 t['doubleyodpatah'] = 0xFB1F; 7643 t['doubleyodpatahhebrew'] = 0xFB1F; 7644 t['downtackbelowcmb'] = 0x031E; 7645 t['downtackmod'] = 0x02D5; 7646 t['dparen'] = 0x249F; 7647 t['dsuperior'] = 0xF6EB; 7648 t['dtail'] = 0x0256; 7649 t['dtopbar'] = 0x018C; 7650 t['duhiragana'] = 0x3065; 7651 t['dukatakana'] = 0x30C5; 7652 t['dz'] = 0x01F3; 7653 t['dzaltone'] = 0x02A3; 7654 t['dzcaron'] = 0x01C6; 7655 t['dzcurl'] = 0x02A5; 7656 t['dzeabkhasiancyrillic'] = 0x04E1; 7657 t['dzecyrillic'] = 0x0455; 7658 t['dzhecyrillic'] = 0x045F; 7659 t['e'] = 0x0065; 7660 t['eacute'] = 0x00E9; 7661 t['earth'] = 0x2641; 7662 t['ebengali'] = 0x098F; 7663 t['ebopomofo'] = 0x311C; 7664 t['ebreve'] = 0x0115; 7665 t['ecandradeva'] = 0x090D; 7666 t['ecandragujarati'] = 0x0A8D; 7667 t['ecandravowelsigndeva'] = 0x0945; 7668 t['ecandravowelsigngujarati'] = 0x0AC5; 7669 t['ecaron'] = 0x011B; 7670 t['ecedillabreve'] = 0x1E1D; 7671 t['echarmenian'] = 0x0565; 7672 t['echyiwnarmenian'] = 0x0587; 7673 t['ecircle'] = 0x24D4; 7674 t['ecircumflex'] = 0x00EA; 7675 t['ecircumflexacute'] = 0x1EBF; 7676 t['ecircumflexbelow'] = 0x1E19; 7677 t['ecircumflexdotbelow'] = 0x1EC7; 7678 t['ecircumflexgrave'] = 0x1EC1; 7679 t['ecircumflexhookabove'] = 0x1EC3; 7680 t['ecircumflextilde'] = 0x1EC5; 7681 t['ecyrillic'] = 0x0454; 7682 t['edblgrave'] = 0x0205; 7683 t['edeva'] = 0x090F; 7684 t['edieresis'] = 0x00EB; 7685 t['edot'] = 0x0117; 7686 t['edotaccent'] = 0x0117; 7687 t['edotbelow'] = 0x1EB9; 7688 t['eegurmukhi'] = 0x0A0F; 7689 t['eematragurmukhi'] = 0x0A47; 7690 t['efcyrillic'] = 0x0444; 7691 t['egrave'] = 0x00E8; 7692 t['egujarati'] = 0x0A8F; 7693 t['eharmenian'] = 0x0567; 7694 t['ehbopomofo'] = 0x311D; 7695 t['ehiragana'] = 0x3048; 7696 t['ehookabove'] = 0x1EBB; 7697 t['eibopomofo'] = 0x311F; 7698 t['eight'] = 0x0038; 7699 t['eightarabic'] = 0x0668; 7700 t['eightbengali'] = 0x09EE; 7701 t['eightcircle'] = 0x2467; 7702 t['eightcircleinversesansserif'] = 0x2791; 7703 t['eightdeva'] = 0x096E; 7704 t['eighteencircle'] = 0x2471; 7705 t['eighteenparen'] = 0x2485; 7706 t['eighteenperiod'] = 0x2499; 7707 t['eightgujarati'] = 0x0AEE; 7708 t['eightgurmukhi'] = 0x0A6E; 7709 t['eighthackarabic'] = 0x0668; 7710 t['eighthangzhou'] = 0x3028; 7711 t['eighthnotebeamed'] = 0x266B; 7712 t['eightideographicparen'] = 0x3227; 7713 t['eightinferior'] = 0x2088; 7714 t['eightmonospace'] = 0xFF18; 7715 t['eightoldstyle'] = 0xF738; 7716 t['eightparen'] = 0x247B; 7717 t['eightperiod'] = 0x248F; 7718 t['eightpersian'] = 0x06F8; 7719 t['eightroman'] = 0x2177; 7720 t['eightsuperior'] = 0x2078; 7721 t['eightthai'] = 0x0E58; 7722 t['einvertedbreve'] = 0x0207; 7723 t['eiotifiedcyrillic'] = 0x0465; 7724 t['ekatakana'] = 0x30A8; 7725 t['ekatakanahalfwidth'] = 0xFF74; 7726 t['ekonkargurmukhi'] = 0x0A74; 7727 t['ekorean'] = 0x3154; 7728 t['elcyrillic'] = 0x043B; 7729 t['element'] = 0x2208; 7730 t['elevencircle'] = 0x246A; 7731 t['elevenparen'] = 0x247E; 7732 t['elevenperiod'] = 0x2492; 7733 t['elevenroman'] = 0x217A; 7734 t['ellipsis'] = 0x2026; 7735 t['ellipsisvertical'] = 0x22EE; 7736 t['emacron'] = 0x0113; 7737 t['emacronacute'] = 0x1E17; 7738 t['emacrongrave'] = 0x1E15; 7739 t['emcyrillic'] = 0x043C; 7740 t['emdash'] = 0x2014; 7741 t['emdashvertical'] = 0xFE31; 7742 t['emonospace'] = 0xFF45; 7743 t['emphasismarkarmenian'] = 0x055B; 7744 t['emptyset'] = 0x2205; 7745 t['enbopomofo'] = 0x3123; 7746 t['encyrillic'] = 0x043D; 7747 t['endash'] = 0x2013; 7748 t['endashvertical'] = 0xFE32; 7749 t['endescendercyrillic'] = 0x04A3; 7750 t['eng'] = 0x014B; 7751 t['engbopomofo'] = 0x3125; 7752 t['enghecyrillic'] = 0x04A5; 7753 t['enhookcyrillic'] = 0x04C8; 7754 t['enspace'] = 0x2002; 7755 t['eogonek'] = 0x0119; 7756 t['eokorean'] = 0x3153; 7757 t['eopen'] = 0x025B; 7758 t['eopenclosed'] = 0x029A; 7759 t['eopenreversed'] = 0x025C; 7760 t['eopenreversedclosed'] = 0x025E; 7761 t['eopenreversedhook'] = 0x025D; 7762 t['eparen'] = 0x24A0; 7763 t['epsilon'] = 0x03B5;
7764 t['epsilontonos'] = 0x03AD; 7765 t['equal'] = 0x003D; 7766 t['equalmonospace'] = 0xFF1D; 7767 t['equalsmall'] = 0xFE66; 7768 t['equalsuperior'] = 0x207C; 7769 t['equivalence'] = 0x2261; 7770 t['erbopomofo'] = 0x3126; 7771 t['ercyrillic'] = 0x0440; 7772 t['ereversed'] = 0x0258; 7773 t['ereversedcyrillic'] = 0x044D; 7774 t['escyrillic'] = 0x0441; 7775 t['esdescendercyrillic'] = 0x04AB; 7776 t['esh'] = 0x0283; 7777 t['eshcurl'] = 0x0286; 7778 t['eshortdeva'] = 0x090E; 7779 t['eshortvowelsigndeva'] = 0x0946; 7780 t['eshreversedloop'] = 0x01AA; 7781 t['eshsquatreversed'] = 0x0285; 7782 t['esmallhiragana'] = 0x3047; 7783 t['esmallkatakana'] = 0x30A7; 7784 t['esmallkatakanahalfwidth'] = 0xFF6A; 7785 t['estimated'] = 0x212E; 7786 t['esuperior'] = 0xF6EC; 7787 t['eta'] = 0x03B7; 7788 t['etarmenian'] = 0x0568; 7789 t['etatonos'] = 0x03AE; 7790 t['eth'] = 0x00F0; 7791 t['etilde'] = 0x1EBD; 7792 t['etildebelow'] = 0x1E1B; 7793 t['etnahtafoukhhebrew'] = 0x0591; 7794 t['etnahtafoukhlefthebrew'] = 0x0591; 7795 t['etnahtahebrew'] = 0x0591; 7796 t['etnahtalefthebrew'] = 0x0591; 7797 t['eturned'] = 0x01DD; 7798 t['eukorean'] = 0x3161; 7799 t['euro'] = 0x20AC; 7800 t['evowelsignbengali'] = 0x09C7; 7801 t['evowelsigndeva'] = 0x0947; 7802 t['evowelsigngujarati'] = 0x0AC7; 7803 t['exclam'] = 0x0021; 7804 t['exclamarmenian'] = 0x055C; 7805 t['exclamdbl'] = 0x203C; 7806 t['exclamdown'] = 0x00A1; 7807 t['exclamdownsmall'] = 0xF7A1; 7808 t['exclammonospace'] = 0xFF01; 7809 t['exclamsmall'] = 0xF721; 7810 t['existential'] = 0x2203; 7811 t['ezh'] = 0x0292; 7812 t['ezhcaron'] = 0x01EF; 7813 t['ezhcurl'] = 0x0293; 7814 t['ezhreversed'] = 0x01B9; 7815 t['ezhtail'] = 0x01BA; 7816 t['f'] = 0x0066; 7817 t['fadeva'] = 0x095E; 7818 t['fagurmukhi'] = 0x0A5E; 7819 t['fahrenheit'] = 0x2109; 7820 t['fathaarabic'] = 0x064E; 7821 t['fathalowarabic'] = 0x064E; 7822 t['fathatanarabic'] = 0x064B; 7823 t['fbopomofo'] = 0x3108; 7824 t['fcircle'] = 0x24D5; 7825 t['fdotaccent'] = 0x1E1F; 7826 t['feharabic'] = 0x0641; 7827 t['feharmenian'] = 0x0586; 7828 t['fehfinalarabic'] = 0xFED2; 7829 t['fehinitialarabic'] = 0xFED3; 7830 t['fehmedialarabic'] = 0xFED4; 7831 t['feicoptic'] = 0x03E5; 7832 t['female'] = 0x2640; 7833 t['ff'] = 0xFB00; 7834 t['ffi'] = 0xFB03; 7835 t['ffl'] = 0xFB04; 7836 t['fi'] = 0xFB01; 7837 t['fifteencircle'] = 0x246E; 7838 t['fifteenparen'] = 0x2482; 7839 t['fifteenperiod'] = 0x2496; 7840 t['figuredash'] = 0x2012; 7841 t['filledbox'] = 0x25A0; 7842 t['filledrect'] = 0x25AC; 7843 t['finalkaf'] = 0x05DA; 7844 t['finalkafdagesh'] = 0xFB3A; 7845 t['finalkafdageshhebrew'] = 0xFB3A; 7846 t['finalkafhebrew'] = 0x05DA; 7847 t['finalmem'] = 0x05DD; 7848 t['finalmemhebrew'] = 0x05DD; 7849 t['finalnun'] = 0x05DF; 7850 t['finalnunhebrew'] = 0x05DF; 7851 t['finalpe'] = 0x05E3; 7852 t['finalpehebrew'] = 0x05E3; 7853 t['finaltsadi'] = 0x05E5; 7854 t['finaltsadihebrew'] = 0x05E5; 7855 t['firsttonechinese'] = 0x02C9; 7856 t['fisheye'] = 0x25C9; 7857 t['fitacyrillic'] = 0x0473; 7858 t['five'] = 0x0035; 7859 t['fivearabic'] = 0x0665; 7860 t['fivebengali'] = 0x09EB; 7861 t['fivecircle'] = 0x2464; 7862 t['fivecircleinversesansserif'] = 0x278E; 7863 t['fivedeva'] = 0x096B; 7864 t['fiveeighths'] = 0x215D; 7865 t['fivegujarati'] = 0x0AEB; 7866 t['fivegurmukhi'] = 0x0A6B; 7867 t['fivehackarabic'] = 0x0665; 7868 t['fivehangzhou'] = 0x3025; 7869 t['fiveideographicparen'] = 0x3224; 7870 t['fiveinferior'] = 0x2085; 7871 t['fivemonospace'] = 0xFF15; 7872 t['fiveoldstyle'] = 0xF735; 7873 t['fiveparen'] = 0x2478; 7874 t['fiveperiod'] = 0x248C; 7875 t['fivepersian'] = 0x06F5; 7876 t['fiveroman'] = 0x2174; 7877 t['fivesuperior'] = 0x2075; 7878 t['fivethai'] = 0x0E55; 7879 t['fl'] = 0xFB02; 7880 t['florin'] = 0x0192; 7881 t['fmonospace'] = 0xFF46; 7882 t['fmsquare'] = 0x3399; 7883 t['fofanthai'] = 0x0E1F; 7884 t['fofathai'] = 0x0E1D; 7885 t['fongmanthai'] = 0x0E4F; 7886 t['forall'] = 0x2200; 7887 t['four'] = 0x0034; 7888 t['fourarabic'] = 0x0664; 7889 t['fourbengali'] = 0x09EA; 7890 t['fourcircle'] = 0x2463; 7891 t['fourcircleinversesansserif'] = 0x278D; 7892 t['fourdeva'] = 0x096A; 7893 t['fourgujarati'] = 0x0AEA; 7894 t['fourgurmukhi'] = 0x0A6A; 7895 t['fourhackarabic'] = 0x0664; 7896 t['fourhangzhou'] = 0x3024; 7897 t['fourideographicparen'] = 0x3223; 7898 t['fourinferior'] = 0x2084; 7899 t['fourmonospace'] = 0xFF14; 7900 t['fournumeratorbengali'] = 0x09F7; 7901 t['fouroldstyle'] = 0xF734; 7902 t['fourparen'] = 0x2477; 7903 t['fourperiod'] = 0x248B; 7904 t['fourpersian'] = 0x06F4; 7905 t['fourroman'] = 0x2173; 7906 t['foursuperior'] = 0x2074; 7907 t['fourteencircle'] = 0x246D; 7908 t['fourteenparen'] = 0x2481; 7909 t['fourteenperiod'] = 0x2495;
7910 t['fourthai'] = 0x0E54; 7911 t['fourthtonechinese'] = 0x02CB; 7912 t['fparen'] = 0x24A1; 7913 t['fraction'] = 0x2044; 7914 t['franc'] = 0x20A3; 7915 t['g'] = 0x0067; 7916 t['gabengali'] = 0x0997; 7917 t['gacute'] = 0x01F5; 7918 t['gadeva'] = 0x0917; 7919 t['gafarabic'] = 0x06AF; 7920 t['gaffinalarabic'] = 0xFB93; 7921 t['gafinitialarabic'] = 0xFB94; 7922 t['gafmedialarabic'] = 0xFB95; 7923 t['gagujarati'] = 0x0A97; 7924 t['gagurmukhi'] = 0x0A17; 7925 t['gahiragana'] = 0x304C; 7926 t['gakatakana'] = 0x30AC; 7927 t['gamma'] = 0x03B3; 7928 t['gammalatinsmall'] = 0x0263; 7929 t['gammasuperior'] = 0x02E0; 7930 t['gangiacoptic'] = 0x03EB; 7931 t['gbopomofo'] = 0x310D; 7932 t['gbreve'] = 0x011F; 7933 t['gcaron'] = 0x01E7; 7934 t['gcedilla'] = 0x0123; 7935 t['gcircle'] = 0x24D6; 7936 t['gcircumflex'] = 0x011D; 7937 t['gcommaaccent'] = 0x0123; 7938 t['gdot'] = 0x0121; 7939 t['gdotaccent'] = 0x0121; 7940 t['gecyrillic'] = 0x0433; 7941 t['gehiragana'] = 0x3052; 7942 t['gekatakana'] = 0x30B2; 7943 t['geometricallyequal'] = 0x2251; 7944 t['gereshaccenthebrew'] = 0x059C; 7945 t['gereshhebrew'] = 0x05F3; 7946 t['gereshmuqdamhebrew'] = 0x059D; 7947 t['germandbls'] = 0x00DF; 7948 t['gershayimaccenthebrew'] = 0x059E; 7949 t['gershayimhebrew'] = 0x05F4; 7950 t['getamark'] = 0x3013; 7951 t['ghabengali'] = 0x0998; 7952 t['ghadarmenian'] = 0x0572; 7953 t['ghadeva'] = 0x0918; 7954 t['ghagujarati'] = 0x0A98; 7955 t['ghagurmukhi'] = 0x0A18; 7956 t['ghainarabic'] = 0x063A; 7957 t['ghainfinalarabic'] = 0xFECE; 7958 t['ghaininitialarabic'] = 0xFECF; 7959 t['ghainmedialarabic'] = 0xFED0; 7960 t['ghemiddlehookcyrillic'] = 0x0495; 7961 t['ghestrokecyrillic'] = 0x0493; 7962 t['gheupturncyrillic'] = 0x0491; 7963 t['ghhadeva'] = 0x095A; 7964 t['ghhagurmukhi'] = 0x0A5A; 7965 t['ghook'] = 0x0260; 7966 t['ghzsquare'] = 0x3393; 7967 t['gihiragana'] = 0x304E; 7968 t['gikatakana'] = 0x30AE; 7969 t['gimarmenian'] = 0x0563; 7970 t['gimel'] = 0x05D2; 7971 t['gimeldagesh'] = 0xFB32; 7972 t['gimeldageshhebrew'] = 0xFB32; 7973 t['gimelhebrew'] = 0x05D2; 7974 t['gjecyrillic'] = 0x0453; 7975 t['glottalinvertedstroke'] = 0x01BE; 7976 t['glottalstop'] = 0x0294; 7977 t['glottalstopinverted'] = 0x0296; 7978 t['glottalstopmod'] = 0x02C0; 7979 t['glottalstopreversed'] = 0x0295; 7980 t['glottalstopreversedmod'] = 0x02C1; 7981 t['glottalstopreversedsuperior'] = 0x02E4; 7982 t['glottalstopstroke'] = 0x02A1; 7983 t['glottalstopstrokereversed'] = 0x02A2; 7984 t['gmacron'] = 0x1E21; 7985 t['gmonospace'] = 0xFF47; 7986 t['gohiragana'] = 0x3054; 7987 t['gokatakana'] = 0x30B4; 7988 t['gparen'] = 0x24A2; 7989 t['gpasquare'] = 0x33AC; 7990 t['gradient'] = 0x2207; 7991 t['grave'] = 0x0060; 7992 t['gravebelowcmb'] = 0x0316; 7993 t['gravecmb'] = 0x0300; 7994 t['gravecomb'] = 0x0300; 7995 t['gravedeva'] = 0x0953; 7996 t['gravelowmod'] = 0x02CE; 7997 t['gravemonospace'] = 0xFF40; 7998 t['gravetonecmb'] = 0x0340; 7999 t['greater'] = 0x003E; 8000 t['greaterequal'] = 0x2265; 8001 t['greaterequalorless'] = 0x22DB; 8002 t['greatermonospace'] = 0xFF1E; 8003 t['greaterorequivalent'] = 0x2273; 8004 t['greaterorless'] = 0x2277; 8005 t['greateroverequal'] = 0x2267; 8006 t['greatersmall'] = 0xFE65; 8007 t['gscript'] = 0x0261; 8008 t['gstroke'] = 0x01E5; 8009 t['guhiragana'] = 0x3050; 8010 t['guillemotleft'] = 0x00AB; 8011 t['guillemotright'] = 0x00BB; 8012 t['guilsinglleft'] = 0x2039; 8013 t['guilsinglright'] = 0x203A; 8014 t['gukatakana'] = 0x30B0; 8015 t['guramusquare'] = 0x3318; 8016 t['gysquare'] = 0x33C9; 8017 t['h'] = 0x0068; 8018 t['haabkhasiancyrillic'] = 0x04A9; 8019 t['haaltonearabic'] = 0x06C1; 8020 t['habengali'] = 0x09B9; 8021 t['hadescendercyrillic'] = 0x04B3; 8022 t['hadeva'] = 0x0939; 8023 t['hagujarati'] = 0x0AB9; 8024 t['hagurmukhi'] = 0x0A39; 8025 t['haharabic'] = 0x062D; 8026 t['hahfinalarabic'] = 0xFEA2; 8027 t['hahinitialarabic'] = 0xFEA3; 8028 t['hahiragana'] = 0x306F; 8029 t['hahmedialarabic'] = 0xFEA4; 8030 t['haitusquare'] = 0x332A; 8031 t['hakatakana'] = 0x30CF; 8032 t['hakatakanahalfwidth'] = 0xFF8A; 8033 t['halantgurmukhi'] = 0x0A4D; 8034 t['hamzaarabic'] = 0x0621; 8035 t['hamzalowarabic'] = 0x0621; 8036 t['hangulfiller'] = 0x3164; 8037 t['hardsigncyrillic'] = 0x044A; 8038 t['harpoonleftbarbup'] = 0x21BC; 8039 t['harpoonrightbarbup'] = 0x21C0; 8040 t['hasquare'] = 0x33CA; 8041 t['hatafpatah'] = 0x05B2; 8042 t['hatafpatah16'] = 0x05B2; 8043 t['hatafpatah23'] = 0x05B2; 8044 t['hatafpatah2f'] = 0x05B2; 8045 t['hatafpatahhebrew'] = 0x05B2; 8046 t['hatafpatahnarrowhebrew'] = 0x05B2; 8047 t['hatafpatahquarterhebrew'] = 0x05B2; 8048 t['hatafpatahwidehebrew'] = 0x05B2; 8049 t['hatafqamats'] = 0x05B3; 8050 t['hatafqamats1b'] = 0x05B3; 8051 t['hatafqamats28'] = 0x05B3; 8052 t['hatafqamats34'] = 0x05B3; 8053 t['hatafqamatshebrew'] = 0x05B3; 8054 t['hatafqamatsnarrowhebrew'] = 0x05B3; 8055 t['hatafqamatsquarterhebrew'] = 0x05B3; 8056 t['hatafqamatswidehebrew'] = 0x05B3; 8057 t['hatafsegol'] = 0x05B1; 8058 t['hatafsegol17'] = 0x05B1; 8059 t['hatafsegol24'] = 0x05B1; 8060 t['hatafsegol30'] = 0x05B1; 8061 t['hatafsegolhebrew'] = 0x05B1; 8062 t['hatafsegolnarrowhebrew'] = 0x05B1; 8063 t['hatafsegolquarterhebrew'] = 0x05B1; 8064 t['hatafsegolwidehebrew'] = 0x05B1; 8065 t['hbar'] = 0x0127; 8066 t['hbopomofo'] = 0x310F; 8067 t['hbrevebelow'] = 0x1E2B; 8068 t['hcedilla'] = 0x1E29; 8069 t['hcircle'] = 0x24D7; 8070 t['hcircumflex'] = 0x0125; 8071 t['hdieresis'] = 0x1E27; 8072 t['hdotaccent'] = 0x1E23; 8073 t['hdotbelow'] = 0x1E25; 8074 t['he'] = 0x05D4; 8075 t['heart'] = 0x2665; 8076 t['heartsuitblack'] = 0x2665; 8077 t['heartsuitwhite'] = 0x2661; 8078 t['hedagesh'] = 0xFB34; 8079 t['hedageshhebrew'] = 0xFB34; 8080 t['hehaltonearabic'] = 0x06C1; 8081 t['heharabic'] = 0x0647; 8082 t['hehebrew'] = 0x05D4; 8083 t['hehfinalaltonearabic'] = 0xFBA7; 8084 t['hehfinalalttwoarabic'] = 0xFEEA; 8085 t['hehfinalarabic'] = 0xFEEA; 8086 t['hehhamzaabovefinalarabic'] = 0xFBA5; 8087 t['hehhamzaaboveisolatedarabic'] = 0xFBA4;
8088 t['hehinitialaltonearabic'] = 0xFBA8; 8089 t['hehinitialarabic'] = 0xFEEB; 8090 t['hehiragana'] = 0x3078; 8091 t['hehmedialaltonearabic'] = 0xFBA9; 8092 t['hehmedialarabic'] = 0xFEEC; 8093 t['heiseierasquare'] = 0x337B; 8094 t['hekatakana'] = 0x30D8; 8095 t['hekatakanahalfwidth'] = 0xFF8D; 8096 t['hekutaarusquare'] = 0x3336; 8097 t['henghook'] = 0x0267; 8098 t['herutusquare'] = 0x3339; 8099 t['het'] = 0x05D7; 8100 t['hethebrew'] = 0x05D7; 8101 t['hhook'] = 0x0266; 8102 t['hhooksuperior'] = 0x02B1; 8103 t['hieuhacirclekorean'] = 0x327B; 8104 t['hieuhaparenkorean'] = 0x321B; 8105 t['hieuhcirclekorean'] = 0x326D; 8106 t['hieuhkorean'] = 0x314E; 8107 t['hieuhparenkorean'] = 0x320D; 8108 t['hihiragana'] = 0x3072; 8109 t['hikatakana'] = 0x30D2; 8110 t['hikatakanahalfwidth'] = 0xFF8B; 8111 t['hiriq'] = 0x05B4; 8112 t['hiriq14'] = 0x05B4; 8113 t['hiriq21'] = 0x05B4; 8114 t['hiriq2d'] = 0x05B4; 8115 t['hiriqhebrew'] = 0x05B4; 8116 t['hiriqnarrowhebrew'] = 0x05B4; 8117 t['hiriqquarterhebrew'] = 0x05B4; 8118 t['hiriqwidehebrew'] = 0x05B4; 8119 t['hlinebelow'] = 0x1E96; 8120 t['hmonospace'] = 0xFF48; 8121 t['hoarmenian'] = 0x0570; 8122 t['hohipthai'] = 0x0E2B; 8123 t['hohiragana'] = 0x307B; 8124 t['hokatakana'] = 0x30DB; 8125 t['hokatakanahalfwidth'] = 0xFF8E; 8126 t['holam'] = 0x05B9; 8127 t['holam19'] = 0x05B9; 8128 t['holam26'] = 0x05B9; 8129 t['holam32'] = 0x05B9; 8130 t['holamhebrew'] = 0x05B9; 8131 t['holamnarrowhebrew'] = 0x05B9; 8132 t['holamquarterhebrew'] = 0x05B9; 8133 t['holamwidehebrew'] = 0x05B9; 8134 t['honokhukthai'] = 0x0E2E; 8135 t['hookabovecomb'] = 0x0309; 8136 t['hookcmb'] = 0x0309; 8137 t['hookpalatalizedbelowcmb'] = 0x0321; 8138 t['hookretroflexbelowcmb'] = 0x0322; 8139 t['hoonsquare'] = 0x3342; 8140 t['horicoptic'] = 0x03E9; 8141 t['horizontalbar'] = 0x2015; 8142 t['horncmb'] = 0x031B; 8143 t['hotsprings'] = 0x2668; 8144 t['house'] = 0x2302; 8145 t['hparen'] = 0x24A3; 8146 t['hsuperior'] = 0x02B0; 8147 t['hturned'] = 0x0265; 8148 t['huhiragana'] = 0x3075; 8149 t['huiitosquare'] = 0x3333; 8150 t['hukatakana'] = 0x30D5; 8151 t['hukatakanahalfwidth'] = 0xFF8C; 8152 t['hungarumlaut'] = 0x02DD; 8153 t['hungarumlautcmb'] = 0x030B; 8154 t['hv'] = 0x0195; 8155 t['hyphen'] = 0x002D; 8156 t['hypheninferior'] = 0xF6E5; 8157 t['hyphenmonospace'] = 0xFF0D; 8158 t['hyphensmall'] = 0xFE63; 8159 t['hyphensuperior'] = 0xF6E6; 8160 t['hyphentwo'] = 0x2010; 8161 t['i'] = 0x0069; 8162 t['iacute'] = 0x00ED; 8163 t['iacyrillic'] = 0x044F; 8164 t['ibengali'] = 0x0987; 8165 t['ibopomofo'] = 0x3127; 8166 t['ibreve'] = 0x012D; 8167 t['icaron'] = 0x01D0; 8168 t['icircle'] = 0x24D8; 8169 t['icircumflex'] = 0x00EE; 8170 t['icyrillic'] = 0x0456; 8171 t['idblgrave'] = 0x0209; 8172 t['ideographearthcircle'] = 0x328F; 8173 t['ideographfirecircle'] = 0x328B; 8174 t['ideographicallianceparen'] = 0x323F; 8175 t['ideographiccallparen'] = 0x323A; 8176 t['ideographiccentrecircle'] = 0x32A5; 8177 t['ideographicclose'] = 0x3006; 8178 t['ideographiccomma'] = 0x3001; 8179 t['ideographiccommaleft'] = 0xFF64; 8180 t['ideographiccongratulationparen'] = 0x3237; 8181 t['ideographiccorrectcircle'] = 0x32A3; 8182 t['ideographicearthparen'] = 0x322F; 8183 t['ideographicenterpriseparen'] = 0x323D; 8184 t['ideographicexcellentcircle'] = 0x329D; 8185 t['ideographicfestivalparen'] = 0x3240; 8186 t['ideographicfinancialcircle'] = 0x3296; 8187 t['ideographicfinancialparen'] = 0x3236; 8188 t['ideographicfireparen'] = 0x322B; 8189 t['ideographichaveparen'] = 0x3232; 8190 t['ideographichighcircle'] = 0x32A4; 8191 t['ideographiciterationmark'] = 0x3005; 8192 t['ideographiclaborcircle'] = 0x3298; 8193 t['ideographiclaborparen'] = 0x3238; 8194 t['ideographicleftcircle'] = 0x32A7; 8195 t['ideographiclowcircle'] = 0x32A6; 8196 t['ideographicmedicinecircle'] = 0x32A9; 8197 t['ideographicmetalparen'] = 0x322E; 8198 t['ideographicmoonparen'] = 0x322A; 8199 t['ideographicnameparen'] = 0x3234; 8200 t['ideographicperiod'] = 0x3002; 8201 t['ideographicprintcircle'] = 0x329E; 8202 t['ideographicreachparen'] = 0x3243; 8203 t['ideographicrepresentparen'] = 0x3239; 8204 t['ideographicresourceparen'] = 0x323E; 8205 t['ideographicrightcircle'] = 0x32A8; 8206 t['ideographicsecretcircle'] = 0x3299; 8207 t['ideographicselfparen'] = 0x3242; 8208 t['ideographicsocietyparen'] = 0x3233; 8209 t['ideographicspace'] = 0x3000; 8210 t['ideographicspecialparen'] = 0x3235; 8211 t['ideographicstockparen'] = 0x3231; 8212 t['ideographicstudyparen'] = 0x323B; 8213 t['ideographicsunparen'] = 0x3230; 8214 t['ideographicsuperviseparen'] = 0x323C; 8215 t['ideographicwaterparen'] = 0x322C; 8216 t['ideographicwoodparen'] = 0x322D; 8217 t['ideographiczero'] = 0x3007; 8218 t['ideographmetalcircle'] = 0x328E; 8219 t['ideographmooncircle'] = 0x328A; 8220 t['ideographnamecircle'] = 0x3294; 8221 t['ideographsuncircle'] = 0x3290; 8222 t['ideographwatercircle'] = 0x328C; 8223 t['ideographwoodcircle'] = 0x328D; 8224 t['ideva'] = 0x0907; 8225 t['idieresis'] = 0x00EF; 8226 t['idieresisacute'] = 0x1E2F; 8227 t['idieresiscyrillic'] = 0x04E5; 8228 t['idotbelow'] = 0x1ECB; 8229 t['iebrevecyrillic'] = 0x04D7; 8230 t['iecyrillic'] = 0x0435; 8231 t['ieungacirclekorean'] = 0x3275; 8232 t['ieungaparenkorean'] = 0x3215; 8233 t['ieungcirclekorean'] = 0x3267; 8234 t['ieungkorean'] = 0x3147; 8235 t['ieungparenkorean'] = 0x3207; 8236 t['igrave'] = 0x00EC; 8237 t['igujarati'] = 0x0A87; 8238 t['igurmukhi'] = 0x0A07; 8239 t['ihiragana'] = 0x3044; 8240 t['ihookabove'] = 0x1EC9; 8241 t['iibengali'] = 0x0988; 8242 t['iicyrillic'] = 0x0438; 8243 t['iideva'] = 0x0908; 8244 t['iigujarati'] = 0x0A88; 8245 t['iigurmukhi'] = 0x0A08; 8246 t['iimatragurmukhi'] = 0x0A40; 8247 t['iinvertedbreve'] = 0x020B; 8248 t['iishortcyrillic'] = 0x0439; 8249 t['iivowelsignbengali'] = 0x09C0; 8250 t['iivowelsigndeva'] = 0x0940; 8251 t['iivowelsigngujarati'] = 0x0AC0; 8252 t['ij'] = 0x0133; 8253 t['ikatakana'] = 0x30A4; 8254 t['ikatakanahalfwidth'] = 0xFF72; 8255 t['ikorean'] = 0x3163; 8256 t['ilde'] = 0x02DC; 8257 t['iluyhebrew'] = 0x05AC; 8258 t['imacron'] = 0x012B; 8259 t['imacroncyrillic'] = 0x04E3; 8260 t['imageorapproximatelyequal'] = 0x2253; 8261 t['imatragurmukhi'] = 0x0A3F; 8262 t['imonospace'] = 0xFF49; 8263 t['increment'] = 0x2206; 8264 t['infinity'] = 0x221E; 8265 t['iniarmenian'] = 0x056B; 8266 t['integral'] = 0x222B; 8267 t['integralbottom'] = 0x2321; 8268 t['integralbt'] = 0x2321; 8269 t['integralex'] = 0xF8F5; 8270 t['integraltop'] = 0x2320; 8271 t['integraltp'] = 0x2320; 8272 t['intersection'] = 0x2229; 8273 t['intisquare'] = 0x3305; 8274 t['invbullet'] = 0x25D8; 8275 t['invcircle'] = 0x25D9; 8276 t['invsmileface'] = 0x263B; 8277 t['iocyrillic'] = 0x0451; 8278 t['iogonek'] = 0x012F; 8279 t['iota'] = 0x03B9; 8280 t['iotadieresis'] = 0x03CA;
8281 t['iotadieresistonos'] = 0x0390; 8282 t['iotalatin'] = 0x0269; 8283 t['iotatonos'] = 0x03AF; 8284 t['iparen'] = 0x24A4; 8285 t['irigurmukhi'] = 0x0A72; 8286 t['ismallhiragana'] = 0x3043; 8287 t['ismallkatakana'] = 0x30A3; 8288 t['ismallkatakanahalfwidth'] = 0xFF68; 8289 t['issharbengali'] = 0x09FA; 8290 t['istroke'] = 0x0268; 8291 t['isuperior'] = 0xF6ED; 8292 t['iterationhiragana'] = 0x309D; 8293 t['iterationkatakana'] = 0x30FD; 8294 t['itilde'] = 0x0129; 8295 t['itildebelow'] = 0x1E2D; 8296 t['iubopomofo'] = 0x3129; 8297 t['iucyrillic'] = 0x044E; 8298 t['ivowelsignbengali'] = 0x09BF; 8299 t['ivowelsigndeva'] = 0x093F; 8300 t['ivowelsigngujarati'] = 0x0ABF; 8301 t['izhitsacyrillic'] = 0x0475; 8302 t['izhitsadblgravecyrillic'] = 0x0477; 8303 t['j'] = 0x006A; 8304 t['jaarmenian'] = 0x0571; 8305 t['jabengali'] = 0x099C; 8306 t['jadeva'] = 0x091C; 8307 t['jagujarati'] = 0x0A9C; 8308 t['jagurmukhi'] = 0x0A1C; 8309 t['jbopomofo'] = 0x3110; 8310 t['jcaron'] = 0x01F0; 8311 t['jcircle'] = 0x24D9; 8312 t['jcircumflex'] = 0x0135; 8313 t['jcrossedtail'] = 0x029D; 8314 t['jdotlessstroke'] = 0x025F; 8315 t['jecyrillic'] = 0x0458; 8316 t['jeemarabic'] = 0x062C; 8317 t['jeemfinalarabic'] = 0xFE9E; 8318 t['jeeminitialarabic'] = 0xFE9F; 8319 t['jeemmedialarabic'] = 0xFEA0; 8320 t['jeharabic'] = 0x0698; 8321 t['jehfinalarabic'] = 0xFB8B; 8322 t['jhabengali'] = 0x099D; 8323 t['jhadeva'] = 0x091D; 8324 t['jhagujarati'] = 0x0A9D; 8325 t['jhagurmukhi'] = 0x0A1D; 8326 t['jheharmenian'] = 0x057B; 8327 t['jis'] = 0x3004; 8328 t['jmonospace'] = 0xFF4A; 8329 t['jparen'] = 0x24A5; 8330 t['jsuperior'] = 0x02B2; 8331 t['k'] = 0x006B; 8332 t['kabashkircyrillic'] = 0x04A1; 8333 t['kabengali'] = 0x0995; 8334 t['kacute'] = 0x1E31; 8335 t['kacyrillic'] = 0x043A; 8336 t['kadescendercyrillic'] = 0x049B; 8337 t['kadeva'] = 0x0915; 8338 t['kaf'] = 0x05DB; 8339 t['kafarabic'] = 0x0643; 8340 t['kafdagesh'] = 0xFB3B; 8341 t['kafdageshhebrew'] = 0xFB3B; 8342 t['kaffinalarabic'] = 0xFEDA; 8343 t['kafhebrew'] = 0x05DB; 8344 t['kafinitialarabic'] = 0xFEDB; 8345 t['kafmedialarabic'] = 0xFEDC; 8346 t['kafrafehebrew'] = 0xFB4D; 8347 t['kagujarati'] = 0x0A95; 8348 t['kagurmukhi'] = 0x0A15; 8349 t['kahiragana'] = 0x304B; 8350 t['kahookcyrillic'] = 0x04C4; 8351 t['kakatakana'] = 0x30AB; 8352 t['kakatakanahalfwidth'] = 0xFF76; 8353 t['kappa'] = 0x03BA; 8354 t['kappasymbolgreek'] = 0x03F0; 8355 t['kapyeounmieumkorean'] = 0x3171; 8356 t['kapyeounphieuphkorean'] = 0x3184; 8357 t['kapyeounpieupkorean'] = 0x3178; 8358 t['kapyeounssangpieupkorean'] = 0x3179; 8359 t['karoriisquare'] = 0x330D; 8360 t['kashidaautoarabic'] = 0x0640; 8361 t['kashidaautonosidebearingarabic'] = 0x0640; 8362 t['kasmallkatakana'] = 0x30F5; 8363 t['kasquare'] = 0x3384; 8364 t['kasraarabic'] = 0x0650; 8365 t['kasratanarabic'] = 0x064D; 8366 t['kastrokecyrillic'] = 0x049F; 8367 t['katahiraprolongmarkhalfwidth'] = 0xFF70; 8368 t['kaverticalstrokecyrillic'] = 0x049D; 8369 t['kbopomofo'] = 0x310E; 8370 t['kcalsquare'] = 0x3389; 8371 t['kcaron'] = 0x01E9; 8372 t['kcedilla'] = 0x0137; 8373 t['kcircle'] = 0x24DA; 8374 t['kcommaaccent'] = 0x0137; 8375 t['kdotbelow'] = 0x1E33; 8376 t['keharmenian'] = 0x0584; 8377 t['kehiragana'] = 0x3051; 8378 t['kekatakana'] = 0x30B1; 8379 t['kekatakanahalfwidth'] = 0xFF79; 8380 t['kenarmenian'] = 0x056F; 8381 t['kesmallkatakana'] = 0x30F6; 8382 t['kgreenlandic'] = 0x0138; 8383 t['khabengali'] = 0x0996; 8384 t['khacyrillic'] = 0x0445; 8385 t['khadeva'] = 0x0916; 8386 t['khagujarati'] = 0x0A96; 8387 t['khagurmukhi'] = 0x0A16; 8388 t['khaharabic'] = 0x062E; 8389 t['khahfinalarabic'] = 0xFEA6; 8390 t['khahinitialarabic'] = 0xFEA7; 8391 t['khahmedialarabic'] = 0xFEA8; 8392 t['kheicoptic'] = 0x03E7; 8393 t['khhadeva'] = 0x0959; 8394 t['khhagurmukhi'] = 0x0A59; 8395 t['khieukhacirclekorean'] = 0x3278; 8396 t['khieukhaparenkorean'] = 0x3218; 8397 t['khieukhcirclekorean'] = 0x326A; 8398 t['khieukhkorean'] = 0x314B; 8399 t['khieukhparenkorean'] = 0x320A; 8400 t['khokhaithai'] = 0x0E02; 8401 t['khokhonthai'] = 0x0E05; 8402 t['khokhuatthai'] = 0x0E03; 8403 t['khokhwaithai'] = 0x0E04; 8404 t['khomutthai'] = 0x0E5B; 8405 t['khook'] = 0x0199; 8406 t['khorakhangthai'] = 0x0E06; 8407 t['khzsquare'] = 0x3391; 8408 t['kihiragana'] = 0x304D; 8409 t['kikatakana'] = 0x30AD; 8410 t['kikatakanahalfwidth'] = 0xFF77; 8411 t['kiroguramusquare'] = 0x3315; 8412 t['kiromeetorusquare'] = 0x3316; 8413 t['kirosquare'] = 0x3314; 8414 t['kiyeokacirclekorean'] = 0x326E; 8415 t['kiyeokaparenkorean'] = 0x320E; 8416 t['kiyeokcirclekorean'] = 0x3260; 8417 t['kiyeokkorean'] = 0x3131; 8418 t['kiyeokparenkorean'] = 0x3200; 8419 t['kiyeoksioskorean'] = 0x3133; 8420 t['kjecyrillic'] = 0x045C; 8421 t['klinebelow'] = 0x1E35; 8422 t['klsquare'] = 0x3398; 8423 t['kmcubedsquare'] = 0x33A6; 8424 t['kmonospace'] = 0xFF4B; 8425 t['kmsquaredsquare'] = 0x33A2; 8426 t['kohiragana'] = 0x3053; 8427 t['kohmsquare'] = 0x33C0; 8428 t['kokaithai'] = 0x0E01; 8429 t['kokatakana'] = 0x30B3; 8430 t['kokatakanahalfwidth'] = 0xFF7A;
8431 t['kooposquare'] = 0x331E; 8432 t['koppacyrillic'] = 0x0481; 8433 t['koreanstandardsymbol'] = 0x327F; 8434 t['koroniscmb'] = 0x0343; 8435 t['kparen'] = 0x24A6; 8436 t['kpasquare'] = 0x33AA; 8437 t['ksicyrillic'] = 0x046F; 8438 t['ktsquare'] = 0x33CF; 8439 t['kturned'] = 0x029E; 8440 t['kuhiragana'] = 0x304F; 8441 t['kukatakana'] = 0x30AF; 8442 t['kukatakanahalfwidth'] = 0xFF78; 8443 t['kvsquare'] = 0x33B8; 8444 t['kwsquare'] = 0x33BE; 8445 t['l'] = 0x006C; 8446 t['labengali'] = 0x09B2; 8447 t['lacute'] = 0x013A; 8448 t['ladeva'] = 0x0932; 8449 t['lagujarati'] = 0x0AB2; 8450 t['lagurmukhi'] = 0x0A32; 8451 t['lakkhangyaothai'] = 0x0E45; 8452 t['lamaleffinalarabic'] = 0xFEFC; 8453 t['lamalefhamzaabovefinalarabic'] = 0xFEF8; 8454 t['lamalefhamzaaboveisolatedarabic'] = 0xFEF7; 8455 t['lamalefhamzabelowfinalarabic'] = 0xFEFA; 8456 t['lamalefhamzabelowisolatedarabic'] = 0xFEF9; 8457 t['lamalefisolatedarabic'] = 0xFEFB; 8458 t['lamalefmaddaabovefinalarabic'] = 0xFEF6; 8459 t['lamalefmaddaaboveisolatedarabic'] = 0xFEF5; 8460 t['lamarabic'] = 0x0644; 8461 t['lambda'] = 0x03BB; 8462 t['lambdastroke'] = 0x019B; 8463 t['lamed'] = 0x05DC; 8464 t['lameddagesh'] = 0xFB3C; 8465 t['lameddageshhebrew'] = 0xFB3C; 8466 t['lamedhebrew'] = 0x05DC; 8467 t['lamfinalarabic'] = 0xFEDE; 8468 t['lamhahinitialarabic'] = 0xFCCA; 8469 t['laminitialarabic'] = 0xFEDF; 8470 t['lamjeeminitialarabic'] = 0xFCC9; 8471 t['lamkhahinitialarabic'] = 0xFCCB; 8472 t['lamlamhehisolatedarabic'] = 0xFDF2; 8473 t['lammedialarabic'] = 0xFEE0; 8474 t['lammeemhahinitialarabic'] = 0xFD88; 8475 t['lammeeminitialarabic'] = 0xFCCC; 8476 t['largecircle'] = 0x25EF; 8477 t['lbar'] = 0x019A; 8478 t['lbelt'] = 0x026C; 8479 t['lbopomofo'] = 0x310C; 8480 t['lcaron'] = 0x013E; 8481 t['lcedilla'] = 0x013C; 8482 t['lcircle'] = 0x24DB; 8483 t['lcircumflexbelow'] = 0x1E3D; 8484 t['lcommaaccent'] = 0x013C; 8485 t['ldot'] = 0x0140; 8486 t['ldotaccent'] = 0x0140; 8487 t['ldotbelow'] = 0x1E37; 8488 t['ldotbelowmacron'] = 0x1E39; 8489 t['leftangleabovecmb'] = 0x031A; 8490 t['lefttackbelowcmb'] = 0x0318; 8491 t['less'] = 0x003C; 8492 t['lessequal'] = 0x2264; 8493 t['lessequalorgreater'] = 0x22DA; 8494 t['lessmonospace'] = 0xFF1C; 8495 t['lessorequivalent'] = 0x2272; 8496 t['lessorgreater'] = 0x2276; 8497 t['lessoverequal'] = 0x2266; 8498 t['lesssmall'] = 0xFE64; 8499 t['lezh'] = 0x026E; 8500 t['lfblock'] = 0x258C; 8501 t['lhookretroflex'] = 0x026D; 8502 t['lira'] = 0x20A4; 8503 t['liwnarmenian'] = 0x056C; 8504 t['lj'] = 0x01C9; 8505 t['ljecyrillic'] = 0x0459; 8506 t['ll'] = 0xF6C0; 8507 t['lladeva'] = 0x0933; 8508 t['llagujarati'] = 0x0AB3; 8509 t['llinebelow'] = 0x1E3B; 8510 t['llladeva'] = 0x0934; 8511 t['llvocalicbengali'] = 0x09E1; 8512 t['llvocalicdeva'] = 0x0961; 8513 t['llvocalicvowelsignbengali'] = 0x09E3; 8514 t['llvocalicvowelsigndeva'] = 0x0963; 8515 t['lmiddletilde'] = 0x026B; 8516 t['lmonospace'] = 0xFF4C; 8517 t['lmsquare'] = 0x33D0; 8518 t['lochulathai'] = 0x0E2C; 8519 t['logicaland'] = 0x2227; 8520 t['logicalnot'] = 0x00AC; 8521 t['logicalnotreversed'] = 0x2310; 8522 t['logicalor'] = 0x2228; 8523 t['lolingthai'] = 0x0E25; 8524 t['longs'] = 0x017F; 8525 t['lowlinecenterline'] = 0xFE4E; 8526 t['lowlinecmb'] = 0x0332; 8527 t['lowlinedashed'] = 0xFE4D; 8528 t['lozenge'] = 0x25CA; 8529 t['lparen'] = 0x24A7; 8530 t['lslash'] = 0x0142; 8531 t['lsquare'] = 0x2113; 8532 t['lsuperior'] = 0xF6EE; 8533 t['ltshade'] = 0x2591; 8534 t['luthai'] = 0x0E26; 8535 t['lvocalicbengali'] = 0x098C; 8536 t['lvocalicdeva'] = 0x090C; 8537 t['lvocalicvowelsignbengali'] = 0x09E2; 8538 t['lvocalicvowelsigndeva'] = 0x0962; 8539 t['lxsquare'] = 0x33D3; 8540 t['m'] = 0x006D; 8541 t['mabengali'] = 0x09AE; 8542 t['macron'] = 0x00AF; 8543 t['macronbelowcmb'] = 0x0331; 8544 t['macroncmb'] = 0x0304; 8545 t['macronlowmod'] = 0x02CD; 8546 t['macronmonospace'] = 0xFFE3; 8547 t['macute'] = 0x1E3F; 8548 t['madeva'] = 0x092E; 8549 t['magujarati'] = 0x0AAE; 8550 t['magurmukhi'] = 0x0A2E; 8551 t['mahapakhhebrew'] = 0x05A4; 8552 t['mahapakhlefthebrew'] = 0x05A4; 8553 t['mahiragana'] = 0x307E; 8554 t['maichattawalowleftthai'] = 0xF895; 8555 t['maichattawalowrightthai'] = 0xF894; 8556 t['maichattawathai'] = 0x0E4B; 8557 t['maichattawaupperleftthai'] = 0xF893; 8558 t['maieklowleftthai'] = 0xF88C; 8559 t['maieklowrightthai'] = 0xF88B; 8560 t['maiekthai'] = 0x0E48; 8561 t['maiekupperleftthai'] = 0xF88A; 8562 t['maihanakatleftthai'] = 0xF884; 8563 t['maihanakatthai'] = 0x0E31; 8564 t['maitaikhuleftthai'] = 0xF889; 8565 t['maitaikhuthai'] = 0x0E47; 8566 t['maitholowleftthai'] = 0xF88F; 8567 t['maitholowrightthai'] = 0xF88E; 8568 t['maithothai'] = 0x0E49;
8569 t['maithoupperleftthai'] = 0xF88D; 8570 t['maitrilowleftthai'] = 0xF892; 8571 t['maitrilowrightthai'] = 0xF891; 8572 t['maitrithai'] = 0x0E4A; 8573 t['maitriupperleftthai'] = 0xF890; 8574 t['maiyamokthai'] = 0x0E46; 8575 t['makatakana'] = 0x30DE; 8576 t['makatakanahalfwidth'] = 0xFF8F; 8577 t['male'] = 0x2642; 8578 t['mansyonsquare'] = 0x3347; 8579 t['maqafhebrew'] = 0x05BE; 8580 t['mars'] = 0x2642; 8581 t['masoracirclehebrew'] = 0x05AF; 8582 t['masquare'] = 0x3383; 8583 t['mbopomofo'] = 0x3107; 8584 t['mbsquare'] = 0x33D4; 8585 t['mcircle'] = 0x24DC; 8586 t['mcubedsquare'] = 0x33A5; 8587 t['mdotaccent'] = 0x1E41; 8588 t['mdotbelow'] = 0x1E43; 8589 t['meemarabic'] = 0x0645; 8590 t['meemfinalarabic'] = 0xFEE2; 8591 t['meeminitialarabic'] = 0xFEE3; 8592 t['meemmedialarabic'] = 0xFEE4; 8593 t['meemmeeminitialarabic'] = 0xFCD1; 8594 t['meemmeemisolatedarabic'] = 0xFC48; 8595 t['meetorusquare'] = 0x334D; 8596 t['mehiragana'] = 0x3081; 8597 t['meizierasquare'] = 0x337E; 8598 t['mekatakana'] = 0x30E1; 8599 t['mekatakanahalfwidth'] = 0xFF92; 8600 t['mem'] = 0x05DE; 8601 t['memdagesh'] = 0xFB3E; 8602 t['memdageshhebrew'] = 0xFB3E; 8603 t['memhebrew'] = 0x05DE; 8604 t['menarmenian'] = 0x0574; 8605 t['merkhahebrew'] = 0x05A5; 8606 t['merkhakefulahebrew'] = 0x05A6; 8607 t['merkhakefulalefthebrew'] = 0x05A6; 8608 t['merkhalefthebrew'] = 0x05A5; 8609 t['mhook'] = 0x0271; 8610 t['mhzsquare'] = 0x3392; 8611 t['middledotkatakanahalfwidth'] = 0xFF65; 8612 t['middot'] = 0x00B7; 8613 t['mieumacirclekorean'] = 0x3272; 8614 t['mieumaparenkorean'] = 0x3212; 8615 t['mieumcirclekorean'] = 0x3264; 8616 t['mieumkorean'] = 0x3141; 8617 t['mieumpansioskorean'] = 0x3170; 8618 t['mieumparenkorean'] = 0x3204; 8619 t['mieumpieupkorean'] = 0x316E; 8620 t['mieumsioskorean'] = 0x316F; 8621 t['mihiragana'] = 0x307F; 8622 t['mikatakana'] = 0x30DF; 8623 t['mikatakanahalfwidth'] = 0xFF90; 8624 t['minus'] = 0x2212; 8625 t['minusbelowcmb'] = 0x0320; 8626 t['minuscircle'] = 0x2296; 8627 t['minusmod'] = 0x02D7; 8628 t['minusplus'] = 0x2213; 8629 t['minute'] = 0x2032; 8630 t['miribaarusquare'] = 0x334A; 8631 t['mirisquare'] = 0x3349; 8632 t['mlonglegturned'] = 0x0270; 8633 t['mlsquare'] = 0x3396; 8634 t['mmcubedsquare'] = 0x33A3; 8635 t['mmonospace'] = 0xFF4D; 8636 t['mmsquaredsquare'] = 0x339F; 8637 t['mohiragana'] = 0x3082; 8638 t['mohmsquare'] = 0x33C1; 8639 t['mokatakana'] = 0x30E2; 8640 t['mokatakanahalfwidth'] = 0xFF93; 8641 t['molsquare'] = 0x33D6; 8642 t['momathai'] = 0x0E21; 8643 t['moverssquare'] = 0x33A7; 8644 t['moverssquaredsquare'] = 0x33A8; 8645 t['mparen'] = 0x24A8; 8646 t['mpasquare'] = 0x33AB; 8647 t['mssquare'] = 0x33B3; 8648 t['msuperior'] = 0xF6EF; 8649 t['mturned'] = 0x026F; 8650 t['mu'] = 0x00B5; 8651 t['mu1'] = 0x00B5; 8652 t['muasquare'] = 0x3382; 8653 t['muchgreater'] = 0x226B; 8654 t['muchless'] = 0x226A; 8655 t['mufsquare'] = 0x338C; 8656 t['mugreek'] = 0x03BC; 8657 t['mugsquare'] = 0x338D; 8658 t['muhiragana'] = 0x3080; 8659 t['mukatakana'] = 0x30E0; 8660 t['mukatakanahalfwidth'] = 0xFF91; 8661 t['mulsquare'] = 0x3395; 8662 t['multiply'] = 0x00D7; 8663 t['mumsquare'] = 0x339B; 8664 t['munahhebrew'] = 0x05A3; 8665 t['munahlefthebrew'] = 0x05A3; 8666 t['musicalnote'] = 0x266A; 8667 t['musicalnotedbl'] = 0x266B; 8668 t['musicflatsign'] = 0x266D; 8669 t['musicsharpsign'] = 0x266F; 8670 t['mussquare'] = 0x33B2; 8671 t['muvsquare'] = 0x33B6; 8672 t['muwsquare'] = 0x33BC; 8673 t['mvmegasquare'] = 0x33B9; 8674 t['mvsquare'] = 0x33B7; 8675 t['mwmegasquare'] = 0x33BF; 8676 t['mwsquare'] = 0x33BD; 8677 t['n'] = 0x006E; 8678 t['nabengali'] = 0x09A8; 8679 t['nabla'] = 0x2207; 8680 t['nacute'] = 0x0144; 8681 t['nadeva'] = 0x0928; 8682 t['nagujarati'] = 0x0AA8; 8683 t['nagurmukhi'] = 0x0A28; 8684 t['nahiragana'] = 0x306A; 8685 t['nakatakana'] = 0x30CA; 8686 t['nakatakanahalfwidth'] = 0xFF85; 8687 t['napostrophe'] = 0x0149; 8688 t['nasquare'] = 0x3381; 8689 t['nbopomofo'] = 0x310B; 8690 t['nbspace'] = 0x00A0; 8691 t['ncaron'] = 0x0148; 8692 t['ncedilla'] = 0x0146; 8693 t['ncircle'] = 0x24DD; 8694 t['ncircumflexbelow'] = 0x1E4B; 8695 t['ncommaaccent'] = 0x0146; 8696 t['ndotaccent'] = 0x1E45; 8697 t['ndotbelow'] = 0x1E47; 8698 t['nehiragana'] = 0x306D; 8699 t['nekatakana'] = 0x30CD; 8700 t['nekatakanahalfwidth'] = 0xFF88; 8701 t['newsheqelsign'] = 0x20AA; 8702 t['nfsquare'] = 0x338B; 8703 t['ngabengali'] = 0x0999; 8704 t['ngadeva'] = 0x0919; 8705 t['ngagujarati'] = 0x0A99; 8706 t['ngagurmukhi'] = 0x0A19; 8707 t['ngonguthai'] = 0x0E07; 8708 t['nhiragana'] = 0x3093; 8709 t['nhookleft'] = 0x0272; 8710 t['nhookretroflex'] = 0x0273; 8711 t['nieunacirclekorean'] = 0x326F; 8712 t['nieunaparenkorean'] = 0x320F; 8713 t['nieuncieuckorean'] = 0x3135; 8714 t['nieuncirclekorean'] = 0x3261; 8715 t['nieunhieuhkorean'] = 0x3136; 8716 t['nieunkorean'] = 0x3134;
8717 t['nieunpansioskorean'] = 0x3168; 8718 t['nieunparenkorean'] = 0x3201; 8719 t['nieunsioskorean'] = 0x3167; 8720 t['nieuntikeutkorean'] = 0x3166; 8721 t['nihiragana'] = 0x306B; 8722 t['nikatakana'] = 0x30CB; 8723 t['nikatakanahalfwidth'] = 0xFF86; 8724 t['nikhahitleftthai'] = 0xF899; 8725 t['nikhahitthai'] = 0x0E4D; 8726 t['nine'] = 0x0039; 8727 t['ninearabic'] = 0x0669; 8728 t['ninebengali'] = 0x09EF; 8729 t['ninecircle'] = 0x2468; 8730 t['ninecircleinversesansserif'] = 0x2792; 8731 t['ninedeva'] = 0x096F; 8732 t['ninegujarati'] = 0x0AEF; 8733 t['ninegurmukhi'] = 0x0A6F; 8734 t['ninehackarabic'] = 0x0669; 8735 t['ninehangzhou'] = 0x3029; 8736 t['nineideographicparen'] = 0x3228; 8737 t['nineinferior'] = 0x2089; 8738 t['ninemonospace'] = 0xFF19; 8739 t['nineoldstyle'] = 0xF739; 8740 t['nineparen'] = 0x247C; 8741 t['nineperiod'] = 0x2490; 8742 t['ninepersian'] = 0x06F9; 8743 t['nineroman'] = 0x2178; 8744 t['ninesuperior'] = 0x2079; 8745 t['nineteencircle'] = 0x2472; 8746 t['nineteenparen'] = 0x2486; 8747 t['nineteenperiod'] = 0x249A; 8748 t['ninethai'] = 0x0E59; 8749 t['nj'] = 0x01CC; 8750 t['njecyrillic'] = 0x045A; 8751 t['nkatakana'] = 0x30F3; 8752 t['nkatakanahalfwidth'] = 0xFF9D; 8753 t['nlegrightlong'] = 0x019E; 8754 t['nlinebelow'] = 0x1E49; 8755 t['nmonospace'] = 0xFF4E; 8756 t['nmsquare'] = 0x339A; 8757 t['nnabengali'] = 0x09A3; 8758 t['nnadeva'] = 0x0923; 8759 t['nnagujarati'] = 0x0AA3; 8760 t['nnagurmukhi'] = 0x0A23; 8761 t['nnnadeva'] = 0x0929; 8762 t['nohiragana'] = 0x306E; 8763 t['nokatakana'] = 0x30CE; 8764 t['nokatakanahalfwidth'] = 0xFF89; 8765 t['nonbreakingspace'] = 0x00A0; 8766 t['nonenthai'] = 0x0E13; 8767 t['nonuthai'] = 0x0E19; 8768 t['noonarabic'] = 0x0646; 8769 t['noonfinalarabic'] = 0xFEE6; 8770 t['noonghunnaarabic'] = 0x06BA; 8771 t['noonghunnafinalarabic'] = 0xFB9F; 8772 t['nooninitialarabic'] = 0xFEE7; 8773 t['noonjeeminitialarabic'] = 0xFCD2; 8774 t['noonjeemisolatedarabic'] = 0xFC4B; 8775 t['noonmedialarabic'] = 0xFEE8; 8776 t['noonmeeminitialarabic'] = 0xFCD5; 8777 t['noonmeemisolatedarabic'] = 0xFC4E; 8778 t['noonnoonfinalarabic'] = 0xFC8D; 8779 t['notcontains'] = 0x220C; 8780 t['notelement'] = 0x2209; 8781 t['notelementof'] = 0x2209; 8782 t['notequal'] = 0x2260; 8783 t['notgreater'] = 0x226F; 8784 t['notgreaternorequal'] = 0x2271; 8785 t['notgreaternorless'] = 0x2279; 8786 t['notidentical'] = 0x2262; 8787 t['notless'] = 0x226E; 8788 t['notlessnorequal'] = 0x2270; 8789 t['notparallel'] = 0x2226; 8790 t['notprecedes'] = 0x2280; 8791 t['notsubset'] = 0x2284; 8792 t['notsucceeds'] = 0x2281; 8793 t['notsuperset'] = 0x2285; 8794 t['nowarmenian'] = 0x0576; 8795 t['nparen'] = 0x24A9; 8796 t['nssquare'] = 0x33B1; 8797 t['nsuperior'] = 0x207F; 8798 t['ntilde'] = 0x00F1; 8799 t['nu'] = 0x03BD; 8800 t['nuhiragana'] = 0x306C; 8801 t['nukatakana'] = 0x30CC; 8802 t['nukatakanahalfwidth'] = 0xFF87; 8803 t['nuktabengali'] = 0x09BC; 8804 t['nuktadeva'] = 0x093C; 8805 t['nuktagujarati'] = 0x0ABC; 8806 t['nuktagurmukhi'] = 0x0A3C; 8807 t['numbersign'] = 0x0023; 8808 t['numbersignmonospace'] = 0xFF03; 8809 t['numbersignsmall'] = 0xFE5F; 8810 t['numeralsigngreek'] = 0x0374; 8811 t['numeralsignlowergreek'] = 0x0375; 8812 t['numero'] = 0x2116; 8813 t['nun'] = 0x05E0; 8814 t['nundagesh'] = 0xFB40; 8815 t['nundageshhebrew'] = 0xFB40; 8816 t['nunhebrew'] = 0x05E0; 8817 t['nvsquare'] = 0x33B5; 8818 t['nwsquare'] = 0x33BB; 8819 t['nyabengali'] = 0x099E; 8820 t['nyadeva'] = 0x091E; 8821 t['nyagujarati'] = 0x0A9E; 8822 t['nyagurmukhi'] = 0x0A1E; 8823 t['o'] = 0x006F; 8824 t['oacute'] = 0x00F3; 8825 t['oangthai'] = 0x0E2D; 8826 t['obarred'] = 0x0275; 8827 t['obarredcyrillic'] = 0x04E9; 8828 t['obarreddieresiscyrillic'] = 0x04EB; 8829 t['obengali'] = 0x0993; 8830 t['obopomofo'] = 0x311B; 8831 t['obreve'] = 0x014F; 8832 t['ocandradeva'] = 0x0911; 8833 t['ocandragujarati'] = 0x0A91; 8834 t['ocandravowelsigndeva'] = 0x0949; 8835 t['ocandravowelsigngujarati'] = 0x0AC9; 8836 t['ocaron'] = 0x01D2; 8837 t['ocircle'] = 0x24DE; 8838 t['ocircumflex'] = 0x00F4; 8839 t['ocircumflexacute'] = 0x1ED1; 8840 t['ocircumflexdotbelow'] = 0x1ED9; 8841 t['ocircumflexgrave'] = 0x1ED3; 8842 t['ocircumflexhookabove'] = 0x1ED5; 8843 t['ocircumflextilde'] = 0x1ED7; 8844 t['ocyrillic'] = 0x043E; 8845 t['odblacute'] = 0x0151; 8846 t['odblgrave'] = 0x020D; 8847 t['odeva'] = 0x0913; 8848 t['odieresis'] = 0x00F6; 8849 t['odieresiscyrillic'] = 0x04E7; 8850 t['odotbelow'] = 0x1ECD; 8851 t['oe'] = 0x0153; 8852 t['oekorean'] = 0x315A; 8853 t['ogonek'] = 0x02DB; 8854 t['ogonekcmb'] = 0x0328; 8855 t['ograve'] = 0x00F2; 8856 t['ogujarati'] = 0x0A93; 8857 t['oharmenian'] = 0x0585; 8858 t['ohiragana'] = 0x304A; 8859 t['ohookabove'] = 0x1ECF; 8860 t['ohorn'] = 0x01A1; 8861 t['ohornacute'] = 0x1EDB; 8862 t['ohorndotbelow'] = 0x1EE3; 8863 t['ohorngrave'] = 0x1EDD; 8864 t['ohornhookabove'] = 0x1EDF; 8865 t['ohorntilde'] = 0x1EE1; 8866 t['ohungarumlaut'] = 0x0151; 8867 t['oi'] = 0x01A3; 8868 t['oinvertedbreve'] = 0x020F; 8869 t['okatakana'] = 0x30AA; 8870 t['okatakanahalfwidth'] = 0xFF75; 8871 t['okorean'] = 0x3157; 8872 t['olehebrew'] = 0x05AB; 8873 t['omacron'] = 0x014D; 8874 t['omacronacute'] = 0x1E53; 8875 t['omacrongrave'] = 0x1E51; 8876 t['omdeva'] = 0x0950; 8877 t['omega'] = 0x03C9; 8878 t['omega1'] = 0x03D6; 8879 t['omegacyrillic'] = 0x0461; 8880 t['omegalatinclosed'] = 0x0277; 8881 t['omegaroundcyrillic'] = 0x047B; 8882 t['omegatitlocyrillic'] = 0x047D;
8883 t['omegatonos'] = 0x03CE; 8884 t['omgujarati'] = 0x0AD0; 8885 t['omicron'] = 0x03BF; 8886 t['omicrontonos'] = 0x03CC; 8887 t['omonospace'] = 0xFF4F; 8888 t['one'] = 0x0031; 8889 t['onearabic'] = 0x0661; 8890 t['onebengali'] = 0x09E7; 8891 t['onecircle'] = 0x2460; 8892 t['onecircleinversesansserif'] = 0x278A; 8893 t['onedeva'] = 0x0967; 8894 t['onedotenleader'] = 0x2024; 8895 t['oneeighth'] = 0x215B; 8896 t['onefitted'] = 0xF6DC; 8897 t['onegujarati'] = 0x0AE7; 8898 t['onegurmukhi'] = 0x0A67; 8899 t['onehackarabic'] = 0x0661; 8900 t['onehalf'] = 0x00BD; 8901 t['onehangzhou'] = 0x3021; 8902 t['oneideographicparen'] = 0x3220; 8903 t['oneinferior'] = 0x2081; 8904 t['onemonospace'] = 0xFF11; 8905 t['onenumeratorbengali'] = 0x09F4; 8906 t['oneoldstyle'] = 0xF731; 8907 t['oneparen'] = 0x2474; 8908 t['oneperiod'] = 0x2488; 8909 t['onepersian'] = 0x06F1; 8910 t['onequarter'] = 0x00BC; 8911 t['oneroman'] = 0x2170; 8912 t['onesuperior'] = 0x00B9; 8913 t['onethai'] = 0x0E51; 8914 t['onethird'] = 0x2153; 8915 t['oogonek'] = 0x01EB; 8916 t['oogonekmacron'] = 0x01ED; 8917 t['oogurmukhi'] = 0x0A13; 8918 t['oomatragurmukhi'] = 0x0A4B; 8919 t['oopen'] = 0x0254; 8920 t['oparen'] = 0x24AA; 8921 t['openbullet'] = 0x25E6; 8922 t['option'] = 0x2325; 8923 t['ordfeminine'] = 0x00AA; 8924 t['ordmasculine'] = 0x00BA; 8925 t['orthogonal'] = 0x221F; 8926 t['oshortdeva'] = 0x0912; 8927 t['oshortvowelsigndeva'] = 0x094A; 8928 t['oslash'] = 0x00F8; 8929 t['oslashacute'] = 0x01FF; 8930 t['osmallhiragana'] = 0x3049; 8931 t['osmallkatakana'] = 0x30A9; 8932 t['osmallkatakanahalfwidth'] = 0xFF6B; 8933 t['ostrokeacute'] = 0x01FF; 8934 t['osuperior'] = 0xF6F0; 8935 t['otcyrillic'] = 0x047F; 8936 t['otilde'] = 0x00F5; 8937 t['otildeacute'] = 0x1E4D; 8938 t['otildedieresis'] = 0x1E4F; 8939 t['oubopomofo'] = 0x3121; 8940 t['overline'] = 0x203E; 8941 t['overlinecenterline'] = 0xFE4A; 8942 t['overlinecmb'] = 0x0305; 8943 t['overlinedashed'] = 0xFE49; 8944 t['overlinedblwavy'] = 0xFE4C; 8945 t['overlinewavy'] = 0xFE4B; 8946 t['overscore'] = 0x00AF; 8947 t['ovowelsignbengali'] = 0x09CB; 8948 t['ovowelsigndeva'] = 0x094B; 8949 t['ovowelsigngujarati'] = 0x0ACB; 8950 t['p'] = 0x0070; 8951 t['paampssquare'] = 0x3380; 8952 t['paasentosquare'] = 0x332B; 8953 t['pabengali'] = 0x09AA; 8954 t['pacute'] = 0x1E55; 8955 t['padeva'] = 0x092A; 8956 t['pagedown'] = 0x21DF; 8957 t['pageup'] = 0x21DE; 8958 t['pagujarati'] = 0x0AAA; 8959 t['pagurmukhi'] = 0x0A2A; 8960 t['pahiragana'] = 0x3071; 8961 t['paiyannoithai'] = 0x0E2F; 8962 t['pakatakana'] = 0x30D1; 8963 t['palatalizationcyrilliccmb'] = 0x0484; 8964 t['palochkacyrillic'] = 0x04C0; 8965 t['pansioskorean'] = 0x317F; 8966 t['paragraph'] = 0x00B6; 8967 t['parallel'] = 0x2225; 8968 t['parenleft'] = 0x0028; 8969 t['parenleftaltonearabic'] = 0xFD3E; 8970 t['parenleftbt'] = 0xF8ED; 8971 t['parenleftex'] = 0xF8EC; 8972 t['parenleftinferior'] = 0x208D; 8973 t['parenleftmonospace'] = 0xFF08; 8974 t['parenleftsmall'] = 0xFE59; 8975 t['parenleftsuperior'] = 0x207D; 8976 t['parenlefttp'] = 0xF8EB; 8977 t['parenleftvertical'] = 0xFE35; 8978 t['parenright'] = 0x0029; 8979 t['parenrightaltonearabic'] = 0xFD3F; 8980 t['parenrightbt'] = 0xF8F8; 8981 t['parenrightex'] = 0xF8F7; 8982 t['parenrightinferior'] = 0x208E; 8983 t['parenrightmonospace'] = 0xFF09; 8984 t['parenrightsmall'] = 0xFE5A; 8985 t['parenrightsuperior'] = 0x207E; 8986 t['parenrighttp'] = 0xF8F6; 8987 t['parenrightvertical'] = 0xFE36; 8988 t['partialdiff'] = 0x2202; 8989 t['paseqhebrew'] = 0x05C0; 8990 t['pashtahebrew'] = 0x0599; 8991 t['pasquare'] = 0x33A9; 8992 t['patah'] = 0x05B7; 8993 t['patah11'] = 0x05B7; 8994 t['patah1d'] = 0x05B7; 8995 t['patah2a'] = 0x05B7; 8996 t['patahhebrew'] = 0x05B7; 8997 t['patahnarrowhebrew'] = 0x05B7; 8998 t['patahquarterhebrew'] = 0x05B7; 8999 t['patahwidehebrew'] = 0x05B7; 9000 t['pazerhebrew'] = 0x05A1; 9001 t['pbopomofo'] = 0x3106; 9002 t['pcircle'] = 0x24DF; 9003 t['pdotaccent'] = 0x1E57; 9004 t['pe'] = 0x05E4; 9005 t['pecyrillic'] = 0x043F; 9006 t['pedagesh'] = 0xFB44; 9007 t['pedageshhebrew'] = 0xFB44; 9008 t['peezisquare'] = 0x333B; 9009 t['pefinaldageshhebrew'] = 0xFB43; 9010 t['peharabic'] = 0x067E; 9011 t['peharmenian'] = 0x057A; 9012 t['pehebrew'] = 0x05E4; 9013 t['pehfinalarabic'] = 0xFB57; 9014 t['pehinitialarabic'] = 0xFB58; 9015 t['pehiragana'] = 0x307A; 9016 t['pehmedialarabic'] = 0xFB59; 9017 t['pekatakana'] = 0x30DA; 9018 t['pemiddlehookcyrillic'] = 0x04A7; 9019 t['perafehebrew'] = 0xFB4E; 9020 t['percent'] = 0x0025; 9021 t['percentarabic'] = 0x066A; 9022 t['percentmonospace'] = 0xFF05; 9023 t['percentsmall'] = 0xFE6A; 9024 t['period'] = 0x002E; 9025 t['periodarmenian'] = 0x0589;
9026 t['periodcentered'] = 0x00B7; 9027 t['periodhalfwidth'] = 0xFF61; 9028 t['periodinferior'] = 0xF6E7; 9029 t['periodmonospace'] = 0xFF0E; 9030 t['periodsmall'] = 0xFE52; 9031 t['periodsuperior'] = 0xF6E8; 9032 t['perispomenigreekcmb'] = 0x0342; 9033 t['perpendicular'] = 0x22A5; 9034 t['perthousand'] = 0x2030; 9035 t['peseta'] = 0x20A7; 9036 t['pfsquare'] = 0x338A; 9037 t['phabengali'] = 0x09AB; 9038 t['phadeva'] = 0x092B; 9039 t['phagujarati'] = 0x0AAB; 9040 t['phagurmukhi'] = 0x0A2B; 9041 t['phi'] = 0x03C6; 9042 t['phi1'] = 0x03D5; 9043 t['phieuphacirclekorean'] = 0x327A; 9044 t['phieuphaparenkorean'] = 0x321A; 9045 t['phieuphcirclekorean'] = 0x326C; 9046 t['phieuphkorean'] = 0x314D; 9047 t['phieuphparenkorean'] = 0x320C; 9048 t['philatin'] = 0x0278; 9049 t['phinthuthai'] = 0x0E3A; 9050 t['phisymbolgreek'] = 0x03D5; 9051 t['phook'] = 0x01A5; 9052 t['phophanthai'] = 0x0E1E; 9053 t['phophungthai'] = 0x0E1C; 9054 t['phosamphaothai'] = 0x0E20; 9055 t['pi'] = 0x03C0; 9056 t['pieupacirclekorean'] = 0x3273; 9057 t['pieupaparenkorean'] = 0x3213; 9058 t['pieupcieuckorean'] = 0x3176; 9059 t['pieupcirclekorean'] = 0x3265; 9060 t['pieupkiyeokkorean'] = 0x3172; 9061 t['pieupkorean'] = 0x3142; 9062 t['pieupparenkorean'] = 0x3205; 9063 t['pieupsioskiyeokkorean'] = 0x3174; 9064 t['pieupsioskorean'] = 0x3144; 9065 t['pieupsiostikeutkorean'] = 0x3175; 9066 t['pieupthieuthkorean'] = 0x3177; 9067 t['pieuptikeutkorean'] = 0x3173; 9068 t['pihiragana'] = 0x3074; 9069 t['pikatakana'] = 0x30D4; 9070 t['pisymbolgreek'] = 0x03D6; 9071 t['piwrarmenian'] = 0x0583; 9072 t['plus'] = 0x002B; 9073 t['plusbelowcmb'] = 0x031F; 9074 t['pluscircle'] = 0x2295; 9075 t['plusminus'] = 0x00B1; 9076 t['plusmod'] = 0x02D6; 9077 t['plusmonospace'] = 0xFF0B; 9078 t['plussmall'] = 0xFE62; 9079 t['plussuperior'] = 0x207A; 9080 t['pmonospace'] = 0xFF50; 9081 t['pmsquare'] = 0x33D8; 9082 t['pohiragana'] = 0x307D; 9083 t['pointingindexdownwhite'] = 0x261F; 9084 t['pointingindexleftwhite'] = 0x261C; 9085 t['pointingindexrightwhite'] = 0x261E; 9086 t['pointingindexupwhite'] = 0x261D; 9087 t['pokatakana'] = 0x30DD; 9088 t['poplathai'] = 0x0E1B; 9089 t['postalmark'] = 0x3012; 9090 t['postalmarkface'] = 0x3020; 9091 t['pparen'] = 0x24AB; 9092 t['precedes'] = 0x227A; 9093 t['prescription'] = 0x211E; 9094 t['primemod'] = 0x02B9; 9095 t['primereversed'] = 0x2035; 9096 t['product'] = 0x220F; 9097 t['projective'] = 0x2305; 9098 t['prolongedkana'] = 0x30FC; 9099 t['propellor'] = 0x2318; 9100 t['propersubset'] = 0x2282; 9101 t['propersuperset'] = 0x2283; 9102 t['proportion'] = 0x2237; 9103 t['proportional'] = 0x221D; 9104 t['psi'] = 0x03C8; 9105 t['psicyrillic'] = 0x0471; 9106 t['psilipneumatacyrilliccmb'] = 0x0486; 9107 t['pssquare'] = 0x33B0; 9108 t['puhiragana'] = 0x3077; 9109 t['pukatakana'] = 0x30D7; 9110 t['pvsquare'] = 0x33B4; 9111 t['pwsquare'] = 0x33BA; 9112 t['q'] = 0x0071; 9113 t['qadeva'] = 0x0958; 9114 t['qadmahebrew'] = 0x05A8; 9115 t['qafarabic'] = 0x0642; 9116 t['qaffinalarabic'] = 0xFED6; 9117 t['qafinitialarabic'] = 0xFED7; 9118 t['qafmedialarabic'] = 0xFED8; 9119 t['qamats'] = 0x05B8; 9120 t['qamats10'] = 0x05B8; 9121 t['qamats1a'] = 0x05B8; 9122 t['qamats1c'] = 0x05B8; 9123 t['qamats27'] = 0x05B8; 9124 t['qamats29'] = 0x05B8; 9125 t['qamats33'] = 0x05B8; 9126 t['qamatsde'] = 0x05B8; 9127 t['qamatshebrew'] = 0x05B8; 9128 t['qamatsnarrowhebrew'] = 0x05B8; 9129 t['qamatsqatanhebrew'] = 0x05B8; 9130 t['qamatsqatannarrowhebrew'] = 0x05B8; 9131 t['qamatsqatanquarterhebrew'] = 0x05B8; 9132 t['qamatsqatanwidehebrew'] = 0x05B8; 9133 t['qamatsquarterhebrew'] = 0x05B8; 9134 t['qamatswidehebrew'] = 0x05B8; 9135 t['qarneyparahebrew'] = 0x059F; 9136 t['qbopomofo'] = 0x3111; 9137 t['qcircle'] = 0x24E0; 9138 t['qhook'] = 0x02A0; 9139 t['qmonospace'] = 0xFF51; 9140 t['qof'] = 0x05E7; 9141 t['qofdagesh'] = 0xFB47; 9142 t['qofdageshhebrew'] = 0xFB47; 9143 t['qofhebrew'] = 0x05E7; 9144 t['qparen'] = 0x24AC; 9145 t['quarternote'] = 0x2669; 9146 t['qubuts'] = 0x05BB; 9147 t['qubuts18'] = 0x05BB; 9148 t['qubuts25'] = 0x05BB; 9149 t['qubuts31'] = 0x05BB; 9150 t['qubutshebrew'] = 0x05BB; 9151 t['qubutsnarrowhebrew'] = 0x05BB; 9152 t['qubutsquarterhebrew'] = 0x05BB; 9153 t['qubutswidehebrew'] = 0x05BB; 9154 t['question'] = 0x003F; 9155 t['questionarabic'] = 0x061F; 9156 t['questionarmenian'] = 0x055E; 9157 t['questiondown'] = 0x00BF; 9158 t['questiondownsmall'] = 0xF7BF; 9159 t['questiongreek'] = 0x037E; 9160 t['questionmonospace'] = 0xFF1F; 9161 t['questionsmall'] = 0xF73F; 9162 t['quotedbl'] = 0x0022; 9163 t['quotedblbase'] = 0x201E; 9164 t['quotedblleft'] = 0x201C; 9165 t['quotedblmonospace'] = 0xFF02; 9166 t['quotedblprime'] = 0x301E; 9167 t['quotedblprimereversed'] = 0x301D; 9168 t['quotedblright'] = 0x201D; 9169 t['quoteleft'] = 0x2018; 9170 t['quoteleftreversed'] = 0x201B; 9171 t['quotereversed'] = 0x201B; 9172 t['quoteright'] = 0x2019; 9173 t['quoterightn'] = 0x0149; 9174 t['quotesinglbase'] = 0x201A; 9175 t['quotesingle'] = 0x0027; 9176 t['quotesinglemonospace'] = 0xFF07; 9177 t['r'] = 0x0072; 9178 t['raarmenian'] = 0x057C; 9179 t['rabengali'] = 0x09B0; 9180 t['racute'] = 0x0155; 9181 t['radeva'] = 0x0930; 9182 t['radical'] = 0x221A;
9183 t['radicalex'] = 0xF8E5; 9184 t['radoverssquare'] = 0x33AE; 9185 t['radoverssquaredsquare'] = 0x33AF; 9186 t['radsquare'] = 0x33AD; 9187 t['rafe'] = 0x05BF; 9188 t['rafehebrew'] = 0x05BF; 9189 t['ragujarati'] = 0x0AB0; 9190 t['ragurmukhi'] = 0x0A30; 9191 t['rahiragana'] = 0x3089; 9192 t['rakatakana'] = 0x30E9; 9193 t['rakatakanahalfwidth'] = 0xFF97; 9194 t['ralowerdiagonalbengali'] = 0x09F1; 9195 t['ramiddlediagonalbengali'] = 0x09F0; 9196 t['ramshorn'] = 0x0264; 9197 t['ratio'] = 0x2236; 9198 t['rbopomofo'] = 0x3116; 9199 t['rcaron'] = 0x0159; 9200 t['rcedilla'] = 0x0157; 9201 t['rcircle'] = 0x24E1; 9202 t['rcommaaccent'] = 0x0157; 9203 t['rdblgrave'] = 0x0211; 9204 t['rdotaccent'] = 0x1E59; 9205 t['rdotbelow'] = 0x1E5B; 9206 t['rdotbelowmacron'] = 0x1E5D; 9207 t['referencemark'] = 0x203B; 9208 t['reflexsubset'] = 0x2286; 9209 t['reflexsuperset'] = 0x2287; 9210 t['registered'] = 0x00AE; 9211 t['registersans'] = 0xF8E8; 9212 t['registerserif'] = 0xF6DA; 9213 t['reharabic'] = 0x0631; 9214 t['reharmenian'] = 0x0580; 9215 t['rehfinalarabic'] = 0xFEAE; 9216 t['rehiragana'] = 0x308C; 9217 t['rekatakana'] = 0x30EC; 9218 t['rekatakanahalfwidth'] = 0xFF9A; 9219 t['resh'] = 0x05E8; 9220 t['reshdageshhebrew'] = 0xFB48; 9221 t['reshhebrew'] = 0x05E8; 9222 t['reversedtilde'] = 0x223D; 9223 t['reviahebrew'] = 0x0597; 9224 t['reviamugrashhebrew'] = 0x0597; 9225 t['revlogicalnot'] = 0x2310; 9226 t['rfishhook'] = 0x027E; 9227 t['rfishhookreversed'] = 0x027F; 9228 t['rhabengali'] = 0x09DD; 9229 t['rhadeva'] = 0x095D; 9230 t['rho'] = 0x03C1; 9231 t['rhook'] = 0x027D; 9232 t['rhookturned'] = 0x027B; 9233 t['rhookturnedsuperior'] = 0x02B5; 9234 t['rhosymbolgreek'] = 0x03F1; 9235 t['rhotichookmod'] = 0x02DE; 9236 t['rieulacirclekorean'] = 0x3271; 9237 t['rieulaparenkorean'] = 0x3211; 9238 t['rieulcirclekorean'] = 0x3263; 9239 t['rieulhieuhkorean'] = 0x3140; 9240 t['rieulkiyeokkorean'] = 0x313A; 9241 t['rieulkiyeoksioskorean'] = 0x3169; 9242 t['rieulkorean'] = 0x3139; 9243 t['rieulmieumkorean'] = 0x313B; 9244 t['rieulpansioskorean'] = 0x316C; 9245 t['rieulparenkorean'] = 0x3203; 9246 t['rieulphieuphkorean'] = 0x313F; 9247 t['rieulpieupkorean'] = 0x313C; 9248 t['rieulpieupsioskorean'] = 0x316B; 9249 t['rieulsioskorean'] = 0x313D; 9250 t['rieulthieuthkorean'] = 0x313E; 9251 t['rieultikeutkorean'] = 0x316A; 9252 t['rieulyeorinhieuhkorean'] = 0x316D; 9253 t['rightangle'] = 0x221F; 9254 t['righttackbelowcmb'] = 0x0319; 9255 t['righttriangle'] = 0x22BF; 9256 t['rihiragana'] = 0x308A; 9257 t['rikatakana'] = 0x30EA; 9258 t['rikatakanahalfwidth'] = 0xFF98; 9259 t['ring'] = 0x02DA; 9260 t['ringbelowcmb'] = 0x0325; 9261 t['ringcmb'] = 0x030A; 9262 t['ringhalfleft'] = 0x02BF; 9263 t['ringhalfleftarmenian'] = 0x0559; 9264 t['ringhalfleftbelowcmb'] = 0x031C; 9265 t['ringhalfleftcentered'] = 0x02D3; 9266 t['ringhalfright'] = 0x02BE; 9267 t['ringhalfrightbelowcmb'] = 0x0339; 9268 t['ringhalfrightcentered'] = 0x02D2; 9269 t['rinvertedbreve'] = 0x0213; 9270 t['rittorusquare'] = 0x3351; 9271 t['rlinebelow'] = 0x1E5F; 9272 t['rlongleg'] = 0x027C; 9273 t['rlonglegturned'] = 0x027A; 9274 t['rmonospace'] = 0xFF52; 9275 t['rohiragana'] = 0x308D; 9276 t['rokatakana'] = 0x30ED; 9277 t['rokatakanahalfwidth'] = 0xFF9B; 9278 t['roruathai'] = 0x0E23; 9279 t['rparen'] = 0x24AD; 9280 t['rrabengali'] = 0x09DC; 9281 t['rradeva'] = 0x0931; 9282 t['rragurmukhi'] = 0x0A5C; 9283 t['rreharabic'] = 0x0691; 9284 t['rrehfinalarabic'] = 0xFB8D; 9285 t['rrvocalicbengali'] = 0x09E0; 9286 t['rrvocalicdeva'] = 0x0960; 9287 t['rrvocalicgujarati'] = 0x0AE0; 9288 t['rrvocalicvowelsignbengali'] = 0x09C4; 9289 t['rrvocalicvowelsigndeva'] = 0x0944; 9290 t['rrvocalicvowelsigngujarati'] = 0x0AC4; 9291 t['rsuperior'] = 0xF6F1; 9292 t['rtblock'] = 0x2590; 9293 t['rturned'] = 0x0279; 9294 t['rturnedsuperior'] = 0x02B4; 9295 t['ruhiragana'] = 0x308B; 9296 t['rukatakana'] = 0x30EB; 9297 t['rukatakanahalfwidth'] = 0xFF99; 9298 t['rupeemarkbengali'] = 0x09F2; 9299 t['rupeesignbengali'] = 0x09F3; 9300 t['rupiah'] = 0xF6DD; 9301 t['ruthai'] = 0x0E24; 9302 t['rvocalicbengali'] = 0x098B; 9303 t['rvocalicdeva'] = 0x090B; 9304 t['rvocalicgujarati'] = 0x0A8B; 9305 t['rvocalicvowelsignbengali'] = 0x09C3; 9306 t['rvocalicvowelsigndeva'] = 0x0943; 9307 t['rvocalicvowelsigngujarati'] = 0x0AC3; 9308 t['s'] = 0x0073; 9309 t['sabengali'] = 0x09B8; 9310 t['sacute'] = 0x015B; 9311 t['sacutedotaccent'] = 0x1E65; 9312 t['sadarabic'] = 0x0635; 9313 t['sadeva'] = 0x0938; 9314 t['sadfinalarabic'] = 0xFEBA; 9315 t['sadinitialarabic'] = 0xFEBB; 9316 t['sadmedialarabic'] = 0xFEBC; 9317 t['sagujarati'] = 0x0AB8; 9318 t['sagurmukhi'] = 0x0A38; 9319 t['sahiragana'] = 0x3055; 9320 t['sakatakana'] = 0x30B5;
9321 t['sakatakanahalfwidth'] = 0xFF7B; 9322 t['sallallahoualayhewasallamarabic'] = 0xFDFA; 9323 t['samekh'] = 0x05E1; 9324 t['samekhdagesh'] = 0xFB41; 9325 t['samekhdageshhebrew'] = 0xFB41; 9326 t['samekhhebrew'] = 0x05E1; 9327 t['saraaathai'] = 0x0E32; 9328 t['saraaethai'] = 0x0E41; 9329 t['saraaimaimalaithai'] = 0x0E44; 9330 t['saraaimaimuanthai'] = 0x0E43; 9331 t['saraamthai'] = 0x0E33; 9332 t['saraathai'] = 0x0E30; 9333 t['saraethai'] = 0x0E40; 9334 t['saraiileftthai'] = 0xF886; 9335 t['saraiithai'] = 0x0E35; 9336 t['saraileftthai'] = 0xF885; 9337 t['saraithai'] = 0x0E34; 9338 t['saraothai'] = 0x0E42; 9339 t['saraueeleftthai'] = 0xF888; 9340 t['saraueethai'] = 0x0E37; 9341 t['saraueleftthai'] = 0xF887; 9342 t['sarauethai'] = 0x0E36; 9343 t['sarauthai'] = 0x0E38; 9344 t['sarauuthai'] = 0x0E39; 9345 t['sbopomofo'] = 0x3119; 9346 t['scaron'] = 0x0161; 9347 t['scarondotaccent'] = 0x1E67; 9348 t['scedilla'] = 0x015F; 9349 t['schwa'] = 0x0259; 9350 t['schwacyrillic'] = 0x04D9; 9351 t['schwadieresiscyrillic'] = 0x04DB; 9352 t['schwahook'] = 0x025A; 9353 t['scircle'] = 0x24E2; 9354 t['scircumflex'] = 0x015D; 9355 t['scommaaccent'] = 0x0219; 9356 t['sdotaccent'] = 0x1E61; 9357 t['sdotbelow'] = 0x1E63; 9358 t['sdotbelowdotaccent'] = 0x1E69; 9359 t['seagullbelowcmb'] = 0x033C; 9360 t['second'] = 0x2033; 9361 t['secondtonechinese'] = 0x02CA; 9362 t['section'] = 0x00A7; 9363 t['seenarabic'] = 0x0633; 9364 t['seenfinalarabic'] = 0xFEB2; 9365 t['seeninitialarabic'] = 0xFEB3; 9366 t['seenmedialarabic'] = 0xFEB4; 9367 t['segol'] = 0x05B6; 9368 t['segol13'] = 0x05B6; 9369 t['segol1f'] = 0x05B6; 9370 t['segol2c'] = 0x05B6; 9371 t['segolhebrew'] = 0x05B6; 9372 t['segolnarrowhebrew'] = 0x05B6; 9373 t['segolquarterhebrew'] = 0x05B6; 9374 t['segoltahebrew'] = 0x0592; 9375 t['segolwidehebrew'] = 0x05B6; 9376 t['seharmenian'] = 0x057D; 9377 t['sehiragana'] = 0x305B; 9378 t['sekatakana'] = 0x30BB; 9379 t['sekatakanahalfwidth'] = 0xFF7E; 9380 t['semicolon'] = 0x003B; 9381 t['semicolonarabic'] = 0x061B; 9382 t['semicolonmonospace'] = 0xFF1B; 9383 t['semicolonsmall'] = 0xFE54; 9384 t['semivoicedmarkkana'] = 0x309C; 9385 t['semivoicedmarkkanahalfwidth'] = 0xFF9F; 9386 t['sentisquare'] = 0x3322; 9387 t['sentosquare'] = 0x3323; 9388 t['seven'] = 0x0037; 9389 t['sevenarabic'] = 0x0667; 9390 t['sevenbengali'] = 0x09ED; 9391 t['sevencircle'] = 0x2466; 9392 t['sevencircleinversesansserif'] = 0x2790; 9393 t['sevendeva'] = 0x096D; 9394 t['seveneighths'] = 0x215E; 9395 t['sevengujarati'] = 0x0AED; 9396 t['sevengurmukhi'] = 0x0A6D; 9397 t['sevenhackarabic'] = 0x0667; 9398 t['sevenhangzhou'] = 0x3027; 9399 t['sevenideographicparen'] = 0x3226; 9400 t['seveninferior'] = 0x2087; 9401 t['sevenmonospace'] = 0xFF17; 9402 t['sevenoldstyle'] = 0xF737; 9403 t['sevenparen'] = 0x247A; 9404 t['sevenperiod'] = 0x248E; 9405 t['sevenpersian'] = 0x06F7; 9406 t['sevenroman'] = 0x2176; 9407 t['sevensuperior'] = 0x2077; 9408 t['seventeencircle'] = 0x2470; 9409 t['seventeenparen'] = 0x2484; 9410 t['seventeenperiod'] = 0x2498; 9411 t['seventhai'] = 0x0E57; 9412 t['sfthyphen'] = 0x00AD; 9413 t['shaarmenian'] = 0x0577; 9414 t['shabengali'] = 0x09B6; 9415 t['shacyrillic'] = 0x0448; 9416 t['shaddaarabic'] = 0x0651; 9417 t['shaddadammaarabic'] = 0xFC61; 9418 t['shaddadammatanarabic'] = 0xFC5E; 9419 t['shaddafathaarabic'] = 0xFC60; 9420 t['shaddakasraarabic'] = 0xFC62; 9421 t['shaddakasratanarabic'] = 0xFC5F; 9422 t['shade'] = 0x2592; 9423 t['shadedark'] = 0x2593; 9424 t['shadelight'] = 0x2591; 9425 t['shademedium'] = 0x2592; 9426 t['shadeva'] = 0x0936; 9427 t['shagujarati'] = 0x0AB6; 9428 t['shagurmukhi'] = 0x0A36; 9429 t['shalshelethebrew'] = 0x0593; 9430 t['shbopomofo'] = 0x3115; 9431 t['shchacyrillic'] = 0x0449; 9432 t['sheenarabic'] = 0x0634; 9433 t['sheenfinalarabic'] = 0xFEB6; 9434 t['sheeninitialarabic'] = 0xFEB7; 9435 t['sheenmedialarabic'] = 0xFEB8; 9436 t['sheicoptic'] = 0x03E3; 9437 t['sheqel'] = 0x20AA; 9438 t['sheqelhebrew'] = 0x20AA; 9439 t['sheva'] = 0x05B0; 9440 t['sheva115'] = 0x05B0; 9441 t['sheva15'] = 0x05B0; 9442 t['sheva22'] = 0x05B0; 9443 t['sheva2e'] = 0x05B0; 9444 t['shevahebrew'] = 0x05B0; 9445 t['shevanarrowhebrew'] = 0x05B0; 9446 t['shevaquarterhebrew'] = 0x05B0; 9447 t['shevawidehebrew'] = 0x05B0; 9448 t['shhacyrillic'] = 0x04BB; 9449 t['shimacoptic'] = 0x03ED; 9450 t['shin'] = 0x05E9; 9451 t['shindagesh'] = 0xFB49; 9452 t['shindageshhebrew'] = 0xFB49; 9453 t['shindageshshindot'] = 0xFB2C; 9454 t['shindageshshindothebrew'] = 0xFB2C; 9455 t['shindageshsindot'] = 0xFB2D; 9456 t['shindageshsindothebrew'] = 0xFB2D; 9457 t['shindothebrew'] = 0x05C1; 9458 t['shinhebrew'] = 0x05E9; 9459 t['shinshindot'] = 0xFB2A; 9460 t['shinshindothebrew'] = 0xFB2A; 9461 t['shinsindot'] = 0xFB2B; 9462 t['shinsindothebrew'] = 0xFB2B; 9463 t['shook'] = 0x0282;
9464 t['sigma'] = 0x03C3; 9465 t['sigma1'] = 0x03C2; 9466 t['sigmafinal'] = 0x03C2; 9467 t['sigmalunatesymbolgreek'] = 0x03F2; 9468 t['sihiragana'] = 0x3057; 9469 t['sikatakana'] = 0x30B7; 9470 t['sikatakanahalfwidth'] = 0xFF7C; 9471 t['siluqhebrew'] = 0x05BD; 9472 t['siluqlefthebrew'] = 0x05BD; 9473 t['similar'] = 0x223C; 9474 t['sindothebrew'] = 0x05C2; 9475 t['siosacirclekorean'] = 0x3274; 9476 t['siosaparenkorean'] = 0x3214; 9477 t['sioscieuckorean'] = 0x317E; 9478 t['sioscirclekorean'] = 0x3266; 9479 t['sioskiyeokkorean'] = 0x317A; 9480 t['sioskorean'] = 0x3145; 9481 t['siosnieunkorean'] = 0x317B; 9482 t['siosparenkorean'] = 0x3206; 9483 t['siospieupkorean'] = 0x317D; 9484 t['siostikeutkorean'] = 0x317C; 9485 t['six'] = 0x0036; 9486 t['sixarabic'] = 0x0666; 9487 t['sixbengali'] = 0x09EC; 9488 t['sixcircle'] = 0x2465; 9489 t['sixcircleinversesansserif'] = 0x278F; 9490 t['sixdeva'] = 0x096C; 9491 t['sixgujarati'] = 0x0AEC; 9492 t['sixgurmukhi'] = 0x0A6C; 9493 t['sixhackarabic'] = 0x0666; 9494 t['sixhangzhou'] = 0x3026; 9495 t['sixideographicparen'] = 0x3225; 9496 t['sixinferior'] = 0x2086; 9497 t['sixmonospace'] = 0xFF16; 9498 t['sixoldstyle'] = 0xF736; 9499 t['sixparen'] = 0x2479; 9500 t['sixperiod'] = 0x248D; 9501 t['sixpersian'] = 0x06F6; 9502 t['sixroman'] = 0x2175; 9503 t['sixsuperior'] = 0x2076; 9504 t['sixteencircle'] = 0x246F; 9505 t['sixteencurrencydenominatorbengali'] = 0x09F9; 9506 t['sixteenparen'] = 0x2483; 9507 t['sixteenperiod'] = 0x2497; 9508 t['sixthai'] = 0x0E56; 9509 t['slash'] = 0x002F; 9510 t['slashmonospace'] = 0xFF0F; 9511 t['slong'] = 0x017F; 9512 t['slongdotaccent'] = 0x1E9B; 9513 t['smileface'] = 0x263A; 9514 t['smonospace'] = 0xFF53; 9515 t['sofpasuqhebrew'] = 0x05C3; 9516 t['softhyphen'] = 0x00AD; 9517 t['softsigncyrillic'] = 0x044C; 9518 t['sohiragana'] = 0x305D; 9519 t['sokatakana'] = 0x30BD; 9520 t['sokatakanahalfwidth'] = 0xFF7F; 9521 t['soliduslongoverlaycmb'] = 0x0338; 9522 t['solidusshortoverlaycmb'] = 0x0337; 9523 t['sorusithai'] = 0x0E29; 9524 t['sosalathai'] = 0x0E28; 9525 t['sosothai'] = 0x0E0B; 9526 t['sosuathai'] = 0x0E2A; 9527 t['space'] = 0x0020; 9528 t['spacehackarabic'] = 0x0020; 9529 t['spade'] = 0x2660; 9530 t['spadesuitblack'] = 0x2660; 9531 t['spadesuitwhite'] = 0x2664; 9532 t['sparen'] = 0x24AE; 9533 t['squarebelowcmb'] = 0x033B; 9534 t['squarecc'] = 0x33C4; 9535 t['squarecm'] = 0x339D; 9536 t['squarediagonalcrosshatchfill'] = 0x25A9; 9537 t['squarehorizontalfill'] = 0x25A4; 9538 t['squarekg'] = 0x338F; 9539 t['squarekm'] = 0x339E; 9540 t['squarekmcapital'] = 0x33CE; 9541 t['squareln'] = 0x33D1; 9542 t['squarelog'] = 0x33D2; 9543 t['squaremg'] = 0x338E; 9544 t['squaremil'] = 0x33D5; 9545 t['squaremm'] = 0x339C; 9546 t['squaremsquared'] = 0x33A1; 9547 t['squareorthogonalcrosshatchfill'] = 0x25A6; 9548 t['squareupperlefttolowerrightfill'] = 0x25A7; 9549 t['squareupperrighttolowerleftfill'] = 0x25A8; 9550 t['squareverticalfill'] = 0x25A5; 9551 t['squarewhitewithsmallblack'] = 0x25A3; 9552 t['srsquare'] = 0x33DB; 9553 t['ssabengali'] = 0x09B7; 9554 t['ssadeva'] = 0x0937; 9555 t['ssagujarati'] = 0x0AB7; 9556 t['ssangcieuckorean'] = 0x3149; 9557 t['ssanghieuhkorean'] = 0x3185; 9558 t['ssangieungkorean'] = 0x3180; 9559 t['ssangkiyeokkorean'] = 0x3132; 9560 t['ssangnieunkorean'] = 0x3165; 9561 t['ssangpieupkorean'] = 0x3143; 9562 t['ssangsioskorean'] = 0x3146; 9563 t['ssangtikeutkorean'] = 0x3138; 9564 t['ssuperior'] = 0xF6F2; 9565 t['sterling'] = 0x00A3; 9566 t['sterlingmonospace'] = 0xFFE1; 9567 t['strokelongoverlaycmb'] = 0x0336; 9568 t['strokeshortoverlaycmb'] = 0x0335; 9569 t['subset'] = 0x2282; 9570 t['subsetnotequal'] = 0x228A; 9571 t['subsetorequal'] = 0x2286; 9572 t['succeeds'] = 0x227B; 9573 t['suchthat'] = 0x220B; 9574 t['suhiragana'] = 0x3059; 9575 t['sukatakana'] = 0x30B9; 9576 t['sukatakanahalfwidth'] = 0xFF7D; 9577 t['sukunarabic'] = 0x0652; 9578 t['summation'] = 0x2211; 9579 t['sun'] = 0x263C; 9580 t['superset'] = 0x2283; 9581 t['supersetnotequal'] = 0x228B; 9582 t['supersetorequal'] = 0x2287; 9583 t['svsquare'] = 0x33DC; 9584 t['syouwaerasquare'] = 0x337C; 9585 t['t'] = 0x0074; 9586 t['tabengali'] = 0x09A4; 9587 t['tackdown'] = 0x22A4; 9588 t['tackleft'] = 0x22A3; 9589 t['tadeva'] = 0x0924; 9590 t['tagujarati'] = 0x0AA4; 9591 t['tagurmukhi'] = 0x0A24; 9592 t['taharabic'] = 0x0637; 9593 t['tahfinalarabic'] = 0xFEC2; 9594 t['tahinitialarabic'] = 0xFEC3; 9595 t['tahiragana'] = 0x305F; 9596 t['tahmedialarabic'] = 0xFEC4; 9597 t['taisyouerasquare'] = 0x337D; 9598 t['takatakana'] = 0x30BF; 9599 t['takatakanahalfwidth'] = 0xFF80; 9600 t['tatweelarabic'] = 0x0640; 9601 t['tau'] = 0x03C4; 9602 t['tav'] = 0x05EA; 9603 t['tavdages'] = 0xFB4A; 9604 t['tavdagesh'] = 0xFB4A; 9605 t['tavdageshhebrew'] = 0xFB4A; 9606 t['tavhebrew'] = 0x05EA; 9607 t['tbar'] = 0x0167; 9608 t['tbopomofo'] = 0x310A; 9609 t['tcaron'] = 0x0165; 9610 t['tccurl'] = 0x02A8; 9611 t['tcedilla'] = 0x0163; 9612 t['tcheharabic'] = 0x0686; 9613 t['tchehfinalarabic'] = 0xFB7B; 9614 t['tchehinitialarabic'] = 0xFB7C; 9615 t['tchehmedialarabic'] = 0xFB7D; 9616 t['tcircle'] = 0x24E3; 9617 t['tcircumflexbelow'] = 0x1E71; 9618 t['tcommaaccent'] = 0x0163; 9619 t['tdieresis'] = 0x1E97; 9620 t['tdotaccent'] = 0x1E6B; 9621 t['tdotbelow'] = 0x1E6D; 9622 t['tecyrillic'] = 0x0442; 9623 t['tedescendercyrillic'] = 0x04AD; 9624 t['teharabic'] = 0x062A; 9625 t['tehfinalarabic'] = 0xFE96; 9626 t['tehhahinitialarabic'] = 0xFCA2; 9627 t['tehhahisolatedarabic'] = 0xFC0C; 9628 t['tehinitialarabic'] = 0xFE97; 9629 t['tehiragana'] = 0x3066; 9630 t['tehjeeminitialarabic'] = 0xFCA1; 9631 t['tehjeemisolatedarabic'] = 0xFC0B; 9632 t['tehmarbutaarabic'] = 0x0629; 9633 t['tehmarbutafinalarabic'] = 0xFE94; 9634 t['tehmedialarabic'] = 0xFE98; 9635 t['tehmeeminitialarabic'] = 0xFCA4; 9636 t['tehmeemisolatedarabic'] = 0xFC0E; 9637 t['tehnoonfinalarabic'] = 0xFC73; 9638 t['tekatakana'] = 0x30C6; 9639 t['tekatakanahalfwidth'] = 0xFF83; 9640 t['telephone'] = 0x2121; 9641 t['telephoneblack'] = 0x260E; 9642 t['telishagedolahebrew'] = 0x05A0; 9643 t['telishaqetanahebrew'] = 0x05A9; 9644 t['tencircle'] = 0x2469; 9645 t['tenideographicparen'] = 0x3229; 9646 t['tenparen'] = 0x247D; 9647 t['tenperiod'] = 0x2491; 9648 t['tenroman'] = 0x2179; 9649 t['tesh'] = 0x02A7; 9650 t['tet'] = 0x05D8; 9651 t['tetdagesh'] = 0xFB38; 9652 t['tetdageshhebrew'] = 0xFB38; 9653 t['tethebrew'] = 0x05D8; 9654 t['tetsecyrillic'] = 0x04B5; 9655 t['tevirhebrew'] = 0x059B; 9656 t['tevirlefthebrew'] = 0x059B; 9657 t['thabengali'] = 0x09A5; 9658 t['thadeva'] = 0x0925; 9659 t['thagujarati'] = 0x0AA5; 9660 t['thagurmukhi'] = 0x0A25; 9661 t['thalarabic'] = 0x0630; 9662 t['thalfinalarabic'] = 0xFEAC;
9663 t['thanthakhatlowleftthai'] = 0xF898; 9664 t['thanthakhatlowrightthai'] = 0xF897; 9665 t['thanthakhatthai'] = 0x0E4C; 9666 t['thanthakhatupperleftthai'] = 0xF896; 9667 t['theharabic'] = 0x062B; 9668 t['thehfinalarabic'] = 0xFE9A; 9669 t['thehinitialarabic'] = 0xFE9B; 9670 t['thehmedialarabic'] = 0xFE9C; 9671 t['thereexists'] = 0x2203; 9672 t['therefore'] = 0x2234; 9673 t['theta'] = 0x03B8; 9674 t['theta1'] = 0x03D1; 9675 t['thetasymbolgreek'] = 0x03D1; 9676 t['thieuthacirclekorean'] = 0x3279; 9677 t['thieuthaparenkorean'] = 0x3219; 9678 t['thieuthcirclekorean'] = 0x326B; 9679 t['thieuthkorean'] = 0x314C; 9680 t['thieuthparenkorean'] = 0x320B; 9681 t['thirteencircle'] = 0x246C; 9682 t['thirteenparen'] = 0x2480; 9683 t['thirteenperiod'] = 0x2494; 9684 t['thonangmonthothai'] = 0x0E11; 9685 t['thook'] = 0x01AD; 9686 t['thophuthaothai'] = 0x0E12; 9687 t['thorn'] = 0x00FE; 9688 t['thothahanthai'] = 0x0E17; 9689 t['thothanthai'] = 0x0E10; 9690 t['thothongthai'] = 0x0E18; 9691 t['thothungthai'] = 0x0E16; 9692 t['thousandcyrillic'] = 0x0482; 9693 t['thousandsseparatorarabic'] = 0x066C; 9694 t['thousandsseparatorpersian'] = 0x066C; 9695 t['three'] = 0x0033; 9696 t['threearabic'] = 0x0663; 9697 t['threebengali'] = 0x09E9; 9698 t['threecircle'] = 0x2462; 9699 t['threecircleinversesansserif'] = 0x278C; 9700 t['threedeva'] = 0x0969; 9701 t['threeeighths'] = 0x215C; 9702 t['threegujarati'] = 0x0AE9; 9703 t['threegurmukhi'] = 0x0A69; 9704 t['threehackarabic'] = 0x0663; 9705 t['threehangzhou'] = 0x3023; 9706 t['threeideographicparen'] = 0x3222; 9707 t['threeinferior'] = 0x2083; 9708 t['threemonospace'] = 0xFF13; 9709 t['threenumeratorbengali'] = 0x09F6; 9710 t['threeoldstyle'] = 0xF733; 9711 t['threeparen'] = 0x2476; 9712 t['threeperiod'] = 0x248A; 9713 t['threepersian'] = 0x06F3; 9714 t['threequarters'] = 0x00BE; 9715 t['threequartersemdash'] = 0xF6DE; 9716 t['threeroman'] = 0x2172; 9717 t['threesuperior'] = 0x00B3; 9718 t['threethai'] = 0x0E53; 9719 t['thzsquare'] = 0x3394; 9720 t['tihiragana'] = 0x3061; 9721 t['tikatakana'] = 0x30C1; 9722 t['tikatakanahalfwidth'] = 0xFF81; 9723 t['tikeutacirclekorean'] = 0x3270; 9724 t['tikeutaparenkorean'] = 0x3210; 9725 t['tikeutcirclekorean'] = 0x3262; 9726 t['tikeutkorean'] = 0x3137; 9727 t['tikeutparenkorean'] = 0x3202; 9728 t['tilde'] = 0x02DC; 9729 t['tildebelowcmb'] = 0x0330; 9730 t['tildecmb'] = 0x0303; 9731 t['tildecomb'] = 0x0303; 9732 t['tildedoublecmb'] = 0x0360; 9733 t['tildeoperator'] = 0x223C; 9734 t['tildeoverlaycmb'] = 0x0334; 9735 t['tildeverticalcmb'] = 0x033E; 9736 t['timescircle'] = 0x2297; 9737 t['tipehahebrew'] = 0x0596; 9738 t['tipehalefthebrew'] = 0x0596; 9739 t['tippigurmukhi'] = 0x0A70; 9740 t['titlocyrilliccmb'] = 0x0483; 9741 t['tiwnarmenian'] = 0x057F; 9742 t['tlinebelow'] = 0x1E6F; 9743 t['tmonospace'] = 0xFF54; 9744 t['toarmenian'] = 0x0569; 9745 t['tohiragana'] = 0x3068; 9746 t['tokatakana'] = 0x30C8; 9747 t['tokatakanahalfwidth'] = 0xFF84; 9748 t['tonebarextrahighmod'] = 0x02E5; 9749 t['tonebarextralowmod'] = 0x02E9; 9750 t['tonebarhighmod'] = 0x02E6; 9751 t['tonebarlowmod'] = 0x02E8; 9752 t['tonebarmidmod'] = 0x02E7; 9753 t['tonefive'] = 0x01BD; 9754 t['tonesix'] = 0x0185; 9755 t['tonetwo'] = 0x01A8; 9756 t['tonos'] = 0x0384; 9757 t['tonsquare'] = 0x3327; 9758 t['topatakthai'] = 0x0E0F; 9759 t['tortoiseshellbracketleft'] = 0x3014; 9760 t['tortoiseshellbracketleftsmall'] = 0xFE5D; 9761 t['tortoiseshellbracketleftvertical'] = 0xFE39; 9762 t['tortoiseshellbracketright'] = 0x3015; 9763 t['tortoiseshellbracketrightsmall'] = 0xFE5E; 9764 t['tortoiseshellbracketrightvertical'] = 0xFE3A; 9765 t['totaothai'] = 0x0E15; 9766 t['tpalatalhook'] = 0x01AB; 9767 t['tparen'] = 0x24AF; 9768 t['trademark'] = 0x2122; 9769 t['trademarksans'] = 0xF8EA; 9770 t['trademarkserif'] = 0xF6DB; 9771 t['tretroflexhook'] = 0x0288; 9772 t['triagdn'] = 0x25BC; 9773 t['triaglf'] = 0x25C4; 9774 t['triagrt'] = 0x25BA; 9775 t['triagup'] = 0x25B2; 9776 t['ts'] = 0x02A6; 9777 t['tsadi'] = 0x05E6; 9778 t['tsadidagesh'] = 0xFB46; 9779 t['tsadidageshhebrew'] = 0xFB46; 9780 t['tsadihebrew'] = 0x05E6; 9781 t['tsecyrillic'] = 0x0446; 9782 t['tsere'] = 0x05B5; 9783 t['tsere12'] = 0x05B5; 9784 t['tsere1e'] = 0x05B5; 9785 t['tsere2b'] = 0x05B5; 9786 t['tserehebrew'] = 0x05B5; 9787 t['tserenarrowhebrew'] = 0x05B5; 9788 t['tserequarterhebrew'] = 0x05B5; 9789 t['tserewidehebrew'] = 0x05B5; 9790 t['tshecyrillic'] = 0x045B; 9791 t['tsuperior'] = 0xF6F3; 9792 t['ttabengali'] = 0x099F; 9793 t['ttadeva'] = 0x091F; 9794 t['ttagujarati'] = 0x0A9F; 9795 t['ttagurmukhi'] = 0x0A1F; 9796 t['tteharabic'] = 0x0679; 9797 t['ttehfinalarabic'] = 0xFB67; 9798 t['ttehinitialarabic'] = 0xFB68; 9799 t['ttehmedialarabic'] = 0xFB69;
9800 t['tthabengali'] = 0x09A0; 9801 t['tthadeva'] = 0x0920; 9802 t['tthagujarati'] = 0x0AA0; 9803 t['tthagurmukhi'] = 0x0A20; 9804 t['tturned'] = 0x0287; 9805 t['tuhiragana'] = 0x3064; 9806 t['tukatakana'] = 0x30C4; 9807 t['tukatakanahalfwidth'] = 0xFF82; 9808 t['tusmallhiragana'] = 0x3063; 9809 t['tusmallkatakana'] = 0x30C3; 9810 t['tusmallkatakanahalfwidth'] = 0xFF6F; 9811 t['twelvecircle'] = 0x246B; 9812 t['twelveparen'] = 0x247F; 9813 t['twelveperiod'] = 0x2493; 9814 t['twelveroman'] = 0x217B; 9815 t['twentycircle'] = 0x2473; 9816 t['twentyhangzhou'] = 0x5344; 9817 t['twentyparen'] = 0x2487; 9818 t['twentyperiod'] = 0x249B; 9819 t['two'] = 0x0032; 9820 t['twoarabic'] = 0x0662; 9821 t['twobengali'] = 0x09E8; 9822 t['twocircle'] = 0x2461; 9823 t['twocircleinversesansserif'] = 0x278B; 9824 t['twodeva'] = 0x0968; 9825 t['twodotenleader'] = 0x2025; 9826 t['twodotleader'] = 0x2025; 9827 t['twodotleadervertical'] = 0xFE30; 9828 t['twogujarati'] = 0x0AE8; 9829 t['twogurmukhi'] = 0x0A68; 9830 t['twohackarabic'] = 0x0662; 9831 t['twohangzhou'] = 0x3022; 9832 t['twoideographicparen'] = 0x3221; 9833 t['twoinferior'] = 0x2082; 9834 t['twomonospace'] = 0xFF12; 9835 t['twonumeratorbengali'] = 0x09F5; 9836 t['twooldstyle'] = 0xF732; 9837 t['twoparen'] = 0x2475; 9838 t['twoperiod'] = 0x2489; 9839 t['twopersian'] = 0x06F2; 9840 t['tworoman'] = 0x2171; 9841 t['twostroke'] = 0x01BB; 9842 t['twosuperior'] = 0x00B2; 9843 t['twothai'] = 0x0E52; 9844 t['twothirds'] = 0x2154; 9845 t['u'] = 0x0075; 9846 t['uacute'] = 0x00FA; 9847 t['ubar'] = 0x0289; 9848 t['ubengali'] = 0x0989; 9849 t['ubopomofo'] = 0x3128; 9850 t['ubreve'] = 0x016D; 9851 t['ucaron'] = 0x01D4; 9852 t['ucircle'] = 0x24E4; 9853 t['ucircumflex'] = 0x00FB; 9854 t['ucircumflexbelow'] = 0x1E77; 9855 t['ucyrillic'] = 0x0443; 9856 t['udattadeva'] = 0x0951; 9857 t['udblacute'] = 0x0171; 9858 t['udblgrave'] = 0x0215; 9859 t['udeva'] = 0x0909; 9860 t['udieresis'] = 0x00FC; 9861 t['udieresisacute'] = 0x01D8; 9862 t['udieresisbelow'] = 0x1E73; 9863 t['udieresiscaron'] = 0x01DA; 9864 t['udieresiscyrillic'] = 0x04F1; 9865 t['udieresisgrave'] = 0x01DC; 9866 t['udieresismacron'] = 0x01D6; 9867 t['udotbelow'] = 0x1EE5; 9868 t['ugrave'] = 0x00F9; 9869 t['ugujarati'] = 0x0A89; 9870 t['ugurmukhi'] = 0x0A09; 9871 t['uhiragana'] = 0x3046; 9872 t['uhookabove'] = 0x1EE7; 9873 t['uhorn'] = 0x01B0; 9874 t['uhornacute'] = 0x1EE9; 9875 t['uhorndotbelow'] = 0x1EF1; 9876 t['uhorngrave'] = 0x1EEB; 9877 t['uhornhookabove'] = 0x1EED; 9878 t['uhorntilde'] = 0x1EEF; 9879 t['uhungarumlaut'] = 0x0171; 9880 t['uhungarumlautcyrillic'] = 0x04F3; 9881 t['uinvertedbreve'] = 0x0217; 9882 t['ukatakana'] = 0x30A6; 9883 t['ukatakanahalfwidth'] = 0xFF73; 9884 t['ukcyrillic'] = 0x0479; 9885 t['ukorean'] = 0x315C; 9886 t['umacron'] = 0x016B; 9887 t['umacroncyrillic'] = 0x04EF; 9888 t['umacrondieresis'] = 0x1E7B; 9889 t['umatragurmukhi'] = 0x0A41; 9890 t['umonospace'] = 0xFF55; 9891 t['underscore'] = 0x005F; 9892 t['underscoredbl'] = 0x2017; 9893 t['underscoremonospace'] = 0xFF3F; 9894 t['underscorevertical'] = 0xFE33; 9895 t['underscorewavy'] = 0xFE4F; 9896 t['union'] = 0x222A; 9897 t['universal'] = 0x2200; 9898 t['uogonek'] = 0x0173; 9899 t['uparen'] = 0x24B0; 9900 t['upblock'] = 0x2580; 9901 t['upperdothebrew'] = 0x05C4; 9902 t['upsilon'] = 0x03C5; 9903 t['upsilondieresis'] = 0x03CB; 9904 t['upsilondieresistonos'] = 0x03B0; 9905 t['upsilonlatin'] = 0x028A; 9906 t['upsilontonos'] = 0x03CD; 9907 t['uptackbelowcmb'] = 0x031D; 9908 t['uptackmod'] = 0x02D4; 9909 t['uragurmukhi'] = 0x0A73; 9910 t['uring'] = 0x016F; 9911 t['ushortcyrillic'] = 0x045E; 9912 t['usmallhiragana'] = 0x3045; 9913 t['usmallkatakana'] = 0x30A5; 9914 t['usmallkatakanahalfwidth'] = 0xFF69; 9915 t['ustraightcyrillic'] = 0x04AF; 9916 t['ustraightstrokecyrillic'] = 0x04B1; 9917 t['utilde'] = 0x0169; 9918 t['utildeacute'] = 0x1E79; 9919 t['utildebelow'] = 0x1E75; 9920 t['uubengali'] = 0x098A; 9921 t['uudeva'] = 0x090A; 9922 t['uugujarati'] = 0x0A8A; 9923 t['uugurmukhi'] = 0x0A0A; 9924 t['uumatragurmukhi'] = 0x0A42; 9925 t['uuvowelsignbengali'] = 0x09C2; 9926 t['uuvowelsigndeva'] = 0x0942; 9927 t['uuvowelsigngujarati'] = 0x0AC2; 9928 t['uvowelsignbengali'] = 0x09C1; 9929 t['uvowelsigndeva'] = 0x0941; 9930 t['uvowelsigngujarati'] = 0x0AC1; 9931 t['v'] = 0x0076; 9932 t['vadeva'] = 0x0935; 9933 t['vagujarati'] = 0x0AB5; 9934 t['vagurmukhi'] = 0x0A35; 9935 t['vakatakana'] = 0x30F7; 9936 t['vav'] = 0x05D5; 9937 t['vavdagesh'] = 0xFB35; 9938 t['vavdagesh65'] = 0xFB35; 9939 t['vavdageshhebrew'] = 0xFB35; 9940 t['vavhebrew'] = 0x05D5; 9941 t['vavholam'] = 0xFB4B; 9942 t['vavholamhebrew'] = 0xFB4B; 9943 t['vavvavhebrew'] = 0x05F0; 9944 t['vavyodhebrew'] = 0x05F1; 9945 t['vcircle'] = 0x24E5; 9946 t['vdotbelow'] = 0x1E7F; 9947 t['vecyrillic'] = 0x0432; 9948 t['veharabic'] = 0x06A4; 9949 t['vehfinalarabic'] = 0xFB6B; 9950 t['vehinitialarabic'] = 0xFB6C; 9951 t['vehmedialarabic'] = 0xFB6D; 9952 t['vekatakana'] = 0x30F9; 9953 t['venus'] = 0x2640; 9954 t['verticalbar'] = 0x007C; 9955 t['verticallineabovecmb'] = 0x030D; 9956 t['verticallinebelowcmb'] = 0x0329; 9957 t['verticallinelowmod'] = 0x02CC; 9958 t['verticallinemod'] = 0x02C8; 9959 t['vewarmenian'] = 0x057E; 9960 t['vhook'] = 0x028B; 9961 t['vikatakana'] = 0x30F8; 9962 t['viramabengali'] = 0x09CD; 9963 t['viramadeva'] = 0x094D; 9964 t['viramagujarati'] = 0x0ACD; 9965 t['visargabengali'] = 0x0983; 9966 t['visargadeva'] = 0x0903; 9967 t['visargagujarati'] = 0x0A83; 9968 t['vmonospace'] = 0xFF56; 9969 t['voarmenian'] = 0x0578; 9970 t['voicediterationhiragana'] = 0x309E; 9971 t['voicediterationkatakana'] = 0x30FE; 9972 t['voicedmarkkana'] = 0x309B; 9973 t['voicedmarkkanahalfwidth'] = 0xFF9E; 9974 t['vokatakana'] = 0x30FA; 9975 t['vparen'] = 0x24B1; 9976 t['vtilde'] = 0x1E7D; 9977 t['vturned'] = 0x028C; 9978 t['vuhiragana'] = 0x3094; 9979 t['vukatakana'] = 0x30F4; 9980 t['w'] = 0x0077; 9981 t['wacute'] = 0x1E83; 9982 t['waekorean'] = 0x3159; 9983 t['wahiragana'] = 0x308F; 9984 t['wakatakana'] = 0x30EF; 9985 t['wakatakanahalfwidth'] = 0xFF9C; 9986 t['wakorean'] = 0x3158; 9987 t['wasmallhiragana'] = 0x308E; 9988 t['wasmallkatakana'] = 0x30EE; 9989 t['wattosquare'] = 0x3357; 9990 t['wavedash'] = 0x301C; 9991 t['wavyunderscorevertical'] = 0xFE34; 9992 t['wawarabic'] = 0x0648; 9993 t['wawfinalarabic'] = 0xFEEE; 9994 t['wawhamzaabovearabic'] = 0x0624; 9995 t['wawhamzaabovefinalarabic'] = 0xFE86; 9996 t['wbsquare'] = 0x33DD; 9997 t['wcircle'] = 0x24E6; 9998 t['wcircumflex'] = 0x0175; 9999 t['wdieresis'] = 0x1E85; 10000 t['wdotaccent'] = 0x1E87; 10001 t['wdotbelow'] = 0x1E89; 10002 t['wehiragana'] = 0x3091; 10003 t['weierstrass'] = 0x2118; 10004 t['wekatakana'] = 0x30F1; 10005 t['wekorean'] = 0x315E; 10006 t['weokorean'] = 0x315D; 10007 t['wgrave'] = 0x1E81; 10008 t['whitebullet'] = 0x25E6; 10009 t['whitecircle'] = 0x25CB; 10010 t['whitecircleinverse'] = 0x25D9; 10011 t['whitecornerbracketleft'] = 0x300E; 10012 t['whitecornerbracketleftvertical'] = 0xFE43; 10013 t['whitecornerbracketright'] = 0x300F; 10014 t['whitecornerbracketrightvertical'] = 0xFE44; 10015 t['whitediamond'] = 0x25C7; 10016 t['whitediamondcontainingblacksmalldiamond'] = 0x25C8;
10017 t['whitedownpointingsmalltriangle'] = 0x25BF; 10018 t['whitedownpointingtriangle'] = 0x25BD; 10019 t['whiteleftpointingsmalltriangle'] = 0x25C3; 10020 t['whiteleftpointingtriangle'] = 0x25C1; 10021 t['whitelenticularbracketleft'] = 0x3016; 10022 t['whitelenticularbracketright'] = 0x3017; 10023 t['whiterightpointingsmalltriangle'] = 0x25B9; 10024 t['whiterightpointingtriangle'] = 0x25B7; 10025 t['whitesmallsquare'] = 0x25AB; 10026 t['whitesmilingface'] = 0x263A; 10027 t['whitesquare'] = 0x25A1; 10028 t['whitestar'] = 0x2606; 10029 t['whitetelephone'] = 0x260F; 10030 t['whitetortoiseshellbracketleft'] = 0x3018; 10031 t['whitetortoiseshellbracketright'] = 0x3019; 10032 t['whiteuppointingsmalltriangle'] = 0x25B5; 10033 t['whiteuppointingtriangle'] = 0x25B3; 10034 t['wihiragana'] = 0x3090; 10035 t['wikatakana'] = 0x30F0; 10036 t['wikorean'] = 0x315F; 10037 t['wmonospace'] = 0xFF57; 10038 t['wohiragana'] = 0x3092; 10039 t['wokatakana'] = 0x30F2; 10040 t['wokatakanahalfwidth'] = 0xFF66; 10041 t['won'] = 0x20A9; 10042 t['wonmonospace'] = 0xFFE6; 10043 t['wowaenthai'] = 0x0E27; 10044 t['wparen'] = 0x24B2; 10045 t['wring'] = 0x1E98; 10046 t['wsuperior'] = 0x02B7; 10047 t['wturned'] = 0x028D; 10048 t['wynn'] = 0x01BF; 10049 t['x'] = 0x0078; 10050 t['xabovecmb'] = 0x033D; 10051 t['xbopomofo'] = 0x3112; 10052 t['xcircle'] = 0x24E7; 10053 t['xdieresis'] = 0x1E8D; 10054 t['xdotaccent'] = 0x1E8B; 10055 t['xeharmenian'] = 0x056D; 10056 t['xi'] = 0x03BE; 10057 t['xmonospace'] = 0xFF58; 10058 t['xparen'] = 0x24B3; 10059 t['xsuperior'] = 0x02E3; 10060 t['y'] = 0x0079; 10061 t['yaadosquare'] = 0x334E; 10062 t['yabengali'] = 0x09AF; 10063 t['yacute'] = 0x00FD; 10064 t['yadeva'] = 0x092F; 10065 t['yaekorean'] = 0x3152; 10066 t['yagujarati'] = 0x0AAF; 10067 t['yagurmukhi'] = 0x0A2F; 10068 t['yahiragana'] = 0x3084; 10069 t['yakatakana'] = 0x30E4; 10070 t['yakatakanahalfwidth'] = 0xFF94; 10071 t['yakorean'] = 0x3151; 10072 t['yamakkanthai'] = 0x0E4E; 10073 t['yasmallhiragana'] = 0x3083; 10074 t['yasmallkatakana'] = 0x30E3; 10075 t['yasmallkatakanahalfwidth'] = 0xFF6C; 10076 t['yatcyrillic'] = 0x0463; 10077 t['ycircle'] = 0x24E8; 10078 t['ycircumflex'] = 0x0177; 10079 t['ydieresis'] = 0x00FF; 10080 t['ydotaccent'] = 0x1E8F; 10081 t['ydotbelow'] = 0x1EF5; 10082 t['yeharabic'] = 0x064A; 10083 t['yehbarreearabic'] = 0x06D2; 10084 t['yehbarreefinalarabic'] = 0xFBAF; 10085 t['yehfinalarabic'] = 0xFEF2; 10086 t['yehhamzaabovearabic'] = 0x0626; 10087 t['yehhamzaabovefinalarabic'] = 0xFE8A; 10088 t['yehhamzaaboveinitialarabic'] = 0xFE8B; 10089 t['yehhamzaabovemedialarabic'] = 0xFE8C; 10090 t['yehinitialarabic'] = 0xFEF3; 10091 t['yehmedialarabic'] = 0xFEF4; 10092 t['yehmeeminitialarabic'] = 0xFCDD; 10093 t['yehmeemisolatedarabic'] = 0xFC58; 10094 t['yehnoonfinalarabic'] = 0xFC94; 10095 t['yehthreedotsbelowarabic'] = 0x06D1; 10096 t['yekorean'] = 0x3156; 10097 t['yen'] = 0x00A5; 10098 t['yenmonospace'] = 0xFFE5; 10099 t['yeokorean'] = 0x3155; 10100 t['yeorinhieuhkorean'] = 0x3186; 10101 t['yerahbenyomohebrew'] = 0x05AA; 10102 t['yerahbenyomolefthebrew'] = 0x05AA; 10103 t['yericyrillic'] = 0x044B; 10104 t['yerudieresiscyrillic'] = 0x04F9; 10105 t['yesieungkorean'] = 0x3181; 10106 t['yesieungpansioskorean'] = 0x3183; 10107 t['yesieungsioskorean'] = 0x3182; 10108 t['yetivhebrew'] = 0x059A; 10109 t['ygrave'] = 0x1EF3; 10110 t['yhook'] = 0x01B4; 10111 t['yhookabove'] = 0x1EF7; 10112 t['yiarmenian'] = 0x0575; 10113 t['yicyrillic'] = 0x0457; 10114 t['yikorean'] = 0x3162; 10115 t['yinyang'] = 0x262F; 10116 t['yiwnarmenian'] = 0x0582; 10117 t['ymonospace'] = 0xFF59; 10118 t['yod'] = 0x05D9; 10119 t['yoddagesh'] = 0xFB39; 10120 t['yoddageshhebrew'] = 0xFB39; 10121 t['yodhebrew'] = 0x05D9; 10122 t['yodyodhebrew'] = 0x05F2; 10123 t['yodyodpatahhebrew'] = 0xFB1F; 10124 t['yohiragana'] = 0x3088; 10125 t['yoikorean'] = 0x3189; 10126 t['yokatakana'] = 0x30E8; 10127 t['yokatakanahalfwidth'] = 0xFF96; 10128 t['yokorean'] = 0x315B; 10129 t['yosmallhiragana'] = 0x3087; 10130 t['yosmallkatakana'] = 0x30E7; 10131 t['yosmallkatakanahalfwidth'] = 0xFF6E; 10132 t['yotgreek'] = 0x03F3; 10133 t['yoyaekorean'] = 0x3188; 10134 t['yoyakorean'] = 0x3187; 10135 t['yoyakthai'] = 0x0E22; 10136 t['yoyingthai'] = 0x0E0D; 10137 t['yparen'] = 0x24B4; 10138 t['ypogegrammeni'] = 0x037A; 10139 t['ypogegrammenigreekcmb'] = 0x0345; 10140 t['yr'] = 0x01A6; 10141 t['yring'] = 0x1E99; 10142 t['ysuperior'] = 0x02B8; 10143 t['ytilde'] = 0x1EF9; 10144 t['yturned'] = 0x028E; 10145 t['yuhiragana'] = 0x3086; 10146 t['yuikorean'] = 0x318C; 10147 t['yukatakana'] = 0x30E6; 10148 t['yukatakanahalfwidth'] = 0xFF95; 10149 t['yukorean'] = 0x3160; 10150 t['yusbigcyrillic'] = 0x046B; 10151 t['yusbigiotifiedcyrillic'] = 0x046D; 10152 t['yuslittlecyrillic'] = 0x0467; 10153 t['yuslittleiotifiedcyrillic'] = 0x0469; 10154 t['yusmallhiragana'] = 0x3085; 10155 t['yusmallkatakana'] = 0x30E5; 10156 t['yusmallkatakanahalfwidth'] = 0xFF6D; 10157 t['yuyekorean'] = 0x318B; 10158 t['yuyeokorean'] = 0x318A; 10159 t['yyabengali'] = 0x09DF; 10160 t['yyadeva'] = 0x095F; 10161 t['z'] = 0x007A; 10162 t['zaarmenian'] = 0x0566; 10163 t['zacute'] = 0x017A; 10164 t['zadeva'] = 0x095B; 10165 t['zagurmukhi'] = 0x0A5B; 10166 t['zaharabic'] = 0x0638; 10167 t['zahfinalarabic'] = 0xFEC6; 10168 t['zahinitialarabic'] = 0xFEC7; 10169 t['zahiragana'] = 0x3056; 10170 t['zahmedialarabic'] = 0xFEC8; 10171 t['zainarabic'] = 0x0632; 10172 t['zainfinalarabic'] = 0xFEB0; 10173 t['zakatakana'] = 0x30B6; 10174 t['zaqefgadolhebrew'] = 0x0595; 10175 t['zaqefqatanhebrew'] = 0x0594; 10176 t['zarqahebrew'] = 0x0598; 10177 t['zayin'] = 0x05D6; 10178 t['zayindagesh'] = 0xFB36; 10179 t['zayindageshhebrew'] = 0xFB36; 10180 t['zayinhebrew'] = 0x05D6; 10181 t['zbopomofo'] = 0x3117; 10182 t['zcaron'] = 0x017E; 10183 t['zcircle'] = 0x24E9; 10184 t['zcircumflex'] = 0x1E91; 10185 t['zcurl'] = 0x0291; 10186 t['zdot'] = 0x017C; 10187 t['zdotaccent'] = 0x017C; 10188 t['zdotbelow'] = 0x1E93; 10189 t['zecyrillic'] = 0x0437; 10190 t['zedescendercyrillic'] = 0x0499; 10191 t['zedieresiscyrillic'] = 0x04DF; 10192 t['zehiragana'] = 0x305C;
10193 t['zekatakana'] = 0x30BC; 10194 t['zero'] = 0x0030; 10195 t['zeroarabic'] = 0x0660; 10196 t['zerobengali'] = 0x09E6; 10197 t['zerodeva'] = 0x0966; 10198 t['zerogujarati'] = 0x0AE6; 10199 t['zerogurmukhi'] = 0x0A66; 10200 t['zerohackarabic'] = 0x0660; 10201 t['zeroinferior'] = 0x2080; 10202 t['zeromonospace'] = 0xFF10; 10203 t['zerooldstyle'] = 0xF730; 10204 t['zeropersian'] = 0x06F0; 10205 t['zerosuperior'] = 0x2070; 10206 t['zerothai'] = 0x0E50; 10207 t['zerowidthjoiner'] = 0xFEFF; 10208 t['zerowidthnonjoiner'] = 0x200C; 10209 t['zerowidthspace'] = 0x200B; 10210 t['zeta'] = 0x03B6; 10211 t['zhbopomofo'] = 0x3113; 10212 t['zhearmenian'] = 0x056A; 10213 t['zhebrevecyrillic'] = 0x04C2; 10214 t['zhecyrillic'] = 0x0436; 10215 t['zhedescendercyrillic'] = 0x0497; 10216 t['zhedieresiscyrillic'] = 0x04DD; 10217 t['zihiragana'] = 0x3058; 10218 t['zikatakana'] = 0x30B8; 10219 t['zinorhebrew'] = 0x05AE; 10220 t['zlinebelow'] = 0x1E95; 10221 t['zmonospace'] = 0xFF5A; 10222 t['zohiragana'] = 0x305E; 10223 t['zokatakana'] = 0x30BE; 10224 t['zparen'] = 0x24B5; 10225 t['zretroflexhook'] = 0x0290; 10226 t['zstroke'] = 0x01B6; 10227 t['zuhiragana'] = 0x305A; 10228 t['zukatakana'] = 0x30BA; 10229 t['.notdef'] = 0x0000; 10230 t['angbracketleftbig'] = 0x2329; 10231 t['angbracketleftBig'] = 0x2329; 10232 t['angbracketleftbigg'] = 0x2329; 10233 t['angbracketleftBigg'] = 0x2329; 10234 t['angbracketrightBig'] = 0x232A; 10235 t['angbracketrightbig'] = 0x232A; 10236 t['angbracketrightBigg'] = 0x232A; 10237 t['angbracketrightbigg'] = 0x232A; 10238 t['arrowhookleft'] = 0x21AA; 10239 t['arrowhookright'] = 0x21A9; 10240 t['arrowlefttophalf'] = 0x21BC; 10241 t['arrowleftbothalf'] = 0x21BD; 10242 t['arrownortheast'] = 0x2197; 10243 t['arrownorthwest'] = 0x2196; 10244 t['arrowrighttophalf'] = 0x21C0; 10245 t['arrowrightbothalf'] = 0x21C1; 10246 t['arrowsoutheast'] = 0x2198; 10247 t['arrowsouthwest'] = 0x2199; 10248 t['backslashbig'] = 0x2216; 10249 t['backslashBig'] = 0x2216; 10250 t['backslashBigg'] = 0x2216; 10251 t['backslashbigg'] = 0x2216; 10252 t['bardbl'] = 0x2016; 10253 t['bracehtipdownleft'] = 0xFE37; 10254 t['bracehtipdownright'] = 0xFE37; 10255 t['bracehtipupleft'] = 0xFE38; 10256 t['bracehtipupright'] = 0xFE38; 10257 t['braceleftBig'] = 0x007B; 10258 t['braceleftbig'] = 0x007B; 10259 t['braceleftbigg'] = 0x007B; 10260 t['braceleftBigg'] = 0x007B; 10261 t['bracerightBig'] = 0x007D; 10262 t['bracerightbig'] = 0x007D; 10263 t['bracerightbigg'] = 0x007D; 10264 t['bracerightBigg'] = 0x007D; 10265 t['bracketleftbig'] = 0x005B; 10266 t['bracketleftBig'] = 0x005B; 10267 t['bracketleftbigg'] = 0x005B; 10268 t['bracketleftBigg'] = 0x005B; 10269 t['bracketrightBig'] = 0x005D; 10270 t['bracketrightbig'] = 0x005D; 10271 t['bracketrightbigg'] = 0x005D; 10272 t['bracketrightBigg'] = 0x005D; 10273 t['ceilingleftbig'] = 0x2308; 10274 t['ceilingleftBig'] = 0x2308; 10275 t['ceilingleftBigg'] = 0x2308; 10276 t['ceilingleftbigg'] = 0x2308; 10277 t['ceilingrightbig'] = 0x2309; 10278 t['ceilingrightBig'] = 0x2309; 10279 t['ceilingrightbigg'] = 0x2309; 10280 t['ceilingrightBigg'] = 0x2309; 10281 t['circledotdisplay'] = 0x2299; 10282 t['circledottext'] = 0x2299; 10283 t['circlemultiplydisplay'] = 0x2297; 10284 t['circlemultiplytext'] = 0x2297; 10285 t['circleplusdisplay'] = 0x2295; 10286 t['circleplustext'] = 0x2295; 10287 t['contintegraldisplay'] = 0x222E; 10288 t['contintegraltext'] = 0x222E; 10289 t['coproductdisplay'] = 0x2210; 10290 t['coproducttext'] = 0x2210; 10291 t['floorleftBig'] = 0x230A; 10292 t['floorleftbig'] = 0x230A; 10293 t['floorleftbigg'] = 0x230A; 10294 t['floorleftBigg'] = 0x230A; 10295 t['floorrightbig'] = 0x230B; 10296 t['floorrightBig'] = 0x230B; 10297 t['floorrightBigg'] = 0x230B; 10298 t['floorrightbigg'] = 0x230B; 10299 t['hatwide'] = 0x0302; 10300 t['hatwider'] = 0x0302; 10301 t['hatwidest'] = 0x0302; 10302 t['intercal'] = 0x1D40; 10303 t['integraldisplay'] = 0x222B; 10304 t['integraltext'] = 0x222B; 10305 t['intersectiondisplay'] = 0x22C2; 10306 t['intersectiontext'] = 0x22C2; 10307 t['logicalanddisplay'] = 0x2227; 10308 t['logicalandtext'] = 0x2227; 10309 t['logicalordisplay'] = 0x2228; 10310 t['logicalortext'] = 0x2228; 10311 t['parenleftBig'] = 0x0028; 10312 t['parenleftbig'] = 0x0028; 10313 t['parenleftBigg'] = 0x0028; 10314 t['parenleftbigg'] = 0x0028; 10315 t['parenrightBig'] = 0x0029; 10316 t['parenrightbig'] = 0x0029; 10317 t['parenrightBigg'] = 0x0029; 10318 t['parenrightbigg'] = 0x0029; 10319 t['prime'] = 0x2032; 10320 t['productdisplay'] = 0x220F; 10321 t['producttext'] = 0x220F; 10322 t['radicalbig'] = 0x221A; 10323 t['radicalBig'] = 0x221A; 10324 t['radicalBigg'] = 0x221A; 10325 t['radicalbigg'] = 0x221A; 10326 t['radicalbt'] = 0x221A; 10327 t['radicaltp'] = 0x221A; 10328 t['radicalvertex'] = 0x221A; 10329 t['slashbig'] = 0x002F; 10330 t['slashBig'] = 0x002F; 10331 t['slashBigg'] = 0x002F; 10332 t['slashbigg'] = 0x002F; 10333 t['summationdisplay'] = 0x2211; 10334 t['summationtext'] = 0x2211; 10335 t['tildewide'] = 0x02DC; 10336 t['tildewider'] = 0x02DC; 10337 t['tildewidest'] = 0x02DC; 10338 t['uniondisplay'] = 0x22C3; 10339 t['unionmultidisplay'] = 0x228E; 10340 t['unionmultitext'] = 0x228E; 10341 t['unionsqdisplay'] = 0x2294; 10342 t['unionsqtext'] = 0x2294; 10343 t['uniontext'] = 0x22C3; 10344 t['vextenddouble'] = 0x2225; 10345 t['vextendsingle'] = 0x2223; 10346}); 10347var getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) { 10348 t['space'] = 0x0020; 10349 t['a1'] = 0x2701; 10350 t['a2'] = 0x2702; 10351 t['a202'] = 0x2703; 10352 t['a3'] = 0x2704; 10353 t['a4'] = 0x260E; 10354 t['a5'] = 0x2706; 10355 t['a119'] = 0x2707; 10356 t['a118'] = 0x2708; 10357 t['a117'] = 0x2709; 10358 t['a11'] = 0x261B; 10359 t['a12'] = 0x261E; 10360 t['a13'] = 0x270C; 10361 t['a14'] = 0x270D; 10362 t['a15'] = 0x270E; 10363 t['a16'] = 0x270F; 10364 t['a105'] = 0x2710; 10365 t['a17'] = 0x2711; 10366 t['a18'] = 0x2712; 10367 t['a19'] = 0x2713; 10368 t['a20'] = 0x2714; 10369 t['a21'] = 0x2715; 10370 t['a22'] = 0x2716; 10371 t['a23'] = 0x2717; 10372 t['a24'] = 0x2718; 10373 t['a25'] = 0x2719; 10374 t['a26'] = 0x271A; 10375 t['a27'] = 0x271B; 10376 t['a28'] = 0x271C; 10377 t['a6'] = 0x271D; 10378 t['a7'] = 0x271E; 10379 t['a8'] = 0x271F; 10380 t['a9'] = 0x2720; 10381 t['a10'] = 0x2721; 10382 t['a29'] = 0x2722; 10383 t['a30'] = 0x2723; 10384 t['a31'] = 0x2724; 10385 t['a32'] = 0x2725; 10386 t['a33'] = 0x2726; 10387 t['a34'] = 0x2727; 10388 t['a35'] = 0x2605; 10389 t['a36'] = 0x2729; 10390 t['a37'] = 0x272A; 10391 t['a38'] = 0x272B; 10392 t['a39'] = 0x272C; 10393 t['a40'] = 0x272D; 10394 t['a41'] = 0x272E; 10395 t['a42'] = 0x272F; 10396 t['a43'] = 0x2730; 10397 t['a44'] = 0x2731; 10398 t['a45'] = 0x2732; 10399 t['a46'] = 0x2733; 10400 t['a47'] = 0x2734; 10401 t['a48'] = 0x2735; 10402 t['a49'] = 0x2736; 10403 t['a50'] = 0x2737; 10404 t['a51'] = 0x2738; 10405 t['a52'] = 0x2739; 10406 t['a53'] = 0x273A; 10407 t['a54'] = 0x273B; 10408 t['a55'] = 0x273C; 10409 t['a56'] = 0x273D; 10410 t['a57'] = 0x273E; 10411 t['a58'] = 0x273F; 10412 t['a59'] = 0x2740; 10413 t['a60'] = 0x2741; 10414 t['a61'] = 0x2742; 10415 t['a62'] = 0x2743; 10416 t['a63'] = 0x2744; 10417 t['a64'] = 0x2745; 10418 t['a65'] = 0x2746; 10419 t['a66'] = 0x2747; 10420 t['a67'] = 0x2748; 10421 t['a68'] = 0x2749; 10422 t['a69'] = 0x274A; 10423 t['a70'] = 0x274B; 10424 t['a71'] = 0x25CF; 10425 t['a72'] = 0x274D; 10426 t['a73'] = 0x25A0; 10427 t['a74'] = 0x274F; 10428 t['a203'] = 0x2750; 10429 t['a75'] = 0x2751; 10430 t['a204'] = 0x2752; 10431 t['a76'] = 0x25B2; 10432 t['a77'] = 0x25BC; 10433 t['a78'] = 0x25C6; 10434 t['a79'] = 0x2756; 10435 t['a81'] = 0x25D7; 10436 t['a82'] = 0x2758; 10437 t['a83'] = 0x2759; 10438 t['a84'] = 0x275A; 10439 t['a97'] = 0x275B; 10440 t['a98'] = 0x275C; 10441 t['a99'] = 0x275D; 10442 t['a100'] = 0x275E; 10443 t['a101'] = 0x2761; 10444 t['a102'] = 0x2762; 10445 t['a103'] = 0x2763; 10446 t['a104'] = 0x2764; 10447 t['a106'] = 0x2765; 10448 t['a107'] = 0x2766; 10449 t['a108'] = 0x2767; 10450 t['a112'] = 0x2663; 10451 t['a111'] = 0x2666; 10452 t['a110'] = 0x2665; 10453 t['a109'] = 0x2660; 10454 t['a120'] = 0x2460; 10455 t['a121'] = 0x2461; 10456 t['a122'] = 0x2462; 10457 t['a123'] = 0x2463; 10458 t['a124'] = 0x2464; 10459 t['a125'] = 0x2465; 10460 t['a126'] = 0x2466; 10461 t['a127'] = 0x2467; 10462 t['a128'] = 0x2468; 10463 t['a129'] = 0x2469; 10464 t['a130'] = 0x2776; 10465 t['a131'] = 0x2777; 10466 t['a132'] = 0x2778; 10467 t['a133'] = 0x2779; 10468 t['a134'] = 0x277A;
10469 t['a135'] = 0x277B; 10470 t['a136'] = 0x277C; 10471 t['a137'] = 0x277D; 10472 t['a138'] = 0x277E; 10473 t['a139'] = 0x277F; 10474 t['a140'] = 0x2780; 10475 t['a141'] = 0x2781; 10476 t['a142'] = 0x2782; 10477 t['a143'] = 0x2783; 10478 t['a144'] = 0x2784; 10479 t['a145'] = 0x2785; 10480 t['a146'] = 0x2786; 10481 t['a147'] = 0x2787; 10482 t['a148'] = 0x2788; 10483 t['a149'] = 0x2789; 10484 t['a150'] = 0x278A; 10485 t['a151'] = 0x278B; 10486 t['a152'] = 0x278C; 10487 t['a153'] = 0x278D; 10488 t['a154'] = 0x278E; 10489 t['a155'] = 0x278F; 10490 t['a156'] = 0x2790; 10491 t['a157'] = 0x2791; 10492 t['a158'] = 0x2792; 10493 t['a159'] = 0x2793; 10494 t['a160'] = 0x2794; 10495 t['a161'] = 0x2192; 10496 t['a163'] = 0x2194; 10497 t['a164'] = 0x2195; 10498 t['a196'] = 0x2798; 10499 t['a165'] = 0x2799; 10500 t['a192'] = 0x279A; 10501 t['a166'] = 0x279B; 10502 t['a167'] = 0x279C; 10503 t['a168'] = 0x279D; 10504 t['a169'] = 0x279E; 10505 t['a170'] = 0x279F; 10506 t['a171'] = 0x27A0; 10507 t['a172'] = 0x27A1; 10508 t['a173'] = 0x27A2; 10509 t['a162'] = 0x27A3; 10510 t['a174'] = 0x27A4; 10511 t['a175'] = 0x27A5; 10512 t['a176'] = 0x27A6; 10513 t['a177'] = 0x27A7; 10514 t['a178'] = 0x27A8; 10515 t['a179'] = 0x27A9; 10516 t['a193'] = 0x27AA; 10517 t['a180'] = 0x27AB; 10518 t['a199'] = 0x27AC; 10519 t['a181'] = 0x27AD; 10520 t['a200'] = 0x27AE; 10521 t['a182'] = 0x27AF; 10522 t['a201'] = 0x27B1; 10523 t['a183'] = 0x27B2; 10524 t['a184'] = 0x27B3; 10525 t['a197'] = 0x27B4; 10526 t['a185'] = 0x27B5; 10527 t['a194'] = 0x27B6; 10528 t['a198'] = 0x27B7; 10529 t['a186'] = 0x27B8; 10530 t['a195'] = 0x27B9; 10531 t['a187'] = 0x27BA; 10532 t['a188'] = 0x27BB; 10533 t['a189'] = 0x27BC; 10534 t['a190'] = 0x27BD; 10535 t['a191'] = 0x27BE; 10536 t['a89'] = 0x2768; 10537 t['a90'] = 0x2769; 10538 t['a93'] = 0x276A; 10539 t['a94'] = 0x276B; 10540 t['a91'] = 0x276C; 10541 t['a92'] = 0x276D; 10542 t['a205'] = 0x276E; 10543 t['a85'] = 0x276F; 10544 t['a206'] = 0x2770; 10545 t['a86'] = 0x2771; 10546 t['a87'] = 0x2772; 10547 t['a88'] = 0x2773; 10548 t['a95'] = 0x2774; 10549 t['a96'] = 0x2775; 10550 t['.notdef'] = 0x0000; 10551}); 10552exports.getGlyphsUnicode = getGlyphsUnicode; 10553exports.getDingbatsGlyphsUnicode = getDingbatsGlyphsUnicode; 10554 10555/***/ }), 10556/* 43 */ 10557/***/ (function(module, exports, __w_pdfjs_require__) { 10558 10559"use strict"; 10560 10561 10562module.exports = !__w_pdfjs_require__(8) && !__w_pdfjs_require__(9)(function () { 10563 return Object.defineProperty(__w_pdfjs_require__(44)('div'), 'a', { 10564 get: function get() { 10565 return 7; 10566 } 10567 }).a != 7; 10568}); 10569 10570/***/ }), 10571/* 44 */ 10572/***/ (function(module, exports, __w_pdfjs_require__) { 10573 10574"use strict"; 10575 10576 10577var isObject = __w_pdfjs_require__(4); 10578var document = __w_pdfjs_require__(3).document; 10579var is = isObject(document) && isObject(document.createElement); 10580module.exports = function (it) { 10581 return is ? document.createElement(it) : {}; 10582}; 10583 10584/***/ }), 10585/* 45 */ 10586/***/ (function(module, exports, __w_pdfjs_require__) { 10587 10588"use strict"; 10589 10590 10591var global = __w_pdfjs_require__(3); 10592var hide = __w_pdfjs_require__(6); 10593var uid = __w_pdfjs_require__(14); 10594var TYPED = uid('typed_array'); 10595var VIEW = uid('view'); 10596var ABV = !!(global.ArrayBuffer && global.DataView); 10597var CONSTR = ABV; 10598var i = 0; 10599var l = 9; 10600var Typed; 10601var TypedArrayConstructors = 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'.split(','); 10602while (i < l) { 10603 if (Typed = global[TypedArrayConstructors[i++]]) { 10604 hide(Typed.prototype, TYPED, true); 10605 hide(Typed.prototype, VIEW, true); 10606 } else CONSTR = false; 10607} 10608module.exports = { 10609 ABV: ABV, 10610 CONSTR: CONSTR, 10611 TYPED: TYPED, 10612 VIEW: VIEW 10613}; 10614 10615/***/ }), 10616/* 46 */ 10617/***/ (function(module, exports, __w_pdfjs_require__) { 10618 10619"use strict"; 10620 10621 10622var toInteger = __w_pdfjs_require__(20); 10623var toLength = __w_pdfjs_require__(11); 10624module.exports = function (it) { 10625 if (it === undefined) return 0; 10626 var number = toInteger(it); 10627 var length = toLength(number); 10628 if (number !== length) throw RangeError('Wrong length!'); 10629 return length; 10630}; 10631 10632/***/ }), 10633/* 47 */ 10634/***/ (function(module, exports, __w_pdfjs_require__) { 10635 10636"use strict"; 10637 10638 10639var $keys = __w_pdfjs_require__(48); 10640var hiddenKeys = __w_pdfjs_require__(36).concat('length', 'prototype'); 10641exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { 10642 return $keys(O, hiddenKeys); 10643}; 10644 10645/***/ }), 10646/* 48 */ 10647/***/ (function(module, exports, __w_pdfjs_require__) { 10648 10649"use strict"; 10650 10651 10652var has = __w_pdfjs_require__(7); 10653var toIObject = __w_pdfjs_require__(26); 10654var arrayIndexOf = __w_pdfjs_require__(50)(false); 10655var IE_PROTO = __w_pdfjs_require__(35)('IE_PROTO'); 10656module.exports = function (object, names) { 10657 var O = toIObject(object); 10658 var i = 0; 10659 var result = []; 10660 var key; 10661 for (key in O) { 10662 if (key != IE_PROTO) has(O, key) && result.push(key); 10663 }while (names.length > i) { 10664 if (has(O, key = names[i++])) { 10665 ~arrayIndexOf(result, key) || result.push(key); 10666 } 10667 }return result; 10668}; 10669 10670/***/ }), 10671/* 49 */ 10672/***/ (function(module, exports, __w_pdfjs_require__) { 10673 10674"use strict"; 10675 10676 10677module.exports = function (it) { 10678 if (it == undefined) throw TypeError("Can't call method on " + it); 10679 return it; 10680}; 10681 10682/***/ }), 10683/* 50 */ 10684/***/ (function(module, exports, __w_pdfjs_require__) { 10685 10686"use strict"; 10687 10688 10689var toIObject = __w_pdfjs_require__(26);
vendor: 5,083 bytes, lines 10690-10875
10690var toLength = __w_pdfjs_require__(11); 10691var toAbsoluteIndex = __w_pdfjs_require__(27); 10692module.exports = function (IS_INCLUDES) { 10693 return function ($this, el, fromIndex) { 10694 var O = toIObject($this); 10695 var length = toLength(O.length); 10696 var index = toAbsoluteIndex(fromIndex, length); 10697 var value; 10698 if (IS_INCLUDES && el != el) while (length > index) { 10699 value = O[index++]; 10700 if (value != value) return true; 10701 } else for (; length > index; index++) { 10702 if (IS_INCLUDES || index in O) { 10703 if (O[index] === el) return IS_INCLUDES || index || 0; 10704 } 10705 }return !IS_INCLUDES && -1; 10706 }; 10707}; 10708 10709/***/ }), 10710/* 51 */ 10711/***/ (function(module, exports, __w_pdfjs_require__) { 10712 10713"use strict"; 10714 10715 10716var global = __w_pdfjs_require__(3); 10717var SHARED = '__core-js_shared__'; 10718var store = global[SHARED] || (global[SHARED] = {}); 10719module.exports = function (key) { 10720 return store[key] || (store[key] = {}); 10721}; 10722 10723/***/ }), 10724/* 52 */ 10725/***/ (function(module, exports, __w_pdfjs_require__) { 10726 10727"use strict"; 10728 10729 10730var toObject = __w_pdfjs_require__(16); 10731var toAbsoluteIndex = __w_pdfjs_require__(27); 10732var toLength = __w_pdfjs_require__(11); 10733module.exports = function fill(value) { 10734 var O = toObject(this); 10735 var length = toLength(O.length); 10736 var aLen = arguments.length; 10737 var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); 10738 var end = aLen > 2 ? arguments[2] : undefined; 10739 var endPos = end === undefined ? length : toAbsoluteIndex(end, length); 10740 while (endPos > index) { 10741 O[index++] = value; 10742 }return O; 10743}; 10744 10745/***/ }), 10746/* 53 */ 10747/***/ (function(module, exports, __w_pdfjs_require__) { 10748 10749"use strict"; 10750 10751 10752var Iterators = __w_pdfjs_require__(17); 10753var ITERATOR = __w_pdfjs_require__(1)('iterator'); 10754var ArrayProto = Array.prototype; 10755module.exports = function (it) { 10756 return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); 10757}; 10758 10759/***/ }), 10760/* 54 */ 10761/***/ (function(module, exports, __w_pdfjs_require__) { 10762 10763"use strict"; 10764 10765 10766var anObject = __w_pdfjs_require__(10); 10767var dPs = __w_pdfjs_require__(80); 10768var enumBugKeys = __w_pdfjs_require__(36); 10769var IE_PROTO = __w_pdfjs_require__(35)('IE_PROTO'); 10770var Empty = function Empty() {}; 10771var PROTOTYPE = 'prototype'; 10772var _createDict = function createDict() { 10773 var iframe = __w_pdfjs_require__(44)('iframe'); 10774 var i = enumBugKeys.length; 10775 var lt = '<'; 10776 var gt = '>'; 10777 var iframeDocument; 10778 iframe.style.display = 'none'; 10779 __w_pdfjs_require__(81).appendChild(iframe); 10780 iframe.src = 'javascript:'; 10781 iframeDocument = iframe.contentWindow.document; 10782 iframeDocument.open(); 10783 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); 10784 iframeDocument.close(); 10785 _createDict = iframeDocument.F; 10786 while (i--) { 10787 delete _createDict[PROTOTYPE][enumBugKeys[i]]; 10788 }return _createDict(); 10789}; 10790module.exports = Object.create || function create(O, Properties) { 10791 var result; 10792 if (O !== null) { 10793 Empty[PROTOTYPE] = anObject(O); 10794 result = new Empty(); 10795 Empty[PROTOTYPE] = null; 10796 result[IE_PROTO] = O; 10797 } else result = _createDict(); 10798 return Properties === undefined ? result : dPs(result, Properties); 10799}; 10800 10801/***/ }), 10802/* 55 */ 10803/***/ (function(module, exports, __w_pdfjs_require__) { 10804 10805"use strict"; 10806 10807 10808var has = __w_pdfjs_require__(7); 10809var toObject = __w_pdfjs_require__(16); 10810var IE_PROTO = __w_pdfjs_require__(35)('IE_PROTO'); 10811var ObjectProto = Object.prototype; 10812module.exports = Object.getPrototypeOf || function (O) { 10813 O = toObject(O); 10814 if (has(O, IE_PROTO)) return O[IE_PROTO]; 10815 if (typeof O.constructor == 'function' && O instanceof O.constructor) { 10816 return O.constructor.prototype; 10817 } 10818 return O instanceof Object ? ObjectProto : null; 10819}; 10820 10821/***/ }), 10822/* 56 */ 10823/***/ (function(module, exports, __w_pdfjs_require__) { 10824 10825"use strict"; 10826 10827 10828var classof = __w_pdfjs_require__(37); 10829var ITERATOR = __w_pdfjs_require__(1)('iterator'); 10830var Iterators = __w_pdfjs_require__(17); 10831module.exports = __w_pdfjs_require__(19).getIteratorMethod = function (it) { 10832 if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; 10833}; 10834 10835/***/ }), 10836/* 57 */ 10837/***/ (function(module, exports, __w_pdfjs_require__) { 10838 10839"use strict"; 10840 10841 10842var addToUnscopables = __w_pdfjs_require__(86); 10843var step = __w_pdfjs_require__(87); 10844var Iterators = __w_pdfjs_require__(17); 10845var toIObject = __w_pdfjs_require__(26); 10846module.exports = __w_pdfjs_require__(88)(Array, 'Array', function (iterated, kind) { 10847 this._t = toIObject(iterated); 10848 this._i = 0; 10849 this._k = kind; 10850}, function () { 10851 var O = this._t; 10852 var kind = this._k; 10853 var index = this._i++; 10854 if (!O || index >= O.length) { 10855 this._t = undefined; 10856 return step(1); 10857 } 10858 if (kind == 'keys') return step(0, index); 10859 if (kind == 'values') return step(0, O[index]); 10860 return step(0, [index, O[index]]); 10861}, 'values'); 10862Iterators.Arguments = Iterators.Array; 10863addToUnscopables('keys'); 10864addToUnscopables('values'); 10865addToUnscopables('entries'); 10866 10867/***/ }), 10868/* 58 */ 10869/***/ (function(module, exports, __w_pdfjs_require__) { 10870 10871"use strict"; 10872 10873 10874var ITERATOR = __w_pdfjs_require__(1)('iterator'); 10875var SAFE_CLOSING = false;
10876try { 10877 var riter = [7][ITERATOR](); 10878 riter['return'] = function () { 10879 SAFE_CLOSING = true; 10880 }; 10881 Array.from(riter, function () { 10882 throw 2; 10883 }); 10884} catch (e) {} 10885module.exports = function (exec, skipClosing) { 10886 if (!skipClosing && !SAFE_CLOSING) return false; 10887 var safe = false; 10888 try { 10889 var arr = [7]; 10890 var iter = arr[ITERATOR](); 10891 iter.next = function () { 10892 return { done: safe = true }; 10893 }; 10894 arr[ITERATOR] = function () { 10895 return iter; 10896 }; 10897 exec(arr); 10898 } catch (e) {} 10899 return safe; 10900}; 10901 10902/***/ }), 10903/* 59 */ 10904/***/ (function(module, exports, __w_pdfjs_require__) { 10905 10906"use strict"; 10907 10908 10909var pIE = __w_pdfjs_require__(60); 10910var createDesc = __w_pdfjs_require__(23); 10911var toIObject = __w_pdfjs_require__(26); 10912var toPrimitive = __w_pdfjs_require__(31); 10913var has = __w_pdfjs_require__(7); 10914var IE8_DOM_DEFINE = __w_pdfjs_require__(43); 10915var gOPD = Object.getOwnPropertyDescriptor; 10916exports.f = __w_pdfjs_require__(8) ? gOPD : function getOwnPropertyDescriptor(O, P) { 10917 O = toIObject(O); 10918 P = toPrimitive(P, true); 10919 if (IE8_DOM_DEFINE) try { 10920 return gOPD(O, P); 10921 } catch (e) {} 10922 if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); 10923}; 10924 10925/***/ }), 10926/* 60 */ 10927/***/ (function(module, exports, __w_pdfjs_require__) { 10928 10929"use strict"; 10930 10931 10932exports.f = {}.propertyIsEnumerable; 10933 10934/***/ }), 10935/* 61 */ 10936/***/ (function(module, exports, __w_pdfjs_require__) { 10937 10938"use strict"; 10939 10940 10941var isObject = __w_pdfjs_require__(4); 10942module.exports = function (it, TYPE) { 10943 if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); 10944 return it; 10945}; 10946 10947/***/ }), 10948/* 62 */ 10949/***/ (function(module, exports, __w_pdfjs_require__) { 10950 10951"use strict"; 10952 10953 10954Object.defineProperty(exports, "__esModule", { 10955 value: true 10956}); 10957exports.ChunkedStreamManager = exports.ChunkedStream = undefined; 10958 10959var _util = __w_pdfjs_require__(0); 10960 10961var ChunkedStream = function ChunkedStreamClosure() { 10962 function ChunkedStream(length, chunkSize, manager) { 10963 this.bytes = new Uint8Array(length); 10964 this.start = 0; 10965 this.pos = 0; 10966 this.end = length; 10967 this.chunkSize = chunkSize; 10968 this.loadedChunks = []; 10969 this.numChunksLoaded = 0; 10970 this.numChunks = Math.ceil(length / chunkSize); 10971 this.manager = manager; 10972 this.progressiveDataLength = 0; 10973 this.lastSuccessfulEnsureByteChunk = -1; 10974 } 10975 ChunkedStream.prototype = { 10976 getMissingChunks: function ChunkedStream_getMissingChunks() { 10977 var chunks = []; 10978 for (var chunk = 0, n = this.numChunks; chunk < n; ++chunk) { 10979 if (!this.loadedChunks[chunk]) { 10980 chunks.push(chunk); 10981 } 10982 } 10983 return chunks; 10984 }, 10985 getBaseStreams: function ChunkedStream_getBaseStreams() { 10986 return [this]; 10987 }, 10988 allChunksLoaded: function ChunkedStream_allChunksLoaded() { 10989 return this.numChunksLoaded === this.numChunks; 10990 }, 10991 onReceiveData: function ChunkedStream_onReceiveData(begin, chunk) { 10992 var end = begin + chunk.byteLength; 10993 if (begin % this.chunkSize !== 0) { 10994 throw new Error('Bad begin offset: ' + begin); 10995 } 10996 var length = this.bytes.length; 10997 if (end % this.chunkSize !== 0 && end !== length) { 10998 throw new Error('Bad end offset: ' + end); 10999 } 11000 this.bytes.set(new Uint8Array(chunk), begin); 11001 var chunkSize = this.chunkSize; 11002 var beginChunk = Math.floor(begin / chunkSize); 11003 var endChunk = Math.floor((end - 1) / chunkSize) + 1; 11004 var curChunk; 11005 for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { 11006 if (!this.loadedChunks[curChunk]) { 11007 this.loadedChunks[curChunk] = true; 11008 ++this.numChunksLoaded; 11009 } 11010 } 11011 }, 11012 onReceiveProgressiveData: function ChunkedStream_onReceiveProgressiveData(data) { 11013 var position = this.progressiveDataLength; 11014 var beginChunk = Math.floor(position / this.chunkSize); 11015 this.bytes.set(new Uint8Array(data), position); 11016 position += data.byteLength; 11017 this.progressiveDataLength = position; 11018 var endChunk = position >= this.end ? this.numChunks : Math.floor(position / this.chunkSize); 11019 var curChunk; 11020 for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { 11021 if (!this.loadedChunks[curChunk]) { 11022 this.loadedChunks[curChunk] = true; 11023 ++this.numChunksLoaded; 11024 } 11025 } 11026 }, 11027 ensureByte: function ChunkedStream_ensureByte(pos) { 11028 var chunk = Math.floor(pos / this.chunkSize); 11029 if (chunk === this.lastSuccessfulEnsureByteChunk) { 11030 return; 11031 } 11032 if (!this.loadedChunks[chunk]) { 11033 throw new _util.MissingDataException(pos, pos + 1); 11034 } 11035 this.lastSuccessfulEnsureByteChunk = chunk; 11036 }, 11037 ensureRange: function ChunkedStream_ensureRange(begin, end) { 11038 if (begin >= end) { 11039 return; 11040 } 11041 if (end <= this.progressiveDataLength) { 11042 return; 11043 } 11044 var chunkSize = this.chunkSize; 11045 var beginChunk = Math.floor(begin / chunkSize); 11046 var endChunk = Math.floor((end - 1) / chunkSize) + 1; 11047 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 11048 if (!this.loadedChunks[chunk]) { 11049 throw new _util.MissingDataException(begin, end); 11050 } 11051 } 11052 }, 11053 nextEmptyChunk: function ChunkedStream_nextEmptyChunk(beginChunk) { 11054 var chunk, 11055 numChunks = this.numChunks; 11056 for (var i = 0; i < numChunks; ++i) { 11057 chunk = (beginChunk + i) % numChunks; 11058 if (!this.loadedChunks[chunk]) { 11059 return chunk; 11060 } 11061 } 11062 return null; 11063 }, 11064 hasChunk: function ChunkedStream_hasChunk(chunk) { 11065 return !!this.loadedChunks[chunk]; 11066 }, 11067 get length() {
vendor: 3,710 bytes, lines 11068-11182
11068 return this.end - this.start; 11069 }, 11070 get isEmpty() { 11071 return this.length === 0; 11072 }, 11073 getByte: function ChunkedStream_getByte() { 11074 var pos = this.pos; 11075 if (pos >= this.end) { 11076 return -1; 11077 } 11078 this.ensureByte(pos); 11079 return this.bytes[this.pos++]; 11080 }, 11081 getUint16: function ChunkedStream_getUint16() { 11082 var b0 = this.getByte(); 11083 var b1 = this.getByte(); 11084 if (b0 === -1 || b1 === -1) { 11085 return -1; 11086 } 11087 return (b0 << 8) + b1; 11088 }, 11089 getInt32: function ChunkedStream_getInt32() { 11090 var b0 = this.getByte(); 11091 var b1 = this.getByte(); 11092 var b2 = this.getByte(); 11093 var b3 = this.getByte(); 11094 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 11095 }, 11096 getBytes: function ChunkedStream_getBytes(length) { 11097 var bytes = this.bytes; 11098 var pos = this.pos; 11099 var strEnd = this.end; 11100 if (!length) { 11101 this.ensureRange(pos, strEnd); 11102 return bytes.subarray(pos, strEnd); 11103 } 11104 var end = pos + length; 11105 if (end > strEnd) { 11106 end = strEnd; 11107 } 11108 this.ensureRange(pos, end); 11109 this.pos = end; 11110 return bytes.subarray(pos, end); 11111 }, 11112 peekByte: function ChunkedStream_peekByte() { 11113 var peekedByte = this.getByte(); 11114 this.pos--; 11115 return peekedByte; 11116 }, 11117 peekBytes: function ChunkedStream_peekBytes(length) { 11118 var bytes = this.getBytes(length); 11119 this.pos -= bytes.length; 11120 return bytes; 11121 }, 11122 getByteRange: function ChunkedStream_getBytes(begin, end) { 11123 this.ensureRange(begin, end); 11124 return this.bytes.subarray(begin, end); 11125 }, 11126 skip: function ChunkedStream_skip(n) { 11127 if (!n) { 11128 n = 1; 11129 } 11130 this.pos += n; 11131 }, 11132 reset: function ChunkedStream_reset() { 11133 this.pos = this.start; 11134 }, 11135 moveStart: function ChunkedStream_moveStart() { 11136 this.start = this.pos; 11137 }, 11138 makeSubStream: function ChunkedStream_makeSubStream(start, length, dict) { 11139 this.ensureRange(start, start + length); 11140 function ChunkedStreamSubstream() {} 11141 ChunkedStreamSubstream.prototype = Object.create(this); 11142 ChunkedStreamSubstream.prototype.getMissingChunks = function () { 11143 var chunkSize = this.chunkSize; 11144 var beginChunk = Math.floor(this.start / chunkSize); 11145 var endChunk = Math.floor((this.end - 1) / chunkSize) + 1; 11146 var missingChunks = []; 11147 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 11148 if (!this.loadedChunks[chunk]) { 11149 missingChunks.push(chunk); 11150 } 11151 } 11152 return missingChunks; 11153 }; 11154 var subStream = new ChunkedStreamSubstream(); 11155 subStream.pos = subStream.start = start; 11156 subStream.end = start + length || this.end; 11157 subStream.dict = dict; 11158 return subStream; 11159 } 11160 }; 11161 return ChunkedStream; 11162}(); 11163var ChunkedStreamManager = function ChunkedStreamManagerClosure() { 11164 function ChunkedStreamManager(pdfNetworkStream, args) { 11165 var chunkSize = args.rangeChunkSize; 11166 var length = args.length; 11167 this.stream = new ChunkedStream(length, chunkSize, this); 11168 this.length = length; 11169 this.chunkSize = chunkSize; 11170 this.pdfNetworkStream = pdfNetworkStream; 11171 this.url = args.url; 11172 this.disableAutoFetch = args.disableAutoFetch; 11173 this.msgHandler = args.msgHandler; 11174 this.currRequestId = 0; 11175 this.chunksNeededByRequest = Object.create(null); 11176 this.requestsByChunk = Object.create(null); 11177 this.promisesByRequest = Object.create(null); 11178 this.progressiveDataLength = 0; 11179 this.aborted = false; 11180 this._loadedStreamCapability = (0, _util.createPromiseCapability)(); 11181 } 11182 ChunkedStreamManager.prototype = {
11183 onLoadedStream: function ChunkedStreamManager_getLoadedStream() { 11184 return this._loadedStreamCapability.promise; 11185 }, 11186 sendRequest: function ChunkedStreamManager_sendRequest(begin, end) { 11187 var _this = this; 11188 11189 var rangeReader = this.pdfNetworkStream.getRangeReader(begin, end); 11190 if (!rangeReader.isStreamingSupported) { 11191 rangeReader.onProgress = this.onProgress.bind(this); 11192 } 11193 var chunks = [], 11194 loaded = 0; 11195 var manager = this; 11196 var promise = new Promise(function (resolve, reject) { 11197 var readChunk = function readChunk(chunk) { 11198 try { 11199 if (!chunk.done) { 11200 var data = chunk.value; 11201 chunks.push(data); 11202 loaded += (0, _util.arrayByteLength)(data); 11203 if (rangeReader.isStreamingSupported) { 11204 manager.onProgress({ loaded: loaded }); 11205 } 11206 rangeReader.read().then(readChunk, reject); 11207 return; 11208 } 11209 var chunkData = (0, _util.arraysToBytes)(chunks); 11210 chunks = null; 11211 resolve(chunkData); 11212 } catch (e) { 11213 reject(e); 11214 } 11215 }; 11216 rangeReader.read().then(readChunk, reject); 11217 }); 11218 promise.then(function (data) { 11219 if (_this.aborted) { 11220 return; 11221 } 11222 _this.onReceiveData({ 11223 chunk: data, 11224 begin: begin 11225 }); 11226 }); 11227 }, 11228 requestAllChunks: function ChunkedStreamManager_requestAllChunks() { 11229 var missingChunks = this.stream.getMissingChunks(); 11230 this._requestChunks(missingChunks); 11231 return this._loadedStreamCapability.promise; 11232 }, 11233 _requestChunks: function ChunkedStreamManager_requestChunks(chunks) { 11234 var requestId = this.currRequestId++; 11235 var i, ii; 11236 var chunksNeeded = Object.create(null); 11237 this.chunksNeededByRequest[requestId] = chunksNeeded; 11238 for (i = 0, ii = chunks.length; i < ii; i++) { 11239 if (!this.stream.hasChunk(chunks[i])) { 11240 chunksNeeded[chunks[i]] = true; 11241 } 11242 } 11243 if ((0, _util.isEmptyObj)(chunksNeeded)) { 11244 return Promise.resolve(); 11245 } 11246 var capability = (0, _util.createPromiseCapability)(); 11247 this.promisesByRequest[requestId] = capability; 11248 var chunksToRequest = []; 11249 for (var chunk in chunksNeeded) { 11250 chunk = chunk | 0; 11251 if (!(chunk in this.requestsByChunk)) { 11252 this.requestsByChunk[chunk] = []; 11253 chunksToRequest.push(chunk); 11254 } 11255 this.requestsByChunk[chunk].push(requestId); 11256 } 11257 if (!chunksToRequest.length) { 11258 return capability.promise; 11259 } 11260 var groupedChunksToRequest = this.groupChunks(chunksToRequest); 11261 for (i = 0; i < groupedChunksToRequest.length; ++i) { 11262 var groupedChunk = groupedChunksToRequest[i]; 11263 var begin = groupedChunk.beginChunk * this.chunkSize; 11264 var end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); 11265 this.sendRequest(begin, end); 11266 } 11267 return capability.promise; 11268 }, 11269 getStream: function ChunkedStreamManager_getStream() { 11270 return this.stream; 11271 }, 11272 requestRange: function ChunkedStreamManager_requestRange(begin, end) { 11273 end = Math.min(end, this.length); 11274 var beginChunk = this.getBeginChunk(begin); 11275 var endChunk = this.getEndChunk(end); 11276 var chunks = []; 11277 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 11278 chunks.push(chunk); 11279 } 11280 return this._requestChunks(chunks); 11281 }, 11282 requestRanges: function ChunkedStreamManager_requestRanges(ranges) { 11283 ranges = ranges || []; 11284 var chunksToRequest = []; 11285 for (var i = 0; i < ranges.length; i++) { 11286 var beginChunk = this.getBeginChunk(ranges[i].begin); 11287 var endChunk = this.getEndChunk(ranges[i].end); 11288 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 11289 if (chunksToRequest.indexOf(chunk) < 0) { 11290 chunksToRequest.push(chunk); 11291 } 11292 } 11293 } 11294 chunksToRequest.sort(function (a, b) { 11295 return a - b; 11296 }); 11297 return this._requestChunks(chunksToRequest); 11298 }, 11299 groupChunks: function ChunkedStreamManager_groupChunks(chunks) { 11300 var groupedChunks = []; 11301 var beginChunk = -1; 11302 var prevChunk = -1; 11303 for (var i = 0; i < chunks.length; ++i) { 11304 var chunk = chunks[i]; 11305 if (beginChunk < 0) { 11306 beginChunk = chunk; 11307 } 11308 if (prevChunk >= 0 && prevChunk + 1 !== chunk) { 11309 groupedChunks.push({ 11310 beginChunk: beginChunk, 11311 endChunk: prevChunk + 1 11312 }); 11313 beginChunk = chunk; 11314 } 11315 if (i + 1 === chunks.length) { 11316 groupedChunks.push({ 11317 beginChunk: beginChunk, 11318 endChunk: chunk + 1 11319 }); 11320 } 11321 prevChunk = chunk; 11322 } 11323 return groupedChunks; 11324 }, 11325 onProgress: function ChunkedStreamManager_onProgress(args) { 11326 var bytesLoaded = this.stream.numChunksLoaded * this.chunkSize + args.loaded; 11327 this.msgHandler.send('DocProgress', { 11328 loaded: bytesLoaded, 11329 total: this.length 11330 }); 11331 }, 11332 onReceiveData: function ChunkedStreamManager_onReceiveData(args) { 11333 var chunk = args.chunk; 11334 var isProgressive = args.begin === undefined; 11335 var begin = isProgressive ? this.progressiveDataLength : args.begin; 11336 var end = begin + chunk.byteLength; 11337 var beginChunk = Math.floor(begin / this.chunkSize); 11338 var endChunk = end < this.length ? Math.floor(end / this.chunkSize) : Math.ceil(end / this.chunkSize); 11339 if (isProgressive) { 11340 this.stream.onReceiveProgressiveData(chunk); 11341 this.progressiveDataLength = end; 11342 } else { 11343 this.stream.onReceiveData(begin, chunk); 11344 } 11345 if (this.stream.allChunksLoaded()) { 11346 this._loadedStreamCapability.resolve(this.stream); 11347 } 11348 var loadedRequests = []; 11349 var i, requestId; 11350 for (chunk = beginChunk; chunk < endChunk; ++chunk) { 11351 var requestIds = this.requestsByChunk[chunk] || []; 11352 delete this.requestsByChunk[chunk]; 11353 for (i = 0; i < requestIds.length; ++i) { 11354 requestId = requestIds[i]; 11355 var chunksNeeded = this.chunksNeededByRequest[requestId]; 11356 if (chunk in chunksNeeded) { 11357 delete chunksNeeded[chunk]; 11358 } 11359 if (!(0, _util.isEmptyObj)(chunksNeeded)) { 11360 continue; 11361 } 11362 loadedRequests.push(requestId); 11363 } 11364 } 11365 if (!this.disableAutoFetch && (0, _util.isEmptyObj)(this.requestsByChunk)) { 11366 var nextEmptyChunk; 11367 if (this.stream.numChunksLoaded === 1) { 11368 var lastChunk = this.stream.numChunks - 1; 11369 if (!this.stream.hasChunk(lastChunk)) { 11370 nextEmptyChunk = lastChunk; 11371 } 11372 } else { 11373 nextEmptyChunk = this.stream.nextEmptyChunk(endChunk); 11374 } 11375 if (Number.isInteger(nextEmptyChunk)) { 11376 this._requestChunks([nextEmptyChunk]); 11377 } 11378 } 11379 for (i = 0; i < loadedRequests.length; ++i) { 11380 requestId = loadedRequests[i]; 11381 var capability = this.promisesByRequest[requestId]; 11382 delete this.promisesByRequest[requestId]; 11383 capability.resolve(); 11384 } 11385 this.msgHandler.send('DocProgress', { 11386 loaded: this.stream.numChunksLoaded * this.chunkSize, 11387 total: this.length 11388 }); 11389 }, 11390 onError: function ChunkedStreamManager_onError(err) { 11391 this._loadedStreamCapability.reject(err); 11392 }, 11393 getBeginChunk: function ChunkedStreamManager_getBeginChunk(begin) { 11394 var chunk = Math.floor(begin / this.chunkSize); 11395 return chunk; 11396 },
11397 getEndChunk: function ChunkedStreamManager_getEndChunk(end) { 11398 var chunk = Math.floor((end - 1) / this.chunkSize) + 1; 11399 return chunk; 11400 }, 11401 abort: function ChunkedStreamManager_abort() { 11402 this.aborted = true; 11403 if (this.pdfNetworkStream) { 11404 this.pdfNetworkStream.cancelAllRequests('abort'); 11405 } 11406 for (var requestId in this.promisesByRequest) { 11407 var capability = this.promisesByRequest[requestId]; 11408 capability.reject(new Error('Request was aborted')); 11409 } 11410 } 11411 }; 11412 return ChunkedStreamManager; 11413}(); 11414exports.ChunkedStream = ChunkedStream; 11415exports.ChunkedStreamManager = ChunkedStreamManager; 11416 11417/***/ }), 11418/* 63 */ 11419/***/ (function(module, exports, __w_pdfjs_require__) { 11420 11421"use strict"; 11422 11423 11424Object.defineProperty(exports, "__esModule", { 11425 value: true 11426}); 11427exports.FileSpec = exports.XRef = exports.ObjectLoader = exports.Catalog = undefined; 11428 11429var _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; }; 11430 11431var _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"); } }; }(); 11432 11433var _util = __w_pdfjs_require__(0); 11434 11435var _primitives = __w_pdfjs_require__(2); 11436 11437var _parser = __w_pdfjs_require__(29); 11438 11439var _chunked_stream = __w_pdfjs_require__(62); 11440 11441var _crypto = __w_pdfjs_require__(66); 11442 11443var _colorspace = __w_pdfjs_require__(21); 11444 11445var Catalog = function CatalogClosure() { 11446 function Catalog(pdfManager, xref, pageFactory) { 11447 this.pdfManager = pdfManager; 11448 this.xref = xref; 11449 this.catDict = xref.getCatalogObj(); 11450 if (!(0, _primitives.isDict)(this.catDict)) { 11451 throw new _util.FormatError('catalog object is not a dictionary'); 11452 } 11453 this.fontCache = new _primitives.RefSetCache(); 11454 this.builtInCMapCache = Object.create(null); 11455 this.pageKidsCountCache = new _primitives.RefSetCache(); 11456 this.pageFactory = pageFactory; 11457 this.pagePromises = []; 11458 } 11459 Catalog.prototype = { 11460 get metadata() { 11461 var streamRef = this.catDict.getRaw('Metadata'); 11462 if (!(0, _primitives.isRef)(streamRef)) { 11463 return (0, _util.shadow)(this, 'metadata', null); 11464 } 11465 var encryptMetadata = !this.xref.encrypt ? false : this.xref.encrypt.encryptMetadata; 11466 var stream = this.xref.fetch(streamRef, !encryptMetadata); 11467 var metadata; 11468 if (stream && (0, _primitives.isDict)(stream.dict)) { 11469 var type = stream.dict.get('Type'); 11470 var subtype = stream.dict.get('Subtype'); 11471 if ((0, _primitives.isName)(type, 'Metadata') && (0, _primitives.isName)(subtype, 'XML')) { 11472 try { 11473 metadata = (0, _util.stringToUTF8String)((0, _util.bytesToString)(stream.getBytes())); 11474 } catch (e) { 11475 if (e instanceof _util.MissingDataException) { 11476 throw e; 11477 } 11478 (0, _util.info)('Skipping invalid metadata.'); 11479 } 11480 } 11481 } 11482 return (0, _util.shadow)(this, 'metadata', metadata); 11483 }, 11484 get toplevelPagesDict() { 11485 var pagesObj = this.catDict.get('Pages'); 11486 if (!(0, _primitives.isDict)(pagesObj)) { 11487 throw new _util.FormatError('invalid top-level pages dictionary'); 11488 } 11489 return (0, _util.shadow)(this, 'toplevelPagesDict', pagesObj); 11490 }, 11491 get documentOutline() { 11492 var obj = null; 11493 try { 11494 obj = this.readDocumentOutline(); 11495 } catch (ex) { 11496 if (ex instanceof _util.MissingDataException) { 11497 throw ex; 11498 } 11499 (0, _util.warn)('Unable to read document outline'); 11500 } 11501 return (0, _util.shadow)(this, 'documentOutline', obj); 11502 }, 11503 readDocumentOutline: function Catalog_readDocumentOutline() { 11504 var obj = this.catDict.get('Outlines'); 11505 if (!(0, _primitives.isDict)(obj)) { 11506 return null; 11507 } 11508 obj = obj.getRaw('First'); 11509 if (!(0, _primitives.isRef)(obj)) { 11510 return null; 11511 } 11512 var root = { items: [] }; 11513 var queue = [{ 11514 obj: obj, 11515 parent: root 11516 }]; 11517 var processed = new _primitives.RefSet(); 11518 processed.put(obj); 11519 var xref = this.xref, 11520 blackColor = new Uint8Array(3); 11521 while (queue.length > 0) { 11522 var i = queue.shift(); 11523 var outlineDict = xref.fetchIfRef(i.obj); 11524 if (outlineDict === null) { 11525 continue; 11526 } 11527 if (!outlineDict.has('Title')) { 11528 throw new _util.FormatError('Invalid outline item'); 11529 } 11530 var data = { 11531 url: null, 11532 dest: null 11533 }; 11534 Catalog.parseDestDictionary({ 11535 destDict: outlineDict, 11536 resultObj: data, 11537 docBaseUrl: this.pdfManager.docBaseUrl 11538 }); 11539 var title = outlineDict.get('Title'); 11540 var flags = outlineDict.get('F') || 0; 11541 var color = outlineDict.getArray('C'), 11542 rgbColor = blackColor; 11543 if (Array.isArray(color) && color.length === 3 && (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) { 11544 rgbColor = _colorspace.ColorSpace.singletons.rgb.getRgb(color, 0); 11545 } 11546 var outlineItem = { 11547 dest: data.dest, 11548 url: data.url, 11549 unsafeUrl: data.unsafeUrl, 11550 newWindow: data.newWindow, 11551 title: (0, _util.stringToPDFString)(title), 11552 color: rgbColor, 11553 count: outlineDict.get('Count'), 11554 bold: !!(flags & 2), 11555 italic: !!(flags & 1), 11556 items: [] 11557 }; 11558 i.parent.items.push(outlineItem); 11559 obj = outlineDict.getRaw('First'); 11560 if ((0, _primitives.isRef)(obj) && !processed.has(obj)) { 11561 queue.push({ 11562 obj: obj, 11563 parent: outlineItem 11564 }); 11565 processed.put(obj); 11566 } 11567 obj = outlineDict.getRaw('Next'); 11568 if ((0, _primitives.isRef)(obj) && !processed.has(obj)) { 11569 queue.push({ 11570 obj: obj, 11571 parent: i.parent 11572 }); 11573 processed.put(obj); 11574 } 11575 } 11576 return root.items.length > 0 ? root.items : null; 11577 }, 11578 get numPages() { 11579 var obj = this.toplevelPagesDict.get('Count'); 11580 if (!Number.isInteger(obj)) { 11581 throw new _util.FormatError('page count in top level pages object is not an integer'); 11582 } 11583 return (0, _util.shadow)(this, 'numPages', obj); 11584 }, 11585 get destinations() { 11586 function fetchDestination(dest) { 11587 return (0, _primitives.isDict)(dest) ? dest.get('D') : dest; 11588 } 11589 var xref = this.xref; 11590 var dests = {}, 11591 nameTreeRef, 11592 nameDictionaryRef; 11593 var obj = this.catDict.get('Names'); 11594 if (obj && obj.has('Dests')) { 11595 nameTreeRef = obj.getRaw('Dests'); 11596 } else if (this.catDict.has('Dests')) { 11597 nameDictionaryRef = this.catDict.get('Dests'); 11598 } 11599 if (nameDictionaryRef) { 11600 obj = nameDictionaryRef;
11601 obj.forEach(function catalogForEach(key, value) { 11602 if (!value) { 11603 return; 11604 } 11605 dests[key] = fetchDestination(value); 11606 }); 11607 } 11608 if (nameTreeRef) { 11609 var nameTree = new NameTree(nameTreeRef, xref); 11610 var names = nameTree.getAll(); 11611 for (var name in names) { 11612 dests[name] = fetchDestination(names[name]); 11613 } 11614 } 11615 return (0, _util.shadow)(this, 'destinations', dests); 11616 }, 11617 getDestination: function Catalog_getDestination(destinationId) { 11618 function fetchDestination(dest) { 11619 return (0, _primitives.isDict)(dest) ? dest.get('D') : dest; 11620 } 11621 var xref = this.xref; 11622 var dest = null, 11623 nameTreeRef, 11624 nameDictionaryRef; 11625 var obj = this.catDict.get('Names'); 11626 if (obj && obj.has('Dests')) { 11627 nameTreeRef = obj.getRaw('Dests'); 11628 } else if (this.catDict.has('Dests')) { 11629 nameDictionaryRef = this.catDict.get('Dests'); 11630 } 11631 if (nameDictionaryRef) { 11632 var value = nameDictionaryRef.get(destinationId); 11633 if (value) { 11634 dest = fetchDestination(value); 11635 } 11636 } 11637 if (nameTreeRef) { 11638 var nameTree = new NameTree(nameTreeRef, xref); 11639 dest = fetchDestination(nameTree.get(destinationId)); 11640 } 11641 return dest; 11642 }, 11643 get pageLabels() { 11644 var obj = null; 11645 try { 11646 obj = this.readPageLabels(); 11647 } catch (ex) { 11648 if (ex instanceof _util.MissingDataException) { 11649 throw ex; 11650 } 11651 (0, _util.warn)('Unable to read page labels.'); 11652 } 11653 return (0, _util.shadow)(this, 'pageLabels', obj); 11654 }, 11655 readPageLabels: function Catalog_readPageLabels() { 11656 var obj = this.catDict.getRaw('PageLabels'); 11657 if (!obj) { 11658 return null; 11659 } 11660 var pageLabels = new Array(this.numPages); 11661 var style = null; 11662 var prefix = ''; 11663 var numberTree = new NumberTree(obj, this.xref); 11664 var nums = numberTree.getAll(); 11665 var currentLabel = '', 11666 currentIndex = 1; 11667 for (var i = 0, ii = this.numPages; i < ii; i++) { 11668 if (i in nums) { 11669 var labelDict = nums[i]; 11670 if (!(0, _primitives.isDict)(labelDict)) { 11671 throw new _util.FormatError('The PageLabel is not a dictionary.'); 11672 } 11673 var type = labelDict.get('Type'); 11674 if (type && !(0, _primitives.isName)(type, 'PageLabel')) { 11675 throw new _util.FormatError('Invalid type in PageLabel dictionary.'); 11676 } 11677 var s = labelDict.get('S'); 11678 if (s && !(0, _primitives.isName)(s)) { 11679 throw new _util.FormatError('Invalid style in PageLabel dictionary.'); 11680 } 11681 style = s ? s.name : null; 11682 var p = labelDict.get('P'); 11683 if (p && !(0, _util.isString)(p)) { 11684 throw new _util.FormatError('Invalid prefix in PageLabel dictionary.'); 11685 } 11686 prefix = p ? (0, _util.stringToPDFString)(p) : ''; 11687 var st = labelDict.get('St'); 11688 if (st && !(Number.isInteger(st) && st >= 1)) { 11689 throw new _util.FormatError('Invalid start in PageLabel dictionary.'); 11690 } 11691 currentIndex = st || 1; 11692 } 11693 switch (style) { 11694 case 'D': 11695 currentLabel = currentIndex; 11696 break; 11697 case 'R': 11698 case 'r': 11699 currentLabel = _util.Util.toRoman(currentIndex, style === 'r'); 11700 break; 11701 case 'A': 11702 case 'a': 11703 var LIMIT = 26; 11704 var A_UPPER_CASE = 0x41, 11705 A_LOWER_CASE = 0x61; 11706 var baseCharCode = style === 'a' ? A_LOWER_CASE : A_UPPER_CASE; 11707 var letterIndex = currentIndex - 1; 11708 var character = String.fromCharCode(baseCharCode + letterIndex % LIMIT); 11709 var charBuf = []; 11710 for (var j = 0, jj = letterIndex / LIMIT | 0; j <= jj; j++) { 11711 charBuf.push(character); 11712 } 11713 currentLabel = charBuf.join(''); 11714 break; 11715 default: 11716 if (style) { 11717 throw new _util.FormatError('Invalid style "' + style + '" in PageLabel dictionary.'); 11718 } 11719 } 11720 pageLabels[i] = prefix + currentLabel; 11721 currentLabel = ''; 11722 currentIndex++; 11723 } 11724 return pageLabels; 11725 }, 11726 get pageMode() { 11727 var obj = this.catDict.get('PageMode'); 11728 var pageMode = 'UseNone'; 11729 if ((0, _primitives.isName)(obj)) { 11730 switch (obj.name) { 11731 case 'UseNone': 11732 case 'UseOutlines': 11733 case 'UseThumbs': 11734 case 'FullScreen': 11735 case 'UseOC': 11736 case 'UseAttachments': 11737 pageMode = obj.name; 11738 } 11739 } 11740 return (0, _util.shadow)(this, 'pageMode', pageMode); 11741 }, 11742 get attachments() { 11743 var xref = this.xref; 11744 var attachments = null, 11745 nameTreeRef; 11746 var obj = this.catDict.get('Names'); 11747 if (obj) { 11748 nameTreeRef = obj.getRaw('EmbeddedFiles'); 11749 } 11750 if (nameTreeRef) {
11751 var nameTree = new NameTree(nameTreeRef, xref); 11752 var names = nameTree.getAll(); 11753 for (var name in names) { 11754 var fs = new FileSpec(names[name], xref); 11755 if (!attachments) { 11756 attachments = Object.create(null); 11757 } 11758 attachments[(0, _util.stringToPDFString)(name)] = fs.serializable; 11759 } 11760 } 11761 return (0, _util.shadow)(this, 'attachments', attachments); 11762 }, 11763 get javaScript() { 11764 var xref = this.xref; 11765 var obj = this.catDict.get('Names'); 11766 var javaScript = []; 11767 function appendIfJavaScriptDict(jsDict) { 11768 var type = jsDict.get('S'); 11769 if (!(0, _primitives.isName)(type, 'JavaScript')) { 11770 return; 11771 } 11772 var js = jsDict.get('JS'); 11773 if ((0, _primitives.isStream)(js)) { 11774 js = (0, _util.bytesToString)(js.getBytes()); 11775 } else if (!(0, _util.isString)(js)) { 11776 return; 11777 } 11778 javaScript.push((0, _util.stringToPDFString)(js)); 11779 } 11780 if (obj && obj.has('JavaScript')) { 11781 var nameTree = new NameTree(obj.getRaw('JavaScript'), xref); 11782 var names = nameTree.getAll(); 11783 for (var name in names) { 11784 var jsDict = names[name]; 11785 if ((0, _primitives.isDict)(jsDict)) { 11786 appendIfJavaScriptDict(jsDict); 11787 } 11788 } 11789 } 11790 var openactionDict = this.catDict.get('OpenAction'); 11791 if ((0, _primitives.isDict)(openactionDict, 'Action')) { 11792 var actionType = openactionDict.get('S'); 11793 if ((0, _primitives.isName)(actionType, 'Named')) { 11794 var action = openactionDict.get('N'); 11795 if ((0, _primitives.isName)(action, 'Print')) { 11796 javaScript.push('print({});'); 11797 } 11798 } else { 11799 appendIfJavaScriptDict(openactionDict); 11800 } 11801 } 11802 return (0, _util.shadow)(this, 'javaScript', javaScript); 11803 }, 11804 cleanup: function Catalog_cleanup() { 11805 var _this = this; 11806 11807 this.pageKidsCountCache.clear(); 11808 var promises = []; 11809 this.fontCache.forEach(function (promise) { 11810 promises.push(promise); 11811 }); 11812 return Promise.all(promises).then(function (translatedFonts) { 11813 for (var i = 0, ii = translatedFonts.length; i < ii; i++) { 11814 var font = translatedFonts[i].dict; 11815 delete font.translated; 11816 } 11817 _this.fontCache.clear(); 11818 _this.builtInCMapCache = Object.create(null); 11819 }); 11820 }, 11821 getPage: function Catalog_getPage(pageIndex) { 11822 var _this2 = this; 11823 11824 if (!(pageIndex in this.pagePromises)) { 11825 this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then(function (_ref) { 11826 var _ref2 = _slicedToArray(_ref, 2), 11827 dict = _ref2[0], 11828 ref = _ref2[1]; 11829 11830 return _this2.pageFactory.createPage(pageIndex, dict, ref, _this2.fontCache, _this2.builtInCMapCache); 11831 }); 11832 } 11833 return this.pagePromises[pageIndex]; 11834 }, 11835 getPageDict: function Catalog_getPageDict(pageIndex) { 11836 var capability = (0, _util.createPromiseCapability)(); 11837 var nodesToVisit = [this.catDict.getRaw('Pages')]; 11838 var count, 11839 currentPageIndex = 0; 11840 var xref = this.xref, 11841 pageKidsCountCache = this.pageKidsCountCache; 11842 function next() { 11843 while (nodesToVisit.length) { 11844 var currentNode = nodesToVisit.pop(); 11845 if ((0, _primitives.isRef)(currentNode)) { 11846 count = pageKidsCountCache.get(currentNode); 11847 if (count > 0 && currentPageIndex + count < pageIndex) { 11848 currentPageIndex += count; 11849 continue; 11850 } 11851 xref.fetchAsync(currentNode).then(function (obj) { 11852 if ((0, _primitives.isDict)(obj, 'Page') || (0, _primitives.isDict)(obj) && !obj.has('Kids')) { 11853 if (pageIndex === currentPageIndex) { 11854 if (currentNode && !pageKidsCountCache.has(currentNode)) { 11855 pageKidsCountCache.put(currentNode, 1); 11856 } 11857 capability.resolve([obj, currentNode]); 11858 } else { 11859 currentPageIndex++; 11860 next(); 11861 } 11862 return; 11863 } 11864 nodesToVisit.push(obj); 11865 next(); 11866 }, capability.reject); 11867 return; 11868 } 11869 if (!(0, _primitives.isDict)(currentNode)) { 11870 capability.reject(new _util.FormatError('page dictionary kid reference points to wrong type of object')); 11871 return; 11872 } 11873 count = currentNode.get('Count'); 11874 var objId = currentNode.objId;
11875 if (objId && !pageKidsCountCache.has(objId)) { 11876 pageKidsCountCache.put(objId, count); 11877 } 11878 if (currentPageIndex + count <= pageIndex) { 11879 currentPageIndex += count; 11880 continue; 11881 } 11882 var kids = currentNode.get('Kids'); 11883 if (!Array.isArray(kids)) { 11884 capability.reject(new _util.FormatError('page dictionary kids object is not an array')); 11885 return; 11886 } 11887 for (var last = kids.length - 1; last >= 0; last--) { 11888 nodesToVisit.push(kids[last]); 11889 } 11890 } 11891 capability.reject(new Error('Page index ' + pageIndex + ' not found.')); 11892 } 11893 next(); 11894 return capability.promise; 11895 }, 11896 getPageIndex: function Catalog_getPageIndex(pageRef) { 11897 var xref = this.xref; 11898 function pagesBeforeRef(kidRef) { 11899 var total = 0; 11900 var parentRef; 11901 return xref.fetchAsync(kidRef).then(function (node) { 11902 if ((0, _primitives.isRefsEqual)(kidRef, pageRef) && !(0, _primitives.isDict)(node, 'Page') && !((0, _primitives.isDict)(node) && !node.has('Type') && node.has('Contents'))) { 11903 throw new _util.FormatError('The reference does not point to a /Page Dict.'); 11904 } 11905 if (!node) { 11906 return null; 11907 } 11908 if (!(0, _primitives.isDict)(node)) { 11909 throw new _util.FormatError('node must be a Dict.'); 11910 } 11911 parentRef = node.getRaw('Parent'); 11912 return node.getAsync('Parent'); 11913 }).then(function (parent) { 11914 if (!parent) { 11915 return null; 11916 } 11917 if (!(0, _primitives.isDict)(parent)) { 11918 throw new _util.FormatError('parent must be a Dict.'); 11919 } 11920 return parent.getAsync('Kids'); 11921 }).then(function (kids) { 11922 if (!kids) { 11923 return null; 11924 } 11925 var kidPromises = []; 11926 var found = false; 11927 for (var i = 0; i < kids.length; i++) { 11928 var kid = kids[i]; 11929 if (!(0, _primitives.isRef)(kid)) { 11930 throw new _util.FormatError('kid must be a Ref.'); 11931 } 11932 if (kid.num === kidRef.num) { 11933 found = true; 11934 break; 11935 } 11936 kidPromises.push(xref.fetchAsync(kid).then(function (kid) { 11937 if (kid.has('Count')) { 11938 var count = kid.get('Count'); 11939 total += count; 11940 } else { 11941 total++; 11942 } 11943 })); 11944 } 11945 if (!found) { 11946 throw new _util.FormatError('kid ref not found in parents kids'); 11947 } 11948 return Promise.all(kidPromises).then(function () { 11949 return [total, parentRef]; 11950 }); 11951 }); 11952 } 11953 var total = 0; 11954 function next(ref) { 11955 return pagesBeforeRef(ref).then(function (args) { 11956 if (!args) { 11957 return total; 11958 } 11959 var count = args[0]; 11960 var parentRef = args[1]; 11961 total += count; 11962 return next(parentRef); 11963 }); 11964 } 11965 return next(pageRef); 11966 } 11967 }; 11968 Catalog.parseDestDictionary = function Catalog_parseDestDictionary(params) { 11969 function addDefaultProtocolToUrl(url) { 11970 if (url.indexOf('www.') === 0) { 11971 return 'http://' + url; 11972 } 11973 return url; 11974 } 11975 function tryConvertUrlEncoding(url) { 11976 try { 11977 return (0, _util.stringToUTF8String)(url); 11978 } catch (e) { 11979 return url; 11980 } 11981 } 11982 var destDict = params.destDict; 11983 if (!(0, _primitives.isDict)(destDict)) { 11984 (0, _util.warn)('parseDestDictionary: "destDict" must be a dictionary.'); 11985 return; 11986 } 11987 var resultObj = params.resultObj; 11988 if ((typeof resultObj === 'undefined' ? 'undefined' : _typeof(resultObj)) !== 'object') { 11989 (0, _util.warn)('parseDestDictionary: "resultObj" must be an object.'); 11990 return; 11991 } 11992 var docBaseUrl = params.docBaseUrl || null; 11993 var action = destDict.get('A'), 11994 url, 11995 dest; 11996 if (!(0, _primitives.isDict)(action) && destDict.has('Dest')) { 11997 action = destDict.get('Dest'); 11998 } 11999 if ((0, _primitives.isDict)(action)) { 12000 var actionType = action.get('S'); 12001 if (!(0, _primitives.isName)(actionType)) { 12002 (0, _util.warn)('parseDestDictionary: Invalid type in Action dictionary.'); 12003 return; 12004 }
12005 var actionName = actionType.name; 12006 switch (actionName) { 12007 case 'URI': 12008 url = action.get('URI'); 12009 if ((0, _primitives.isName)(url)) { 12010 url = '/' + url.name; 12011 } else if ((0, _util.isString)(url)) { 12012 url = addDefaultProtocolToUrl(url); 12013 } 12014 break; 12015 case 'GoTo': 12016 dest = action.get('D'); 12017 break; 12018 case 'Launch': 12019 case 'GoToR': 12020 var urlDict = action.get('F'); 12021 if ((0, _primitives.isDict)(urlDict)) { 12022 url = urlDict.get('F') || null; 12023 } else if ((0, _util.isString)(urlDict)) { 12024 url = urlDict; 12025 } 12026 var remoteDest = action.get('D'); 12027 if (remoteDest) { 12028 if ((0, _primitives.isName)(remoteDest)) { 12029 remoteDest = remoteDest.name; 12030 } 12031 if ((0, _util.isString)(url)) { 12032 var baseUrl = url.split('#')[0]; 12033 if ((0, _util.isString)(remoteDest)) { 12034 url = baseUrl + '#' + remoteDest; 12035 } else if (Array.isArray(remoteDest)) { 12036 url = baseUrl + '#' + JSON.stringify(remoteDest); 12037 } 12038 } 12039 } 12040 var newWindow = action.get('NewWindow'); 12041 if ((0, _util.isBool)(newWindow)) { 12042 resultObj.newWindow = newWindow; 12043 } 12044 break; 12045 case 'Named': 12046 var namedAction = action.get('N'); 12047 if ((0, _primitives.isName)(namedAction)) { 12048 resultObj.action = namedAction.name; 12049 } 12050 break; 12051 case 'JavaScript': 12052 var jsAction = action.get('JS'), 12053 js; 12054 if ((0, _primitives.isStream)(jsAction)) { 12055 js = (0, _util.bytesToString)(jsAction.getBytes()); 12056 } else if ((0, _util.isString)(jsAction)) { 12057 js = jsAction; 12058 } 12059 if (js) { 12060 var URL_OPEN_METHODS = ['app.launchURL', 'window.open']; 12061 var regex = new RegExp('^\\s*(' + URL_OPEN_METHODS.join('|').split('.').join('\\.') + ')\\((?:\'|\")([^\'\"]*)(?:\'|\")(?:,\\s*(\\w+)\\)|\\))', 'i'); 12062 var jsUrl = regex.exec((0, _util.stringToPDFString)(js)); 12063 if (jsUrl && jsUrl[2]) { 12064 url = jsUrl[2]; 12065 if (jsUrl[3] === 'true' && jsUrl[1] === 'app.launchURL') { 12066 resultObj.newWindow = true; 12067 } 12068 break; 12069 } 12070 } 12071 default: 12072 (0, _util.warn)('parseDestDictionary: Unsupported Action type "' + actionName + '".'); 12073 break; 12074 } 12075 } else if (destDict.has('Dest')) { 12076 dest = destDict.get('Dest'); 12077 } 12078 if ((0, _util.isString)(url)) { 12079 url = tryConvertUrlEncoding(url); 12080 var absoluteUrl = (0, _util.createValidAbsoluteUrl)(url, docBaseUrl); 12081 if (absoluteUrl) { 12082 resultObj.url = absoluteUrl.href; 12083 } 12084 resultObj.unsafeUrl = url; 12085 } 12086 if (dest) { 12087 if ((0, _primitives.isName)(dest)) { 12088 dest = dest.name; 12089 } 12090 if ((0, _util.isString)(dest) || Array.isArray(dest)) { 12091 resultObj.dest = dest; 12092 } 12093 } 12094 }; 12095 return Catalog; 12096}(); 12097var XRef = function XRefClosure() { 12098 function XRef(stream, pdfManager) { 12099 this.stream = stream; 12100 this.pdfManager = pdfManager; 12101 this.entries = []; 12102 this.xrefstms = Object.create(null); 12103 this.cache = []; 12104 this.stats = { 12105 streamTypes: [], 12106 fontTypes: [] 12107 }; 12108 } 12109 XRef.prototype = { 12110 setStartXRef: function XRef_setStartXRef(startXRef) { 12111 this.startXRefQueue = [startXRef]; 12112 }, 12113 parse: function XRef_parse(recoveryMode) { 12114 var trailerDict; 12115 if (!recoveryMode) { 12116 trailerDict = this.readXRef(); 12117 } else { 12118 (0, _util.warn)('Indexing all PDF objects'); 12119 trailerDict = this.indexObjects(); 12120 } 12121 trailerDict.assignXref(this); 12122 this.trailer = trailerDict; 12123 var encrypt = trailerDict.get('Encrypt'); 12124 if ((0, _primitives.isDict)(encrypt)) { 12125 var ids = trailerDict.get('ID'); 12126 var fileId = ids && ids.length ? ids[0] : ''; 12127 encrypt.suppressEncryption = true; 12128 this.encrypt = new _crypto.CipherTransformFactory(encrypt, fileId, this.pdfManager.password); 12129 } 12130 if (!(this.root = trailerDict.get('Root'))) { 12131 throw new _util.FormatError('Invalid root reference'); 12132 } 12133 }, 12134 processXRefTable: function XRef_processXRefTable(parser) { 12135 if (!('tableState' in this)) { 12136 this.tableState = { 12137 entryNum: 0, 12138 streamPos: parser.lexer.stream.pos, 12139 parserBuf1: parser.buf1, 12140 parserBuf2: parser.buf2 12141 }; 12142 } 12143 var obj = this.readXRefTable(parser); 12144 if (!(0, _primitives.isCmd)(obj, 'trailer')) { 12145 throw new _util.FormatError('Invalid XRef table: could not find trailer dictionary'); 12146 } 12147 var dict = parser.getObj(); 12148 if (!(0, _primitives.isDict)(dict) && dict.dict) { 12149 dict = dict.dict; 12150 } 12151 if (!(0, _primitives.isDict)(dict)) { 12152 throw new _util.FormatError('Invalid XRef table: could not parse trailer dictionary'); 12153 } 12154 delete this.tableState; 12155 return dict; 12156 }, 12157 readXRefTable: function XRef_readXRefTable(parser) { 12158 var stream = parser.lexer.stream; 12159 var tableState = this.tableState; 12160 stream.pos = tableState.streamPos; 12161 parser.buf1 = tableState.parserBuf1; 12162 parser.buf2 = tableState.parserBuf2; 12163 var obj; 12164 while (true) { 12165 if (!('firstEntryNum' in tableState) || !('entryCount' in tableState)) { 12166 if ((0, _primitives.isCmd)(obj = parser.getObj(), 'trailer')) { 12167 break; 12168 } 12169 tableState.firstEntryNum = obj; 12170 tableState.entryCount = parser.getObj(); 12171 } 12172 var first = tableState.firstEntryNum; 12173 var count = tableState.entryCount; 12174 if (!Number.isInteger(first) || !Number.isInteger(count)) { 12175 throw new _util.FormatError('Invalid XRef table: wrong types in subsection header'); 12176 } 12177 for (var i = tableState.entryNum; i < count; i++) { 12178 tableState.streamPos = stream.pos; 12179 tableState.entryNum = i; 12180 tableState.parserBuf1 = parser.buf1; 12181 tableState.parserBuf2 = parser.buf2; 12182 var entry = {}; 12183 entry.offset = parser.getObj(); 12184 entry.gen = parser.getObj(); 12185 var type = parser.getObj(); 12186 if ((0, _primitives.isCmd)(type, 'f')) { 12187 entry.free = true; 12188 } else if ((0, _primitives.isCmd)(type, 'n')) { 12189 entry.uncompressed = true; 12190 } 12191 if (!Number.isInteger(entry.offset) || !Number.isInteger(entry.gen) || !(entry.free || entry.uncompressed)) { 12192 throw new _util.FormatError('Invalid entry in XRef subsection: ' + first + ', ' + count); 12193 } 12194 if (i === 0 && entry.free && first === 1) { 12195 first = 0; 12196 } 12197 if (!this.entries[i + first]) { 12198 this.entries[i + first] = entry; 12199 } 12200 } 12201 tableState.entryNum = 0; 12202 tableState.streamPos = stream.pos; 12203 tableState.parserBuf1 = parser.buf1; 12204 tableState.parserBuf2 = parser.buf2; 12205 delete tableState.firstEntryNum; 12206 delete tableState.entryCount; 12207 } 12208 if (this.entries[0] && !this.entries[0].free) { 12209 throw new _util.FormatError('Invalid XRef table: unexpected first object'); 12210 } 12211 return obj; 12212 }, 12213 processXRefStream: function XRef_processXRefStream(stream) { 12214 if (!('streamState' in this)) { 12215 var streamParameters = stream.dict;
12216 var byteWidths = streamParameters.get('W'); 12217 var range = streamParameters.get('Index'); 12218 if (!range) { 12219 range = [0, streamParameters.get('Size')]; 12220 } 12221 this.streamState = { 12222 entryRanges: range, 12223 byteWidths: byteWidths, 12224 entryNum: 0, 12225 streamPos: stream.pos 12226 }; 12227 } 12228 this.readXRefStream(stream); 12229 delete this.streamState; 12230 return stream.dict; 12231 }, 12232 readXRefStream: function XRef_readXRefStream(stream) { 12233 var i, j; 12234 var streamState = this.streamState; 12235 stream.pos = streamState.streamPos; 12236 var byteWidths = streamState.byteWidths; 12237 var typeFieldWidth = byteWidths[0]; 12238 var offsetFieldWidth = byteWidths[1]; 12239 var generationFieldWidth = byteWidths[2]; 12240 var entryRanges = streamState.entryRanges; 12241 while (entryRanges.length > 0) { 12242 var first = entryRanges[0]; 12243 var n = entryRanges[1]; 12244 if (!Number.isInteger(first) || !Number.isInteger(n)) { 12245 throw new _util.FormatError('Invalid XRef range fields: ' + first + ', ' + n); 12246 } 12247 if (!Number.isInteger(typeFieldWidth) || !Number.isInteger(offsetFieldWidth) || !Number.isInteger(generationFieldWidth)) { 12248 throw new _util.FormatError('Invalid XRef entry fields length: ' + first + ', ' + n); 12249 } 12250 for (i = streamState.entryNum; i < n; ++i) { 12251 streamState.entryNum = i; 12252 streamState.streamPos = stream.pos; 12253 var type = 0, 12254 offset = 0, 12255 generation = 0; 12256 for (j = 0; j < typeFieldWidth; ++j) { 12257 type = type << 8 | stream.getByte(); 12258 } 12259 if (typeFieldWidth === 0) { 12260 type = 1; 12261 } 12262 for (j = 0; j < offsetFieldWidth; ++j) { 12263 offset = offset << 8 | stream.getByte(); 12264 } 12265 for (j = 0; j < generationFieldWidth; ++j) { 12266 generation = generation << 8 | stream.getByte(); 12267 } 12268 var entry = {}; 12269 entry.offset = offset; 12270 entry.gen = generation; 12271 switch (type) { 12272 case 0: 12273 entry.free = true; 12274 break; 12275 case 1: 12276 entry.uncompressed = true; 12277 break; 12278 case 2: 12279 break; 12280 default: 12281 throw new _util.FormatError('Invalid XRef entry type: ' + type); 12282 } 12283 if (!this.entries[first + i]) { 12284 this.entries[first + i] = entry; 12285 } 12286 } 12287 streamState.entryNum = 0; 12288 streamState.streamPos = stream.pos; 12289 entryRanges.splice(0, 2); 12290 } 12291 }, 12292 indexObjects: function XRef_indexObjects() { 12293 var TAB = 0x9, 12294 LF = 0xA, 12295 CR = 0xD, 12296 SPACE = 0x20; 12297 var PERCENT = 0x25, 12298 LT = 0x3C; 12299 function readToken(data, offset) { 12300 var token = '', 12301 ch = data[offset]; 12302 while (ch !== LF && ch !== CR && ch !== LT) { 12303 if (++offset >= data.length) { 12304 break; 12305 } 12306 token += String.fromCharCode(ch); 12307 ch = data[offset]; 12308 } 12309 return token; 12310 } 12311 function skipUntil(data, offset, what) { 12312 var length = what.length, 12313 dataLength = data.length; 12314 var skipped = 0; 12315 while (offset < dataLength) { 12316 var i = 0; 12317 while (i < length && data[offset + i] === what[i]) { 12318 ++i; 12319 } 12320 if (i >= length) { 12321 break; 12322 } 12323 offset++; 12324 skipped++; 12325 } 12326 return skipped; 12327 } 12328 var objRegExp = /^(\d+)\s+(\d+)\s+obj\b/; 12329 var trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]); 12330 var startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]); 12331 var endobjBytes = new Uint8Array([101, 110, 100, 111, 98, 106]); 12332 var xrefBytes = new Uint8Array([47, 88, 82, 101, 102]); 12333 this.entries.length = 0; 12334 var stream = this.stream; 12335 stream.pos = 0; 12336 var buffer = stream.getBytes(); 12337 var position = stream.start, 12338 length = buffer.length; 12339 var trailers = [], 12340 xrefStms = []; 12341 while (position < length) { 12342 var ch = buffer[position]; 12343 if (ch === TAB || ch === LF || ch === CR || ch === SPACE) { 12344 ++position; 12345 continue; 12346 } 12347 if (ch === PERCENT) { 12348 do { 12349 ++position; 12350 if (position >= length) { 12351 break; 12352 } 12353 ch = buffer[position]; 12354 } while (ch !== LF && ch !== CR); 12355 continue; 12356 } 12357 var token = readToken(buffer, position); 12358 var m; 12359 if (token.indexOf('xref') === 0 && (token.length === 4 || /\s/.test(token[4]))) { 12360 position += skipUntil(buffer, position, trailerBytes); 12361 trailers.push(position); 12362 position += skipUntil(buffer, position, startxrefBytes); 12363 } else if (m = objRegExp.exec(token)) { 12364 if (typeof this.entries[m[1]] === 'undefined') { 12365 this.entries[m[1]] = { 12366 offset: position - stream.start, 12367 gen: m[2] | 0, 12368 uncompressed: true 12369 }; 12370 } 12371 var contentLength = skipUntil(buffer, position, endobjBytes) + 7; 12372 var content = buffer.subarray(position, position + contentLength);
12373 var xrefTagOffset = skipUntil(content, 0, xrefBytes); 12374 if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) { 12375 xrefStms.push(position - stream.start); 12376 this.xrefstms[position - stream.start] = 1; 12377 } 12378 position += contentLength; 12379 } else if (token.indexOf('trailer') === 0 && (token.length === 7 || /\s/.test(token[7]))) { 12380 trailers.push(position); 12381 position += skipUntil(buffer, position, startxrefBytes); 12382 } else { 12383 position += token.length + 1; 12384 } 12385 } 12386 var i, ii; 12387 for (i = 0, ii = xrefStms.length; i < ii; ++i) { 12388 this.startXRefQueue.push(xrefStms[i]); 12389 this.readXRef(true); 12390 } 12391 var dict; 12392 for (i = 0, ii = trailers.length; i < ii; ++i) { 12393 stream.pos = trailers[i]; 12394 var parser = new _parser.Parser(new _parser.Lexer(stream), true, this, true); 12395 var obj = parser.getObj(); 12396 if (!(0, _primitives.isCmd)(obj, 'trailer')) { 12397 continue; 12398 } 12399 dict = parser.getObj(); 12400 if (!(0, _primitives.isDict)(dict)) { 12401 continue; 12402 } 12403 if (dict.has('ID')) { 12404 return dict; 12405 } 12406 } 12407 if (dict) { 12408 return dict; 12409 } 12410 throw new _util.InvalidPDFException('Invalid PDF structure'); 12411 }, 12412 readXRef: function XRef_readXRef(recoveryMode) { 12413 var stream = this.stream; 12414 var startXRefParsedCache = Object.create(null);
12415 try { 12416 while (this.startXRefQueue.length) { 12417 var startXRef = this.startXRefQueue[0]; 12418 if (startXRefParsedCache[startXRef]) { 12419 (0, _util.warn)('readXRef - skipping XRef table since it was already parsed.'); 12420 this.startXRefQueue.shift(); 12421 continue; 12422 } 12423 startXRefParsedCache[startXRef] = true; 12424 stream.pos = startXRef + stream.start; 12425 var parser = new _parser.Parser(new _parser.Lexer(stream), true, this); 12426 var obj = parser.getObj(); 12427 var dict; 12428 if ((0, _primitives.isCmd)(obj, 'xref')) { 12429 dict = this.processXRefTable(parser); 12430 if (!this.topDict) { 12431 this.topDict = dict; 12432 } 12433 obj = dict.get('XRefStm'); 12434 if (Number.isInteger(obj)) { 12435 var pos = obj; 12436 if (!(pos in this.xrefstms)) { 12437 this.xrefstms[pos] = 1; 12438 this.startXRefQueue.push(pos); 12439 } 12440 } 12441 } else if (Number.isInteger(obj)) { 12442 if (!Number.isInteger(parser.getObj()) || !(0, _primitives.isCmd)(parser.getObj(), 'obj') || !(0, _primitives.isStream)(obj = parser.getObj())) { 12443 throw new _util.FormatError('Invalid XRef stream'); 12444 } 12445 dict = this.processXRefStream(obj); 12446 if (!this.topDict) { 12447 this.topDict = dict; 12448 } 12449 if (!dict) { 12450 throw new _util.FormatError('Failed to read XRef stream'); 12451 } 12452 } else { 12453 throw new _util.FormatError('Invalid XRef stream header'); 12454 } 12455 obj = dict.get('Prev'); 12456 if (Number.isInteger(obj)) { 12457 this.startXRefQueue.push(obj); 12458 } else if ((0, _primitives.isRef)(obj)) { 12459 this.startXRefQueue.push(obj.num); 12460 } 12461 this.startXRefQueue.shift(); 12462 } 12463 return this.topDict; 12464 } catch (e) { 12465 if (e instanceof _util.MissingDataException) { 12466 throw e; 12467 } 12468 (0, _util.info)('(while reading XRef): ' + e); 12469 } 12470 if (recoveryMode) { 12471 return; 12472 } 12473 throw new _util.XRefParseException(); 12474 }, 12475 getEntry: function XRef_getEntry(i) { 12476 var xrefEntry = this.entries[i]; 12477 if (xrefEntry && !xrefEntry.free && xrefEntry.offset) { 12478 return xrefEntry; 12479 } 12480 return null; 12481 }, 12482 fetchIfRef: function XRef_fetchIfRef(obj, suppressEncryption) { 12483 if (!(0, _primitives.isRef)(obj)) { 12484 return obj; 12485 } 12486 return this.fetch(obj, suppressEncryption); 12487 }, 12488 fetch: function XRef_fetch(ref, suppressEncryption) { 12489 if (!(0, _primitives.isRef)(ref)) { 12490 throw new Error('ref object is not a reference'); 12491 } 12492 var num = ref.num; 12493 if (num in this.cache) { 12494 var cacheEntry = this.cache[num]; 12495 if (cacheEntry instanceof _primitives.Dict && !cacheEntry.objId) { 12496 cacheEntry.objId = ref.toString(); 12497 } 12498 return cacheEntry; 12499 } 12500 var xrefEntry = this.getEntry(num); 12501 if (xrefEntry === null) { 12502 return this.cache[num] = null; 12503 } 12504 if (xrefEntry.uncompressed) { 12505 xrefEntry = this.fetchUncompressed(ref, xrefEntry, suppressEncryption); 12506 } else { 12507 xrefEntry = this.fetchCompressed(xrefEntry, suppressEncryption); 12508 } 12509 if ((0, _primitives.isDict)(xrefEntry)) { 12510 xrefEntry.objId = ref.toString(); 12511 } else if ((0, _primitives.isStream)(xrefEntry)) { 12512 xrefEntry.dict.objId = ref.toString(); 12513 } 12514 return xrefEntry; 12515 }, 12516 fetchUncompressed: function XRef_fetchUncompressed(ref, xrefEntry, suppressEncryption) { 12517 var gen = ref.gen; 12518 var num = ref.num; 12519 if (xrefEntry.gen !== gen) { 12520 throw new _util.FormatError('inconsistent generation in XRef'); 12521 } 12522 var stream = this.stream.makeSubStream(xrefEntry.offset + this.stream.start); 12523 var parser = new _parser.Parser(new _parser.Lexer(stream), true, this); 12524 var obj1 = parser.getObj(); 12525 var obj2 = parser.getObj(); 12526 var obj3 = parser.getObj(); 12527 if (!Number.isInteger(obj1)) { 12528 obj1 = parseInt(obj1, 10); 12529 } 12530 if (!Number.isInteger(obj2)) { 12531 obj2 = parseInt(obj2, 10); 12532 } 12533 if (obj1 !== num || obj2 !== gen || !(0, _primitives.isCmd)(obj3)) { 12534 throw new _util.FormatError('bad XRef entry'); 12535 } 12536 if (obj3.cmd !== 'obj') { 12537 if (obj3.cmd.indexOf('obj') === 0) { 12538 num = parseInt(obj3.cmd.substring(3), 10); 12539 if (!Number.isNaN(num)) { 12540 return num; 12541 } 12542 } 12543 throw new _util.FormatError('bad XRef entry'); 12544 } 12545 if (this.encrypt && !suppressEncryption) { 12546 xrefEntry = parser.getObj(this.encrypt.createCipherTransform(num, gen)); 12547 } else { 12548 xrefEntry = parser.getObj(); 12549 } 12550 if (!(0, _primitives.isStream)(xrefEntry)) { 12551 this.cache[num] = xrefEntry; 12552 } 12553 return xrefEntry; 12554 }, 12555 fetchCompressed: function XRef_fetchCompressed(xrefEntry, suppressEncryption) { 12556 var tableOffset = xrefEntry.offset; 12557 var stream = this.fetch(new _primitives.Ref(tableOffset, 0)); 12558 if (!(0, _primitives.isStream)(stream)) { 12559 throw new _util.FormatError('bad ObjStm stream'); 12560 } 12561 var first = stream.dict.get('First'); 12562 var n = stream.dict.get('N'); 12563 if (!Number.isInteger(first) || !Number.isInteger(n)) { 12564 throw new _util.FormatError('invalid first and n parameters for ObjStm stream'); 12565 } 12566 var parser = new _parser.Parser(new _parser.Lexer(stream), false, this); 12567 parser.allowStreams = true; 12568 var i,
12569 entries = [], 12570 num, 12571 nums = []; 12572 for (i = 0; i < n; ++i) { 12573 num = parser.getObj(); 12574 if (!Number.isInteger(num)) { 12575 throw new _util.FormatError('invalid object number in the ObjStm stream: ' + num); 12576 } 12577 nums.push(num); 12578 var offset = parser.getObj(); 12579 if (!Number.isInteger(offset)) { 12580 throw new _util.FormatError('invalid object offset in the ObjStm stream: ' + offset); 12581 } 12582 } 12583 for (i = 0; i < n; ++i) { 12584 entries.push(parser.getObj()); 12585 if ((0, _primitives.isCmd)(parser.buf1, 'endobj')) { 12586 parser.shift(); 12587 } 12588 num = nums[i]; 12589 var entry = this.entries[num]; 12590 if (entry && entry.offset === tableOffset && entry.gen === i) { 12591 this.cache[num] = entries[i]; 12592 } 12593 } 12594 xrefEntry = entries[xrefEntry.gen]; 12595 if (xrefEntry === undefined) { 12596 throw new _util.FormatError('bad XRef entry for compressed object'); 12597 } 12598 return xrefEntry; 12599 }, 12600 fetchIfRefAsync: function XRef_fetchIfRefAsync(obj, suppressEncryption) { 12601 if (!(0, _primitives.isRef)(obj)) { 12602 return Promise.resolve(obj); 12603 } 12604 return this.fetchAsync(obj, suppressEncryption); 12605 }, 12606 fetchAsync: function XRef_fetchAsync(ref, suppressEncryption) { 12607 var streamManager = this.stream.manager; 12608 var xref = this; 12609 return new Promise(function tryFetch(resolve, reject) { 12610 try { 12611 resolve(xref.fetch(ref, suppressEncryption)); 12612 } catch (e) { 12613 if (e instanceof _util.MissingDataException) { 12614 streamManager.requestRange(e.begin, e.end).then(function () { 12615 tryFetch(resolve, reject); 12616 }, reject); 12617 return; 12618 } 12619 reject(e); 12620 } 12621 }); 12622 }, 12623 getCatalogObj: function XRef_getCatalogObj() { 12624 return this.root; 12625 } 12626 }; 12627 return XRef; 12628}(); 12629var NameOrNumberTree = function NameOrNumberTreeClosure() { 12630 function NameOrNumberTree(root, xref) { 12631 throw new Error('Cannot initialize NameOrNumberTree.'); 12632 } 12633 NameOrNumberTree.prototype = { 12634 getAll: function NameOrNumberTree_getAll() { 12635 var dict = Object.create(null); 12636 if (!this.root) { 12637 return dict; 12638 } 12639 var xref = this.xref; 12640 var processed = new _primitives.RefSet(); 12641 processed.put(this.root); 12642 var queue = [this.root]; 12643 while (queue.length > 0) { 12644 var i, n; 12645 var obj = xref.fetchIfRef(queue.shift()); 12646 if (!(0, _primitives.isDict)(obj)) { 12647 continue; 12648 } 12649 if (obj.has('Kids')) { 12650 var kids = obj.get('Kids'); 12651 for (i = 0, n = kids.length; i < n; i++) { 12652 var kid = kids[i]; 12653 if (processed.has(kid)) { 12654 throw new _util.FormatError('Duplicate entry in "' + this._type + '" tree.'); 12655 } 12656 queue.push(kid); 12657 processed.put(kid); 12658 } 12659 continue; 12660 } 12661 var entries = obj.get(this._type); 12662 if (Array.isArray(entries)) { 12663 for (i = 0, n = entries.length; i < n; i += 2) { 12664 dict[xref.fetchIfRef(entries[i])] = xref.fetchIfRef(entries[i + 1]); 12665 } 12666 } 12667 } 12668 return dict; 12669 }, 12670 get: function NameOrNumberTree_get(key) { 12671 if (!this.root) { 12672 return null; 12673 } 12674 var xref = this.xref; 12675 var kidsOrEntries = xref.fetchIfRef(this.root); 12676 var loopCount = 0; 12677 var MAX_LEVELS = 10; 12678 var l, r, m; 12679 while (kidsOrEntries.has('Kids')) { 12680 if (++loopCount > MAX_LEVELS) { 12681 (0, _util.warn)('Search depth limit reached for "' + this._type + '" tree.'); 12682 return null; 12683 } 12684 var kids = kidsOrEntries.get('Kids'); 12685 if (!Array.isArray(kids)) { 12686 return null; 12687 } 12688 l = 0; 12689 r = kids.length - 1; 12690 while (l <= r) { 12691 m = l + r >> 1; 12692 var kid = xref.fetchIfRef(kids[m]); 12693 var limits = kid.get('Limits'); 12694 if (key < xref.fetchIfRef(limits[0])) { 12695 r = m - 1; 12696 } else if (key > xref.fetchIfRef(limits[1])) { 12697 l = m + 1; 12698 } else { 12699 kidsOrEntries = xref.fetchIfRef(kids[m]); 12700 break; 12701 } 12702 } 12703 if (l > r) { 12704 return null; 12705 } 12706 } 12707 var entries = kidsOrEntries.get(this._type); 12708 if (Array.isArray(entries)) { 12709 l = 0; 12710 r = entries.length - 2; 12711 while (l <= r) { 12712 m = l + r & ~1; 12713 var currentKey = xref.fetchIfRef(entries[m]); 12714 if (key < currentKey) { 12715 r = m - 2; 12716 } else if (key > currentKey) { 12717 l = m + 2; 12718 } else { 12719 return xref.fetchIfRef(entries[m + 1]); 12720 } 12721 } 12722 } 12723 return null; 12724 } 12725 }; 12726 return NameOrNumberTree; 12727}(); 12728var NameTree = function NameTreeClosure() { 12729 function NameTree(root, xref) { 12730 this.root = root; 12731 this.xref = xref; 12732 this._type = 'Names'; 12733 } 12734 _util.Util.inherit(NameTree, NameOrNumberTree, {}); 12735 return NameTree; 12736}(); 12737var NumberTree = function NumberTreeClosure() { 12738 function NumberTree(root, xref) { 12739 this.root = root; 12740 this.xref = xref; 12741 this._type = 'Nums'; 12742 } 12743 _util.Util.inherit(NumberTree, NameOrNumberTree, {}); 12744 return NumberTree; 12745}(); 12746var FileSpec = function FileSpecClosure() { 12747 function FileSpec(root, xref) { 12748 if (!root || !(0, _primitives.isDict)(root)) { 12749 return; 12750 } 12751 this.xref = xref; 12752 this.root = root; 12753 if (root.has('FS')) { 12754 this.fs = root.get('FS'); 12755 } 12756 this.description = root.has('Desc') ? (0, _util.stringToPDFString)(root.get('Desc')) : ''; 12757 if (root.has('RF')) { 12758 (0, _util.warn)('Related file specifications are not supported'); 12759 } 12760 this.contentAvailable = true; 12761 if (!root.has('EF')) { 12762 this.contentAvailable = false;
12763 (0, _util.warn)('Non-embedded file specifications are not supported'); 12764 } 12765 } 12766 function pickPlatformItem(dict) { 12767 if (dict.has('UF')) { 12768 return dict.get('UF'); 12769 } else if (dict.has('F')) { 12770 return dict.get('F'); 12771 } else if (dict.has('Unix')) { 12772 return dict.get('Unix'); 12773 } else if (dict.has('Mac')) { 12774 return dict.get('Mac'); 12775 } else if (dict.has('DOS')) { 12776 return dict.get('DOS'); 12777 } 12778 return null; 12779 } 12780 FileSpec.prototype = { 12781 get filename() { 12782 if (!this._filename && this.root) { 12783 var filename = pickPlatformItem(this.root) || 'unnamed'; 12784 this._filename = (0, _util.stringToPDFString)(filename).replace(/\\\\/g, '\\').replace(/\\\//g, '/').replace(/\\/g, '/'); 12785 } 12786 return this._filename; 12787 }, 12788 get content() { 12789 if (!this.contentAvailable) { 12790 return null; 12791 } 12792 if (!this.contentRef && this.root) { 12793 this.contentRef = pickPlatformItem(this.root.get('EF')); 12794 } 12795 var content = null; 12796 if (this.contentRef) { 12797 var xref = this.xref; 12798 var fileObj = xref.fetchIfRef(this.contentRef); 12799 if (fileObj && (0, _primitives.isStream)(fileObj)) { 12800 content = fileObj.getBytes(); 12801 } else { 12802 (0, _util.warn)('Embedded file specification points to non-existing/invalid ' + 'content'); 12803 } 12804 } else { 12805 (0, _util.warn)('Embedded file specification does not have a content'); 12806 } 12807 return content; 12808 }, 12809 get serializable() { 12810 return { 12811 filename: this.filename, 12812 content: this.content 12813 }; 12814 } 12815 }; 12816 return FileSpec; 12817}(); 12818var ObjectLoader = function () { 12819 function mayHaveChildren(value) { 12820 return (0, _primitives.isRef)(value) || (0, _primitives.isDict)(value) || Array.isArray(value) || (0, _primitives.isStream)(value); 12821 } 12822 function addChildren(node, nodesToVisit) { 12823 if ((0, _primitives.isDict)(node) || (0, _primitives.isStream)(node)) { 12824 var dict = (0, _primitives.isDict)(node) ? node : node.dict; 12825 var dictKeys = dict.getKeys(); 12826 for (var i = 0, ii = dictKeys.length; i < ii; i++) { 12827 var rawValue = dict.getRaw(dictKeys[i]); 12828 if (mayHaveChildren(rawValue)) { 12829 nodesToVisit.push(rawValue); 12830 } 12831 } 12832 } else if (Array.isArray(node)) { 12833 for (var _i = 0, _ii = node.length; _i < _ii; _i++) { 12834 var value = node[_i]; 12835 if (mayHaveChildren(value)) { 12836 nodesToVisit.push(value); 12837 } 12838 } 12839 } 12840 } 12841 function ObjectLoader(dict, keys, xref) { 12842 this.dict = dict; 12843 this.keys = keys; 12844 this.xref = xref; 12845 this.refSet = null; 12846 this.capability = null; 12847 } 12848 ObjectLoader.prototype = { 12849 load: function load() { 12850 this.capability = (0, _util.createPromiseCapability)(); 12851 if (!(this.xref.stream instanceof _chunked_stream.ChunkedStream) || this.xref.stream.getMissingChunks().length === 0) { 12852 this.capability.resolve(); 12853 return this.capability.promise; 12854 } 12855 var keys = this.keys, 12856 dict = this.dict; 12857 12858 this.refSet = new _primitives.RefSet(); 12859 var nodesToVisit = []; 12860 for (var i = 0, ii = keys.length; i < ii; i++) { 12861 var rawValue = dict.getRaw(keys[i]); 12862 if (rawValue !== undefined) { 12863 nodesToVisit.push(rawValue); 12864 } 12865 } 12866 this._walk(nodesToVisit); 12867 return this.capability.promise; 12868 }, 12869 _walk: function _walk(nodesToVisit) { 12870 var _this3 = this; 12871 12872 var nodesToRevisit = []; 12873 var pendingRequests = []; 12874 while (nodesToVisit.length) { 12875 var currentNode = nodesToVisit.pop(); 12876 if ((0, _primitives.isRef)(currentNode)) { 12877 if (this.refSet.has(currentNode)) { 12878 continue; 12879 } 12880 try { 12881 this.refSet.put(currentNode); 12882 currentNode = this.xref.fetch(currentNode); 12883 } catch (ex) { 12884 if (!(ex instanceof _util.MissingDataException)) { 12885 throw ex; 12886 } 12887 nodesToRevisit.push(currentNode); 12888 pendingRequests.push({ 12889 begin: ex.begin, 12890 end: ex.end 12891 }); 12892 } 12893 } 12894 if (currentNode && currentNode.getBaseStreams) { 12895 var baseStreams = currentNode.getBaseStreams(); 12896 var foundMissingData = false;
12897 for (var i = 0, ii = baseStreams.length; i < ii; i++) { 12898 var stream = baseStreams[i]; 12899 if (stream.getMissingChunks && stream.getMissingChunks().length) { 12900 foundMissingData = true; 12901 pendingRequests.push({ 12902 begin: stream.start, 12903 end: stream.end 12904 }); 12905 } 12906 } 12907 if (foundMissingData) { 12908 nodesToRevisit.push(currentNode); 12909 } 12910 } 12911 addChildren(currentNode, nodesToVisit); 12912 } 12913 if (pendingRequests.length) { 12914 this.xref.stream.manager.requestRanges(pendingRequests).then(function () { 12915 for (var _i2 = 0, _ii2 = nodesToRevisit.length; _i2 < _ii2; _i2++) { 12916 var node = nodesToRevisit[_i2]; 12917 if ((0, _primitives.isRef)(node)) { 12918 _this3.refSet.remove(node); 12919 } 12920 } 12921 _this3._walk(nodesToRevisit); 12922 }, this.capability.reject); 12923 return; 12924 } 12925 this.refSet = null; 12926 this.capability.resolve(); 12927 } 12928 }; 12929 return ObjectLoader; 12930}(); 12931exports.Catalog = Catalog; 12932exports.ObjectLoader = ObjectLoader; 12933exports.XRef = XRef; 12934exports.FileSpec = FileSpec; 12935 12936/***/ }), 12937/* 64 */ 12938/***/ (function(module, exports, __w_pdfjs_require__) { 12939 12940"use strict"; 12941 12942 12943Object.defineProperty(exports, "__esModule", { 12944 value: true 12945}); 12946var ArithmeticDecoder = function ArithmeticDecoderClosure() { 12947 var QeTable = [{ 12948 qe: 0x5601, 12949 nmps: 1, 12950 nlps: 1, 12951 switchFlag: 1 12952 }, { 12953 qe: 0x3401, 12954 nmps: 2, 12955 nlps: 6, 12956 switchFlag: 0 12957 }, { 12958 qe: 0x1801, 12959 nmps: 3, 12960 nlps: 9, 12961 switchFlag: 0 12962 }, { 12963 qe: 0x0AC1, 12964 nmps: 4, 12965 nlps: 12, 12966 switchFlag: 0 12967 }, { 12968 qe: 0x0521, 12969 nmps: 5, 12970 nlps: 29, 12971 switchFlag: 0 12972 }, { 12973 qe: 0x0221, 12974 nmps: 38, 12975 nlps: 33, 12976 switchFlag: 0 12977 }, { 12978 qe: 0x5601, 12979 nmps: 7, 12980 nlps: 6, 12981 switchFlag: 1 12982 }, { 12983 qe: 0x5401, 12984 nmps: 8, 12985 nlps: 14, 12986 switchFlag: 0 12987 }, { 12988 qe: 0x4801, 12989 nmps: 9, 12990 nlps: 14, 12991 switchFlag: 0 12992 }, { 12993 qe: 0x3801, 12994 nmps: 10, 12995 nlps: 14, 12996 switchFlag: 0 12997 }, { 12998 qe: 0x3001, 12999 nmps: 11, 13000 nlps: 17, 13001 switchFlag: 0 13002 }, { 13003 qe: 0x2401, 13004 nmps: 12, 13005 nlps: 18, 13006 switchFlag: 0 13007 }, { 13008 qe: 0x1C01, 13009 nmps: 13, 13010 nlps: 20, 13011 switchFlag: 0 13012 }, { 13013 qe: 0x1601, 13014 nmps: 29, 13015 nlps: 21, 13016 switchFlag: 0 13017 }, { 13018 qe: 0x5601, 13019 nmps: 15, 13020 nlps: 14, 13021 switchFlag: 1 13022 }, { 13023 qe: 0x5401, 13024 nmps: 16, 13025 nlps: 14, 13026 switchFlag: 0 13027 }, { 13028 qe: 0x5101, 13029 nmps: 17, 13030 nlps: 15, 13031 switchFlag: 0 13032 }, { 13033 qe: 0x4801, 13034 nmps: 18, 13035 nlps: 16, 13036 switchFlag: 0 13037 }, { 13038 qe: 0x3801, 13039 nmps: 19, 13040 nlps: 17, 13041 switchFlag: 0 13042 }, { 13043 qe: 0x3401, 13044 nmps: 20, 13045 nlps: 18, 13046 switchFlag: 0 13047 }, { 13048 qe: 0x3001, 13049 nmps: 21, 13050 nlps: 19, 13051 switchFlag: 0 13052 }, { 13053 qe: 0x2801, 13054 nmps: 22, 13055 nlps: 19, 13056 switchFlag: 0 13057 }, { 13058 qe: 0x2401, 13059 nmps: 23, 13060 nlps: 20, 13061 switchFlag: 0 13062 }, { 13063 qe: 0x2201, 13064 nmps: 24, 13065 nlps: 21, 13066 switchFlag: 0 13067 }, { 13068 qe: 0x1C01, 13069 nmps: 25, 13070 nlps: 22, 13071 switchFlag: 0 13072 }, { 13073 qe: 0x1801, 13074 nmps: 26, 13075 nlps: 23, 13076 switchFlag: 0 13077 }, { 13078 qe: 0x1601, 13079 nmps: 27, 13080 nlps: 24, 13081 switchFlag: 0 13082 }, { 13083 qe: 0x1401, 13084 nmps: 28, 13085 nlps: 25, 13086 switchFlag: 0 13087 }, { 13088 qe: 0x1201, 13089 nmps: 29, 13090 nlps: 26, 13091 switchFlag: 0 13092 }, { 13093 qe: 0x1101, 13094 nmps: 30, 13095 nlps: 27, 13096 switchFlag: 0 13097 }, { 13098 qe: 0x0AC1, 13099 nmps: 31, 13100 nlps: 28, 13101 switchFlag: 0 13102 }, { 13103 qe: 0x09C1, 13104 nmps: 32, 13105 nlps: 29, 13106 switchFlag: 0 13107 }, { 13108 qe: 0x08A1, 13109 nmps: 33, 13110 nlps: 30, 13111 switchFlag: 0 13112 }, { 13113 qe: 0x0521, 13114 nmps: 34, 13115 nlps: 31, 13116 switchFlag: 0 13117 }, { 13118 qe: 0x0441, 13119 nmps: 35, 13120 nlps: 32, 13121 switchFlag: 0 13122 }, { 13123 qe: 0x02A1, 13124 nmps: 36, 13125 nlps: 33, 13126 switchFlag: 0 13127 }, { 13128 qe: 0x0221, 13129 nmps: 37, 13130 nlps: 34, 13131 switchFlag: 0 13132 }, { 13133 qe: 0x0141, 13134 nmps: 38, 13135 nlps: 35, 13136 switchFlag: 0 13137 }, { 13138 qe: 0x0111, 13139 nmps: 39, 13140 nlps: 36, 13141 switchFlag: 0 13142 }, { 13143 qe: 0x0085, 13144 nmps: 40, 13145 nlps: 37, 13146 switchFlag: 0 13147 }, { 13148 qe: 0x0049, 13149 nmps: 41, 13150 nlps: 38, 13151 switchFlag: 0 13152 }, { 13153 qe: 0x0025, 13154 nmps: 42, 13155 nlps: 39, 13156 switchFlag: 0 13157 }, { 13158 qe: 0x0015, 13159 nmps: 43, 13160 nlps: 40, 13161 switchFlag: 0 13162 }, { 13163 qe: 0x0009, 13164 nmps: 44, 13165 nlps: 41, 13166 switchFlag: 0 13167 }, { 13168 qe: 0x0005, 13169 nmps: 45, 13170 nlps: 42, 13171 switchFlag: 0 13172 }, { 13173 qe: 0x0001, 13174 nmps: 45, 13175 nlps: 43, 13176 switchFlag: 0 13177 }, { 13178 qe: 0x5601, 13179 nmps: 46, 13180 nlps: 46, 13181 switchFlag: 0 13182 }]; 13183 function ArithmeticDecoder(data, start, end) { 13184 this.data = data; 13185 this.bp = start; 13186 this.dataEnd = end;
13187 this.chigh = data[start]; 13188 this.clow = 0; 13189 this.byteIn(); 13190 this.chigh = this.chigh << 7 & 0xFFFF | this.clow >> 9 & 0x7F; 13191 this.clow = this.clow << 7 & 0xFFFF; 13192 this.ct -= 7; 13193 this.a = 0x8000; 13194 } 13195 ArithmeticDecoder.prototype = { 13196 byteIn: function ArithmeticDecoder_byteIn() { 13197 var data = this.data; 13198 var bp = this.bp; 13199 if (data[bp] === 0xFF) { 13200 var b1 = data[bp + 1]; 13201 if (b1 > 0x8F) { 13202 this.clow += 0xFF00; 13203 this.ct = 8; 13204 } else { 13205 bp++; 13206 this.clow += data[bp] << 9; 13207 this.ct = 7; 13208 this.bp = bp; 13209 } 13210 } else { 13211 bp++; 13212 this.clow += bp < this.dataEnd ? data[bp] << 8 : 0xFF00; 13213 this.ct = 8; 13214 this.bp = bp; 13215 } 13216 if (this.clow > 0xFFFF) { 13217 this.chigh += this.clow >> 16; 13218 this.clow &= 0xFFFF; 13219 } 13220 }, 13221 readBit: function ArithmeticDecoder_readBit(contexts, pos) { 13222 var cx_index = contexts[pos] >> 1, 13223 cx_mps = contexts[pos] & 1; 13224 var qeTableIcx = QeTable[cx_index]; 13225 var qeIcx = qeTableIcx.qe; 13226 var d; 13227 var a = this.a - qeIcx; 13228 if (this.chigh < qeIcx) { 13229 if (a < qeIcx) { 13230 a = qeIcx; 13231 d = cx_mps; 13232 cx_index = qeTableIcx.nmps; 13233 } else { 13234 a = qeIcx; 13235 d = 1 ^ cx_mps; 13236 if (qeTableIcx.switchFlag === 1) { 13237 cx_mps = d; 13238 } 13239 cx_index = qeTableIcx.nlps; 13240 } 13241 } else { 13242 this.chigh -= qeIcx; 13243 if ((a & 0x8000) !== 0) { 13244 this.a = a; 13245 return cx_mps; 13246 } 13247 if (a < qeIcx) { 13248 d = 1 ^ cx_mps; 13249 if (qeTableIcx.switchFlag === 1) { 13250 cx_mps = d; 13251 } 13252 cx_index = qeTableIcx.nlps; 13253 } else { 13254 d = cx_mps; 13255 cx_index = qeTableIcx.nmps; 13256 } 13257 } 13258 do { 13259 if (this.ct === 0) { 13260 this.byteIn(); 13261 } 13262 a <<= 1; 13263 this.chigh = this.chigh << 1 & 0xFFFF | this.clow >> 15 & 1; 13264 this.clow = this.clow << 1 & 0xFFFF; 13265 this.ct--; 13266 } while ((a & 0x8000) === 0); 13267 this.a = a; 13268 contexts[pos] = cx_index << 1 | cx_mps; 13269 return d; 13270 } 13271 }; 13272 return ArithmeticDecoder; 13273}(); 13274exports.ArithmeticDecoder = ArithmeticDecoder; 13275 13276/***/ }), 13277/* 65 */ 13278/***/ (function(module, exports, __w_pdfjs_require__) { 13279 13280"use strict"; 13281 13282 13283Object.defineProperty(exports, "__esModule", { 13284 value: true 13285}); 13286exports.JpxImage = undefined; 13287 13288var _util = __w_pdfjs_require__(0); 13289 13290var _arithmetic_decoder = __w_pdfjs_require__(64); 13291 13292var JpxError = function JpxErrorClosure() { 13293 function JpxError(msg) { 13294 this.message = 'JPX error: ' + msg; 13295 } 13296 JpxError.prototype = new Error(); 13297 JpxError.prototype.name = 'JpxError'; 13298 JpxError.constructor = JpxError; 13299 return JpxError; 13300}(); 13301var JpxImage = function JpxImageClosure() { 13302 var SubbandsGainLog2 = { 13303 'LL': 0, 13304 'LH': 1, 13305 'HL': 1, 13306 'HH': 2 13307 }; 13308 function JpxImage() { 13309 this.failOnCorruptedImage = false; 13310 } 13311 JpxImage.prototype = { 13312 parse: function JpxImage_parse(data) { 13313 var head = (0, _util.readUint16)(data, 0); 13314 if (head === 0xFF4F) { 13315 this.parseCodestream(data, 0, data.length); 13316 return; 13317 } 13318 var position = 0, 13319 length = data.length; 13320 while (position < length) { 13321 var headerSize = 8; 13322 var lbox = (0, _util.readUint32)(data, position); 13323 var tbox = (0, _util.readUint32)(data, position + 4); 13324 position += headerSize; 13325 if (lbox === 1) { 13326 lbox = (0, _util.readUint32)(data, position) * 4294967296 + (0, _util.readUint32)(data, position + 4); 13327 position += 8; 13328 headerSize += 8; 13329 } 13330 if (lbox === 0) { 13331 lbox = length - position + headerSize; 13332 } 13333 if (lbox < headerSize) { 13334 throw new JpxError('Invalid box field size'); 13335 } 13336 var dataLength = lbox - headerSize; 13337 var jumpDataLength = true; 13338 switch (tbox) { 13339 case 0x6A703268: 13340 jumpDataLength = false; 13341 break; 13342 case 0x636F6C72: 13343 var method = data[position]; 13344 if (method === 1) { 13345 var colorspace = (0, _util.readUint32)(data, position + 3); 13346 switch (colorspace) { 13347 case 16: 13348 case 17: 13349 case 18: 13350 break; 13351 default: 13352 (0, _util.warn)('Unknown colorspace ' + colorspace); 13353 break; 13354 } 13355 } else if (method === 2) { 13356 (0, _util.info)('ICC profile not supported'); 13357 } 13358 break; 13359 case 0x6A703263: 13360 this.parseCodestream(data, position, position + dataLength); 13361 break; 13362 case 0x6A502020: 13363 if ((0, _util.readUint32)(data, position) !== 0x0d0a870a) { 13364 (0, _util.warn)('Invalid JP2 signature'); 13365 } 13366 break; 13367 case 0x6A501A1A: 13368 case 0x66747970: 13369 case 0x72726571: 13370 case 0x72657320: 13371 case 0x69686472: 13372 break; 13373 default: 13374 var headerType = String.fromCharCode(tbox >> 24 & 0xFF, tbox >> 16 & 0xFF, tbox >> 8 & 0xFF, tbox & 0xFF); 13375 (0, _util.warn)('Unsupported header type ' + tbox + ' (' + headerType + ')'); 13376 break; 13377 } 13378 if (jumpDataLength) { 13379 position += dataLength; 13380 } 13381 } 13382 }, 13383 parseImageProperties: function JpxImage_parseImageProperties(stream) { 13384 var newByte = stream.getByte(); 13385 while (newByte >= 0) { 13386 var oldByte = newByte; 13387 newByte = stream.getByte(); 13388 var code = oldByte << 8 | newByte; 13389 if (code === 0xFF51) { 13390 stream.skip(4); 13391 var Xsiz = stream.getInt32() >>> 0; 13392 var Ysiz = stream.getInt32() >>> 0; 13393 var XOsiz = stream.getInt32() >>> 0; 13394 var YOsiz = stream.getInt32() >>> 0; 13395 stream.skip(16); 13396 var Csiz = stream.getUint16(); 13397 this.width = Xsiz - XOsiz; 13398 this.height = Ysiz - YOsiz; 13399 this.componentsCount = Csiz; 13400 this.bitsPerComponent = 8; 13401 return; 13402 } 13403 } 13404 throw new JpxError('No size marker found in JPX stream'); 13405 }, 13406 parseCodestream: function JpxImage_parseCodestream(data, start, end) { 13407 var context = {}; 13408 var doNotRecover = false;
vendor: 8,446 bytes, lines 13409-13623
13409 try { 13410 var position = start; 13411 while (position + 1 < end) { 13412 var code = (0, _util.readUint16)(data, position); 13413 position += 2; 13414 var length = 0, 13415 j, 13416 sqcd, 13417 spqcds, 13418 spqcdSize, 13419 scalarExpounded, 13420 tile; 13421 switch (code) { 13422 case 0xFF4F: 13423 context.mainHeader = true; 13424 break; 13425 case 0xFFD9: 13426 break; 13427 case 0xFF51: 13428 length = (0, _util.readUint16)(data, position); 13429 var siz = {}; 13430 siz.Xsiz = (0, _util.readUint32)(data, position + 4); 13431 siz.Ysiz = (0, _util.readUint32)(data, position + 8); 13432 siz.XOsiz = (0, _util.readUint32)(data, position + 12); 13433 siz.YOsiz = (0, _util.readUint32)(data, position + 16); 13434 siz.XTsiz = (0, _util.readUint32)(data, position + 20); 13435 siz.YTsiz = (0, _util.readUint32)(data, position + 24); 13436 siz.XTOsiz = (0, _util.readUint32)(data, position + 28); 13437 siz.YTOsiz = (0, _util.readUint32)(data, position + 32); 13438 var componentsCount = (0, _util.readUint16)(data, position + 36); 13439 siz.Csiz = componentsCount; 13440 var components = []; 13441 j = position + 38; 13442 for (var i = 0; i < componentsCount; i++) { 13443 var component = { 13444 precision: (data[j] & 0x7F) + 1, 13445 isSigned: !!(data[j] & 0x80), 13446 XRsiz: data[j + 1], 13447 YRsiz: data[j + 1] 13448 }; 13449 calculateComponentDimensions(component, siz); 13450 components.push(component); 13451 } 13452 context.SIZ = siz; 13453 context.components = components; 13454 calculateTileGrids(context, components); 13455 context.QCC = []; 13456 context.COC = []; 13457 break; 13458 case 0xFF5C: 13459 length = (0, _util.readUint16)(data, position); 13460 var qcd = {}; 13461 j = position + 2; 13462 sqcd = data[j++]; 13463 switch (sqcd & 0x1F) { 13464 case 0: 13465 spqcdSize = 8; 13466 scalarExpounded = true; 13467 break; 13468 case 1: 13469 spqcdSize = 16; 13470 scalarExpounded = false; 13471 break; 13472 case 2: 13473 spqcdSize = 16; 13474 scalarExpounded = true; 13475 break; 13476 default: 13477 throw new Error('Invalid SQcd value ' + sqcd); 13478 } 13479 qcd.noQuantization = spqcdSize === 8; 13480 qcd.scalarExpounded = scalarExpounded; 13481 qcd.guardBits = sqcd >> 5; 13482 spqcds = []; 13483 while (j < length + position) { 13484 var spqcd = {}; 13485 if (spqcdSize === 8) { 13486 spqcd.epsilon = data[j++] >> 3; 13487 spqcd.mu = 0; 13488 } else { 13489 spqcd.epsilon = data[j] >> 3; 13490 spqcd.mu = (data[j] & 0x7) << 8 | data[j + 1]; 13491 j += 2; 13492 } 13493 spqcds.push(spqcd); 13494 } 13495 qcd.SPqcds = spqcds; 13496 if (context.mainHeader) { 13497 context.QCD = qcd; 13498 } else { 13499 context.currentTile.QCD = qcd; 13500 context.currentTile.QCC = []; 13501 } 13502 break; 13503 case 0xFF5D: 13504 length = (0, _util.readUint16)(data, position); 13505 var qcc = {}; 13506 j = position + 2; 13507 var cqcc; 13508 if (context.SIZ.Csiz < 257) { 13509 cqcc = data[j++]; 13510 } else { 13511 cqcc = (0, _util.readUint16)(data, j); 13512 j += 2; 13513 } 13514 sqcd = data[j++]; 13515 switch (sqcd & 0x1F) { 13516 case 0: 13517 spqcdSize = 8; 13518 scalarExpounded = true; 13519 break; 13520 case 1: 13521 spqcdSize = 16; 13522 scalarExpounded = false; 13523 break; 13524 case 2: 13525 spqcdSize = 16; 13526 scalarExpounded = true; 13527 break; 13528 default: 13529 throw new Error('Invalid SQcd value ' + sqcd); 13530 } 13531 qcc.noQuantization = spqcdSize === 8; 13532 qcc.scalarExpounded = scalarExpounded; 13533 qcc.guardBits = sqcd >> 5; 13534 spqcds = []; 13535 while (j < length + position) { 13536 spqcd = {}; 13537 if (spqcdSize === 8) { 13538 spqcd.epsilon = data[j++] >> 3; 13539 spqcd.mu = 0; 13540 } else { 13541 spqcd.epsilon = data[j] >> 3; 13542 spqcd.mu = (data[j] & 0x7) << 8 | data[j + 1]; 13543 j += 2; 13544 } 13545 spqcds.push(spqcd); 13546 } 13547 qcc.SPqcds = spqcds; 13548 if (context.mainHeader) { 13549 context.QCC[cqcc] = qcc; 13550 } else { 13551 context.currentTile.QCC[cqcc] = qcc; 13552 } 13553 break; 13554 case 0xFF52: 13555 length = (0, _util.readUint16)(data, position); 13556 var cod = {}; 13557 j = position + 2; 13558 var scod = data[j++]; 13559 cod.entropyCoderWithCustomPrecincts = !!(scod & 1); 13560 cod.sopMarkerUsed = !!(scod & 2); 13561 cod.ephMarkerUsed = !!(scod & 4); 13562 cod.progressionOrder = data[j++]; 13563 cod.layersCount = (0, _util.readUint16)(data, j); 13564 j += 2; 13565 cod.multipleComponentTransform = data[j++]; 13566 cod.decompositionLevelsCount = data[j++]; 13567 cod.xcb = (data[j++] & 0xF) + 2; 13568 cod.ycb = (data[j++] & 0xF) + 2; 13569 var blockStyle = data[j++]; 13570 cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1); 13571 cod.resetContextProbabilities = !!(blockStyle & 2); 13572 cod.terminationOnEachCodingPass = !!(blockStyle & 4); 13573 cod.verticalyStripe = !!(blockStyle & 8); 13574 cod.predictableTermination = !!(blockStyle & 16); 13575 cod.segmentationSymbolUsed = !!(blockStyle & 32); 13576 cod.reversibleTransformation = data[j++]; 13577 if (cod.entropyCoderWithCustomPrecincts) { 13578 var precinctsSizes = []; 13579 while (j < length + position) { 13580 var precinctsSize = data[j++]; 13581 precinctsSizes.push({ 13582 PPx: precinctsSize & 0xF, 13583 PPy: precinctsSize >> 4 13584 }); 13585 } 13586 cod.precinctsSizes = precinctsSizes; 13587 } 13588 var unsupported = []; 13589 if (cod.selectiveArithmeticCodingBypass) { 13590 unsupported.push('selectiveArithmeticCodingBypass'); 13591 } 13592 if (cod.resetContextProbabilities) { 13593 unsupported.push('resetContextProbabilities'); 13594 } 13595 if (cod.terminationOnEachCodingPass) { 13596 unsupported.push('terminationOnEachCodingPass'); 13597 } 13598 if (cod.verticalyStripe) { 13599 unsupported.push('verticalyStripe'); 13600 } 13601 if (cod.predictableTermination) { 13602 unsupported.push('predictableTermination'); 13603 } 13604 if (unsupported.length > 0) { 13605 doNotRecover = true; 13606 throw new Error('Unsupported COD options (' + unsupported.join(', ') + ')'); 13607 } 13608 if (context.mainHeader) { 13609 context.COD = cod; 13610 } else { 13611 context.currentTile.COD = cod; 13612 context.currentTile.COC = []; 13613 } 13614 break; 13615 case 0xFF90: 13616 length = (0, _util.readUint16)(data, position); 13617 tile = {}; 13618 tile.index = (0, _util.readUint16)(data, position + 2); 13619 tile.length = (0, _util.readUint32)(data, position + 4); 13620 tile.dataEnd = tile.length + position - 2; 13621 tile.partIndex = data[position + 8]; 13622 tile.partsCount = data[position + 9]; 13623 context.mainHeader = false;
vendor: 7,159 bytes, lines 13624-13790
13624 if (tile.partIndex === 0) { 13625 tile.COD = context.COD; 13626 tile.COC = context.COC.slice(0); 13627 tile.QCD = context.QCD; 13628 tile.QCC = context.QCC.slice(0); 13629 } 13630 context.currentTile = tile; 13631 break; 13632 case 0xFF93: 13633 tile = context.currentTile; 13634 if (tile.partIndex === 0) { 13635 initializeTile(context, tile.index); 13636 buildPackets(context); 13637 } 13638 length = tile.dataEnd - position; 13639 parseTilePackets(context, data, position, length); 13640 break; 13641 case 0xFF55: 13642 case 0xFF57: 13643 case 0xFF58: 13644 case 0xFF64: 13645 length = (0, _util.readUint16)(data, position); 13646 break; 13647 case 0xFF53: 13648 throw new Error('Codestream code 0xFF53 (COC) is ' + 'not implemented'); 13649 default: 13650 throw new Error('Unknown codestream code: ' + code.toString(16)); 13651 } 13652 position += length; 13653 } 13654 } catch (e) { 13655 if (doNotRecover || this.failOnCorruptedImage) { 13656 throw new JpxError(e.message); 13657 } else { 13658 (0, _util.warn)('JPX: Trying to recover from: ' + e.message); 13659 } 13660 } 13661 this.tiles = transformComponents(context); 13662 this.width = context.SIZ.Xsiz - context.SIZ.XOsiz; 13663 this.height = context.SIZ.Ysiz - context.SIZ.YOsiz; 13664 this.componentsCount = context.SIZ.Csiz; 13665 } 13666 }; 13667 function calculateComponentDimensions(component, siz) { 13668 component.x0 = Math.ceil(siz.XOsiz / component.XRsiz); 13669 component.x1 = Math.ceil(siz.Xsiz / component.XRsiz); 13670 component.y0 = Math.ceil(siz.YOsiz / component.YRsiz); 13671 component.y1 = Math.ceil(siz.Ysiz / component.YRsiz); 13672 component.width = component.x1 - component.x0; 13673 component.height = component.y1 - component.y0; 13674 } 13675 function calculateTileGrids(context, components) { 13676 var siz = context.SIZ; 13677 var tile, 13678 tiles = []; 13679 var numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz); 13680 var numYtiles = Math.ceil((siz.Ysiz - siz.YTOsiz) / siz.YTsiz); 13681 for (var q = 0; q < numYtiles; q++) { 13682 for (var p = 0; p < numXtiles; p++) { 13683 tile = {}; 13684 tile.tx0 = Math.max(siz.XTOsiz + p * siz.XTsiz, siz.XOsiz); 13685 tile.ty0 = Math.max(siz.YTOsiz + q * siz.YTsiz, siz.YOsiz); 13686 tile.tx1 = Math.min(siz.XTOsiz + (p + 1) * siz.XTsiz, siz.Xsiz); 13687 tile.ty1 = Math.min(siz.YTOsiz + (q + 1) * siz.YTsiz, siz.Ysiz); 13688 tile.width = tile.tx1 - tile.tx0; 13689 tile.height = tile.ty1 - tile.ty0; 13690 tile.components = []; 13691 tiles.push(tile); 13692 } 13693 } 13694 context.tiles = tiles; 13695 var componentsCount = siz.Csiz; 13696 for (var i = 0, ii = componentsCount; i < ii; i++) { 13697 var component = components[i]; 13698 for (var j = 0, jj = tiles.length; j < jj; j++) { 13699 var tileComponent = {}; 13700 tile = tiles[j]; 13701 tileComponent.tcx0 = Math.ceil(tile.tx0 / component.XRsiz); 13702 tileComponent.tcy0 = Math.ceil(tile.ty0 / component.YRsiz); 13703 tileComponent.tcx1 = Math.ceil(tile.tx1 / component.XRsiz); 13704 tileComponent.tcy1 = Math.ceil(tile.ty1 / component.YRsiz); 13705 tileComponent.width = tileComponent.tcx1 - tileComponent.tcx0; 13706 tileComponent.height = tileComponent.tcy1 - tileComponent.tcy0; 13707 tile.components[i] = tileComponent; 13708 } 13709 } 13710 } 13711 function getBlocksDimensions(context, component, r) { 13712 var codOrCoc = component.codingStyleParameters; 13713 var result = {}; 13714 if (!codOrCoc.entropyCoderWithCustomPrecincts) { 13715 result.PPx = 15; 13716 result.PPy = 15; 13717 } else { 13718 result.PPx = codOrCoc.precinctsSizes[r].PPx; 13719 result.PPy = codOrCoc.precinctsSizes[r].PPy; 13720 } 13721 result.xcb_ = r > 0 ? Math.min(codOrCoc.xcb, result.PPx - 1) : Math.min(codOrCoc.xcb, result.PPx); 13722 result.ycb_ = r > 0 ? Math.min(codOrCoc.ycb, result.PPy - 1) : Math.min(codOrCoc.ycb, result.PPy); 13723 return result; 13724 } 13725 function buildPrecincts(context, resolution, dimensions) { 13726 var precinctWidth = 1 << dimensions.PPx; 13727 var precinctHeight = 1 << dimensions.PPy; 13728 var isZeroRes = resolution.resLevel === 0; 13729 var precinctWidthInSubband = 1 << dimensions.PPx + (isZeroRes ? 0 : -1); 13730 var precinctHeightInSubband = 1 << dimensions.PPy + (isZeroRes ? 0 : -1); 13731 var numprecinctswide = resolution.trx1 > resolution.trx0 ? Math.ceil(resolution.trx1 / precinctWidth) - Math.floor(resolution.trx0 / precinctWidth) : 0; 13732 var numprecinctshigh = resolution.try1 > resolution.try0 ? Math.ceil(resolution.try1 / precinctHeight) - Math.floor(resolution.try0 / precinctHeight) : 0; 13733 var numprecincts = numprecinctswide * numprecinctshigh; 13734 resolution.precinctParameters = { 13735 precinctWidth: precinctWidth, 13736 precinctHeight: precinctHeight, 13737 numprecinctswide: numprecinctswide, 13738 numprecinctshigh: numprecinctshigh, 13739 numprecincts: numprecincts, 13740 precinctWidthInSubband: precinctWidthInSubband, 13741 precinctHeightInSubband: precinctHeightInSubband 13742 }; 13743 } 13744 function buildCodeblocks(context, subband, dimensions) { 13745 var xcb_ = dimensions.xcb_; 13746 var ycb_ = dimensions.ycb_; 13747 var codeblockWidth = 1 << xcb_; 13748 var codeblockHeight = 1 << ycb_; 13749 var cbx0 = subband.tbx0 >> xcb_; 13750 var cby0 = subband.tby0 >> ycb_; 13751 var cbx1 = subband.tbx1 + codeblockWidth - 1 >> xcb_; 13752 var cby1 = subband.tby1 + codeblockHeight - 1 >> ycb_; 13753 var precinctParameters = subband.resolution.precinctParameters; 13754 var codeblocks = []; 13755 var precincts = []; 13756 var i, j, codeblock, precinctNumber; 13757 for (j = cby0; j < cby1; j++) { 13758 for (i = cbx0; i < cbx1; i++) { 13759 codeblock = { 13760 cbx: i, 13761 cby: j, 13762 tbx0: codeblockWidth * i, 13763 tby0: codeblockHeight * j, 13764 tbx1: codeblockWidth * (i + 1), 13765 tby1: codeblockHeight * (j + 1) 13766 }; 13767 codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0); 13768 codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0); 13769 codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1); 13770 codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1); 13771 var pi = Math.floor((codeblock.tbx0_ - subband.tbx0) / precinctParameters.precinctWidthInSubband); 13772 var pj = Math.floor((codeblock.tby0_ - subband.tby0) / precinctParameters.precinctHeightInSubband); 13773 precinctNumber = pi + pj * precinctParameters.numprecinctswide; 13774 codeblock.precinctNumber = precinctNumber; 13775 codeblock.subbandType = subband.type; 13776 codeblock.Lblock = 3; 13777 if (codeblock.tbx1_ <= codeblock.tbx0_ || codeblock.tby1_ <= codeblock.tby0_) { 13778 continue; 13779 } 13780 codeblocks.push(codeblock); 13781 var precinct = precincts[precinctNumber]; 13782 if (precinct !== undefined) { 13783 if (i < precinct.cbxMin) { 13784 precinct.cbxMin = i; 13785 } else if (i > precinct.cbxMax) { 13786 precinct.cbxMax = i; 13787 } 13788 if (j < precinct.cbyMin) { 13789 precinct.cbxMin = j; 13790 } else if (j >
vendor: 25,242 bytes, lines 13790-14464
13790 precinct.cbyMax) { 13791 precinct.cbyMax = j; 13792 } 13793 } else { 13794 precincts[precinctNumber] = precinct = { 13795 cbxMin: i, 13796 cbyMin: j, 13797 cbxMax: i, 13798 cbyMax: j 13799 }; 13800 } 13801 codeblock.precinct = precinct; 13802 } 13803 } 13804 subband.codeblockParameters = { 13805 codeblockWidth: xcb_, 13806 codeblockHeight: ycb_, 13807 numcodeblockwide: cbx1 - cbx0 + 1, 13808 numcodeblockhigh: cby1 - cby0 + 1 13809 }; 13810 subband.codeblocks = codeblocks; 13811 subband.precincts = precincts; 13812 } 13813 function createPacket(resolution, precinctNumber, layerNumber) { 13814 var precinctCodeblocks = []; 13815 var subbands = resolution.subbands; 13816 for (var i = 0, ii = subbands.length; i < ii; i++) { 13817 var subband = subbands[i]; 13818 var codeblocks = subband.codeblocks; 13819 for (var j = 0, jj = codeblocks.length; j < jj; j++) { 13820 var codeblock = codeblocks[j]; 13821 if (codeblock.precinctNumber !== precinctNumber) { 13822 continue; 13823 } 13824 precinctCodeblocks.push(codeblock); 13825 } 13826 } 13827 return { 13828 layerNumber: layerNumber, 13829 codeblocks: precinctCodeblocks 13830 }; 13831 } 13832 function LayerResolutionComponentPositionIterator(context) { 13833 var siz = context.SIZ; 13834 var tileIndex = context.currentTile.index; 13835 var tile = context.tiles[tileIndex]; 13836 var layersCount = tile.codingStyleDefaultParameters.layersCount; 13837 var componentsCount = siz.Csiz; 13838 var maxDecompositionLevelsCount = 0; 13839 for (var q = 0; q < componentsCount; q++) { 13840 maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, tile.components[q].codingStyleParameters.decompositionLevelsCount); 13841 } 13842 var l = 0, 13843 r = 0, 13844 i = 0, 13845 k = 0; 13846 this.nextPacket = function JpxImage_nextPacket() { 13847 for (; l < layersCount; l++) { 13848 for (; r <= maxDecompositionLevelsCount; r++) { 13849 for (; i < componentsCount; i++) { 13850 var component = tile.components[i]; 13851 if (r > component.codingStyleParameters.decompositionLevelsCount) { 13852 continue; 13853 } 13854 var resolution = component.resolutions[r]; 13855 var numprecincts = resolution.precinctParameters.numprecincts; 13856 for (; k < numprecincts;) { 13857 var packet = createPacket(resolution, k, l); 13858 k++; 13859 return packet; 13860 } 13861 k = 0; 13862 } 13863 i = 0; 13864 } 13865 r = 0; 13866 } 13867 throw new JpxError('Out of packets'); 13868 }; 13869 } 13870 function ResolutionLayerComponentPositionIterator(context) { 13871 var siz = context.SIZ; 13872 var tileIndex = context.currentTile.index; 13873 var tile = context.tiles[tileIndex]; 13874 var layersCount = tile.codingStyleDefaultParameters.layersCount; 13875 var componentsCount = siz.Csiz; 13876 var maxDecompositionLevelsCount = 0; 13877 for (var q = 0; q < componentsCount; q++) { 13878 maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, tile.components[q].codingStyleParameters.decompositionLevelsCount); 13879 } 13880 var r = 0, 13881 l = 0, 13882 i = 0, 13883 k = 0; 13884 this.nextPacket = function JpxImage_nextPacket() { 13885 for (; r <= maxDecompositionLevelsCount; r++) { 13886 for (; l < layersCount; l++) { 13887 for (; i < componentsCount; i++) { 13888 var component = tile.components[i]; 13889 if (r > component.codingStyleParameters.decompositionLevelsCount) { 13890 continue; 13891 } 13892 var resolution = component.resolutions[r]; 13893 var numprecincts = resolution.precinctParameters.numprecincts; 13894 for (; k < numprecincts;) { 13895 var packet = createPacket(resolution, k, l); 13896 k++; 13897 return packet; 13898 } 13899 k = 0; 13900 } 13901 i = 0; 13902 } 13903 l = 0; 13904 } 13905 throw new JpxError('Out of packets'); 13906 }; 13907 } 13908 function ResolutionPositionComponentLayerIterator(context) { 13909 var siz = context.SIZ; 13910 var tileIndex = context.currentTile.index; 13911 var tile = context.tiles[tileIndex]; 13912 var layersCount = tile.codingStyleDefaultParameters.layersCount; 13913 var componentsCount = siz.Csiz; 13914 var l, r, c, p; 13915 var maxDecompositionLevelsCount = 0; 13916 for (c = 0; c < componentsCount; c++) { 13917 var component = tile.components[c]; 13918 maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, component.codingStyleParameters.decompositionLevelsCount); 13919 } 13920 var maxNumPrecinctsInLevel = new Int32Array(maxDecompositionLevelsCount + 1); 13921 for (r = 0; r <= maxDecompositionLevelsCount; ++r) { 13922 var maxNumPrecincts = 0; 13923 for (c = 0; c < componentsCount; ++c) { 13924 var resolutions = tile.components[c].resolutions; 13925 if (r < resolutions.length) { 13926 maxNumPrecincts = Math.max(maxNumPrecincts, resolutions[r].precinctParameters.numprecincts); 13927 } 13928 } 13929 maxNumPrecinctsInLevel[r] = maxNumPrecincts; 13930 } 13931 l = 0; 13932 r = 0; 13933 c = 0; 13934 p = 0; 13935 this.nextPacket = function JpxImage_nextPacket() { 13936 for (; r <= maxDecompositionLevelsCount; r++) { 13937 for (; p < maxNumPrecinctsInLevel[r]; p++) { 13938 for (; c < componentsCount; c++) { 13939 var component = tile.components[c]; 13940 if (r > component.codingStyleParameters.decompositionLevelsCount) { 13941 continue; 13942 } 13943 var resolution = component.resolutions[r]; 13944 var numprecincts = resolution.precinctParameters.numprecincts; 13945 if (p >= numprecincts) { 13946 continue; 13947 } 13948 for (; l < layersCount;) { 13949 var packet = createPacket(resolution, p, l); 13950 l++; 13951 return packet; 13952 } 13953 l = 0; 13954 } 13955 c = 0; 13956 } 13957 p = 0; 13958 } 13959 throw new JpxError('Out of packets'); 13960 }; 13961 } 13962 function PositionComponentResolutionLayerIterator(context) { 13963 var siz = context.SIZ; 13964 var tileIndex = context.currentTile.index; 13965 var tile = context.tiles[tileIndex]; 13966 var layersCount = tile.codingStyleDefaultParameters.layersCount; 13967 var componentsCount = siz.Csiz; 13968 var precinctsSizes = getPrecinctSizesInImageScale(tile); 13969 var precinctsIterationSizes = precinctsSizes; 13970 var l = 0, 13971 r = 0, 13972 c = 0, 13973 px = 0, 13974 py = 0; 13975 this.nextPacket = function JpxImage_nextPacket() { 13976 for (; py < precinctsIterationSizes.maxNumHigh; py++) { 13977 for (; px < precinctsIterationSizes.maxNumWide; px++) { 13978 for (; c < componentsCount; c++) { 13979 var component = tile.components[c]; 13980 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 13981 for (; r <= decompositionLevelsCount; r++) { 13982 var resolution = component.resolutions[r]; 13983 var sizeInImageScale = precinctsSizes.components[c].resolutions[r]; 13984 var k = getPrecinctIndexIfExist(px, py, sizeInImageScale, precinctsIterationSizes, resolution); 13985 if (k === null) { 13986 continue; 13987 } 13988 for (; l < layersCount;) { 13989 var packet = createPacket(resolution, k, l); 13990 l++; 13991 return packet; 13992 } 13993 l = 0; 13994 } 13995 r = 0; 13996 } 13997 c = 0; 13998 } 13999 px = 0; 14000 } 14001 throw new JpxError('Out of packets'); 14002 }; 14003 } 14004 function ComponentPositionResolutionLayerIterator(context) { 14005 var siz = context.SIZ; 14006 var tileIndex = context.currentTile.index; 14007 var tile = context.tiles[tileIndex]; 14008 var layersCount = tile.codingStyleDefaultParameters.layersCount; 14009 var componentsCount = siz.Csiz; 14010 var precinctsSizes = getPrecinctSizesInImageScale(tile); 14011 var l = 0, 14012 r = 0, 14013 c = 0, 14014 px = 0, 14015 py = 0; 14016 this.nextPacket = function JpxImage_nextPacket() { 14017 for (; c < componentsCount; ++c) { 14018 var component = tile.components[c]; 14019 var precinctsIterationSizes = precinctsSizes.components[c]; 14020 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 14021 for (; py < precinctsIterationSizes.maxNumHigh; py++) { 14022 for (; px < precinctsIterationSizes.maxNumWide; px++) { 14023 for (; r <= decompositionLevelsCount; r++) { 14024 var resolution = component.resolutions[r]; 14025 var sizeInImageScale = precinctsIterationSizes.resolutions[r]; 14026 var k = getPrecinctIndexIfExist(px, py, sizeInImageScale, precinctsIterationSizes, resolution); 14027 if (k === null) { 14028 continue; 14029 } 14030 for (; l < layersCount;) { 14031 var packet = createPacket(resolution, k, l); 14032 l++; 14033 return packet; 14034 } 14035 l = 0; 14036 } 14037 r = 0; 14038 } 14039 px = 0; 14040 } 14041 py = 0; 14042 } 14043 throw new JpxError('Out of packets'); 14044 }; 14045 } 14046 function getPrecinctIndexIfExist(pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) { 14047 var posX = pxIndex * precinctIterationSizes.minWidth; 14048 var posY = pyIndex * precinctIterationSizes.minHeight; 14049 if (posX % sizeInImageScale.width !== 0 || posY % sizeInImageScale.height !== 0) { 14050 return null; 14051 } 14052 var startPrecinctRowIndex = posY / sizeInImageScale.width * resolution.precinctParameters.numprecinctswide; 14053 return posX / sizeInImageScale.height + startPrecinctRowIndex; 14054 } 14055 function getPrecinctSizesInImageScale(tile) { 14056 var componentsCount = tile.components.length; 14057 var minWidth = Number.MAX_VALUE; 14058 var minHeight = Number.MAX_VALUE; 14059 var maxNumWide = 0; 14060 var maxNumHigh = 0; 14061 var sizePerComponent = new Array(componentsCount); 14062 for (var c = 0; c < componentsCount; c++) { 14063 var component = tile.components[c]; 14064 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 14065 var sizePerResolution = new Array(decompositionLevelsCount + 1); 14066 var minWidthCurrentComponent = Number.MAX_VALUE; 14067 var minHeightCurrentComponent = Number.MAX_VALUE; 14068 var maxNumWideCurrentComponent = 0; 14069 var maxNumHighCurrentComponent = 0; 14070 var scale = 1; 14071 for (var r = decompositionLevelsCount; r >= 0; --r) { 14072 var resolution = component.resolutions[r]; 14073 var widthCurrentResolution = scale * resolution.precinctParameters.precinctWidth; 14074 var heightCurrentResolution = scale * resolution.precinctParameters.precinctHeight; 14075 minWidthCurrentComponent = Math.min(minWidthCurrentComponent, widthCurrentResolution); 14076 minHeightCurrentComponent = Math.min(minHeightCurrentComponent, heightCurrentResolution); 14077 maxNumWideCurrentComponent = Math.max(maxNumWideCurrentComponent, resolution.precinctParameters.numprecinctswide); 14078 maxNumHighCurrentComponent = Math.max(maxNumHighCurrentComponent, resolution.precinctParameters.numprecinctshigh); 14079 sizePerResolution[r] = { 14080 width: widthCurrentResolution, 14081 height: heightCurrentResolution 14082 }; 14083 scale <<= 1; 14084 } 14085 minWidth = Math.min(minWidth, minWidthCurrentComponent); 14086 minHeight = Math.min(minHeight, minHeightCurrentComponent); 14087 maxNumWide = Math.max(maxNumWide, maxNumWideCurrentComponent); 14088 maxNumHigh = Math.max(maxNumHigh, maxNumHighCurrentComponent); 14089 sizePerComponent[c] = { 14090 resolutions: sizePerResolution, 14091 minWidth: minWidthCurrentComponent, 14092 minHeight: minHeightCurrentComponent, 14093 maxNumWide: maxNumWideCurrentComponent, 14094 maxNumHigh: maxNumHighCurrentComponent 14095 }; 14096 } 14097 return { 14098 components: sizePerComponent, 14099 minWidth: minWidth, 14100 minHeight: minHeight, 14101 maxNumWide: maxNumWide, 14102 maxNumHigh: maxNumHigh 14103 }; 14104 } 14105 function buildPackets(context) { 14106 var siz = context.SIZ; 14107 var tileIndex = context.currentTile.index; 14108 var tile = context.tiles[tileIndex]; 14109 var componentsCount = siz.Csiz; 14110 for (var c = 0; c < componentsCount; c++) { 14111 var component = tile.components[c]; 14112 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 14113 var resolutions = []; 14114 var subbands = []; 14115 for (var r = 0; r <= decompositionLevelsCount; r++) { 14116 var blocksDimensions = getBlocksDimensions(context, component, r); 14117 var resolution = {}; 14118 var scale = 1 << decompositionLevelsCount - r; 14119 resolution.trx0 = Math.ceil(component.tcx0 / scale); 14120 resolution.try0 = Math.ceil(component.tcy0 / scale); 14121 resolution.trx1 = Math.ceil(component.tcx1 / scale); 14122 resolution.try1 = Math.ceil(component.tcy1 / scale); 14123 resolution.resLevel = r; 14124 buildPrecincts(context, resolution, blocksDimensions); 14125 resolutions.push(resolution); 14126 var subband; 14127 if (r === 0) { 14128 subband = {}; 14129 subband.type = 'LL'; 14130 subband.tbx0 = Math.ceil(component.tcx0 / scale); 14131 subband.tby0 = Math.ceil(component.tcy0 / scale); 14132 subband.tbx1 = Math.ceil(component.tcx1 / scale); 14133 subband.tby1 = Math.ceil(component.tcy1 / scale); 14134 subband.resolution = resolution; 14135 buildCodeblocks(context, subband, blocksDimensions); 14136 subbands.push(subband); 14137 resolution.subbands = [subband]; 14138 } else { 14139 var bscale = 1 << decompositionLevelsCount - r + 1; 14140 var resolutionSubbands = []; 14141 subband = {}; 14142 subband.type = 'HL'; 14143 subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); 14144 subband.tby0 = Math.ceil(component.tcy0 / bscale); 14145 subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); 14146 subband.tby1 = Math.ceil(component.tcy1 / bscale); 14147 subband.resolution = resolution; 14148 buildCodeblocks(context, subband, blocksDimensions); 14149 subbands.push(subband); 14150 resolutionSubbands.push(subband); 14151 subband = {}; 14152 subband.type = 'LH'; 14153 subband.tbx0 = Math.ceil(component.tcx0 / bscale); 14154 subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); 14155 subband.tbx1 = Math.ceil(component.tcx1 / bscale); 14156 subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); 14157 subband.resolution = resolution; 14158 buildCodeblocks(context, subband, blocksDimensions); 14159 subbands.push(subband); 14160 resolutionSubbands.push(subband); 14161 subband = {}; 14162 subband.type = 'HH'; 14163 subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); 14164 subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); 14165 subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); 14166 subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); 14167 subband.resolution = resolution; 14168 buildCodeblocks(context, subband, blocksDimensions); 14169 subbands.push(subband); 14170 resolutionSubbands.push(subband); 14171 resolution.subbands = resolutionSubbands; 14172 } 14173 } 14174 component.resolutions = resolutions; 14175 component.subbands = subbands; 14176 } 14177 var progressionOrder = tile.codingStyleDefaultParameters.progressionOrder; 14178 switch (progressionOrder) { 14179 case 0: 14180 tile.packetsIterator = new LayerResolutionComponentPositionIterator(context); 14181 break; 14182 case 1: 14183 tile.packetsIterator = new ResolutionLayerComponentPositionIterator(context); 14184 break; 14185 case 2: 14186 tile.packetsIterator = new ResolutionPositionComponentLayerIterator(context); 14187 break; 14188 case 3: 14189 tile.packetsIterator = new PositionComponentResolutionLayerIterator(context); 14190 break; 14191 case 4: 14192 tile.packetsIterator = new ComponentPositionResolutionLayerIterator(context); 14193 break; 14194 default: 14195 throw new JpxError('Unsupported progression order ' + progressionOrder); 14196 } 14197 } 14198 function parseTilePackets(context, data, offset, dataLength) { 14199 var position = 0; 14200 var buffer, 14201 bufferSize = 0, 14202 skipNextBit = false; 14203 function readBits(count) { 14204 while (bufferSize < count) { 14205 var b = data[offset + position]; 14206 position++; 14207 if (skipNextBit) { 14208 buffer = buffer << 7 | b; 14209 bufferSize += 7; 14210 skipNextBit = false; 14211 } else { 14212 buffer = buffer << 8 | b; 14213 bufferSize += 8; 14214 } 14215 if (b === 0xFF) { 14216 skipNextBit = true; 14217 } 14218 } 14219 bufferSize -= count; 14220 return buffer >>> bufferSize & (1 << count) - 1; 14221 } 14222 function skipMarkerIfEqual(value) { 14223 if (data[offset + position - 1] === 0xFF && data[offset + position] === value) { 14224 skipBytes(1); 14225 return true; 14226 } else if (data[offset + position] === 0xFF && data[offset + position + 1] === value) { 14227 skipBytes(2); 14228 return true; 14229 } 14230 return false; 14231 } 14232 function skipBytes(count) { 14233 position += count; 14234 } 14235 function alignToByte() { 14236 bufferSize = 0; 14237 if (skipNextBit) { 14238 position++; 14239 skipNextBit = false; 14240 } 14241 } 14242 function readCodingpasses() { 14243 if (readBits(1) === 0) { 14244 return 1; 14245 } 14246 if (readBits(1) === 0) { 14247 return 2; 14248 } 14249 var value = readBits(2); 14250 if (value < 3) { 14251 return value + 3; 14252 } 14253 value = readBits(5); 14254 if (value < 31) { 14255 return value + 6; 14256 } 14257 value = readBits(7); 14258 return value + 37; 14259 } 14260 var tileIndex = context.currentTile.index; 14261 var tile = context.tiles[tileIndex]; 14262 var sopMarkerUsed = context.COD.sopMarkerUsed; 14263 var ephMarkerUsed = context.COD.ephMarkerUsed; 14264 var packetsIterator = tile.packetsIterator; 14265 while (position < dataLength) { 14266 alignToByte(); 14267 if (sopMarkerUsed && skipMarkerIfEqual(0x91)) { 14268 skipBytes(4); 14269 } 14270 var packet = packetsIterator.nextPacket(); 14271 if (!readBits(1)) { 14272 continue; 14273 } 14274 var layerNumber = packet.layerNumber; 14275 var queue = [], 14276 codeblock; 14277 for (var i = 0, ii = packet.codeblocks.length; i < ii; i++) { 14278 codeblock = packet.codeblocks[i]; 14279 var precinct = codeblock.precinct; 14280 var codeblockColumn = codeblock.cbx - precinct.cbxMin; 14281 var codeblockRow = codeblock.cby - precinct.cbyMin; 14282 var codeblockIncluded = false; 14283 var firstTimeInclusion = false; 14284 var valueReady; 14285 if (codeblock['included'] !== undefined) { 14286 codeblockIncluded = !!readBits(1); 14287 } else { 14288 precinct = codeblock.precinct; 14289 var inclusionTree, zeroBitPlanesTree; 14290 if (precinct['inclusionTree'] !== undefined) { 14291 inclusionTree = precinct.inclusionTree; 14292 } else { 14293 var width = precinct.cbxMax - precinct.cbxMin + 1; 14294 var height = precinct.cbyMax - precinct.cbyMin + 1; 14295 inclusionTree = new InclusionTree(width, height, layerNumber); 14296 zeroBitPlanesTree = new TagTree(width, height); 14297 precinct.inclusionTree = inclusionTree; 14298 precinct.zeroBitPlanesTree = zeroBitPlanesTree; 14299 } 14300 if (inclusionTree.reset(codeblockColumn, codeblockRow, layerNumber)) { 14301 while (true) { 14302 if (readBits(1)) { 14303 valueReady = !inclusionTree.nextLevel(); 14304 if (valueReady) { 14305 codeblock.included = true; 14306 codeblockIncluded = firstTimeInclusion = true; 14307 break; 14308 } 14309 } else { 14310 inclusionTree.incrementValue(layerNumber); 14311 break; 14312 } 14313 } 14314 } 14315 } 14316 if (!codeblockIncluded) { 14317 continue; 14318 } 14319 if (firstTimeInclusion) { 14320 zeroBitPlanesTree = precinct.zeroBitPlanesTree; 14321 zeroBitPlanesTree.reset(codeblockColumn, codeblockRow); 14322 while (true) { 14323 if (readBits(1)) { 14324 valueReady = !zeroBitPlanesTree.nextLevel(); 14325 if (valueReady) { 14326 break; 14327 } 14328 } else { 14329 zeroBitPlanesTree.incrementValue(); 14330 } 14331 } 14332 codeblock.zeroBitPlanes = zeroBitPlanesTree.value; 14333 } 14334 var codingpasses = readCodingpasses(); 14335 while (readBits(1)) { 14336 codeblock.Lblock++; 14337 } 14338 var codingpassesLog2 = (0, _util.log2)(codingpasses); 14339 var bits = (codingpasses < 1 << codingpassesLog2 ? codingpassesLog2 - 1 : codingpassesLog2) + codeblock.Lblock; 14340 var codedDataLength = readBits(bits); 14341 queue.push({ 14342 codeblock: codeblock, 14343 codingpasses: codingpasses, 14344 dataLength: codedDataLength 14345 }); 14346 } 14347 alignToByte(); 14348 if (ephMarkerUsed) { 14349 skipMarkerIfEqual(0x92); 14350 } 14351 while (queue.length > 0) { 14352 var packetItem = queue.shift(); 14353 codeblock = packetItem.codeblock; 14354 if (codeblock['data'] === undefined) { 14355 codeblock.data = []; 14356 } 14357 codeblock.data.push({ 14358 data: data, 14359 start: offset + position, 14360 end: offset + position + packetItem.dataLength, 14361 codingpasses: packetItem.codingpasses 14362 }); 14363 position += packetItem.dataLength; 14364 } 14365 } 14366 return position; 14367 } 14368 function copyCoefficients(coefficients, levelWidth, levelHeight, subband, delta, mb, reversible, segmentationSymbolUsed) { 14369 var x0 = subband.tbx0; 14370 var y0 = subband.tby0; 14371 var width = subband.tbx1 - subband.tbx0; 14372 var codeblocks = subband.codeblocks; 14373 var right = subband.type.charAt(0) === 'H' ? 1 : 0; 14374 var bottom = subband.type.charAt(1) === 'H' ? levelWidth : 0; 14375 for (var i = 0, ii = codeblocks.length; i < ii; ++i) { 14376 var codeblock = codeblocks[i]; 14377 var blockWidth = codeblock.tbx1_ - codeblock.tbx0_; 14378 var blockHeight = codeblock.tby1_ - codeblock.tby0_; 14379 if (blockWidth === 0 || blockHeight === 0) { 14380 continue; 14381 } 14382 if (codeblock['data'] === undefined) { 14383 continue; 14384 } 14385 var bitModel, currentCodingpassType; 14386 bitModel = new BitModel(blockWidth, blockHeight, codeblock.subbandType, codeblock.zeroBitPlanes, mb); 14387 currentCodingpassType = 2; 14388 var data = codeblock.data, 14389 totalLength = 0, 14390 codingpasses = 0; 14391 var j, jj, dataItem; 14392 for (j = 0, jj = data.length; j < jj; j++) { 14393 dataItem = data[j]; 14394 totalLength += dataItem.end - dataItem.start; 14395 codingpasses += dataItem.codingpasses; 14396 } 14397 var encodedData = new Uint8Array(totalLength); 14398 var position = 0; 14399 for (j = 0, jj = data.length; j < jj; j++) { 14400 dataItem = data[j]; 14401 var chunk = dataItem.data.subarray(dataItem.start, dataItem.end); 14402 encodedData.set(chunk, position); 14403 position += chunk.length; 14404 } 14405 var decoder = new _arithmetic_decoder.ArithmeticDecoder(encodedData, 0, totalLength); 14406 bitModel.setDecoder(decoder); 14407 for (j = 0; j < codingpasses; j++) { 14408 switch (currentCodingpassType) { 14409 case 0: 14410 bitModel.runSignificancePropagationPass(); 14411 break; 14412 case 1: 14413 bitModel.runMagnitudeRefinementPass(); 14414 break; 14415 case 2: 14416 bitModel.runCleanupPass(); 14417 if (segmentationSymbolUsed) { 14418 bitModel.checkSegmentationSymbol(); 14419 } 14420 break; 14421 } 14422 currentCodingpassType = (currentCodingpassType + 1) % 3; 14423 } 14424 var offset = codeblock.tbx0_ - x0 + (codeblock.tby0_ - y0) * width; 14425 var sign = bitModel.coefficentsSign; 14426 var magnitude = bitModel.coefficentsMagnitude; 14427 var bitsDecoded = bitModel.bitsDecoded; 14428 var magnitudeCorrection = reversible ? 0 : 0.5; 14429 var k, n, nb; 14430 position = 0; 14431 var interleave = subband.type !== 'LL'; 14432 for (j = 0; j < blockHeight; j++) { 14433 var row = offset / width | 0; 14434 var levelOffset = 2 * row * (levelWidth - width) + right + bottom; 14435 for (k = 0; k < blockWidth; k++) { 14436 n = magnitude[position]; 14437 if (n !== 0) { 14438 n = (n + magnitudeCorrection) * delta; 14439 if (sign[position] !== 0) { 14440 n = -n; 14441 } 14442 nb = bitsDecoded[position]; 14443 var pos = interleave ? levelOffset + (offset << 1) : offset; 14444 if (reversible && nb >= mb) { 14445 coefficients[pos] = n; 14446 } else { 14447 coefficients[pos] = n * (1 << mb - nb); 14448 } 14449 } 14450 offset++; 14451 position++; 14452 } 14453 offset += width - blockWidth; 14454 } 14455 } 14456 } 14457 function transformTile(context, tile, c) { 14458 var component = tile.components[c]; 14459 var codingStyleParameters = component.codingStyleParameters; 14460 var quantizationParameters = component.quantizationParameters; 14461 var decompositionLevelsCount = codingStyleParameters.decompositionLevelsCount; 14462 var spqcds = quantizationParameters.SPqcds; 14463 var scalarExpounded = quantizationParameters.scalarExpounded; 14464 var guardBits = quantizationParameters.guardBits;
vendor: 5,461 bytes, lines 14465-14610
14465 var segmentationSymbolUsed = codingStyleParameters.segmentationSymbolUsed; 14466 var precision = context.components[c].precision; 14467 var reversible = codingStyleParameters.reversibleTransformation; 14468 var transform = reversible ? new ReversibleTransform() : new IrreversibleTransform(); 14469 var subbandCoefficients = []; 14470 var b = 0; 14471 for (var i = 0; i <= decompositionLevelsCount; i++) { 14472 var resolution = component.resolutions[i]; 14473 var width = resolution.trx1 - resolution.trx0; 14474 var height = resolution.try1 - resolution.try0; 14475 var coefficients = new Float32Array(width * height); 14476 for (var j = 0, jj = resolution.subbands.length; j < jj; j++) { 14477 var mu, epsilon; 14478 if (!scalarExpounded) { 14479 mu = spqcds[0].mu; 14480 epsilon = spqcds[0].epsilon + (i > 0 ? 1 - i : 0); 14481 } else { 14482 mu = spqcds[b].mu; 14483 epsilon = spqcds[b].epsilon; 14484 b++; 14485 } 14486 var subband = resolution.subbands[j]; 14487 var gainLog2 = SubbandsGainLog2[subband.type]; 14488 var delta = reversible ? 1 : Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048); 14489 var mb = guardBits + epsilon - 1; 14490 copyCoefficients(coefficients, width, height, subband, delta, mb, reversible, segmentationSymbolUsed); 14491 } 14492 subbandCoefficients.push({ 14493 width: width, 14494 height: height, 14495 items: coefficients 14496 }); 14497 } 14498 var result = transform.calculate(subbandCoefficients, component.tcx0, component.tcy0); 14499 return { 14500 left: component.tcx0, 14501 top: component.tcy0, 14502 width: result.width, 14503 height: result.height, 14504 items: result.items 14505 }; 14506 } 14507 function transformComponents(context) { 14508 var siz = context.SIZ; 14509 var components = context.components; 14510 var componentsCount = siz.Csiz; 14511 var resultImages = []; 14512 for (var i = 0, ii = context.tiles.length; i < ii; i++) { 14513 var tile = context.tiles[i]; 14514 var transformedTiles = []; 14515 var c; 14516 for (c = 0; c < componentsCount; c++) { 14517 transformedTiles[c] = transformTile(context, tile, c); 14518 } 14519 var tile0 = transformedTiles[0]; 14520 var out = new Uint8ClampedArray(tile0.items.length * componentsCount); 14521 var result = { 14522 left: tile0.left, 14523 top: tile0.top, 14524 width: tile0.width, 14525 height: tile0.height, 14526 items: out 14527 }; 14528 var shift, offset; 14529 var pos = 0, 14530 j, 14531 jj, 14532 y0, 14533 y1, 14534 y2; 14535 if (tile.codingStyleDefaultParameters.multipleComponentTransform) { 14536 var fourComponents = componentsCount === 4; 14537 var y0items = transformedTiles[0].items; 14538 var y1items = transformedTiles[1].items; 14539 var y2items = transformedTiles[2].items; 14540 var y3items = fourComponents ? transformedTiles[3].items : null; 14541 shift = components[0].precision - 8; 14542 offset = (128 << shift) + 0.5; 14543 var component0 = tile.components[0]; 14544 var alpha01 = componentsCount - 3; 14545 jj = y0items.length; 14546 if (!component0.codingStyleParameters.reversibleTransformation) { 14547 for (j = 0; j < jj; j++, pos += alpha01) { 14548 y0 = y0items[j] + offset; 14549 y1 = y1items[j]; 14550 y2 = y2items[j]; 14551 out[pos++] = y0 + 1.402 * y2 >> shift; 14552 out[pos++] = y0 - 0.34413 * y1 - 0.71414 * y2 >> shift; 14553 out[pos++] = y0 + 1.772 * y1 >> shift; 14554 } 14555 } else { 14556 for (j = 0; j < jj; j++, pos += alpha01) { 14557 y0 = y0items[j] + offset; 14558 y1 = y1items[j]; 14559 y2 = y2items[j]; 14560 var g = y0 - (y2 + y1 >> 2); 14561 out[pos++] = g + y2 >> shift; 14562 out[pos++] = g >> shift; 14563 out[pos++] = g + y1 >> shift; 14564 } 14565 } 14566 if (fourComponents) { 14567 for (j = 0, pos = 3; j < jj; j++, pos += 4) { 14568 out[pos] = y3items[j] + offset >> shift; 14569 } 14570 } 14571 } else { 14572 for (c = 0; c < componentsCount; c++) { 14573 var items = transformedTiles[c].items; 14574 shift = components[c].precision - 8; 14575 offset = (128 << shift) + 0.5; 14576 for (pos = c, j = 0, jj = items.length; j < jj; j++) { 14577 out[pos] = items[j] + offset >> shift; 14578 pos += componentsCount; 14579 } 14580 } 14581 } 14582 resultImages.push(result); 14583 } 14584 return resultImages; 14585 } 14586 function initializeTile(context, tileIndex) { 14587 var siz = context.SIZ; 14588 var componentsCount = siz.Csiz; 14589 var tile = context.tiles[tileIndex]; 14590 for (var c = 0; c < componentsCount; c++) { 14591 var component = tile.components[c]; 14592 var qcdOrQcc = context.currentTile.QCC[c] !== undefined ? context.currentTile.QCC[c] : context.currentTile.QCD; 14593 component.quantizationParameters = qcdOrQcc; 14594 var codOrCoc = context.currentTile.COC[c] !== undefined ? context.currentTile.COC[c] : context.currentTile.COD; 14595 component.codingStyleParameters = codOrCoc; 14596 } 14597 tile.codingStyleDefaultParameters = context.currentTile.COD; 14598 } 14599 var TagTree = function TagTreeClosure() { 14600 function TagTree(width, height) { 14601 var levelsLength = (0, _util.log2)(Math.max(width, height)) + 1; 14602 this.levels = []; 14603 for (var i = 0; i < levelsLength; i++) { 14604 var level = { 14605 width: width, 14606 height: height, 14607 items: [] 14608 }; 14609 this.levels.push(level); 14610 width = Math.ceil(width / 2);
vendor: 21,758 bytes, lines 14611-15180
14611 height = Math.ceil(height / 2); 14612 } 14613 } 14614 TagTree.prototype = { 14615 reset: function TagTree_reset(i, j) { 14616 var currentLevel = 0, 14617 value = 0, 14618 level; 14619 while (currentLevel < this.levels.length) { 14620 level = this.levels[currentLevel]; 14621 var index = i + j * level.width; 14622 if (level.items[index] !== undefined) { 14623 value = level.items[index]; 14624 break; 14625 } 14626 level.index = index; 14627 i >>= 1; 14628 j >>= 1; 14629 currentLevel++; 14630 } 14631 currentLevel--; 14632 level = this.levels[currentLevel]; 14633 level.items[level.index] = value; 14634 this.currentLevel = currentLevel; 14635 delete this.value; 14636 }, 14637 incrementValue: function TagTree_incrementValue() { 14638 var level = this.levels[this.currentLevel]; 14639 level.items[level.index]++; 14640 }, 14641 nextLevel: function TagTree_nextLevel() { 14642 var currentLevel = this.currentLevel; 14643 var level = this.levels[currentLevel]; 14644 var value = level.items[level.index]; 14645 currentLevel--; 14646 if (currentLevel < 0) { 14647 this.value = value; 14648 return false; 14649 } 14650 this.currentLevel = currentLevel; 14651 level = this.levels[currentLevel]; 14652 level.items[level.index] = value; 14653 return true; 14654 } 14655 }; 14656 return TagTree; 14657 }(); 14658 var InclusionTree = function InclusionTreeClosure() { 14659 function InclusionTree(width, height, defaultValue) { 14660 var levelsLength = (0, _util.log2)(Math.max(width, height)) + 1; 14661 this.levels = []; 14662 for (var i = 0; i < levelsLength; i++) { 14663 var items = new Uint8Array(width * height); 14664 for (var j = 0, jj = items.length; j < jj; j++) { 14665 items[j] = defaultValue; 14666 } 14667 var level = { 14668 width: width, 14669 height: height, 14670 items: items 14671 }; 14672 this.levels.push(level); 14673 width = Math.ceil(width / 2); 14674 height = Math.ceil(height / 2); 14675 } 14676 } 14677 InclusionTree.prototype = { 14678 reset: function InclusionTree_reset(i, j, stopValue) { 14679 var currentLevel = 0; 14680 while (currentLevel < this.levels.length) { 14681 var level = this.levels[currentLevel]; 14682 var index = i + j * level.width; 14683 level.index = index; 14684 var value = level.items[index]; 14685 if (value === 0xFF) { 14686 break; 14687 } 14688 if (value > stopValue) { 14689 this.currentLevel = currentLevel; 14690 this.propagateValues(); 14691 return false; 14692 } 14693 i >>= 1; 14694 j >>= 1; 14695 currentLevel++; 14696 } 14697 this.currentLevel = currentLevel - 1; 14698 return true; 14699 }, 14700 incrementValue: function InclusionTree_incrementValue(stopValue) { 14701 var level = this.levels[this.currentLevel]; 14702 level.items[level.index] = stopValue + 1; 14703 this.propagateValues(); 14704 }, 14705 propagateValues: function InclusionTree_propagateValues() { 14706 var levelIndex = this.currentLevel; 14707 var level = this.levels[levelIndex]; 14708 var currentValue = level.items[level.index]; 14709 while (--levelIndex >= 0) { 14710 level = this.levels[levelIndex]; 14711 level.items[level.index] = currentValue; 14712 } 14713 }, 14714 nextLevel: function InclusionTree_nextLevel() { 14715 var currentLevel = this.currentLevel; 14716 var level = this.levels[currentLevel]; 14717 var value = level.items[level.index]; 14718 level.items[level.index] = 0xFF; 14719 currentLevel--; 14720 if (currentLevel < 0) { 14721 return false; 14722 } 14723 this.currentLevel = currentLevel; 14724 level = this.levels[currentLevel]; 14725 level.items[level.index] = value; 14726 return true; 14727 } 14728 }; 14729 return InclusionTree; 14730 }(); 14731 var BitModel = function BitModelClosure() { 14732 var UNIFORM_CONTEXT = 17; 14733 var RUNLENGTH_CONTEXT = 18; 14734 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]); 14735 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]); 14736 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]); 14737 function BitModel(width, height, subband, zeroBitPlanes, mb) { 14738 this.width = width; 14739 this.height = height; 14740 this.contextLabelTable = subband === 'HH' ? HHContextLabel : subband === 'HL' ? HLContextLabel : LLAndLHContextsLabel; 14741 var coefficientCount = width * height; 14742 this.neighborsSignificance = new Uint8Array(coefficientCount); 14743 this.coefficentsSign = new Uint8Array(coefficientCount); 14744 this.coefficentsMagnitude = mb > 14 ? new Uint32Array(coefficientCount) : mb > 6 ? new Uint16Array(coefficientCount) : new Uint8Array(coefficientCount); 14745 this.processingFlags = new Uint8Array(coefficientCount); 14746 var bitsDecoded = new Uint8Array(coefficientCount); 14747 if (zeroBitPlanes !== 0) { 14748 for (var i = 0; i < coefficientCount; i++) { 14749 bitsDecoded[i] = zeroBitPlanes; 14750 } 14751 } 14752 this.bitsDecoded = bitsDecoded; 14753 this.reset(); 14754 } 14755 BitModel.prototype = { 14756 setDecoder: function BitModel_setDecoder(decoder) { 14757 this.decoder = decoder; 14758 }, 14759 reset: function BitModel_reset() { 14760 this.contexts = new Int8Array(19); 14761 this.contexts[0] = 4 << 1 | 0; 14762 this.contexts[UNIFORM_CONTEXT] = 46 << 1 | 0; 14763 this.contexts[RUNLENGTH_CONTEXT] = 3 << 1 | 0; 14764 }, 14765 setNeighborsSignificance: function BitModel_setNeighborsSignificance(row, column, index) { 14766 var neighborsSignificance = this.neighborsSignificance; 14767 var width = this.width, 14768 height = this.height; 14769 var left = column > 0; 14770 var right = column + 1 < width; 14771 var i; 14772 if (row > 0) { 14773 i = index - width; 14774 if (left) { 14775 neighborsSignificance[i - 1] += 0x10; 14776 } 14777 if (right) { 14778 neighborsSignificance[i + 1] += 0x10; 14779 } 14780 neighborsSignificance[i] += 0x04; 14781 } 14782 if (row + 1 < height) { 14783 i = index + width; 14784 if (left) { 14785 neighborsSignificance[i - 1] += 0x10; 14786 } 14787 if (right) { 14788 neighborsSignificance[i + 1] += 0x10; 14789 } 14790 neighborsSignificance[i] += 0x04; 14791 } 14792 if (left) { 14793 neighborsSignificance[index - 1] += 0x01; 14794 } 14795 if (right) { 14796 neighborsSignificance[index + 1] += 0x01; 14797 } 14798 neighborsSignificance[index] |= 0x80; 14799 }, 14800 runSignificancePropagationPass: function BitModel_runSignificancePropagationPass() { 14801 var decoder = this.decoder; 14802 var width = this.width, 14803 height = this.height; 14804 var coefficentsMagnitude = this.coefficentsMagnitude; 14805 var coefficentsSign = this.coefficentsSign; 14806 var neighborsSignificance = this.neighborsSignificance; 14807 var processingFlags = this.processingFlags; 14808 var contexts = this.contexts; 14809 var labels = this.contextLabelTable; 14810 var bitsDecoded = this.bitsDecoded; 14811 var processedInverseMask = ~1; 14812 var processedMask = 1; 14813 var firstMagnitudeBitMask = 2; 14814 for (var i0 = 0; i0 < height; i0 += 4) { 14815 for (var j = 0; j < width; j++) { 14816 var index = i0 * width + j; 14817 for (var i1 = 0; i1 < 4; i1++, index += width) { 14818 var i = i0 + i1; 14819 if (i >= height) { 14820 break; 14821 } 14822 processingFlags[index] &= processedInverseMask; 14823 if (coefficentsMagnitude[index] || !neighborsSignificance[index]) { 14824 continue; 14825 } 14826 var contextLabel = labels[neighborsSignificance[index]]; 14827 var decision = decoder.readBit(contexts, contextLabel); 14828 if (decision) { 14829 var sign = this.decodeSignBit(i, j, index); 14830 coefficentsSign[index] = sign; 14831 coefficentsMagnitude[index] = 1; 14832 this.setNeighborsSignificance(i, j, index); 14833 processingFlags[index] |= firstMagnitudeBitMask; 14834 } 14835 bitsDecoded[index]++; 14836 processingFlags[index] |= processedMask; 14837 } 14838 } 14839 } 14840 }, 14841 decodeSignBit: function BitModel_decodeSignBit(row, column, index) { 14842 var width = this.width, 14843 height = this.height; 14844 var coefficentsMagnitude = this.coefficentsMagnitude; 14845 var coefficentsSign = this.coefficentsSign; 14846 var contribution, sign0, sign1, significance1; 14847 var contextLabel, decoded; 14848 significance1 = column > 0 && coefficentsMagnitude[index - 1] !== 0; 14849 if (column + 1 < width && coefficentsMagnitude[index + 1] !== 0) { 14850 sign1 = coefficentsSign[index + 1]; 14851 if (significance1) { 14852 sign0 = coefficentsSign[index - 1]; 14853 contribution = 1 - sign1 - sign0; 14854 } else { 14855 contribution = 1 - sign1 - sign1; 14856 } 14857 } else if (significance1) { 14858 sign0 = coefficentsSign[index - 1]; 14859 contribution = 1 - sign0 - sign0; 14860 } else { 14861 contribution = 0; 14862 } 14863 var horizontalContribution = 3 * contribution; 14864 significance1 = row > 0 && coefficentsMagnitude[index - width] !== 0; 14865 if (row + 1 < height && coefficentsMagnitude[index + width] !== 0) { 14866 sign1 = coefficentsSign[index + width]; 14867 if (significance1) { 14868 sign0 = coefficentsSign[index - width]; 14869 contribution = 1 - sign1 - sign0 + horizontalContribution; 14870 } else { 14871 contribution = 1 - sign1 - sign1 + horizontalContribution; 14872 } 14873 } else if (significance1) { 14874 sign0 = coefficentsSign[index - width]; 14875 contribution = 1 - sign0 - sign0 + horizontalContribution; 14876 } else { 14877 contribution = horizontalContribution; 14878 } 14879 if (contribution >= 0) { 14880 contextLabel = 9 + contribution; 14881 decoded = this.decoder.readBit(this.contexts, contextLabel); 14882 } else { 14883 contextLabel = 9 - contribution; 14884 decoded = this.decoder.readBit(this.contexts, contextLabel) ^ 1; 14885 } 14886 return decoded; 14887 }, 14888 runMagnitudeRefinementPass: function BitModel_runMagnitudeRefinementPass() { 14889 var decoder = this.decoder; 14890 var width = this.width, 14891 height = this.height; 14892 var coefficentsMagnitude = this.coefficentsMagnitude; 14893 var neighborsSignificance = this.neighborsSignificance; 14894 var contexts = this.contexts; 14895 var bitsDecoded = this.bitsDecoded; 14896 var processingFlags = this.processingFlags; 14897 var processedMask = 1; 14898 var firstMagnitudeBitMask = 2; 14899 var length = width * height; 14900 var width4 = width * 4; 14901 for (var index0 = 0, indexNext; index0 < length; index0 = indexNext) { 14902 indexNext = Math.min(length, index0 + width4); 14903 for (var j = 0; j < width; j++) { 14904 for (var index = index0 + j; index < indexNext; index += width) { 14905 if (!coefficentsMagnitude[index] || (processingFlags[index] & processedMask) !== 0) { 14906 continue; 14907 } 14908 var contextLabel = 16; 14909 if ((processingFlags[index] & firstMagnitudeBitMask) !== 0) { 14910 processingFlags[index] ^= firstMagnitudeBitMask; 14911 var significance = neighborsSignificance[index] & 127; 14912 contextLabel = significance === 0 ? 15 : 14; 14913 } 14914 var bit = decoder.readBit(contexts, contextLabel); 14915 coefficentsMagnitude[index] = coefficentsMagnitude[index] << 1 | bit; 14916 bitsDecoded[index]++; 14917 processingFlags[index] |= processedMask; 14918 } 14919 } 14920 } 14921 }, 14922 runCleanupPass: function BitModel_runCleanupPass() { 14923 var decoder = this.decoder; 14924 var width = this.width, 14925 height = this.height; 14926 var neighborsSignificance = this.neighborsSignificance; 14927 var coefficentsMagnitude = this.coefficentsMagnitude; 14928 var coefficentsSign = this.coefficentsSign; 14929 var contexts = this.contexts; 14930 var labels = this.contextLabelTable; 14931 var bitsDecoded = this.bitsDecoded; 14932 var processingFlags = this.processingFlags; 14933 var processedMask = 1; 14934 var firstMagnitudeBitMask = 2; 14935 var oneRowDown = width; 14936 var twoRowsDown = width * 2; 14937 var threeRowsDown = width * 3; 14938 var iNext; 14939 for (var i0 = 0; i0 < height; i0 = iNext) { 14940 iNext = Math.min(i0 + 4, height); 14941 var indexBase = i0 * width; 14942 var checkAllEmpty = i0 + 3 < height; 14943 for (var j = 0; j < width; j++) { 14944 var index0 = indexBase + j; 14945 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; 14946 var i1 = 0, 14947 index = index0; 14948 var i = i0, 14949 sign; 14950 if (allEmpty) { 14951 var hasSignificantCoefficent = decoder.readBit(contexts, RUNLENGTH_CONTEXT); 14952 if (!hasSignificantCoefficent) { 14953 bitsDecoded[index0]++; 14954 bitsDecoded[index0 + oneRowDown]++; 14955 bitsDecoded[index0 + twoRowsDown]++; 14956 bitsDecoded[index0 + threeRowsDown]++; 14957 continue; 14958 } 14959 i1 = decoder.readBit(contexts, UNIFORM_CONTEXT) << 1 | decoder.readBit(contexts, UNIFORM_CONTEXT); 14960 if (i1 !== 0) { 14961 i = i0 + i1; 14962 index += i1 * width; 14963 } 14964 sign = this.decodeSignBit(i, j, index); 14965 coefficentsSign[index] = sign; 14966 coefficentsMagnitude[index] = 1; 14967 this.setNeighborsSignificance(i, j, index); 14968 processingFlags[index] |= firstMagnitudeBitMask; 14969 index = index0; 14970 for (var i2 = i0; i2 <= i; i2++, index += width) { 14971 bitsDecoded[index]++; 14972 } 14973 i1++; 14974 } 14975 for (i = i0 + i1; i < iNext; i++, index += width) { 14976 if (coefficentsMagnitude[index] || (processingFlags[index] & processedMask) !== 0) { 14977 continue; 14978 } 14979 var contextLabel = labels[neighborsSignificance[index]]; 14980 var decision = decoder.readBit(contexts, contextLabel); 14981 if (decision === 1) { 14982 sign = this.decodeSignBit(i, j, index); 14983 coefficentsSign[index] = sign; 14984 coefficentsMagnitude[index] = 1; 14985 this.setNeighborsSignificance(i, j, index); 14986 processingFlags[index] |= firstMagnitudeBitMask; 14987 } 14988 bitsDecoded[index]++; 14989 } 14990 } 14991 } 14992 }, 14993 checkSegmentationSymbol: function BitModel_checkSegmentationSymbol() { 14994 var decoder = this.decoder; 14995 var contexts = this.contexts; 14996 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); 14997 if (symbol !== 0xA) { 14998 throw new JpxError('Invalid segmentation symbol'); 14999 } 15000 } 15001 }; 15002 return BitModel; 15003 }(); 15004 var Transform = function TransformClosure() { 15005 function Transform() {} 15006 Transform.prototype.calculate = function transformCalculate(subbands, u0, v0) { 15007 var ll = subbands[0]; 15008 for (var i = 1, ii = subbands.length; i < ii; i++) { 15009 ll = this.iterate(ll, subbands[i], u0, v0); 15010 } 15011 return ll; 15012 }; 15013 Transform.prototype.extend = function extend(buffer, offset, size) { 15014 var i1 = offset - 1, 15015 j1 = offset + 1; 15016 var i2 = offset + size - 2, 15017 j2 = offset + size; 15018 buffer[i1--] = buffer[j1++]; 15019 buffer[j2++] = buffer[i2--]; 15020 buffer[i1--] = buffer[j1++]; 15021 buffer[j2++] = buffer[i2--]; 15022 buffer[i1--] = buffer[j1++]; 15023 buffer[j2++] = buffer[i2--]; 15024 buffer[i1] = buffer[j1]; 15025 buffer[j2] = buffer[i2]; 15026 }; 15027 Transform.prototype.iterate = function Transform_iterate(ll, hl_lh_hh, u0, v0) { 15028 var llWidth = ll.width, 15029 llHeight = ll.height, 15030 llItems = ll.items; 15031 var width = hl_lh_hh.width; 15032 var height = hl_lh_hh.height; 15033 var items = hl_lh_hh.items; 15034 var i, j, k, l, u, v; 15035 for (k = 0, i = 0; i < llHeight; i++) { 15036 l = i * 2 * width; 15037 for (j = 0; j < llWidth; j++, k++, l += 2) { 15038 items[l] = llItems[k]; 15039 } 15040 } 15041 llItems = ll.items = null; 15042 var bufferPadding = 4; 15043 var rowBuffer = new Float32Array(width + 2 * bufferPadding); 15044 if (width === 1) { 15045 if ((u0 & 1) !== 0) { 15046 for (v = 0, k = 0; v < height; v++, k += width) { 15047 items[k] *= 0.5; 15048 } 15049 } 15050 } else { 15051 for (v = 0, k = 0; v < height; v++, k += width) { 15052 rowBuffer.set(items.subarray(k, k + width), bufferPadding); 15053 this.extend(rowBuffer, bufferPadding, width); 15054 this.filter(rowBuffer, bufferPadding, width); 15055 items.set(rowBuffer.subarray(bufferPadding, bufferPadding + width), k); 15056 } 15057 } 15058 var numBuffers = 16; 15059 var colBuffers = []; 15060 for (i = 0; i < numBuffers; i++) { 15061 colBuffers.push(new Float32Array(height + 2 * bufferPadding)); 15062 } 15063 var b, 15064 currentBuffer = 0; 15065 ll = bufferPadding + height; 15066 if (height === 1) { 15067 if ((v0 & 1) !== 0) { 15068 for (u = 0; u < width; u++) { 15069 items[u] *= 0.5; 15070 } 15071 } 15072 } else { 15073 for (u = 0; u < width; u++) { 15074 if (currentBuffer === 0) { 15075 numBuffers = Math.min(width - u, numBuffers); 15076 for (k = u, l = bufferPadding; l < ll; k += width, l++) { 15077 for (b = 0; b < numBuffers; b++) { 15078 colBuffers[b][l] = items[k + b]; 15079 } 15080 } 15081 currentBuffer = numBuffers; 15082 } 15083 currentBuffer--; 15084 var buffer = colBuffers[currentBuffer]; 15085 this.extend(buffer, bufferPadding, height); 15086 this.filter(buffer, bufferPadding, height); 15087 if (currentBuffer === 0) { 15088 k = u - numBuffers + 1; 15089 for (l = bufferPadding; l < ll; k += width, l++) { 15090 for (b = 0; b < numBuffers; b++) { 15091 items[k + b] = colBuffers[b][l]; 15092 } 15093 } 15094 } 15095 } 15096 } 15097 return { 15098 width: width, 15099 height: height, 15100 items: items 15101 }; 15102 }; 15103 return Transform; 15104 }(); 15105 var IrreversibleTransform = function IrreversibleTransformClosure() { 15106 function IrreversibleTransform() { 15107 Transform.call(this); 15108 } 15109 IrreversibleTransform.prototype = Object.create(Transform.prototype); 15110 IrreversibleTransform.prototype.filter = function irreversibleTransformFilter(x, offset, length) { 15111 var len = length >> 1; 15112 offset = offset | 0; 15113 var j, n, current, next; 15114 var alpha = -1.586134342059924; 15115 var beta = -0.052980118572961; 15116 var gamma = 0.882911075530934; 15117 var delta = 0.443506852043971; 15118 var K = 1.230174104914001; 15119 var K_ = 1 / K; 15120 j = offset - 3; 15121 for (n = len + 4; n--; j += 2) { 15122 x[j] *= K_; 15123 } 15124 j = offset - 2; 15125 current = delta * x[j - 1]; 15126 for (n = len + 3; n--; j += 2) { 15127 next = delta * x[j + 1]; 15128 x[j] = K * x[j] - current - next; 15129 if (n--) { 15130 j += 2; 15131 current = delta * x[j + 1]; 15132 x[j] = K * x[j] - current - next; 15133 } else { 15134 break; 15135 } 15136 } 15137 j = offset - 1; 15138 current = gamma * x[j - 1]; 15139 for (n = len + 2; n--; j += 2) { 15140 next = gamma * x[j + 1]; 15141 x[j] -= current + next; 15142 if (n--) { 15143 j += 2; 15144 current = gamma * x[j + 1]; 15145 x[j] -= current + next; 15146 } else { 15147 break; 15148 } 15149 } 15150 j = offset; 15151 current = beta * x[j - 1]; 15152 for (n = len + 1; n--; j += 2) { 15153 next = beta * x[j + 1]; 15154 x[j] -= current + next; 15155 if (n--) { 15156 j += 2; 15157 current = beta * x[j + 1]; 15158 x[j] -= current + next; 15159 } else { 15160 break; 15161 } 15162 } 15163 if (len !== 0) { 15164 j = offset + 1; 15165 current = alpha * x[j - 1]; 15166 for (n = len; n--; j += 2) { 15167 next = alpha * x[j + 1]; 15168 x[j] -= current + next; 15169 if (n--) { 15170 j += 2; 15171 current = alpha * x[j + 1]; 15172 x[j] -= current + next; 15173 } else { 15174 break; 15175 } 15176 } 15177 } 15178 }; 15179 return IrreversibleTransform; 15180 }();
15181 var ReversibleTransform = function ReversibleTransformClosure() { 15182 function ReversibleTransform() { 15183 Transform.call(this); 15184 } 15185 ReversibleTransform.prototype = Object.create(Transform.prototype); 15186 ReversibleTransform.prototype.filter = function reversibleTransformFilter(x, offset, length) { 15187 var len = length >> 1; 15188 offset = offset | 0; 15189 var j, n; 15190 for (j = offset, n = len + 1; n--; j += 2) { 15191 x[j] -= x[j - 1] + x[j + 1] + 2 >> 2; 15192 } 15193 for (j = offset + 1, n = len; n--; j += 2) { 15194 x[j] += x[j - 1] + x[j + 1] >> 1; 15195 } 15196 }; 15197 return ReversibleTransform; 15198 }(); 15199 return JpxImage; 15200}(); 15201exports.JpxImage = JpxImage; 15202 15203/***/ }), 15204/* 66 */ 15205/***/ (function(module, exports, __w_pdfjs_require__) { 15206 15207"use strict"; 15208 15209 15210Object.defineProperty(exports, "__esModule", { 15211 value: true 15212}); 15213exports.calculateSHA512 = exports.calculateSHA384 = exports.calculateSHA256 = exports.calculateMD5 = exports.PDF20 = exports.PDF17 = exports.CipherTransformFactory = exports.ARCFourCipher = exports.AES256Cipher = exports.AES128Cipher = undefined; 15214 15215var _util = __w_pdfjs_require__(0); 15216 15217var _primitives = __w_pdfjs_require__(2); 15218 15219var _stream = __w_pdfjs_require__(5); 15220 15221var ARCFourCipher = function ARCFourCipherClosure() { 15222 function ARCFourCipher(key) { 15223 this.a = 0; 15224 this.b = 0; 15225 var s = new Uint8Array(256); 15226 var i, 15227 j = 0, 15228 tmp, 15229 keyLength = key.length; 15230 for (i = 0; i < 256; ++i) { 15231 s[i] = i; 15232 } 15233 for (i = 0; i < 256; ++i) { 15234 tmp = s[i]; 15235 j = j + tmp + key[i % keyLength] & 0xFF; 15236 s[i] = s[j]; 15237 s[j] = tmp; 15238 } 15239 this.s = s; 15240 } 15241 ARCFourCipher.prototype = { 15242 encryptBlock: function ARCFourCipher_encryptBlock(data) { 15243 var i, 15244 n = data.length, 15245 tmp, 15246 tmp2; 15247 var a = this.a, 15248 b = this.b, 15249 s = this.s; 15250 var output = new Uint8Array(n); 15251 for (i = 0; i < n; ++i) { 15252 a = a + 1 & 0xFF; 15253 tmp = s[a]; 15254 b = b + tmp & 0xFF; 15255 tmp2 = s[b]; 15256 s[a] = tmp2; 15257 s[b] = tmp; 15258 output[i] = data[i] ^ s[tmp + tmp2 & 0xFF]; 15259 } 15260 this.a = a; 15261 this.b = b; 15262 return output; 15263 } 15264 }; 15265 ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock; 15266 return ARCFourCipher; 15267}(); 15268var calculateMD5 = function calculateMD5Closure() { 15269 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]); 15270 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]); 15271 function hash(data, offset, length) { 15272 var h0 = 1732584193, 15273 h1 = -271733879, 15274 h2 = -1732584194, 15275 h3 = 271733878; 15276 var paddedLength = length + 72 & ~63; 15277 var padded = new Uint8Array(paddedLength); 15278 var i, j, n; 15279 for (i = 0; i < length; ++i) { 15280 padded[i] = data[offset++]; 15281 } 15282 padded[i++] = 0x80; 15283 n = paddedLength - 8; 15284 while (i < n) { 15285 padded[i++] = 0; 15286 } 15287 padded[i++] = length << 3 & 0xFF; 15288 padded[i++] = length >> 5 & 0xFF; 15289 padded[i++] = length >> 13 & 0xFF; 15290 padded[i++] = length >> 21 & 0xFF; 15291 padded[i++] = length >>> 29 & 0xFF; 15292 padded[i++] = 0; 15293 padded[i++] = 0; 15294 padded[i++] = 0; 15295 var w = new Int32Array(16); 15296 for (i = 0; i < paddedLength;) { 15297 for (j = 0; j < 16; ++j, i += 4) { 15298 w[j] = padded[i] | padded[i + 1] << 8 | padded[i + 2] << 16 | padded[i + 3] << 24; 15299 } 15300 var a = h0, 15301 b = h1, 15302 c = h2, 15303 d = h3, 15304 f, 15305 g; 15306 for (j = 0; j < 64; ++j) { 15307 if (j < 16) { 15308 f = b & c | ~b & d; 15309 g = j; 15310 } else if (j < 32) { 15311 f = d & b | ~d & c; 15312 g = 5 * j + 1 & 15; 15313 } else if (j < 48) { 15314 f = b ^ c ^ d; 15315 g = 3 * j + 5 & 15; 15316 } else { 15317 f = c ^ (b | ~d); 15318 g = 7 * j & 15; 15319 } 15320 var tmp = d, 15321 rotateArg = a + f + k[j] + w[g] | 0, 15322 rotate = r[j]; 15323 d = c; 15324 c = b; 15325 b = b + (rotateArg << rotate | rotateArg >>> 32 - rotate) | 0; 15326 a = tmp; 15327 } 15328 h0 = h0 + a | 0; 15329 h1 = h1 + b | 0; 15330 h2 = h2 + c | 0; 15331 h3 = h3 + d | 0; 15332 } 15333 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]); 15334 } 15335 return hash; 15336}(); 15337var Word64 = function Word64Closure() { 15338 function Word64(highInteger, lowInteger) { 15339 this.high = highInteger | 0; 15340 this.low = lowInteger | 0; 15341 } 15342 Word64.prototype = { 15343 and: function Word64_and(word) { 15344 this.high &= word.high; 15345 this.low &= word.low; 15346 }, 15347 xor: function Word64_xor(word) { 15348 this.high ^= word.high; 15349 this.low ^= word.low; 15350 }, 15351 or: function Word64_or(word) { 15352 this.high |= word.high; 15353 this.low |= word.low; 15354 }, 15355 shiftRight: function Word64_shiftRight(places) { 15356 if (places >= 32) { 15357 this.low = this.high >>> places - 32 | 0; 15358 this.high = 0; 15359 } else { 15360 this.low = this.low >>> places | this.high << 32 - places; 15361 this.high = this.high >>> places | 0; 15362 } 15363 }, 15364 shiftLeft: function Word64_shiftLeft(places) { 15365 if (places >= 32) { 15366 this.high = this.low << places - 32; 15367 this.low = 0; 15368 } else { 15369 this.high = this.high << places | this.low >>> 32 - places; 15370 this.low = this.low << places; 15371 } 15372 }, 15373 rotateRight: function Word64_rotateRight(places) { 15374 var low, high; 15375 if (places & 32) { 15376 high = this.low; 15377 low = this.high; 15378 } else { 15379 low = this.low; 15380 high = this.high; 15381 } 15382 places &= 31; 15383 this.low = low >>> places | high << 32 - places; 15384 this.high = high >>> places | low << 32 - places; 15385 }, 15386 not: function Word64_not() { 15387 this.high = ~this.high; 15388 this.low = ~this.low; 15389 }, 15390 add: function Word64_add(word) { 15391 var lowAdd = (this.low >>> 0) + (word.low >>> 0); 15392 var highAdd = (this.high >>> 0) + (word.high >>> 0); 15393 if (lowAdd > 0xFFFFFFFF) { 15394 highAdd += 1; 15395 } 15396 this.low = lowAdd | 0; 15397 this.high = highAdd | 0; 15398 }, 15399 copyTo: function Word64_copyTo(bytes, offset) { 15400 bytes[offset] = this.high >>> 24 & 0xFF; 15401 bytes[offset + 1] = this.high >> 16 & 0xFF; 15402 bytes[offset + 2] = this.high >> 8 & 0xFF; 15403 bytes[offset + 3] = this.high & 0xFF; 15404 bytes[offset + 4] = this.low >>> 24 & 0xFF; 15405 bytes[offset + 5] = this.low >> 16 & 0xFF; 15406 bytes[offset + 6] = this.low >> 8 & 0xFF; 15407 bytes[offset + 7] = this.low & 0xFF; 15408 }, 15409 assign: function Word64_assign(word) { 15410 this.high = word.high; 15411 this.low = word.low; 15412 } 15413 }; 15414 return Word64; 15415}(); 15416var calculateSHA256 = function calculateSHA256Closure() { 15417 function rotr(x, n) { 15418 return x >>> n | x << 32 - n; 15419 } 15420 function ch(x, y, z) { 15421 return x & y ^ ~x & z; 15422 } 15423 function maj(x, y, z) { 15424 return x & y ^ x & z ^ y & z; 15425 } 15426 function sigma(x) {
vendor: 4,928 bytes, lines 15427-15570
15427 return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22); 15428 } 15429 function sigmaPrime(x) { 15430 return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); 15431 } 15432 function littleSigma(x) { 15433 return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3; 15434 } 15435 function littleSigmaPrime(x) { 15436 return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10; 15437 } 15438 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]; 15439 function hash(data, offset, length) { 15440 var h0 = 0x6a09e667, 15441 h1 = 0xbb67ae85, 15442 h2 = 0x3c6ef372, 15443 h3 = 0xa54ff53a, 15444 h4 = 0x510e527f, 15445 h5 = 0x9b05688c, 15446 h6 = 0x1f83d9ab, 15447 h7 = 0x5be0cd19; 15448 var paddedLength = Math.ceil((length + 9) / 64) * 64; 15449 var padded = new Uint8Array(paddedLength); 15450 var i, j, n; 15451 for (i = 0; i < length; ++i) { 15452 padded[i] = data[offset++]; 15453 } 15454 padded[i++] = 0x80; 15455 n = paddedLength - 8; 15456 while (i < n) { 15457 padded[i++] = 0; 15458 } 15459 padded[i++] = 0; 15460 padded[i++] = 0; 15461 padded[i++] = 0; 15462 padded[i++] = length >>> 29 & 0xFF; 15463 padded[i++] = length >> 21 & 0xFF; 15464 padded[i++] = length >> 13 & 0xFF; 15465 padded[i++] = length >> 5 & 0xFF; 15466 padded[i++] = length << 3 & 0xFF; 15467 var w = new Uint32Array(64); 15468 for (i = 0; i < paddedLength;) { 15469 for (j = 0; j < 16; ++j) { 15470 w[j] = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; 15471 i += 4; 15472 } 15473 for (j = 16; j < 64; ++j) { 15474 w[j] = littleSigmaPrime(w[j - 2]) + w[j - 7] + littleSigma(w[j - 15]) + w[j - 16] | 0; 15475 } 15476 var a = h0, 15477 b = h1, 15478 c = h2, 15479 d = h3, 15480 e = h4, 15481 f = h5, 15482 g = h6, 15483 h = h7, 15484 t1, 15485 t2; 15486 for (j = 0; j < 64; ++j) { 15487 t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j]; 15488 t2 = sigma(a) + maj(a, b, c); 15489 h = g; 15490 g = f; 15491 f = e; 15492 e = d + t1 | 0; 15493 d = c; 15494 c = b; 15495 b = a; 15496 a = t1 + t2 | 0; 15497 } 15498 h0 = h0 + a | 0; 15499 h1 = h1 + b | 0; 15500 h2 = h2 + c | 0; 15501 h3 = h3 + d | 0; 15502 h4 = h4 + e | 0; 15503 h5 = h5 + f | 0; 15504 h6 = h6 + g | 0; 15505 h7 = h7 + h | 0; 15506 } 15507 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]); 15508 } 15509 return hash; 15510}(); 15511var calculateSHA512 = function calculateSHA512Closure() { 15512 function ch(result, x, y, z, tmp) { 15513 result.assign(x); 15514 result.and(y); 15515 tmp.assign(x); 15516 tmp.not(); 15517 tmp.and(z); 15518 result.xor(tmp); 15519 } 15520 function maj(result, x, y, z, tmp) { 15521 result.assign(x); 15522 result.and(y); 15523 tmp.assign(x); 15524 tmp.and(z); 15525 result.xor(tmp); 15526 tmp.assign(y); 15527 tmp.and(z); 15528 result.xor(tmp); 15529 } 15530 function sigma(result, x, tmp) { 15531 result.assign(x); 15532 result.rotateRight(28); 15533 tmp.assign(x); 15534 tmp.rotateRight(34); 15535 result.xor(tmp); 15536 tmp.assign(x); 15537 tmp.rotateRight(39); 15538 result.xor(tmp); 15539 } 15540 function sigmaPrime(result, x, tmp) { 15541 result.assign(x); 15542 result.rotateRight(14); 15543 tmp.assign(x); 15544 tmp.rotateRight(18); 15545 result.xor(tmp); 15546 tmp.assign(x); 15547 tmp.rotateRight(41); 15548 result.xor(tmp); 15549 } 15550 function littleSigma(result, x, tmp) { 15551 result.assign(x); 15552 result.rotateRight(1); 15553 tmp.assign(x); 15554 tmp.rotateRight(8); 15555 result.xor(tmp); 15556 tmp.assign(x); 15557 tmp.shiftRight(7); 15558 result.xor(tmp); 15559 } 15560 function littleSigmaPrime(result, x, tmp) { 15561 result.assign(x); 15562 result.rotateRight(19); 15563 tmp.assign(x); 15564 tmp.rotateRight(61); 15565 result.xor(tmp); 15566 tmp.assign(x); 15567 tmp.shiftRight(6); 15568 result.xor(tmp); 15569 } 15570 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,369 bytes, lines 15570-15732
15570605d019), 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)]; 15571 function hash(data, offset, length, mode384) { 15572 mode384 = !!mode384; 15573 var h0, h1, h2, h3, h4, h5, h6, h7; 15574 if (!mode384) { 15575 h0 = new Word64(0x6a09e667, 0xf3bcc908); 15576 h1 = new Word64(0xbb67ae85, 0x84caa73b); 15577 h2 = new Word64(0x3c6ef372, 0xfe94f82b); 15578 h3 = new Word64(0xa54ff53a, 0x5f1d36f1); 15579 h4 = new Word64(0x510e527f, 0xade682d1); 15580 h5 = new Word64(0x9b05688c, 0x2b3e6c1f); 15581 h6 = new Word64(0x1f83d9ab, 0xfb41bd6b); 15582 h7 = new Word64(0x5be0cd19, 0x137e2179); 15583 } else { 15584 h0 = new Word64(0xcbbb9d5d, 0xc1059ed8); 15585 h1 = new Word64(0x629a292a, 0x367cd507); 15586 h2 = new Word64(0x9159015a, 0x3070dd17); 15587 h3 = new Word64(0x152fecd8, 0xf70e5939); 15588 h4 = new Word64(0x67332667, 0xffc00b31); 15589 h5 = new Word64(0x8eb44a87, 0x68581511); 15590 h6 = new Word64(0xdb0c2e0d, 0x64f98fa7); 15591 h7 = new Word64(0x47b5481d, 0xbefa4fa4); 15592 } 15593 var paddedLength = Math.ceil((length + 17) / 128) * 128; 15594 var padded = new Uint8Array(paddedLength); 15595 var i, j, n; 15596 for (i = 0; i < length; ++i) { 15597 padded[i] = data[offset++]; 15598 } 15599 padded[i++] = 0x80; 15600 n = paddedLength - 16; 15601 while (i < n) { 15602 padded[i++] = 0; 15603 } 15604 padded[i++] = 0; 15605 padded[i++] = 0; 15606 padded[i++] = 0; 15607 padded[i++] = 0; 15608 padded[i++] = 0; 15609 padded[i++] = 0; 15610 padded[i++] = 0; 15611 padded[i++] = 0; 15612 padded[i++] = 0; 15613 padded[i++] = 0; 15614 padded[i++] = 0; 15615 padded[i++] = length >>> 29 & 0xFF; 15616 padded[i++] = length >> 21 & 0xFF; 15617 padded[i++] = length >> 13 & 0xFF; 15618 padded[i++] = length >> 5 & 0xFF; 15619 padded[i++] = length << 3 & 0xFF; 15620 var w = new Array(80); 15621 for (i = 0; i < 80; i++) { 15622 w[i] = new Word64(0, 0); 15623 } 15624 var a = new Word64(0, 0), 15625 b = new Word64(0, 0), 15626 c = new Word64(0, 0); 15627 var d = new Word64(0, 0), 15628 e = new Word64(0, 0), 15629 f = new Word64(0, 0); 15630 var g = new Word64(0, 0), 15631 h = new Word64(0, 0); 15632 var t1 = new Word64(0, 0), 15633 t2 = new Word64(0, 0); 15634 var tmp1 = new Word64(0, 0), 15635 tmp2 = new Word64(0, 0), 15636 tmp3; 15637 for (i = 0; i < paddedLength;) { 15638 for (j = 0; j < 16; ++j) { 15639 w[j].high = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; 15640 w[j].low = padded[i + 4] << 24 | padded[i + 5] << 16 | padded[i + 6] << 8 | padded[i + 7]; 15641 i += 8; 15642 } 15643 for (j = 16; j < 80; ++j) { 15644 tmp3 = w[j]; 15645 littleSigmaPrime(tmp3, w[j - 2], tmp2); 15646 tmp3.add(w[j - 7]); 15647 littleSigma(tmp1, w[j - 15], tmp2); 15648 tmp3.add(tmp1); 15649 tmp3.add(w[j - 16]); 15650 } 15651 a.assign(h0); 15652 b.assign(h1); 15653 c.assign(h2); 15654 d.assign(h3); 15655 e.assign(h4); 15656 f.assign(h5); 15657 g.assign(h6); 15658 h.assign(h7); 15659 for (j = 0; j < 80; ++j) { 15660 t1.assign(h); 15661 sigmaPrime(tmp1, e, tmp2); 15662 t1.add(tmp1); 15663 ch(tmp1, e, f, g, tmp2); 15664 t1.add(tmp1); 15665 t1.add(k[j]); 15666 t1.add(w[j]); 15667 sigma(t2, a, tmp2); 15668 maj(tmp1, a, b, c, tmp2); 15669 t2.add(tmp1); 15670 tmp3 = h; 15671 h = g; 15672 g = f; 15673 f = e; 15674 d.add(t1); 15675 e = d; 15676 d = c; 15677 c = b; 15678 b = a; 15679 tmp3.assign(t1); 15680 tmp3.add(t2); 15681 a = tmp3; 15682 } 15683 h0.add(a); 15684 h1.add(b); 15685 h2.add(c); 15686 h3.add(d); 15687 h4.add(e); 15688 h5.add(f); 15689 h6.add(g); 15690 h7.add(h); 15691 } 15692 var result; 15693 if (!mode384) { 15694 result = new Uint8Array(64); 15695 h0.copyTo(result, 0); 15696 h1.copyTo(result, 8); 15697 h2.copyTo(result, 16); 15698 h3.copyTo(result, 24); 15699 h4.copyTo(result, 32); 15700 h5.copyTo(result, 40); 15701 h6.copyTo(result, 48); 15702 h7.copyTo(result, 56); 15703 } else { 15704 result = new Uint8Array(48); 15705 h0.copyTo(result, 0); 15706 h1.copyTo(result, 8); 15707 h2.copyTo(result, 16); 15708 h3.copyTo(result, 24); 15709 h4.copyTo(result, 32); 15710 h5.copyTo(result, 40); 15711 } 15712 return result; 15713 } 15714 return hash; 15715}(); 15716var calculateSHA384 = function calculateSHA384Closure() { 15717 function hash(data, offset, length) { 15718 return calculateSHA512(data, offset, length, true); 15719 } 15720 return hash; 15721}(); 15722var NullCipher = function NullCipherClosure() { 15723 function NullCipher() {} 15724 NullCipher.prototype = { 15725 decryptBlock: function NullCipher_decryptBlock(data) { 15726 return data; 15727 } 15728 }; 15729 return NullCipher; 15730}(); 15731var AES128Cipher = function AES128CipherClosure() { 15732 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,
157320xd3, 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]); 15733 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]); 15734 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]); 15735 var mixCol = new Uint8Array(256); 15736 for (var i = 0; i < 256; i++) { 15737 if (i < 128) { 15738 mixCol[i] = i << 1; 15739 } else { 15740 mixCol[i] = i << 1 ^ 0x1b; 15741 } 15742 } 15743 var mix = new Uint32Array([0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c
vendor: 28,196 bytes, lines 15743-16429
1574374, 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]); 15744 function expandKey128(cipherKey) { 15745 var b = 176, 15746 result = new Uint8Array(b); 15747 result.set(cipherKey); 15748 for (var j = 16, i = 1; j < b; ++i) { 15749 var t1 = result[j - 3], 15750 t2 = result[j - 2], 15751 t3 = result[j - 1], 15752 t4 = result[j - 4]; 15753 t1 = s[t1]; 15754 t2 = s[t2]; 15755 t3 = s[t3]; 15756 t4 = s[t4]; 15757 t1 = t1 ^ rcon[i]; 15758 for (var n = 0; n < 4; ++n) { 15759 result[j] = t1 ^= result[j - 16]; 15760 j++; 15761 result[j] = t2 ^= result[j - 16]; 15762 j++; 15763 result[j] = t3 ^= result[j - 16]; 15764 j++; 15765 result[j] = t4 ^= result[j - 16]; 15766 j++; 15767 } 15768 } 15769 return result; 15770 } 15771 function decrypt128(input, key) { 15772 var state = new Uint8Array(16); 15773 state.set(input); 15774 var i, j, k; 15775 var t, u, v; 15776 for (j = 0, k = 160; j < 16; ++j, ++k) { 15777 state[j] ^= key[k]; 15778 } 15779 for (i = 9; i >= 1; --i) { 15780 t = state[13]; 15781 state[13] = state[9]; 15782 state[9] = state[5]; 15783 state[5] = state[1]; 15784 state[1] = t; 15785 t = state[14]; 15786 u = state[10]; 15787 state[14] = state[6]; 15788 state[10] = state[2]; 15789 state[6] = t; 15790 state[2] = u; 15791 t = state[15]; 15792 u = state[11]; 15793 v = state[7]; 15794 state[15] = state[3]; 15795 state[11] = t; 15796 state[7] = u; 15797 state[3] = v; 15798 for (j = 0; j < 16; ++j) { 15799 state[j] = inv_s[state[j]]; 15800 } 15801 for (j = 0, k = i * 16; j < 16; ++j, ++k) { 15802 state[j] ^= key[k]; 15803 } 15804 for (j = 0; j < 16; j += 4) { 15805 var s0 = mix[state[j]], 15806 s1 = mix[state[j + 1]], 15807 s2 = mix[state[j + 2]], 15808 s3 = mix[state[j + 3]]; 15809 t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8; 15810 state[j] = t >>> 24 & 0xFF; 15811 state[j + 1] = t >> 16 & 0xFF; 15812 state[j + 2] = t >> 8 & 0xFF; 15813 state[j + 3] = t & 0xFF; 15814 } 15815 } 15816 t = state[13]; 15817 state[13] = state[9]; 15818 state[9] = state[5]; 15819 state[5] = state[1]; 15820 state[1] = t; 15821 t = state[14]; 15822 u = state[10]; 15823 state[14] = state[6]; 15824 state[10] = state[2]; 15825 state[6] = t; 15826 state[2] = u; 15827 t = state[15]; 15828 u = state[11]; 15829 v = state[7]; 15830 state[15] = state[3]; 15831 state[11] = t; 15832 state[7] = u; 15833 state[3] = v; 15834 for (j = 0; j < 16; ++j) { 15835 state[j] = inv_s[state[j]]; 15836 state[j] ^= key[j]; 15837 } 15838 return state; 15839 } 15840 function encrypt128(input, key) { 15841 var t, u, v, k; 15842 var state = new Uint8Array(16); 15843 state.set(input); 15844 for (j = 0; j < 16; ++j) { 15845 state[j] ^= key[j]; 15846 } 15847 for (i = 1; i < 10; i++) { 15848 for (j = 0; j < 16; ++j) { 15849 state[j] = s[state[j]]; 15850 } 15851 v = state[1]; 15852 state[1] = state[5]; 15853 state[5] = state[9]; 15854 state[9] = state[13]; 15855 state[13] = v; 15856 v = state[2]; 15857 u = state[6]; 15858 state[2] = state[10]; 15859 state[6] = state[14]; 15860 state[10] = v; 15861 state[14] = u; 15862 v = state[3]; 15863 u = state[7]; 15864 t = state[11]; 15865 state[3] = state[15]; 15866 state[7] = v; 15867 state[11] = u; 15868 state[15] = t; 15869 for (var j = 0; j < 16; j += 4) { 15870 var s0 = state[j + 0], 15871 s1 = state[j + 1]; 15872 var s2 = state[j + 2], 15873 s3 = state[j + 3]; 15874 t = s0 ^ s1 ^ s2 ^ s3; 15875 state[j + 0] ^= t ^ mixCol[s0 ^ s1]; 15876 state[j + 1] ^= t ^ mixCol[s1 ^ s2]; 15877 state[j + 2] ^= t ^ mixCol[s2 ^ s3]; 15878 state[j + 3] ^= t ^ mixCol[s3 ^ s0]; 15879 } 15880 for (j = 0, k = i * 16; j < 16; ++j, ++k) { 15881 state[j] ^= key[k]; 15882 } 15883 } 15884 for (j = 0; j < 16; ++j) { 15885 state[j] = s[state[j]]; 15886 } 15887 v = state[1]; 15888 state[1] = state[5]; 15889 state[5] = state[9]; 15890 state[9] = state[13]; 15891 state[13] = v; 15892 v = state[2]; 15893 u = state[6]; 15894 state[2] = state[10]; 15895 state[6] = state[14]; 15896 state[10] = v; 15897 state[14] = u; 15898 v = state[3]; 15899 u = state[7]; 15900 t = state[11]; 15901 state[3] = state[15]; 15902 state[7] = v; 15903 state[11] = u; 15904 state[15] = t; 15905 for (j = 0, k = 160; j < 16; ++j, ++k) { 15906 state[j] ^= key[k]; 15907 } 15908 return state; 15909 } 15910 function AES128Cipher(key) { 15911 this.key = expandKey128(key); 15912 this.buffer = new Uint8Array(16); 15913 this.bufferPosition = 0; 15914 } 15915 function decryptBlock2(data, finalize) { 15916 var i, 15917 j, 15918 ii, 15919 sourceLength = data.length, 15920 buffer = this.buffer, 15921 bufferLength = this.bufferPosition, 15922 result = [], 15923 iv = this.iv; 15924 for (i = 0; i < sourceLength; ++i) { 15925 buffer[bufferLength] = data[i]; 15926 ++bufferLength; 15927 if (bufferLength < 16) { 15928 continue; 15929 } 15930 var plain = decrypt128(buffer, this.key); 15931 for (j = 0; j < 16; ++j) { 15932 plain[j] ^= iv[j]; 15933 } 15934 iv = buffer; 15935 result.push(plain); 15936 buffer = new Uint8Array(16); 15937 bufferLength = 0; 15938 } 15939 this.buffer = buffer; 15940 this.bufferLength = bufferLength; 15941 this.iv = iv; 15942 if (result.length === 0) { 15943 return new Uint8Array([]); 15944 } 15945 var outputLength = 16 * result.length; 15946 if (finalize) { 15947 var lastBlock = result[result.length - 1]; 15948 var psLen = lastBlock[15]; 15949 if (psLen <= 16) { 15950 for (i = 15, ii = 16 - psLen; i >= ii; --i) { 15951 if (lastBlock[i] !== psLen) { 15952 psLen = 0; 15953 break; 15954 } 15955 } 15956 outputLength -= psLen; 15957 result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); 15958 } 15959 } 15960 var output = new Uint8Array(outputLength); 15961 for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { 15962 output.set(result[i], j); 15963 } 15964 return output; 15965 } 15966 AES128Cipher.prototype = { 15967 decryptBlock: function AES128Cipher_decryptBlock(data, finalize) { 15968 var i, 15969 sourceLength = data.length; 15970 var buffer = this.buffer, 15971 bufferLength = this.bufferPosition; 15972 for (i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { 15973 buffer[bufferLength] = data[i]; 15974 } 15975 if (bufferLength < 16) { 15976 this.bufferLength = bufferLength; 15977 return new Uint8Array([]); 15978 } 15979 this.iv = buffer; 15980 this.buffer = new Uint8Array(16); 15981 this.bufferLength = 0; 15982 this.decryptBlock = decryptBlock2; 15983 return this.decryptBlock(data.subarray(16), finalize); 15984 }, 15985 encrypt: function AES128Cipher_encrypt(data, iv) { 15986 var i, 15987 j, 15988 ii, 15989 sourceLength = data.length, 15990 buffer = this.buffer, 15991 bufferLength = this.bufferPosition, 15992 result = []; 15993 if (!iv) { 15994 iv = new Uint8Array(16); 15995 } 15996 for (i = 0; i < sourceLength; ++i) { 15997 buffer[bufferLength] = data[i]; 15998 ++bufferLength; 15999 if (bufferLength < 16) { 16000 continue; 16001 } 16002 for (j = 0; j < 16; ++j) { 16003 buffer[j] ^= iv[j]; 16004 } 16005 var cipher = encrypt128(buffer, this.key); 16006 iv = cipher; 16007 result.push(cipher); 16008 buffer = new Uint8Array(16); 16009 bufferLength = 0; 16010 } 16011 this.buffer = buffer; 16012 this.bufferLength = bufferLength; 16013 this.iv = iv; 16014 if (result.length === 0) { 16015 return new Uint8Array([]); 16016 } 16017 var outputLength = 16 * result.length; 16018 var output = new Uint8Array(outputLength); 16019 for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { 16020 output.set(result[i], j); 16021 } 16022 return output; 16023 } 16024 }; 16025 return AES128Cipher; 16026}(); 16027var AES256Cipher = function AES256CipherClosure() { 16028 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]); 16029 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]); 16030 var mixCol = new Uint8Array(256); 16031 for (var i = 0; i < 256; i++) { 16032 if (i < 128) { 16033 mixCol[i] = i << 1; 16034 } else { 16035 mixCol[i] = i << 1 ^ 0x1b; 16036 } 16037 } 16038 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, 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]); 16039 function expandKey256(cipherKey) { 16040 var b = 240, 16041 result = new Uint8Array(b); 16042 var r = 1; 16043 result.set(cipherKey); 16044 for (var j = 32, i = 1; j < b; ++i) { 16045 if (j % 32 === 16) { 16046 t1 = s[t1]; 16047 t2 = s[t2]; 16048 t3 = s[t3]; 16049 t4 = s[t4]; 16050 } else if (j % 32 === 0) { 16051 var t1 = result[j - 3], 16052 t2 = result[j - 2], 16053 t3 = result[j - 1], 16054 t4 = result[j - 4]; 16055 t1 = s[t1]; 16056 t2 = s[t2]; 16057 t3 = s[t3]; 16058 t4 = s[t4]; 16059 t1 = t1 ^ r; 16060 if ((r <<= 1) >= 256) { 16061 r = (r ^ 0x1b) & 0xFF; 16062 } 16063 } 16064 for (var n = 0; n < 4; ++n) { 16065 result[j] = t1 ^= result[j - 32]; 16066 j++; 16067 result[j] = t2 ^= result[j - 32]; 16068 j++; 16069 result[j] = t3 ^= result[j - 32]; 16070 j++; 16071 result[j] = t4 ^= result[j - 32]; 16072 j++; 16073 } 16074 } 16075 return result; 16076 } 16077 function decrypt256(input, key) { 16078 var state = new Uint8Array(16); 16079 state.set(input); 16080 var i, j, k; 16081 var t, u, v; 16082 for (j = 0, k = 224; j < 16; ++j, ++k) { 16083 state[j] ^= key[k]; 16084 } 16085 for (i = 13; i >= 1; --i) { 16086 t = state[13]; 16087 state[13] = state[9]; 16088 state[9] = state[5]; 16089 state[5] = state[1]; 16090 state[1] = t; 16091 t = state[14]; 16092 u = state[10]; 16093 state[14] = state[6]; 16094 state[10] = state[2]; 16095 state[6] = t; 16096 state[2] = u; 16097 t = state[15]; 16098 u = state[11]; 16099 v = state[7]; 16100 state[15] = state[3]; 16101 state[11] = t; 16102 state[7] = u; 16103 state[3] = v; 16104 for (j = 0; j < 16; ++j) { 16105 state[j] = inv_s[state[j]]; 16106 } 16107 for (j = 0, k = i * 16; j < 16; ++j, ++k) { 16108 state[j] ^= key[k]; 16109 } 16110 for (j = 0; j < 16; j += 4) { 16111 var s0 = mix[state[j]], 16112 s1 = mix[state[j + 1]], 16113 s2 = mix[state[j + 2]], 16114 s3 = mix[state[j + 3]]; 16115 t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8; 16116 state[j] = t >>> 24 & 0xFF; 16117 state[j + 1] = t >> 16 & 0xFF; 16118 state[j + 2] = t >> 8 & 0xFF; 16119 state[j + 3] = t & 0xFF; 16120 } 16121 } 16122 t = state[13]; 16123 state[13] = state[9]; 16124 state[9] = state[5]; 16125 state[5] = state[1]; 16126 state[1] = t; 16127 t = state[14]; 16128 u = state[10]; 16129 state[14] = state[6]; 16130 state[10] = state[2]; 16131 state[6] = t; 16132 state[2] = u; 16133 t = state[15]; 16134 u = state[11]; 16135 v = state[7]; 16136 state[15] = state[3]; 16137 state[11] = t; 16138 state[7] = u; 16139 state[3] = v; 16140 for (j = 0; j < 16; ++j) { 16141 state[j] = inv_s[state[j]]; 16142 state[j] ^= key[j]; 16143 } 16144 return state; 16145 } 16146 function encrypt256(input, key) { 16147 var t, u, v, k; 16148 var state = new Uint8Array(16); 16149 state.set(input); 16150 for (j = 0; j < 16; ++j) { 16151 state[j] ^= key[j]; 16152 } 16153 for (i = 1; i < 14; i++) { 16154 for (j = 0; j < 16; ++j) { 16155 state[j] = s[state[j]]; 16156 } 16157 v = state[1]; 16158 state[1] = state[5]; 16159 state[5] = state[9]; 16160 state[9] = state[13]; 16161 state[13] = v; 16162 v = state[2]; 16163 u = state[6]; 16164 state[2] = state[10]; 16165 state[6] = state[14]; 16166 state[10] = v; 16167 state[14] = u; 16168 v = state[3]; 16169 u = state[7]; 16170 t = state[11]; 16171 state[3] = state[15]; 16172 state[7] = v; 16173 state[11] = u; 16174 state[15] = t; 16175 for (var j = 0; j < 16; j += 4) { 16176 var s0 = state[j + 0], 16177 s1 = state[j + 1]; 16178 var s2 = state[j + 2], 16179 s3 = state[j + 3]; 16180 t = s0 ^ s1 ^ s2 ^ s3; 16181 state[j + 0] ^= t ^ mixCol[s0 ^ s1]; 16182 state[j + 1] ^= t ^ mixCol[s1 ^ s2]; 16183 state[j + 2] ^= t ^ mixCol[s2 ^ s3]; 16184 state[j + 3] ^= t ^ mixCol[s3 ^ s0]; 16185 } 16186 for (j = 0, k = i * 16; j < 16; ++j, ++k) { 16187 state[j] ^= key[k]; 16188 } 16189 } 16190 for (j = 0; j < 16; ++j) { 16191 state[j] = s[state[j]]; 16192 } 16193 v = state[1]; 16194 state[1] = state[5]; 16195 state[5] = state[9]; 16196 state[9] = state[13]; 16197 state[13] = v; 16198 v = state[2]; 16199 u = state[6]; 16200 state[2] = state[10]; 16201 state[6] = state[14]; 16202 state[10] = v; 16203 state[14] = u; 16204 v = state[3]; 16205 u = state[7]; 16206 t = state[11]; 16207 state[3] = state[15]; 16208 state[7] = v; 16209 state[11] = u; 16210 state[15] = t; 16211 for (j = 0, k = 224; j < 16; ++j, ++k) { 16212 state[j] ^= key[k]; 16213 } 16214 return state; 16215 } 16216 function AES256Cipher(key) { 16217 this.key = expandKey256(key); 16218 this.buffer = new Uint8Array(16); 16219 this.bufferPosition = 0; 16220 } 16221 function decryptBlock2(data, finalize) { 16222 var i, 16223 j, 16224 ii, 16225 sourceLength = data.length, 16226 buffer = this.buffer, 16227 bufferLength = this.bufferPosition, 16228 result = [], 16229 iv = this.iv; 16230 for (i = 0; i < sourceLength; ++i) { 16231 buffer[bufferLength] = data[i]; 16232 ++bufferLength; 16233 if (bufferLength < 16) { 16234 continue; 16235 } 16236 var plain = decrypt256(buffer, this.key); 16237 for (j = 0; j < 16; ++j) { 16238 plain[j] ^= iv[j]; 16239 } 16240 iv = buffer; 16241 result.push(plain); 16242 buffer = new Uint8Array(16); 16243 bufferLength = 0; 16244 } 16245 this.buffer = buffer; 16246 this.bufferLength = bufferLength; 16247 this.iv = iv; 16248 if (result.length === 0) { 16249 return new Uint8Array([]); 16250 } 16251 var outputLength = 16 * result.length; 16252 if (finalize) { 16253 var lastBlock = result[result.length - 1]; 16254 var psLen = lastBlock[15]; 16255 if (psLen <= 16) { 16256 for (i = 15, ii = 16 - psLen; i >= ii; --i) { 16257 if (lastBlock[i] !== psLen) { 16258 psLen = 0; 16259 break; 16260 } 16261 } 16262 outputLength -= psLen; 16263 result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); 16264 } 16265 } 16266 var output = new Uint8Array(outputLength); 16267 for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { 16268 output.set(result[i], j); 16269 } 16270 return output; 16271 } 16272 AES256Cipher.prototype = { 16273 decryptBlock: function AES256Cipher_decryptBlock(data, finalize, iv) { 16274 var i, 16275 sourceLength = data.length; 16276 var buffer = this.buffer, 16277 bufferLength = this.bufferPosition; 16278 if (iv) { 16279 this.iv = iv; 16280 } else { 16281 for (i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { 16282 buffer[bufferLength] = data[i]; 16283 } 16284 if (bufferLength < 16) { 16285 this.bufferLength = bufferLength; 16286 return new Uint8Array([]); 16287 } 16288 this.iv = buffer; 16289 data = data.subarray(16); 16290 } 16291 this.buffer = new Uint8Array(16); 16292 this.bufferLength = 0; 16293 this.decryptBlock = decryptBlock2; 16294 return this.decryptBlock(data, finalize); 16295 }, 16296 encrypt: function AES256Cipher_encrypt(data, iv) { 16297 var i, 16298 j, 16299 ii, 16300 sourceLength = data.length, 16301 buffer = this.buffer, 16302 bufferLength = this.bufferPosition, 16303 result = []; 16304 if (!iv) { 16305 iv = new Uint8Array(16); 16306 } 16307 for (i = 0; i < sourceLength; ++i) { 16308 buffer[bufferLength] = data[i]; 16309 ++bufferLength; 16310 if (bufferLength < 16) { 16311 continue; 16312 } 16313 for (j = 0; j < 16; ++j) { 16314 buffer[j] ^= iv[j]; 16315 } 16316 var cipher = encrypt256(buffer, this.key); 16317 this.iv = cipher; 16318 result.push(cipher); 16319 buffer = new Uint8Array(16); 16320 bufferLength = 0; 16321 } 16322 this.buffer = buffer; 16323 this.bufferLength = bufferLength; 16324 this.iv = iv; 16325 if (result.length === 0) { 16326 return new Uint8Array([]); 16327 } 16328 var outputLength = 16 * result.length; 16329 var output = new Uint8Array(outputLength); 16330 for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { 16331 output.set(result[i], j); 16332 } 16333 return output; 16334 } 16335 }; 16336 return AES256Cipher; 16337}(); 16338var PDF17 = function PDF17Closure() { 16339 function compareByteArrays(array1, array2) { 16340 if (array1.length !== array2.length) { 16341 return false; 16342 } 16343 for (var i = 0; i < array1.length; i++) { 16344 if (array1[i] !== array2[i]) { 16345 return false; 16346 } 16347 } 16348 return true; 16349 } 16350 function PDF17() {} 16351 PDF17.prototype = { 16352 checkOwnerPassword: function PDF17_checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { 16353 var hashData = new Uint8Array(password.length + 56); 16354 hashData.set(password, 0); 16355 hashData.set(ownerValidationSalt, password.length); 16356 hashData.set(userBytes, password.length + ownerValidationSalt.length); 16357 var result = calculateSHA256(hashData, 0, hashData.length); 16358 return compareByteArrays(result, ownerPassword); 16359 }, 16360 checkUserPassword: function PDF17_checkUserPassword(password, userValidationSalt, userPassword) { 16361 var hashData = new Uint8Array(password.length + 8); 16362 hashData.set(password, 0); 16363 hashData.set(userValidationSalt, password.length); 16364 var result = calculateSHA256(hashData, 0, hashData.length); 16365 return compareByteArrays(result, userPassword); 16366 }, 16367 getOwnerKey: function PDF17_getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { 16368 var hashData = new Uint8Array(password.length + 56); 16369 hashData.set(password, 0); 16370 hashData.set(ownerKeySalt, password.length); 16371 hashData.set(userBytes, password.length + ownerKeySalt.length); 16372 var key = calculateSHA256(hashData, 0, hashData.length); 16373 var cipher = new AES256Cipher(key); 16374 return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); 16375 }, 16376 getUserKey: function PDF17_getUserKey(password, userKeySalt, userEncryption) { 16377 var hashData = new Uint8Array(password.length + 8); 16378 hashData.set(password, 0); 16379 hashData.set(userKeySalt, password.length); 16380 var key = calculateSHA256(hashData, 0, hashData.length); 16381 var cipher = new AES256Cipher(key); 16382 return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); 16383 } 16384 }; 16385 return PDF17; 16386}(); 16387var PDF20 = function PDF20Closure() { 16388 function concatArrays(array1, array2) { 16389 var t = new Uint8Array(array1.length + array2.length); 16390 t.set(array1, 0); 16391 t.set(array2, array1.length); 16392 return t; 16393 } 16394 function calculatePDF20Hash(password, input, userBytes) { 16395 var k = calculateSHA256(input, 0, input.length).subarray(0, 32); 16396 var e = [0]; 16397 var i = 0; 16398 while (i < 64 || e[e.length - 1] > i - 32) { 16399 var arrayLength = password.length + k.length + userBytes.length; 16400 var k1 = new Uint8Array(arrayLength * 64); 16401 var array = concatArrays(password, k); 16402 array = concatArrays(array, userBytes); 16403 for (var j = 0, pos = 0; j < 64; j++, pos += arrayLength) { 16404 k1.set(array, pos); 16405 } 16406 var cipher = new AES128Cipher(k.subarray(0, 16)); 16407 e = cipher.encrypt(k1, k.subarray(16, 32)); 16408 var remainder = 0; 16409 for (var z = 0; z < 16; z++) { 16410 remainder *= 256 % 3; 16411 remainder %= 3; 16412 remainder += (e[z] >>> 0) % 3; 16413 remainder %= 3; 16414 } 16415 if (remainder === 0) { 16416 k = calculateSHA256(e, 0, e.length); 16417 } else if (remainder === 1) { 16418 k = calculateSHA384(e, 0, e.length); 16419 } else if (remainder === 2) { 16420 k = calculateSHA512(e, 0, e.length); 16421 } 16422 i++; 16423 } 16424 return k.subarray(0, 32); 16425 } 16426 function PDF20() {} 16427 function compareByteArrays(array1, array2) { 16428 if (array1.length !== array2.length) { 16429 return false;
16430 } 16431 for (var i = 0; i < array1.length; i++) { 16432 if (array1[i] !== array2[i]) { 16433 return false; 16434 } 16435 } 16436 return true; 16437 } 16438 PDF20.prototype = { 16439 hash: function PDF20_hash(password, concatBytes, userBytes) { 16440 return calculatePDF20Hash(password, concatBytes, userBytes); 16441 }, 16442 checkOwnerPassword: function PDF20_checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { 16443 var hashData = new Uint8Array(password.length + 56); 16444 hashData.set(password, 0); 16445 hashData.set(ownerValidationSalt, password.length); 16446 hashData.set(userBytes, password.length + ownerValidationSalt.length); 16447 var result = calculatePDF20Hash(password, hashData, userBytes); 16448 return compareByteArrays(result, ownerPassword); 16449 }, 16450 checkUserPassword: function PDF20_checkUserPassword(password, userValidationSalt, userPassword) { 16451 var hashData = new Uint8Array(password.length + 8); 16452 hashData.set(password, 0); 16453 hashData.set(userValidationSalt, password.length); 16454 var result = calculatePDF20Hash(password, hashData, []); 16455 return compareByteArrays(result, userPassword); 16456 }, 16457 getOwnerKey: function PDF20_getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { 16458 var hashData = new Uint8Array(password.length + 56); 16459 hashData.set(password, 0); 16460 hashData.set(ownerKeySalt, password.length); 16461 hashData.set(userBytes, password.length + ownerKeySalt.length); 16462 var key = calculatePDF20Hash(password, hashData, userBytes); 16463 var cipher = new AES256Cipher(key); 16464 return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); 16465 }, 16466 getUserKey: function PDF20_getUserKey(password, userKeySalt, userEncryption) { 16467 var hashData = new Uint8Array(password.length + 8); 16468 hashData.set(password, 0); 16469 hashData.set(userKeySalt, password.length); 16470 var key = calculatePDF20Hash(password, hashData, []); 16471 var cipher = new AES256Cipher(key); 16472 return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); 16473 } 16474 }; 16475 return PDF20; 16476}(); 16477var CipherTransform = function CipherTransformClosure() { 16478 function CipherTransform(stringCipherConstructor, streamCipherConstructor) { 16479 this.StringCipherConstructor = stringCipherConstructor; 16480 this.StreamCipherConstructor = streamCipherConstructor; 16481 } 16482 CipherTransform.prototype = { 16483 createStream: function CipherTransform_createStream(stream, length) { 16484 var cipher = new this.StreamCipherConstructor(); 16485 return new _stream.DecryptStream(stream, length, function cipherTransformDecryptStream(data, finalize) { 16486 return cipher.decryptBlock(data, finalize); 16487 }); 16488 }, 16489 decryptString: function CipherTransform_decryptString(s) { 16490 var cipher = new this.StringCipherConstructor(); 16491 var data = (0, _util.stringToBytes)(s); 16492 data = cipher.decryptBlock(data, true); 16493 return (0, _util.bytesToString)(data); 16494 } 16495 }; 16496 return CipherTransform; 16497}(); 16498var CipherTransformFactory = function CipherTransformFactoryClosure() { 16499 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]); 16500 function createEncryptionKey20(revision, password, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms) { 16501 if (password) { 16502 var passwordLength = Math.min(127, password.length); 16503 password = password.subarray(0, passwordLength); 16504 } else { 16505 password = []; 16506 } 16507 var pdfAlgorithm; 16508 if (revision === 6) { 16509 pdfAlgorithm = new PDF20(); 16510 } else { 16511 pdfAlgorithm = new PDF17(); 16512 } 16513 if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, userPassword)) { 16514 return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption); 16515 } else if (password.length && pdfAlgorithm.checkOwnerPassword(password, ownerValidationSalt, uBytes, ownerPassword)) {
16516 return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, ownerEncryption); 16517 } 16518 return null; 16519 } 16520 function prepareKeyData(fileId, password, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata) { 16521 var hashDataSize = 40 + ownerPassword.length + fileId.length; 16522 var hashData = new Uint8Array(hashDataSize), 16523 i = 0, 16524 j, 16525 n; 16526 if (password) { 16527 n = Math.min(32, password.length); 16528 for (; i < n; ++i) { 16529 hashData[i] = password[i]; 16530 } 16531 } 16532 j = 0; 16533 while (i < 32) { 16534 hashData[i++] = defaultPasswordBytes[j++]; 16535 } 16536 for (j = 0, n = ownerPassword.length; j < n; ++j) { 16537 hashData[i++] = ownerPassword[j]; 16538 } 16539 hashData[i++] = flags & 0xFF; 16540 hashData[i++] = flags >> 8 & 0xFF; 16541 hashData[i++] = flags >> 16 & 0xFF; 16542 hashData[i++] = flags >>> 24 & 0xFF; 16543 for (j = 0, n = fileId.length; j < n; ++j) { 16544 hashData[i++] = fileId[j]; 16545 } 16546 if (revision >= 4 && !encryptMetadata) { 16547 hashData[i++] = 0xFF; 16548 hashData[i++] = 0xFF; 16549 hashData[i++] = 0xFF; 16550 hashData[i++] = 0xFF; 16551 } 16552 var hash = calculateMD5(hashData, 0, i); 16553 var keyLengthInBytes = keyLength >> 3; 16554 if (revision >= 3) { 16555 for (j = 0; j < 50; ++j) { 16556 hash = calculateMD5(hash, 0, keyLengthInBytes); 16557 } 16558 } 16559 var encryptionKey = hash.subarray(0, keyLengthInBytes); 16560 var cipher, checkData; 16561 if (revision >= 3) { 16562 for (i = 0; i < 32; ++i) { 16563 hashData[i] = defaultPasswordBytes[i]; 16564 } 16565 for (j = 0, n = fileId.length; j < n; ++j) { 16566 hashData[i++] = fileId[j]; 16567 } 16568 cipher = new ARCFourCipher(encryptionKey); 16569 checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i)); 16570 n = encryptionKey.length; 16571 var derivedKey = new Uint8Array(n), 16572 k; 16573 for (j = 1; j <= 19; ++j) { 16574 for (k = 0; k < n; ++k) { 16575 derivedKey[k] = encryptionKey[k] ^ j; 16576 } 16577 cipher = new ARCFourCipher(derivedKey); 16578 checkData = cipher.encryptBlock(checkData); 16579 } 16580 for (j = 0, n = checkData.length; j < n; ++j) { 16581 if (userPassword[j] !== checkData[j]) { 16582 return null; 16583 } 16584 } 16585 } else { 16586 cipher = new ARCFourCipher(encryptionKey); 16587 checkData = cipher.encryptBlock(defaultPasswordBytes); 16588 for (j = 0, n = checkData.length; j < n; ++j) { 16589 if (userPassword[j] !== checkData[j]) { 16590 return null; 16591 } 16592 } 16593 } 16594 return encryptionKey; 16595 } 16596 function decodeUserPassword(password, ownerPassword, revision, keyLength) { 16597 var hashData = new Uint8Array(32), 16598 i = 0, 16599 j, 16600 n; 16601 n = Math.min(32, password.length); 16602 for (; i < n; ++i) { 16603 hashData[i] = password[i]; 16604 } 16605 j = 0; 16606 while (i < 32) { 16607 hashData[i++] = defaultPasswordBytes[j++]; 16608 } 16609 var hash = calculateMD5(hashData, 0, i); 16610 var keyLengthInBytes = keyLength >> 3; 16611 if (revision >= 3) { 16612 for (j = 0; j < 50; ++j) { 16613 hash = calculateMD5(hash, 0, hash.length); 16614 } 16615 } 16616 var cipher, userPassword; 16617 if (revision >= 3) { 16618 userPassword = ownerPassword; 16619 var derivedKey = new Uint8Array(keyLengthInBytes), 16620 k; 16621 for (j = 19; j >= 0; j--) { 16622 for (k = 0; k < keyLengthInBytes; ++k) { 16623 derivedKey[k] = hash[k] ^ j; 16624 } 16625 cipher = new ARCFourCipher(derivedKey); 16626 userPassword = cipher.encryptBlock(userPassword); 16627 } 16628 } else { 16629 cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes)); 16630 userPassword = cipher.encryptBlock(ownerPassword); 16631 } 16632 return userPassword; 16633 } 16634 var identityName = _primitives.Name.get('Identity'); 16635 function CipherTransformFactory(dict, fileId, password) { 16636 var filter = dict.get('Filter'); 16637 if (!(0, _primitives.isName)(filter, 'Standard')) { 16638 throw new _util.FormatError('unknown encryption method'); 16639 } 16640 this.dict = dict; 16641 var algorithm = dict.get('V'); 16642 if (!Number.isInteger(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) { 16643 throw new _util.FormatError('unsupported encryption algorithm'); 16644 } 16645 this.algorithm = algorithm; 16646 var keyLength = dict.get('Length'); 16647 if (!keyLength) { 16648 if (algorithm <= 3) { 16649 keyLength = 40; 16650 } else { 16651 var cfDict = dict.get('CF'); 16652 var streamCryptoName = dict.get('StmF'); 16653 if ((0, _primitives.isDict)(cfDict) && (0, _primitives.isName)(streamCryptoName)) { 16654 cfDict.suppressEncryption = true; 16655 var handlerDict = cfDict.get(streamCryptoName.name); 16656 keyLength = handlerDict && handlerDict.get('Length') || 128; 16657 if (keyLength < 40) { 16658 keyLength <<= 3; 16659 } 16660 } 16661 } 16662 } 16663 if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) { 16664 throw new _util.FormatError('invalid key length'); 16665 } 16666 var ownerPassword = (0, _util.stringToBytes)(dict.get('O')).subarray(0, 32); 16667 var userPassword = (0, _util.stringToBytes)(dict.get('U')).subarray(0, 32); 16668 var flags = dict.get('P'); 16669 var revision = dict.get('R'); 16670 var encryptMetadata = (algorithm === 4 || algorithm === 5) && dict.get('EncryptMetadata') !== false; 16671 this.encryptMetadata = encryptMetadata; 16672 var fileIdBytes = (0, _util.stringToBytes)(fileId); 16673 var passwordBytes; 16674 if (password) { 16675 if (revision === 6) { 16676 try { 16677 password = (0, _util.utf8StringToString)(password); 16678 } catch (ex) { 16679 (0, _util.warn)('CipherTransformFactory: ' + 'Unable to convert UTF8 encoded password.'); 16680 } 16681 } 16682 passwordBytes = (0, _util.stringToBytes)(password); 16683 } 16684 var encryptionKey; 16685 if (algorithm !== 5) { 16686 encryptionKey = prepareKeyData(fileIdBytes, passwordBytes, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); 16687 } else { 16688 var ownerValidationSalt = (0, _util.stringToBytes)(dict.get('O')).subarray(32, 40);
16689 var ownerKeySalt = (0, _util.stringToBytes)(dict.get('O')).subarray(40, 48); 16690 var uBytes = (0, _util.stringToBytes)(dict.get('U')).subarray(0, 48); 16691 var userValidationSalt = (0, _util.stringToBytes)(dict.get('U')).subarray(32, 40); 16692 var userKeySalt = (0, _util.stringToBytes)(dict.get('U')).subarray(40, 48); 16693 var ownerEncryption = (0, _util.stringToBytes)(dict.get('OE')); 16694 var userEncryption = (0, _util.stringToBytes)(dict.get('UE')); 16695 var perms = (0, _util.stringToBytes)(dict.get('Perms')); 16696 encryptionKey = createEncryptionKey20(revision, passwordBytes, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms); 16697 } 16698 if (!encryptionKey && !password) { 16699 throw new _util.PasswordException('No password given', _util.PasswordResponses.NEED_PASSWORD); 16700 } else if (!encryptionKey && password) { 16701 var decodedPassword = decodeUserPassword(passwordBytes, ownerPassword, revision, keyLength); 16702 encryptionKey = prepareKeyData(fileIdBytes, decodedPassword, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); 16703 } 16704 if (!encryptionKey) { 16705 throw new _util.PasswordException('Incorrect Password', _util.PasswordResponses.INCORRECT_PASSWORD); 16706 } 16707 this.encryptionKey = encryptionKey; 16708 if (algorithm >= 4) { 16709 var cf = dict.get('CF'); 16710 if ((0, _primitives.isDict)(cf)) { 16711 cf.suppressEncryption = true; 16712 } 16713 this.cf = cf; 16714 this.stmf = dict.get('StmF') || identityName; 16715 this.strf = dict.get('StrF') || identityName; 16716 this.eff = dict.get('EFF') || this.stmf; 16717 } 16718 } 16719 function buildObjectKey(num, gen, encryptionKey, isAes) { 16720 var key = new Uint8Array(encryptionKey.length + 9), 16721 i, 16722 n; 16723 for (i = 0, n = encryptionKey.length; i < n; ++i) { 16724 key[i] = encryptionKey[i]; 16725 } 16726 key[i++] = num & 0xFF; 16727 key[i++] = num >> 8 & 0xFF; 16728 key[i++] = num >> 16 & 0xFF; 16729 key[i++] = gen & 0xFF; 16730 key[i++] = gen >> 8 & 0xFF; 16731 if (isAes) { 16732 key[i++] = 0x73; 16733 key[i++] = 0x41; 16734 key[i++] = 0x6C; 16735 key[i++] = 0x54; 16736 } 16737 var hash = calculateMD5(key, 0, i); 16738 return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); 16739 } 16740 function buildCipherConstructor(cf, name, num, gen, key) { 16741 if (!(0, _primitives.isName)(name)) { 16742 throw new _util.FormatError('Invalid crypt filter name.'); 16743 } 16744 var cryptFilter = cf.get(name.name); 16745 var cfm;
16746 if (cryptFilter !== null && cryptFilter !== undefined) { 16747 cfm = cryptFilter.get('CFM'); 16748 } 16749 if (!cfm || cfm.name === 'None') { 16750 return function cipherTransformFactoryBuildCipherConstructorNone() { 16751 return new NullCipher(); 16752 }; 16753 } 16754 if (cfm.name === 'V2') { 16755 return function cipherTransformFactoryBuildCipherConstructorV2() { 16756 return new ARCFourCipher(buildObjectKey(num, gen, key, false)); 16757 }; 16758 } 16759 if (cfm.name === 'AESV2') { 16760 return function cipherTransformFactoryBuildCipherConstructorAESV2() { 16761 return new AES128Cipher(buildObjectKey(num, gen, key, true)); 16762 }; 16763 } 16764 if (cfm.name === 'AESV3') { 16765 return function cipherTransformFactoryBuildCipherConstructorAESV3() { 16766 return new AES256Cipher(key); 16767 }; 16768 } 16769 throw new _util.FormatError('Unknown crypto method'); 16770 } 16771 CipherTransformFactory.prototype = { 16772 createCipherTransform: function CipherTransformFactory_createCipherTransform(num, gen) { 16773 if (this.algorithm === 4 || this.algorithm === 5) { 16774 return new CipherTransform(buildCipherConstructor(this.cf, this.stmf, num, gen, this.encryptionKey), buildCipherConstructor(this.cf, this.strf, num, gen, this.encryptionKey)); 16775 } 16776 var key = buildObjectKey(num, gen, this.encryptionKey, false); 16777 var cipherConstructor = function buildCipherCipherConstructor() { 16778 return new ARCFourCipher(key); 16779 }; 16780 return new CipherTransform(cipherConstructor, cipherConstructor); 16781 } 16782 }; 16783 return CipherTransformFactory; 16784}(); 16785exports.AES128Cipher = AES128Cipher; 16786exports.AES256Cipher = AES256Cipher; 16787exports.ARCFourCipher = ARCFourCipher; 16788exports.CipherTransformFactory = CipherTransformFactory; 16789exports.PDF17 = PDF17; 16790exports.PDF20 = PDF20; 16791exports.calculateMD5 = calculateMD5; 16792exports.calculateSHA256 = calculateSHA256; 16793exports.calculateSHA384 = calculateSHA384; 16794exports.calculateSHA512 = calculateSHA512; 16795 16796/***/ }), 16797/* 67 */ 16798/***/ (function(module, exports, __w_pdfjs_require__) { 16799 16800"use strict"; 16801 16802 16803Object.defineProperty(exports, "__esModule", { 16804 value: true 16805}); 16806exports.PartialEvaluator = exports.OperatorList = undefined; 16807 16808var _util = __w_pdfjs_require__(0); 16809 16810var _cmap = __w_pdfjs_require__(113); 16811 16812var _stream = __w_pdfjs_require__(5); 16813 16814var _primitives = __w_pdfjs_require__(2); 16815 16816var _fonts = __w_pdfjs_require__(114); 16817 16818var _encodings = __w_pdfjs_require__(22); 16819 16820var _unicode = __w_pdfjs_require__(70); 16821 16822var _standard_fonts = __w_pdfjs_require__(69); 16823 16824var _pattern = __w_pdfjs_require__(118); 16825 16826var _parser = __w_pdfjs_require__(29); 16827 16828var _bidi = __w_pdfjs_require__(119); 16829 16830var _colorspace = __w_pdfjs_require__(21); 16831 16832var _glyphlist = __w_pdfjs_require__(42); 16833 16834var _metrics = __w_pdfjs_require__(120); 16835 16836var _function = __w_pdfjs_require__(71); 16837 16838var _murmurhash = __w_pdfjs_require__(122); 16839 16840var _image = __w_pdfjs_require__(123); 16841 16842var PartialEvaluator = function PartialEvaluatorClosure() { 16843 var DefaultPartialEvaluatorOptions = { 16844 forceDataSchema: false, 16845 maxImageSize: -1, 16846 disableFontFace: false, 16847 nativeImageDecoderSupport: _util.NativeImageDecoding.DECODE, 16848 ignoreErrors: false, 16849 isEvalSupported: true 16850 }; 16851 function NativeImageDecoder(_ref) { 16852 var xref = _ref.xref, 16853 resources = _ref.resources, 16854 handler = _ref.handler, 16855 _ref$forceDataSchema = _ref.forceDataSchema, 16856 forceDataSchema = _ref$forceDataSchema === undefined ? false : _ref$forceDataSchema, 16857 pdfFunctionFactory = _ref.pdfFunctionFactory; 16858 16859 this.xref = xref; 16860 this.resources = resources; 16861 this.handler = handler; 16862 this.forceDataSchema = forceDataSchema; 16863 this.pdfFunctionFactory = pdfFunctionFactory; 16864 } 16865 NativeImageDecoder.prototype = { 16866 canDecode: function canDecode(image) { 16867 return image instanceof _stream.JpegStream && NativeImageDecoder.isDecodable(image, this.xref, this.resources, this.pdfFunctionFactory); 16868 }, 16869 decode: function decode(image) { 16870 var dict = image.dict; 16871 var colorSpace = dict.get('ColorSpace', 'CS'); 16872 colorSpace = _colorspace.ColorSpace.parse(colorSpace, this.xref, this.resources, this.pdfFunctionFactory); 16873 var numComps = colorSpace.numComps;
16874 var decodePromise = this.handler.sendWithPromise('JpegDecode', [image.getIR(this.forceDataSchema), numComps]); 16875 return decodePromise.then(function (message) { 16876 var data = message.data; 16877 return new _stream.Stream(data, 0, data.length, image.dict); 16878 }); 16879 } 16880 }; 16881 NativeImageDecoder.isSupported = function (image, xref, res, pdfFunctionFactory) { 16882 var dict = image.dict; 16883 if (dict.has('DecodeParms') || dict.has('DP')) { 16884 return false; 16885 } 16886 var cs = _colorspace.ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res, pdfFunctionFactory); 16887 return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') && cs.isDefaultDecode(dict.getArray('Decode', 'D')); 16888 }; 16889 NativeImageDecoder.isDecodable = function (image, xref, res, pdfFunctionFactory) { 16890 var dict = image.dict; 16891 if (dict.has('DecodeParms') || dict.has('DP')) { 16892 return false; 16893 } 16894 var cs = _colorspace.ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res, pdfFunctionFactory); 16895 return (cs.numComps === 1 || cs.numComps === 3) && cs.isDefaultDecode(dict.getArray('Decode', 'D')); 16896 }; 16897 function PartialEvaluator(_ref2) { 16898 var _this = this; 16899 16900 var pdfManager = _ref2.pdfManager, 16901 xref = _ref2.xref, 16902 handler = _ref2.handler, 16903 pageIndex = _ref2.pageIndex, 16904 idFactory = _ref2.idFactory, 16905 fontCache = _ref2.fontCache, 16906 builtInCMapCache = _ref2.builtInCMapCache, 16907 _ref2$options = _ref2.options, 16908 options = _ref2$options === undefined ? null : _ref2$options, 16909 pdfFunctionFactory = _ref2.pdfFunctionFactory; 16910 16911 this.pdfManager = pdfManager; 16912 this.xref = xref; 16913 this.handler = handler; 16914 this.pageIndex = pageIndex; 16915 this.idFactory = idFactory; 16916 this.fontCache = fontCache; 16917 this.builtInCMapCache = builtInCMapCache; 16918 this.options = options || DefaultPartialEvaluatorOptions; 16919 this.pdfFunctionFactory = pdfFunctionFactory; 16920 this.fetchBuiltInCMap = function (name) { 16921 var cachedCMap = _this.builtInCMapCache[name]; 16922 if (cachedCMap) { 16923 return Promise.resolve(cachedCMap); 16924 } 16925 return _this.handler.sendWithPromise('FetchBuiltInCMap', { name: name }).then(function (data) { 16926 if (data.compressionType !== _util.CMapCompressionType.NONE) { 16927 _this.builtInCMapCache[name] = data; 16928 } 16929 return data; 16930 }); 16931 }; 16932 } 16933 var TIME_SLOT_DURATION_MS = 20; 16934 var CHECK_TIME_EVERY = 100; 16935 function TimeSlotManager() { 16936 this.reset(); 16937 } 16938 TimeSlotManager.prototype = { 16939 check: function TimeSlotManager_check() { 16940 if (++this.checked < CHECK_TIME_EVERY) { 16941 return false; 16942 } 16943 this.checked = 0; 16944 return this.endTime <= Date.now(); 16945 }, 16946 reset: function TimeSlotManager_reset() { 16947 this.endTime = Date.now() + TIME_SLOT_DURATION_MS; 16948 this.checked = 0; 16949 } 16950 }; 16951 function normalizeBlendMode(value) { 16952 if (!(0, _primitives.isName)(value)) { 16953 return 'source-over'; 16954 } 16955 switch (value.name) { 16956 case 'Normal': 16957 case 'Compatible': 16958 return 'source-over'; 16959 case 'Multiply': 16960 return 'multiply'; 16961 case 'Screen': 16962 return 'screen'; 16963 case 'Overlay': 16964 return 'overlay'; 16965 case 'Darken': 16966 return 'darken'; 16967 case 'Lighten': 16968 return 'lighten'; 16969 case 'ColorDodge': 16970 return 'color-dodge'; 16971 case 'ColorBurn': 16972 return 'color-burn'; 16973 case 'HardLight': 16974 return 'hard-light'; 16975 case 'SoftLight': 16976 return 'soft-light'; 16977 case 'Difference': 16978 return 'difference'; 16979 case 'Exclusion': 16980 return 'exclusion'; 16981 case 'Hue': 16982 return 'hue'; 16983 case 'Saturation': 16984 return 'saturation'; 16985 case 'Color': 16986 return 'color'; 16987 case 'Luminosity': 16988 return 'luminosity'; 16989 } 16990 (0, _util.warn)('Unsupported blend mode: ' + value.name); 16991 return 'source-over'; 16992 } 16993 var deferred = Promise.resolve(); 16994 var TILING_PATTERN = 1, 16995 SHADING_PATTERN = 2; 16996 PartialEvaluator.prototype = { 16997 clone: function clone() { 16998 var newOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DefaultPartialEvaluatorOptions; 16999 17000 var newEvaluator = Object.create(this); 17001 newEvaluator.options = newOptions; 17002 return newEvaluator; 17003 }, 17004 17005 hasBlendModes: function PartialEvaluator_hasBlendModes(resources) { 17006 if (!(0, _primitives.isDict)(resources)) { 17007 return false;
17008 } 17009 var processed = Object.create(null); 17010 if (resources.objId) { 17011 processed[resources.objId] = true; 17012 } 17013 var nodes = [resources], 17014 xref = this.xref; 17015 while (nodes.length) { 17016 var key, i, ii; 17017 var node = nodes.shift(); 17018 var graphicStates = node.get('ExtGState'); 17019 if ((0, _primitives.isDict)(graphicStates)) { 17020 var graphicStatesKeys = graphicStates.getKeys(); 17021 for (i = 0, ii = graphicStatesKeys.length; i < ii; i++) { 17022 key = graphicStatesKeys[i]; 17023 var graphicState = graphicStates.get(key); 17024 var bm = graphicState.get('BM'); 17025 if ((0, _primitives.isName)(bm) && bm.name !== 'Normal') { 17026 return true; 17027 } 17028 } 17029 } 17030 var xObjects = node.get('XObject'); 17031 if (!(0, _primitives.isDict)(xObjects)) { 17032 continue; 17033 } 17034 var xObjectsKeys = xObjects.getKeys(); 17035 for (i = 0, ii = xObjectsKeys.length; i < ii; i++) { 17036 key = xObjectsKeys[i]; 17037 var xObject = xObjects.getRaw(key); 17038 if ((0, _primitives.isRef)(xObject)) { 17039 if (processed[xObject.toString()]) { 17040 continue; 17041 } 17042 xObject = xref.fetch(xObject); 17043 } 17044 if (!(0, _primitives.isStream)(xObject)) { 17045 continue; 17046 } 17047 if (xObject.dict.objId) { 17048 if (processed[xObject.dict.objId]) { 17049 continue; 17050 } 17051 processed[xObject.dict.objId] = true; 17052 } 17053 var xResources = xObject.dict.get('Resources'); 17054 if ((0, _primitives.isDict)(xResources) && (!xResources.objId || !processed[xResources.objId])) { 17055 nodes.push(xResources); 17056 if (xResources.objId) { 17057 processed[xResources.objId] = true; 17058 } 17059 } 17060 } 17061 } 17062 return false; 17063 }, 17064 buildFormXObject: function PartialEvaluator_buildFormXObject(resources, xobj, smask, operatorList, task, initialState) { 17065 var dict = xobj.dict; 17066 var matrix = dict.getArray('Matrix'); 17067 var bbox = dict.getArray('BBox'); 17068 var group = dict.get('Group'); 17069 if (group) { 17070 var groupOptions = { 17071 matrix: matrix, 17072 bbox: bbox, 17073 smask: smask, 17074 isolated: false, 17075 knockout: false 17076 }; 17077 var groupSubtype = group.get('S'); 17078 var colorSpace = null; 17079 if ((0, _primitives.isName)(groupSubtype, 'Transparency')) { 17080 groupOptions.isolated = group.get('I') || false; 17081 groupOptions.knockout = group.get('K') || false; 17082 if (group.has('CS')) { 17083 colorSpace = _colorspace.ColorSpace.parse(group.get('CS'), this.xref, resources, this.pdfFunctionFactory); 17084 } 17085 } 17086 if (smask && smask.backdrop) { 17087 colorSpace = colorSpace || _colorspace.ColorSpace.singletons.rgb; 17088 smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); 17089 } 17090 operatorList.addOp(_util.OPS.beginGroup, [groupOptions]); 17091 } 17092 operatorList.addOp(_util.OPS.paintFormXObjectBegin, [matrix, bbox]); 17093 return this.getOperatorList({ 17094 stream: xobj, 17095 task: task, 17096 resources: dict.get('Resources') || resources, 17097 operatorList: operatorList, 17098 initialState: initialState 17099 }).then(function () { 17100 operatorList.addOp(_util.OPS.paintFormXObjectEnd, []); 17101 if (group) { 17102 operatorList.addOp(_util.OPS.endGroup, [groupOptions]); 17103 } 17104 }); 17105 }, 17106 buildPaintImageXObject: function PartialEvaluator_buildPaintImageXObject(resources, image, inline, operatorList, cacheKey, imageCache) { 17107 var _this2 = this; 17108 17109 var dict = image.dict; 17110 var w = dict.get('Width', 'W'); 17111 var h = dict.get('Height', 'H'); 17112 if (!(w && (0, _util.isNum)(w)) || !(h && (0, _util.isNum)(h))) { 17113 (0, _util.warn)('Image dimensions are missing, or not numbers.'); 17114 return; 17115 } 17116 var maxImageSize = this.options.maxImageSize; 17117 if (maxImageSize !== -1 && w * h > maxImageSize) { 17118 (0, _util.warn)('Image exceeded maximum allowed size and was removed.'); 17119 return; 17120 } 17121 var imageMask = dict.get('ImageMask', 'IM') || false; 17122 var imgData, args; 17123 if (imageMask) { 17124 var width = dict.get('Width', 'W'); 17125 var height = dict.get('Height', 'H'); 17126 var bitStrideLength = width + 7 >> 3; 17127 var imgArray = image.getBytes(bitStrideLength * height); 17128 var decode = dict.getArray('Decode', 'D'); 17129 imgData = _image.PDFImage.createMask({ 17130 imgArray: imgArray, 17131 width: width, 17132 height: height,
vendor: 4,411 bytes, lines 17133-17236
17133 imageIsFromDecodeStream: image instanceof _stream.DecodeStream, 17134 inverseDecode: !!decode && decode[0] > 0 17135 }); 17136 imgData.cached = true; 17137 args = [imgData]; 17138 operatorList.addOp(_util.OPS.paintImageMaskXObject, args); 17139 if (cacheKey) { 17140 imageCache[cacheKey] = { 17141 fn: _util.OPS.paintImageMaskXObject, 17142 args: args 17143 }; 17144 } 17145 return; 17146 } 17147 var softMask = dict.get('SMask', 'SM') || false; 17148 var mask = dict.get('Mask') || false; 17149 var SMALL_IMAGE_DIMENSIONS = 200; 17150 if (inline && !softMask && !mask && !(image instanceof _stream.JpegStream) && w + h < SMALL_IMAGE_DIMENSIONS) { 17151 var imageObj = new _image.PDFImage({ 17152 xref: this.xref, 17153 res: resources, 17154 image: image, 17155 pdfFunctionFactory: this.pdfFunctionFactory 17156 }); 17157 imgData = imageObj.createImageData(true); 17158 operatorList.addOp(_util.OPS.paintInlineImageXObject, [imgData]); 17159 return; 17160 } 17161 var nativeImageDecoderSupport = this.options.nativeImageDecoderSupport; 17162 var objId = 'img_' + this.idFactory.createObjId(); 17163 operatorList.addDependency(objId); 17164 args = [objId, w, h]; 17165 if (nativeImageDecoderSupport !== _util.NativeImageDecoding.NONE && !softMask && !mask && image instanceof _stream.JpegStream && NativeImageDecoder.isSupported(image, this.xref, resources, this.pdfFunctionFactory)) { 17166 operatorList.addOp(_util.OPS.paintJpegXObject, args); 17167 this.handler.send('obj', [objId, this.pageIndex, 'JpegStream', image.getIR(this.options.forceDataSchema)]); 17168 if (cacheKey) { 17169 imageCache[cacheKey] = { 17170 fn: _util.OPS.paintJpegXObject, 17171 args: args 17172 }; 17173 } 17174 return; 17175 } 17176 var nativeImageDecoder = null; 17177 if (nativeImageDecoderSupport === _util.NativeImageDecoding.DECODE && (image instanceof _stream.JpegStream || mask instanceof _stream.JpegStream || softMask instanceof _stream.JpegStream)) { 17178 nativeImageDecoder = new NativeImageDecoder({ 17179 xref: this.xref, 17180 resources: resources, 17181 handler: this.handler, 17182 forceDataSchema: this.options.forceDataSchema, 17183 pdfFunctionFactory: this.pdfFunctionFactory 17184 }); 17185 } 17186 _image.PDFImage.buildImage({ 17187 handler: this.handler, 17188 xref: this.xref, 17189 res: resources, 17190 image: image, 17191 nativeDecoder: nativeImageDecoder, 17192 pdfFunctionFactory: this.pdfFunctionFactory 17193 }).then(function (imageObj) { 17194 var imgData = imageObj.createImageData(false); 17195 _this2.handler.send('obj', [objId, _this2.pageIndex, 'Image', imgData], [imgData.data.buffer]); 17196 }).catch(function (reason) { 17197 (0, _util.warn)('Unable to decode image: ' + reason); 17198 _this2.handler.send('obj', [objId, _this2.pageIndex, 'Image', null]); 17199 }); 17200 operatorList.addOp(_util.OPS.paintImageXObject, args); 17201 if (cacheKey) { 17202 imageCache[cacheKey] = { 17203 fn: _util.OPS.paintImageXObject, 17204 args: args 17205 }; 17206 } 17207 }, 17208 handleSMask: function PartialEvaluator_handleSmask(smask, resources, operatorList, task, stateManager) { 17209 var smaskContent = smask.get('G'); 17210 var smaskOptions = { 17211 subtype: smask.get('S').name, 17212 backdrop: smask.get('BC') 17213 }; 17214 var transferObj = smask.get('TR'); 17215 if ((0, _function.isPDFFunction)(transferObj)) { 17216 var transferFn = this.pdfFunctionFactory.create(transferObj); 17217 var transferMap = new Uint8Array(256); 17218 var tmp = new Float32Array(1); 17219 for (var i = 0; i < 256; i++) { 17220 tmp[0] = i / 255; 17221 transferFn(tmp, 0, tmp, 0); 17222 transferMap[i] = tmp[0] * 255 | 0; 17223 } 17224 smaskOptions.transferMap = transferMap; 17225 } 17226 return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone()); 17227 }, 17228 handleTilingType: function handleTilingType(fn, args, resources, pattern, patternDict, operatorList, task) { 17229 var _this3 = this; 17230 17231 var tilingOpList = new OperatorList(); 17232 var resourcesArray = [patternDict.get('Resources'), resources]; 17233 var patternResources = _primitives.Dict.merge(this.xref, resourcesArray); 17234 return this.getOperatorList({ 17235 stream: pattern, 17236 task: task,
17237 resources: patternResources, 17238 operatorList: tilingOpList 17239 }).then(function () { 17240 return (0, _pattern.getTilingPatternIR)({ 17241 fnArray: tilingOpList.fnArray, 17242 argsArray: tilingOpList.argsArray 17243 }, patternDict, args); 17244 }).then(function (tilingPatternIR) { 17245 operatorList.addDependencies(tilingOpList.dependencies); 17246 operatorList.addOp(fn, tilingPatternIR); 17247 }, function (reason) { 17248 if (_this3.options.ignoreErrors) { 17249 _this3.handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.unknown }); 17250 (0, _util.warn)('handleTilingType - ignoring pattern: "' + reason + '".'); 17251 return; 17252 } 17253 throw reason; 17254 }); 17255 }, 17256 17257 handleSetFont: function PartialEvaluator_handleSetFont(resources, fontArgs, fontRef, operatorList, task, state) { 17258 var _this4 = this; 17259 17260 var fontName; 17261 if (fontArgs) { 17262 fontArgs = fontArgs.slice(); 17263 fontName = fontArgs[0].name; 17264 } 17265 return this.loadFont(fontName, fontRef, resources).then(function (translated) { 17266 if (!translated.font.isType3Font) { 17267 return translated; 17268 } 17269 return translated.loadType3Data(_this4, resources, operatorList, task).then(function () { 17270 return translated; 17271 }).catch(function (reason) { 17272 _this4.handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.font }); 17273 return new TranslatedFont('g_font_error', new _fonts.ErrorFont('Type3 font load error: ' + reason), translated.font); 17274 }); 17275 }).then(function (translated) { 17276 state.font = translated.font; 17277 translated.send(_this4.handler); 17278 return translated.loadedName; 17279 }); 17280 },
17281 handleText: function PartialEvaluator_handleText(chars, state) { 17282 var _this5 = this; 17283 17284 var font = state.font; 17285 var glyphs = font.charsToGlyphs(chars); 17286 var isAddToPathSet = !!(state.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG); 17287 if (font.data && (isAddToPathSet || this.options.disableFontFace)) { 17288 var buildPath = function buildPath(fontChar) { 17289 if (!font.renderer.hasBuiltPath(fontChar)) { 17290 var path = font.renderer.getPathJs(fontChar); 17291 _this5.handler.send('commonobj', [font.loadedName + '_path_' + fontChar, 'FontPath', path]); 17292 } 17293 }; 17294 for (var i = 0, ii = glyphs.length; i < ii; i++) { 17295 var glyph = glyphs[i]; 17296 buildPath(glyph.fontChar); 17297 var accent = glyph.accent; 17298 if (accent && accent.fontChar) { 17299 buildPath(accent.fontChar); 17300 } 17301 } 17302 } 17303 return glyphs; 17304 }, 17305 setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, stateManager) { 17306 var _this6 = this; 17307 17308 var gStateObj = []; 17309 var gStateKeys = gState.getKeys(); 17310 var promise = Promise.resolve(); 17311 17312 var _loop = function _loop() { 17313 var key = gStateKeys[i]; 17314 var value = gState.get(key); 17315 switch (key) { 17316 case 'Type': 17317 break; 17318 case 'LW': 17319 case 'LC': 17320 case 'LJ': 17321 case 'ML': 17322 case 'D': 17323 case 'RI': 17324 case 'FL': 17325 case 'CA': 17326 case 'ca': 17327 gStateObj.push([key, value]); 17328 break; 17329 case 'Font': 17330 promise = promise.then(function () { 17331 return _this6.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) { 17332 operatorList.addDependency(loadedName); 17333 gStateObj.push([key, [loadedName, value[1]]]); 17334 }); 17335 }); 17336 break; 17337 case 'BM': 17338 gStateObj.push([key, normalizeBlendMode(value)]); 17339 break; 17340 case 'SMask': 17341 if ((0, _primitives.isName)(value, 'None')) { 17342 gStateObj.push([key, false]); 17343 break; 17344 } 17345 if ((0, _primitives.isDict)(value)) { 17346 promise = promise.then(function () { 17347 return _this6.handleSMask(value, resources, operatorList, task, stateManager); 17348 }); 17349 gStateObj.push([key, true]); 17350 } else { 17351 (0, _util.warn)('Unsupported SMask type'); 17352 } 17353 break; 17354 case 'OP': 17355 case 'op': 17356 case 'OPM': 17357 case 'BG': 17358 case 'BG2': 17359 case 'UCR': 17360 case 'UCR2': 17361 case 'TR': 17362 case 'TR2': 17363 case 'HT': 17364 case 'SM': 17365 case 'SA': 17366 case 'AIS': 17367 case 'TK': 17368 (0, _util.info)('graphic state operator ' + key); 17369 break; 17370 default: 17371 (0, _util.info)('Unknown graphic state operator ' + key); 17372 break; 17373 } 17374 }; 17375 17376 for (var i = 0, ii = gStateKeys.length; i < ii; i++) { 17377 _loop(); 17378 } 17379 return promise.then(function () { 17380 if (gStateObj.length > 0) { 17381 operatorList.addOp(_util.OPS.setGState, [gStateObj]); 17382 } 17383 }); 17384 }, 17385 loadFont: function PartialEvaluator_loadFont(fontName, font, resources) { 17386 var _this7 = this; 17387 17388 function errorFont() { 17389 return Promise.resolve(new TranslatedFont('g_font_error', new _fonts.ErrorFont('Font ' + fontName + ' is not available'), font)); 17390 } 17391 var fontRef, 17392 xref = this.xref; 17393 if (font) { 17394 if (!(0, _primitives.isRef)(font)) { 17395 throw new Error('The "font" object should be a reference.'); 17396 } 17397 fontRef = font; 17398 } else { 17399 var fontRes = resources.get('Font'); 17400 if (fontRes) { 17401 fontRef = fontRes.getRaw(fontName); 17402 } else { 17403 (0, _util.warn)('fontRes not available'); 17404 return errorFont(); 17405 } 17406 } 17407 if (!fontRef) { 17408 (0, _util.warn)('fontRef not available'); 17409 return errorFont(); 17410 } 17411 if (this.fontCache.has(fontRef)) { 17412 return this.fontCache.get(fontRef); 17413 } 17414 font = xref.fetchIfRef(fontRef); 17415 if (!(0, _primitives.isDict)(font)) { 17416 return errorFont(); 17417 } 17418 if (font.translated) { 17419 return font.translated; 17420 } 17421 var fontCapability = (0, _util.createPromiseCapability)(); 17422 var preEvaluatedFont = this.preEvaluateFont(font); 17423 var descriptor = preEvaluatedFont.descriptor; 17424 var fontRefIsRef = (0, _primitives.isRef)(fontRef), 17425 fontID; 17426 if (fontRefIsRef) { 17427 fontID = fontRef.toString(); 17428 } 17429 if ((0, _primitives.isDict)(descriptor)) { 17430 if (!descriptor.fontAliases) { 17431 descriptor.fontAliases = Object.create(null); 17432 } 17433 var fontAliases = descriptor.fontAliases; 17434 var hash = preEvaluatedFont.hash; 17435 if (fontAliases[hash]) { 17436 var aliasFontRef = fontAliases[hash].aliasRef; 17437 if (fontRefIsRef && aliasFontRef && this.fontCache.has(ali
17437asFontRef)) { 17438 this.fontCache.putAlias(fontRef, aliasFontRef); 17439 return this.fontCache.get(fontRef); 17440 } 17441 } else { 17442 fontAliases[hash] = { fontID: _fonts.Font.getFontID() }; 17443 } 17444 if (fontRefIsRef) { 17445 fontAliases[hash].aliasRef = fontRef; 17446 } 17447 fontID = fontAliases[hash].fontID; 17448 } 17449 if (fontRefIsRef) { 17450 this.fontCache.put(fontRef, fontCapability.promise); 17451 } else { 17452 if (!fontID) { 17453 fontID = this.idFactory.createObjId(); 17454 } 17455 this.fontCache.put('id_' + fontID, fontCapability.promise); 17456 } 17457 (0, _util.assert)(fontID, 'The "fontID" must be defined.'); 17458 font.loadedName = 'g_' + this.pdfManager.docId + '_f' + fontID; 17459 font.translated = fontCapability.promise; 17460 var translatedPromise; 17461 try { 17462 translatedPromise = this.translateFont(preEvaluatedFont); 17463 } catch (e) { 17464 translatedPromise = Promise.reject(e); 17465 } 17466 translatedPromise.then(function (translatedFont) { 17467 if (translatedFont.fontType !== undefined) { 17468 var xrefFontStats = xref.stats.fontTypes; 17469 xrefFontStats[translatedFont.fontType] = true; 17470 } 17471 fontCapability.resolve(new TranslatedFont(font.loadedName, translatedFont, font)); 17472 }).catch(function (reason) { 17473 _this7.handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.font }); 17474 try { 17475 var descriptor = preEvaluatedFont.descriptor; 17476 var fontFile3 = descriptor && descriptor.get('FontFile3'); 17477 var subtype = fontFile3 && fontFile3.get('Subtype'); 17478 var fontType = (0, _fonts.getFontType)(preEvaluatedFont.type, subtype && subtype.name); 17479 var xrefFontStats = xref.stats.fontTypes; 17480 xrefFontStats[fontType] = true; 17481 } catch (ex) {} 17482 fontCapability.resolve(new TranslatedFont(font.loadedName, new _fonts.ErrorFont(reason instanceof Error ? reason.message : reason), font)); 17483 }); 17484 return fontCapability.promise; 17485 }, 17486 buildPath: function PartialEvaluator_buildPath(operatorList, fn, args) { 17487 var lastIndex = operatorList.length - 1; 17488 if (!args) { 17489 args = []; 17490 } 17491 if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== _util.OPS.constructPath) { 17492 operatorList.addOp(_util.OPS.constructPath, [[fn], args]); 17493 } else { 17494 var opArgs = operatorList.argsArray[lastIndex]; 17495 opArgs[0].push(fn); 17496 Array.prototype.push.apply(opArgs[1], args); 17497 } 17498 }, 17499 handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, cs, patterns, resources, task) { 17500 var patternName = args[args.length - 1]; 17501 var pattern; 17502 if ((0, _primitives.isName)(patternName) && (pattern = patterns.get(patternName.name))) { 17503 var dict = (0, _primitives.isStream)(pattern) ? pattern.dict : pattern; 17504 var typeNum = dict.get('PatternType'); 17505 if (typeNum === TILING_PATTERN) { 17506 var color = cs.base ? cs.base.getRgb(args, 0) : null; 17507 return this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task); 17508 } else if (typeNum === SHADING_PATTERN) { 17509 var shading = dict.get('Shading'); 17510 var matrix = dict.getArray('Matrix'); 17511 pattern = _pattern.Pattern.parseShading(shading, matrix, this.xref, resources, this.handler, this.pdfFunctionFactory); 17512 operatorList.addOp(fn, pattern.getIR()); 17513 return Promise.resolve(); 17514 } 17515 return Promise.reject(new Error('Unknown PatternType: ' + typeNum)); 17516 } 17517 operatorList.addOp(fn, args); 17518 return Promise.resolve(); 17519 }, 17520 getOperatorList: function getOperatorList(_ref3) { 17521 var _this8 = this; 17522 17523 var stream = _ref3.stream, 17524 task = _ref3.task, 17525 resources = _ref3.resources, 17526 operatorList = _ref3.operatorList, 17527 _ref3$initialState = _ref3.initialState, 17528 initialState = _ref3$initialState === undefined ? null : _ref3$initialState; 17529 17530 resources = resources || _primitives.Dict.empty; 17531 initialState = initialState || new EvalState(); 17532 if (!operatorList) { 17533 throw new Error('getOperatorList: missing "operatorList" parameter'); 17534 } 17535 var self = this; 17536 var xref = this.xref; 17537 var imageCache = Object.create(null); 17538 var xobjs = resources.get('XObject') || _primitives.Dict.empty; 17539 var patterns = resources.get('Pattern') || _primitives.Dict.empty; 17540 var stateManager = new StateManager(initialState); 17541 var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); 17542 var timeSlotManager = new TimeSlotManager(); 17543 function closePendingRestoreOPS(argument) { 17544 for (var i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { 17545 operatorList.addOp(_util.OPS.restore, []); 17546 } 17547 } 17548 return new Promise(function promiseBody(resolve, reject) { 17549 var next = function next(promise) { 17550 promise.then(function () { 17551 try { 17552 promiseBody(resolve, reject); 17553 } catch (ex) { 17554 reject(ex); 17555 } 17556 }, reject); 17557 }; 17558 task.ensureNotTerminated(); 17559 timeSlotManager.reset(); 17560 var stop, 17561 operation = {}, 17562 i, 17563 ii, 17564 cs; 17565 while (!(stop = timeSlotManager.check())) { 17566 operation.args = null; 17567 if (!preprocessor.read(operation)) { 17568 break; 17569 } 17570 var args = operation.args; 17571 var fn = operation.fn; 17572 switch (fn | 0) { 17573 case _util.OPS.paintXObject: 17574 var name = args[0].name; 17575 if (name && imageCache[name] !== undefined) { 17576 operatorList.addOp(imageCache[name].fn, imageCache[name].args); 17577 args = null; 17578 continue; 17579 } 17580 next(new Promise(function (resolveXObject, rejectXObject) { 17581 if (!name) { 17582 throw new _util.FormatError('XObject must be referred to by name.'); 17583 } 17584 var xobj = xobjs.get(name); 17585 if (!xobj) { 17586 operatorList.addOp(fn, args); 17587 resolveXObject(); 17588 return; 17589 } 17590 if (!(0, _primitives.isStream)(xobj)) { 17591 throw new _util.FormatError('XObject should be a stream'); 17592 } 17593 var type = xobj.dict.get('Subtype'); 17594 if (!(0, _primitives.isName)(type)) { 17595 throw new _util.FormatError('XObject should have a Name subtype'); 17596 } 17597 if (type.name === 'Form') { 17598 stateManager.save(); 17599 self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone()).then(function () {
vendor: 12,645 bytes, lines 17600-17887
17600 stateManager.restore(); 17601 resolveXObject(); 17602 }, rejectXObject); 17603 return; 17604 } else if (type.name === 'Image') { 17605 self.buildPaintImageXObject(resources, xobj, false, operatorList, name, imageCache); 17606 } else if (type.name === 'PS') { 17607 (0, _util.info)('Ignored XObject subtype PS'); 17608 } else { 17609 throw new _util.FormatError('Unhandled XObject subtype ' + type.name); 17610 } 17611 resolveXObject(); 17612 }).catch(function (reason) { 17613 if (self.options.ignoreErrors) { 17614 self.handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.unknown }); 17615 (0, _util.warn)('getOperatorList - ignoring XObject: "' + reason + '".'); 17616 return; 17617 } 17618 throw reason; 17619 })); 17620 return; 17621 case _util.OPS.setFont: 17622 var fontSize = args[1]; 17623 next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state).then(function (loadedName) { 17624 operatorList.addDependency(loadedName); 17625 operatorList.addOp(_util.OPS.setFont, [loadedName, fontSize]); 17626 })); 17627 return; 17628 case _util.OPS.endInlineImage: 17629 var cacheKey = args[0].cacheKey; 17630 if (cacheKey) { 17631 var cacheEntry = imageCache[cacheKey]; 17632 if (cacheEntry !== undefined) { 17633 operatorList.addOp(cacheEntry.fn, cacheEntry.args); 17634 args = null; 17635 continue; 17636 } 17637 } 17638 self.buildPaintImageXObject(resources, args[0], true, operatorList, cacheKey, imageCache); 17639 args = null; 17640 continue; 17641 case _util.OPS.showText: 17642 args[0] = self.handleText(args[0], stateManager.state); 17643 break; 17644 case _util.OPS.showSpacedText: 17645 var arr = args[0]; 17646 var combinedGlyphs = []; 17647 var arrLength = arr.length; 17648 var state = stateManager.state; 17649 for (i = 0; i < arrLength; ++i) { 17650 var arrItem = arr[i]; 17651 if ((0, _util.isString)(arrItem)) { 17652 Array.prototype.push.apply(combinedGlyphs, self.handleText(arrItem, state)); 17653 } else if ((0, _util.isNum)(arrItem)) { 17654 combinedGlyphs.push(arrItem); 17655 } 17656 } 17657 args[0] = combinedGlyphs; 17658 fn = _util.OPS.showText; 17659 break; 17660 case _util.OPS.nextLineShowText: 17661 operatorList.addOp(_util.OPS.nextLine); 17662 args[0] = self.handleText(args[0], stateManager.state); 17663 fn = _util.OPS.showText; 17664 break; 17665 case _util.OPS.nextLineSetSpacingShowText: 17666 operatorList.addOp(_util.OPS.nextLine); 17667 operatorList.addOp(_util.OPS.setWordSpacing, [args.shift()]); 17668 operatorList.addOp(_util.OPS.setCharSpacing, [args.shift()]); 17669 args[0] = self.handleText(args[0], stateManager.state); 17670 fn = _util.OPS.showText; 17671 break; 17672 case _util.OPS.setTextRenderingMode: 17673 stateManager.state.textRenderingMode = args[0]; 17674 break; 17675 case _util.OPS.setFillColorSpace: 17676 stateManager.state.fillColorSpace = _colorspace.ColorSpace.parse(args[0], xref, resources, self.pdfFunctionFactory); 17677 continue; 17678 case _util.OPS.setStrokeColorSpace: 17679 stateManager.state.strokeColorSpace = _colorspace.ColorSpace.parse(args[0], xref, resources, self.pdfFunctionFactory); 17680 continue; 17681 case _util.OPS.setFillColor: 17682 cs = stateManager.state.fillColorSpace; 17683 args = cs.getRgb(args, 0); 17684 fn = _util.OPS.setFillRGBColor; 17685 break; 17686 case _util.OPS.setStrokeColor: 17687 cs = stateManager.state.strokeColorSpace; 17688 args = cs.getRgb(args, 0); 17689 fn = _util.OPS.setStrokeRGBColor; 17690 break; 17691 case _util.OPS.setFillGray: 17692 stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.gray; 17693 args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); 17694 fn = _util.OPS.setFillRGBColor; 17695 break; 17696 case _util.OPS.setStrokeGray: 17697 stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.gray; 17698 args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); 17699 fn = _util.OPS.setStrokeRGBColor; 17700 break; 17701 case _util.OPS.setFillCMYKColor: 17702 stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.cmyk; 17703 args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); 17704 fn = _util.OPS.setFillRGBColor; 17705 break; 17706 case _util.OPS.setStrokeCMYKColor: 17707 stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.cmyk; 17708 args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); 17709 fn = _util.OPS.setStrokeRGBColor; 17710 break; 17711 case _util.OPS.setFillRGBColor: 17712 stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.rgb; 17713 args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); 17714 break; 17715 case _util.OPS.setStrokeRGBColor: 17716 stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.rgb; 17717 args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); 17718 break; 17719 case _util.OPS.setFillColorN: 17720 cs = stateManager.state.fillColorSpace; 17721 if (cs.name === 'Pattern') { 17722 next(self.handleColorN(operatorList, _util.OPS.setFillColorN, args, cs, patterns, resources, task)); 17723 return; 17724 } 17725 args = cs.getRgb(args, 0); 17726 fn = _util.OPS.setFillRGBColor; 17727 break; 17728 case _util.OPS.setStrokeColorN: 17729 cs = stateManager.state.strokeColorSpace; 17730 if (cs.name === 'Pattern') { 17731 next(self.handleColorN(operatorList, _util.OPS.setStrokeColorN, args, cs, patterns, resources, task)); 17732 return; 17733 } 17734 args = cs.getRgb(args, 0); 17735 fn = _util.OPS.setStrokeRGBColor; 17736 break; 17737 case _util.OPS.shadingFill: 17738 var shadingRes = resources.get('Shading'); 17739 if (!shadingRes) { 17740 throw new _util.FormatError('No shading resource found'); 17741 } 17742 var shading = shadingRes.get(args[0].name); 17743 if (!shading) { 17744 throw new _util.FormatError('No shading object found'); 17745 } 17746 var shadingFill = _pattern.Pattern.parseShading(shading, null, xref, resources, self.handler, self.pdfFunctionFactory); 17747 var patternIR = shadingFill.getIR(); 17748 args = [patternIR]; 17749 fn = _util.OPS.shadingFill; 17750 break; 17751 case _util.OPS.setGState: 17752 var dictName = args[0]; 17753 var extGState = resources.get('ExtGState'); 17754 if (!(0, _primitives.isDict)(extGState) || !extGState.has(dictName.name)) { 17755 break; 17756 } 17757 var gState = extGState.get(dictName.name); 17758 next(self.setGState(resources, gState, operatorList, task, stateManager)); 17759 return; 17760 case _util.OPS.moveTo: 17761 case _util.OPS.lineTo: 17762 case _util.OPS.curveTo: 17763 case _util.OPS.curveTo2: 17764 case _util.OPS.curveTo3: 17765 case _util.OPS.closePath: 17766 self.buildPath(operatorList, fn, args); 17767 continue; 17768 case _util.OPS.rectangle: 17769 self.buildPath(operatorList, fn, args); 17770 continue; 17771 case _util.OPS.markPoint: 17772 case _util.OPS.markPointProps: 17773 case _util.OPS.beginMarkedContent: 17774 case _util.OPS.beginMarkedContentProps: 17775 case _util.OPS.endMarkedContent: 17776 case _util.OPS.beginCompat: 17777 case _util.OPS.endCompat: 17778 continue; 17779 default: 17780 if (args !== null) { 17781 for (i = 0, ii = args.length; i < ii; i++) { 17782 if (args[i] instanceof _primitives.Dict) { 17783 break; 17784 } 17785 } 17786 if (i < ii) { 17787 (0, _util.warn)('getOperatorList - ignoring operator: ' + fn); 17788 continue; 17789 } 17790 } 17791 } 17792 operatorList.addOp(fn, args); 17793 } 17794 if (stop) { 17795 next(deferred); 17796 return; 17797 } 17798 closePendingRestoreOPS(); 17799 resolve(); 17800 }).catch(function (reason) { 17801 if (_this8.options.ignoreErrors) { 17802 _this8.handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.unknown }); 17803 (0, _util.warn)('getOperatorList - ignoring errors during task: ' + task.name); 17804 closePendingRestoreOPS(); 17805 return; 17806 } 17807 throw reason; 17808 }); 17809 }, 17810 getTextContent: function getTextContent(_ref4) { 17811 var _this9 = this; 17812 17813 var stream = _ref4.stream, 17814 task = _ref4.task, 17815 resources = _ref4.resources, 17816 _ref4$stateManager = _ref4.stateManager, 17817 stateManager = _ref4$stateManager === undefined ? null : _ref4$stateManager, 17818 _ref4$normalizeWhites = _ref4.normalizeWhitespace, 17819 normalizeWhitespace = _ref4$normalizeWhites === undefined ? false : _ref4$normalizeWhites, 17820 _ref4$combineTextItem = _ref4.combineTextItems, 17821 combineTextItems = _ref4$combineTextItem === undefined ? false : _ref4$combineTextItem, 17822 sink = _ref4.sink, 17823 _ref4$seenStyles = _ref4.seenStyles, 17824 seenStyles = _ref4$seenStyles === undefined ? Object.create(null) : _ref4$seenStyles; 17825 17826 resources = resources || _primitives.Dict.empty; 17827 stateManager = stateManager || new StateManager(new TextState()); 17828 var WhitespaceRegexp = /\s/g; 17829 var textContent = { 17830 items: [], 17831 styles: Object.create(null) 17832 }; 17833 var textContentItem = { 17834 initialized: false, 17835 str: [], 17836 width: 0, 17837 height: 0, 17838 vertical: false, 17839 lastAdvanceWidth: 0, 17840 lastAdvanceHeight: 0, 17841 textAdvanceScale: 0, 17842 spaceWidth: 0, 17843 fakeSpaceMin: Infinity, 17844 fakeMultiSpaceMin: Infinity, 17845 fakeMultiSpaceMax: -0, 17846 textRunBreakAllowed: false, 17847 transform: null, 17848 fontName: null 17849 }; 17850 var SPACE_FACTOR = 0.3; 17851 var MULTI_SPACE_FACTOR = 1.5; 17852 var MULTI_SPACE_FACTOR_MAX = 4; 17853 var self = this; 17854 var xref = this.xref; 17855 var xobjs = null; 17856 var skipEmptyXObjs = Object.create(null); 17857 var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); 17858 var textState; 17859 function ensureTextContentItem() { 17860 if (textContentItem.initialized) { 17861 return textContentItem; 17862 } 17863 var font = textState.font; 17864 if (!(font.loadedName in seenStyles)) { 17865 seenStyles[font.loadedName] = true; 17866 textContent.styles[font.loadedName] = { 17867 fontFamily: font.fallbackName, 17868 ascent: font.ascent, 17869 descent: font.descent, 17870 vertical: font.vertical 17871 }; 17872 } 17873 textContentItem.fontName = font.loadedName; 17874 var tsm = [textState.fontSize * textState.textHScale, 0, 0, textState.fontSize, 0, textState.textRise]; 17875 if (font.isType3Font && textState.fontMatrix !== _util.FONT_IDENTITY_MATRIX && textState.fontSize === 1) { 17876 var glyphHeight = font.bbox[3] - font.bbox[1]; 17877 if (glyphHeight > 0) { 17878 glyphHeight = glyphHeight * textState.fontMatrix[3]; 17879 tsm[3] *= glyphHeight; 17880 } 17881 } 17882 var trm = _util.Util.transform(textState.ctm, _util.Util.transform(textState.textMatrix, tsm)); 17883 textContentItem.transform = trm; 17884 if (!font.vertical) { 17885 textContentItem.width = 0; 17886 textContentItem.height = Math.sqrt(trm[2] * trm[2] + trm[3] * trm[3]); 17887 textContentItem.vertical = false;
17888 } else { 17889 textContentItem.width = Math.sqrt(trm[0] * trm[0] + trm[1] * trm[1]); 17890 textContentItem.height = 0; 17891 textContentItem.vertical = true; 17892 } 17893 var a = textState.textLineMatrix[0]; 17894 var b = textState.textLineMatrix[1]; 17895 var scaleLineX = Math.sqrt(a * a + b * b); 17896 a = textState.ctm[0]; 17897 b = textState.ctm[1]; 17898 var scaleCtmX = Math.sqrt(a * a + b * b); 17899 textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; 17900 textContentItem.lastAdvanceWidth = 0; 17901 textContentItem.lastAdvanceHeight = 0; 17902 var spaceWidth = font.spaceWidth / 1000 * textState.fontSize; 17903 if (spaceWidth) { 17904 textContentItem.spaceWidth = spaceWidth; 17905 textContentItem.fakeSpaceMin = spaceWidth * SPACE_FACTOR; 17906 textContentItem.fakeMultiSpaceMin = spaceWidth * MULTI_SPACE_FACTOR; 17907 textContentItem.fakeMultiSpaceMax = spaceWidth * MULTI_SPACE_FACTOR_MAX; 17908 textContentItem.textRunBreakAllowed = !font.isMonospace; 17909 } else { 17910 textContentItem.spaceWidth = 0; 17911 textContentItem.fakeSpaceMin = Infinity; 17912 textContentItem.fakeMultiSpaceMin = Infinity; 17913 textContentItem.fakeMultiSpaceMax = 0; 17914 textContentItem.textRunBreakAllowed = false; 17915 } 17916 textContentItem.initialized = true; 17917 return textContentItem; 17918 } 17919 function replaceWhitespace(str) { 17920 var i = 0, 17921 ii = str.length, 17922 code; 17923 while (i < ii && (code = str.charCodeAt(i)) >= 0x20 && code <= 0x7F) { 17924 i++; 17925 } 17926 return i < ii ? str.replace(WhitespaceRegexp, ' ') : str; 17927 } 17928 function runBidiTransform(textChunk) { 17929 var str = textChunk.str.join(''); 17930 var bidiResult = (0, _bidi.bidi)(str, -1, textChunk.vertical); 17931 return { 17932 str: normalizeWhitespace ? replaceWhitespace(bidiResult.str) : bidiResult.str, 17933 dir: bidiResult.dir, 17934 width: textChunk.width, 17935 height: textChunk.height, 17936 transform: textChunk.transform, 17937 fontName: textChunk.fontName 17938 }; 17939 } 17940 function handleSetFont(fontName, fontRef) { 17941 return self.loadFont(fontName, fontRef, resources).then(function (translated) { 17942 textState.font = translated.font; 17943 textState.fontMatrix = translated.font.fontMatrix || _util.FONT_IDENTITY_MATRIX; 17944 }); 17945 } 17946 function buildTextContentItem(chars) { 17947 var font = textState.font; 17948 var textChunk = ensureTextContentItem(); 17949 var width = 0; 17950 var height = 0; 17951 var glyphs = font.charsToGlyphs(chars); 17952 for (var i = 0; i < glyphs.length; i++) { 17953 var glyph = glyphs[i]; 17954 var glyphWidth = null; 17955 if (font.vertical && glyph.vmetric) { 17956 glyphWidth = glyph.vmetric[0]; 17957 } else { 17958 glyphWidth = glyph.width; 17959 } 17960 var glyphUnicode = glyph.unicode; 17961 var NormalizedUnicodes = (0, _unicode.getNormalizedUnicodes)(); 17962 if (NormalizedUnicodes[glyphUnicode] !== undefined) { 17963 glyphUnicode = NormalizedUnicodes[glyphUnicode]; 17964 } 17965 glyphUnicode = (0, _unicode.reverseIfRtl)(glyphUnicode); 17966 var charSpacing = textState.charSpacing; 17967 if (glyph.isSpace) { 17968 var wordSpacing = textState.wordSpacing; 17969 charSpacing += wordSpacing; 17970 if (wordSpacing > 0) { 17971 addFakeSpaces(wordSpacing, textChunk.str); 17972 } 17973 } 17974 var tx = 0; 17975 var ty = 0; 17976 if (!font.vertical) { 17977 var w0 = glyphWidth * textState.fontMatrix[0]; 17978 tx = (w0 * textState.fontSize + charSpacing) * textState.textHScale; 17979 width += tx; 17980 } else { 17981 var w1 = glyphWidth * textState.fontMatrix[0]; 17982 ty = w1 * textState.fontSize + charSpacing; 17983 height += ty; 17984 } 17985 textState.translateTextMatrix(tx, ty); 17986 textChunk.str.push(glyphUnicode); 17987 } 17988 if (!font.vertical) { 17989 textChunk.lastAdvanceWidth = width; 17990 textChunk.width += width; 17991 } else { 17992 textChunk.lastAdvanceHeight = height; 17993 textChunk.height += Math.abs(height); 17994 } 17995 return textChunk; 17996 } 17997 function addFakeSpaces(width, strBuf) { 17998 if (width < textContentItem.fakeSpaceMin) { 17999 return; 18000 } 18001 if (width < textContentItem.fakeMultiSpaceMin) { 18002 strBuf.push(' '); 18003 return; 18004 } 18005 var fakeSpaces = Math.round(width / textContentItem.spaceWi
vendor: 3,472 bytes, lines 18005-18091
18005dth); 18006 while (fakeSpaces-- > 0) { 18007 strBuf.push(' '); 18008 } 18009 } 18010 function flushTextContentItem() { 18011 if (!textContentItem.initialized) { 18012 return; 18013 } 18014 textContentItem.width *= textContentItem.textAdvanceScale; 18015 textContentItem.height *= textContentItem.textAdvanceScale; 18016 textContent.items.push(runBidiTransform(textContentItem)); 18017 textContentItem.initialized = false; 18018 textContentItem.str.length = 0; 18019 } 18020 function enqueueChunk() { 18021 var length = textContent.items.length; 18022 if (length > 0) { 18023 sink.enqueue(textContent, length); 18024 textContent.items = []; 18025 textContent.styles = Object.create(null); 18026 } 18027 } 18028 var timeSlotManager = new TimeSlotManager(); 18029 return new Promise(function promiseBody(resolve, reject) { 18030 var next = function next(promise) { 18031 enqueueChunk(); 18032 Promise.all([promise, sink.ready]).then(function () { 18033 try { 18034 promiseBody(resolve, reject); 18035 } catch (ex) { 18036 reject(ex); 18037 } 18038 }, reject); 18039 }; 18040 task.ensureNotTerminated(); 18041 timeSlotManager.reset(); 18042 var stop, 18043 operation = {}, 18044 args = []; 18045 while (!(stop = timeSlotManager.check())) { 18046 args.length = 0; 18047 operation.args = args; 18048 if (!preprocessor.read(operation)) { 18049 break; 18050 } 18051 textState = stateManager.state; 18052 var fn = operation.fn; 18053 args = operation.args; 18054 var advance, diff; 18055 switch (fn | 0) { 18056 case _util.OPS.setFont: 18057 var fontNameArg = args[0].name, 18058 fontSizeArg = args[1]; 18059 if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) { 18060 break; 18061 } 18062 flushTextContentItem(); 18063 textState.fontName = fontNameArg; 18064 textState.fontSize = fontSizeArg; 18065 next(handleSetFont(fontNameArg, null)); 18066 return; 18067 case _util.OPS.setTextRise: 18068 flushTextContentItem(); 18069 textState.textRise = args[0]; 18070 break; 18071 case _util.OPS.setHScale: 18072 flushTextContentItem(); 18073 textState.textHScale = args[0] / 100; 18074 break; 18075 case _util.OPS.setLeading: 18076 flushTextContentItem(); 18077 textState.leading = args[0]; 18078 break; 18079 case _util.OPS.moveText: 18080 var isSameTextLine = !textState.font ? false : (textState.font.vertical ? args[0] : args[1]) === 0; 18081 advance = args[0] - args[1]; 18082 if (combineTextItems && isSameTextLine && textContentItem.initialized && advance > 0 && advance <= textContentItem.fakeMultiSpaceMax) { 18083 textState.translateTextLineMatrix(args[0], args[1]); 18084 textContentItem.width += args[0] - textContentItem.lastAdvanceWidth; 18085 textContentItem.height += args[1] - textContentItem.lastAdvanceHeight; 18086 diff = args[0] - textContentItem.lastAdvanceWidth - (args[1] - textContentItem.lastAdvanceHeight); 18087 addFakeSpaces(diff, textContentItem.str); 18088 break; 18089 } 18090 flushTextContentItem(); 18091 textState.translateTextLineMatrix(args[0], args[1]);
vendor: 1,946 bytes, lines 18092-18126
18092 textState.textMatrix = textState.textLineMatrix.slice(); 18093 break; 18094 case _util.OPS.setLeadingMoveText: 18095 flushTextContentItem(); 18096 textState.leading = -args[1]; 18097 textState.translateTextLineMatrix(args[0], args[1]); 18098 textState.textMatrix = textState.textLineMatrix.slice(); 18099 break; 18100 case _util.OPS.nextLine: 18101 flushTextContentItem(); 18102 textState.carriageReturn(); 18103 break; 18104 case _util.OPS.setTextMatrix: 18105 advance = textState.calcTextLineMatrixAdvance(args[0], args[1], args[2], args[3], args[4], args[5]); 18106 if (combineTextItems && advance !== null && textContentItem.initialized && advance.value > 0 && advance.value <= textContentItem.fakeMultiSpaceMax) { 18107 textState.translateTextLineMatrix(advance.width, advance.height); 18108 textContentItem.width += advance.width - textContentItem.lastAdvanceWidth; 18109 textContentItem.height += advance.height - textContentItem.lastAdvanceHeight; 18110 diff = advance.width - textContentItem.lastAdvanceWidth - (advance.height - textContentItem.lastAdvanceHeight); 18111 addFakeSpaces(diff, textContentItem.str); 18112 break; 18113 } 18114 flushTextContentItem(); 18115 textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); 18116 textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); 18117 break; 18118 case _util.OPS.setCharSpacing: 18119 textState.charSpacing = args[0]; 18120 break; 18121 case _util.OPS.setWordSpacing: 18122 textState.wordSpacing = args[0]; 18123 break; 18124 case _util.OPS.beginText: 18125 flushTextContentItem(); 18126 textState.textMatrix = _util.IDENTITY_MATRIX.slice();
18127 textState.textLineMatrix = _util.IDENTITY_MATRIX.slice(); 18128 break; 18129 case _util.OPS.showSpacedText: 18130 var items = args[0]; 18131 var offset; 18132 for (var j = 0, jj = items.length; j < jj; j++) { 18133 if (typeof items[j] === 'string') { 18134 buildTextContentItem(items[j]); 18135 } else if ((0, _util.isNum)(items[j])) { 18136 ensureTextContentItem(); 18137 advance = items[j] * textState.fontSize / 1000; 18138 var breakTextRun = false; 18139 if (textState.font.vertical) { 18140 offset = advance; 18141 textState.translateTextMatrix(0, offset); 18142 breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; 18143 if (!breakTextRun) { 18144 textContentItem.height += offset; 18145 } 18146 } else { 18147 advance = -advance; 18148 offset = advance * textState.textHScale; 18149 textState.translateTextMatrix(offset, 0); 18150 breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; 18151 if (!breakTextRun) { 18152 textContentItem.width += offset; 18153 } 18154 } 18155 if (breakTextRun) { 18156 flushTextContentItem(); 18157 } else if (advance > 0) { 18158 addFakeSpaces(advance, textContentItem.str); 18159 } 18160 } 18161 } 18162 break; 18163 case _util.OPS.showText: 18164 buildTextContentItem(args[0]); 18165 break; 18166 case _util.OPS.nextLineShowText: 18167 flushTextContentItem(); 18168 textState.carriageReturn(); 18169 buildTextContentItem(args[0]); 18170 break; 18171 case _util.OPS.nextLineSetSpacingShowText: 18172 flushTextContentItem(); 18173 textState.wordSpacing = args[0]; 18174 textState.charSpacing = args[1]; 18175 textState.carriageReturn(); 18176 buildTextContentItem(args[2]); 18177 break; 18178 case _util.OPS.paintXObject: 18179 flushTextContentItem(); 18180 if (!xobjs) { 18181 xobjs = resources.get('XObject') || _primitives.Dict.empty; 18182 } 18183 var name = args[0].name; 18184 if (name && skipEmptyXObjs[name] !== undefined) { 18185 break; 18186 } 18187 next(new Promise(function (resolveXObject, rejectXObject) { 18188 if (!name) { 18189 throw new _util.FormatError('XObject must be referred to by name.'); 18190 } 18191 var xobj = xobjs.get(name); 18192 if (!xobj) { 18193 resolveXObject(); 18194 return; 18195 } 18196 if (!(0, _primitives.isStream)(xobj)) { 18197 throw new _util.FormatError('XObject should be a stream'); 18198 } 18199 var type = xobj.dict.get('Subtype'); 18200 if (!(0, _primitives.isName)(type)) { 18201 throw new _util.FormatError('XObject should have a Name subtype'); 18202 } 18203 if (type.name !== 'Form') { 18204 skipEmptyXObjs[name] = true; 18205 resolveXObject(); 18206 return; 18207 } 18208 var currentState = stateManager.state.clone(); 18209 var xObjStateManager = new StateManager(currentState); 18210 var matrix = xobj.dict.getArray('Matrix'); 18211 if (Array.isArray(matrix) && matrix.length === 6) { 18212 xObjStateManager.transform(matrix); 18213 } 18214 enqueueChunk(); 18215 var sinkWrapper = { 18216 enqueueInvoked: false, 18217 enqueue: function enqueue(chunk, size) { 18218 this.enqueueInvoked = true; 18219 sink.enqueue(chunk, size); 18220 }, 18221 18222 get desiredSize() { 18223 return sink.desiredSize; 18224 }, 18225 get ready() { 18226 return sink.ready; 18227 } 18228 }; 18229 self.getTextContent({ 18230 stream: xobj, 18231 task: task, 18232 resources: xobj.dict.get('Resources') || resources, 18233 stateManager: xObjStateManager, 18234 normalizeWhitespace: normalizeWhitespace, 18235 combineTextItems: combineTextItems, 18236 sink: sinkWrapper, 18237 seenStyles: seenStyles 18238 }).then(function () { 18239 if (!sinkWrapper.enqueueInvoked) { 18240 skipEmptyXObjs[name] = true; 18241 } 18242 resolveXObject(); 18243 }, rejectXObject); 18244 }).catch(function (reason) { 18245 if (reason instanceof _util.AbortException) { 18246 return; 18247 } 18248 if (self.options.ignoreErrors) { 18249 (0, _util.warn)('getTextContent - ignoring XObject: "' + reason + '".'); 18250 return; 18251 } 18252 throw reason; 18253 })); 18254 return; 18255 case _util.OPS.setGState: 18256 flushTextContentItem(); 18257 var dictName = args[0]; 18258 var extGState = resources.get('ExtGState'); 18259 if (!(0, _primitives.isDict)(extGState) || !(0, _primitives.isName)(dictName)) { 18260 break; 18261 } 18262 var gState = extGState.get(dictName.name); 18263 if (!(0, _primitives.isDict)(gState)) { 18264 break; 18265 } 18266 var gStateFont = gState.get('Font'); 18267 if (gStateFont) { 18268 textState.fontName = null; 18269 textState.fontSize = gStateFont[1]; 18270 next(handleSetFont(null, gStateFont[0])); 18271 return; 18272 } 18273 break; 18274 } 18275 if (textContent.items.length >= sink.desiredSize) { 18276 stop = true; 18277 break; 18278 } 18279 } 18280 if (stop) { 18281 next(deferred); 18282 return; 18283 } 18284 flushTextContentItem(); 18285 enqueueChunk(); 18286 resolve(); 18287 }).catch(function (reason) { 18288 if (reason instanceof _util.AbortException) { 18289 return; 18290 } 18291 if (_this9.options.ignoreErrors) { 18292 (0, _util.warn)('getTextContent - ignoring errors during task: ' + task.name); 18293 flushTextContentItem(); 18294 enqueueChunk(); 18295 return; 18296 } 18297 throw reason; 18298 }); 18299 }, 18300 18301 extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, properties) { 18302 var _this10 = this; 18303 18304 var xref = this.xref; 18305 var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode'); 18306 var toUnicodePromise = toUnicode ? this.readToUnicode(toUnicode) : Promise.resolve(undefined); 18307 if (properties.composite) { 18308 var cidSystemInfo = dict.get('CIDSystemInfo'); 18309 if ((0, _primitives.isDict)(cidSystemInfo)) { 18310 properties.cidSystemInfo = { 18311 registry: cidSystemInfo.get('Registry'), 18312 ordering: cidSystemInfo.get('Ordering'), 18313 supplement: cidSystemInfo.get('Supplement') 18314 }; 18315 } 18316 var cidToGidMap = dict.get('CIDToGIDMap'); 18317 if ((0, _primitives.isStream)(cidToGidMap)) { 18318 properties.cidToGidMap = this.readCidToGidMap(cidToGidMap); 18319 } 18320 } 18321 var differences = []; 18322 var baseEncodingName = null; 18323 var encoding; 18324 if (dict.has('Encoding')) { 18325 encoding = dict.get('Encoding'); 18326 if ((0, _primitives.isDict)(encoding)) { 18327 baseEncodingName = encoding.get('BaseEncoding'); 18328 baseEncodingName = (0, _primitives.isName)(baseEncodingName) ? baseEncodingName.name : null; 18329 if (encoding.has('Differences')) { 18330 var diffEncoding = encoding.get('Differences'); 18331 var index = 0; 18332 for (var j = 0, jj = diffEncoding.length; j < jj; j++) { 18333 var data = xref.fetchIfRef(diffEncoding[j]); 18334 if ((0, _util.isNum)(data)) { 18335 index = data; 18336 } else if ((0, _primitives.isName)(data)) { 18337 differences[index++] = data.name; 18338 } else { 18339 throw new _util.FormatError('Invalid entry in \'Differences\' array: ' + data); 18340 } 18341 } 18342 } 18343 } else if ((0, _primitives.isName)(encoding)) { 18344 baseEncodingName = encoding.name; 18345 } else { 18346 throw new _util.FormatError('Encoding is not a Name nor a Dict'); 18347 } 18348 if (baseEncodingName !== 'MacRomanEncoding' && baseEncodingName !== 'MacExpertEncoding' && baseEncodingName !== 'WinAnsiEncoding') { 18349 baseEncodingName = null; 18350 } 18351 } 18352 if (baseEncodingName) { 18353 properties.defaultEncoding = (0, _encodings.getEncoding)(baseEncodingName).slice(); 18354 } else { 18355 var isSymbolicFont = !!(properties.flags & _fonts.FontFlags.Symbolic); 18356 var isNonsymbolicFont = !!(properties.flags & _fonts.FontFlags.Nonsymbolic); 18357 encoding = _encodings.StandardEncoding; 18358 if (properties.type === 'TrueType' && !isNonsymbolicFont) { 18359 encoding = _encodings.WinAnsiEncoding; 18360 } 18361 if (isSymbolicFont) { 18362 encoding = _encodings.MacRomanEncoding; 18363 if (!properties.file) { 18364 if (/Symbol/i.test(properties.name)) { 18365 encoding = _encodings.SymbolSetEncoding; 18366 } else if (/Dingbats/i.test(properties.name)) { 18367 encoding = _encodings.ZapfDingbatsEncoding; 18368 } 18369 } 18370 } 18371 properties.defaultEncoding = encoding; 18372 } 18373 properties.differences = differences; 18374 properties.baseEncodingName = baseEncodingName; 18375 properties.hasEncoding = !!baseEncodingName || differences.length > 0; 18376 properties.dict = dict; 18377 return toUnicodePromise.then(function (toUnicode) { 18378 properties.toUnicode = toUnicode; 18379 return _this10.buildToUnicode(properties); 18380 }).then(function (toUnicode) { 18381 properties.toUnicode = toUnicode; 18382 return properties; 18383 }); 18384 }, 18385 buildToUnicode: function PartialEvaluator_buildToUnicode(properties) { 18386 properties.hasIncludedToUnicodeMap = !!properties.toUnicode && properties.toUnicode.length > 0; 18387 if (properties.hasIncludedToUnicodeMap) { 18388 return Promise.resolve(properties.toUnicode); 18389 } 18390 var toUnicode, charcode, glyphName; 18391 if (!properties.composite) { 18392 toUnicode = []; 18393 var encoding = properties.defaultEncoding.slice(); 18394 var baseEncodingName = properties.baseEncodingName; 18395 var differences = properties.differences; 18396 for (charcode in differences) { 18397 glyphName = differences[charcode]; 18398 if (glyphName === '.notdef') { 18399 continue; 18400 } 18401 encoding[charcode] = glyphName; 18402 } 18403 var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 18404 for (charcode in encoding) { 18405 glyphName = encoding[charcode]; 18406 if (glyphName === '') { 18407 continue; 18408 } else if (glyphsUnicodeMap[glyphName] === undefined) { 18409 var code = 0; 18410 switch (glyphName[0]) { 18411 case 'G': 18412 if (glyphName.length === 3) { 18413 code = parseInt(glyphName.substr(1), 16); 18414 } 18415 break; 18416 case 'g': 18417 if (glyphName.length === 5) { 18418 code = parseInt(glyphName.substr(1), 16); 18419 } 18420 break; 18421 case 'C': 18422 case 'c': 18423 if (glyphName.length >= 3) { 18424 code = +glyphName.substr(1); 18425 } 18426 break; 18427 default: 18428 var unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap); 18429 if (unicode !== -1) { 18430 code = unicode; 18431 } 18432 } 18433 if (code) { 18434 if (baseEncodingName && code === +charcode) { 18435 var baseEncoding = (0, _encodings.getEncoding)(baseEncodingName); 18436 if (baseEncoding && (glyphName = baseEncoding[charcode])) { 18437 toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); 18438 continue; 18439 } 18440 } 18441 toUnicode[charcode] = String.fromCharCode(code); 18442 } 18443 continue; 18444 } 18445 toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); 18446 } 18447 return Promise.resolve(new _fonts.ToUnicodeMap(toUnicode)); 18448 } 18449 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'))) { 18450 var registry = properties.cidSystemInfo.registry; 18451 var ordering = properties.cidSystemInfo.ordering; 18452 var ucs2CMapName = _primitives.Name.get(registry + '-' + ordering + '-UCS2'); 18453 return _cmap.CMapFactory.create({ 18454 encoding: ucs2CMapName, 18455 fetchBuiltInCMap: this.fetchBuiltInCMap, 18456 useCMap: null 18457 }).then(function (ucs2CMap) { 18458 var cMap = properties.cMap; 18459 toUnicode = [];
18460 cMap.forEach(function (charcode, cid) { 18461 if (cid > 0xffff) { 18462 throw new _util.FormatError('Max size of CID is 65,535'); 18463 } 18464 var ucs2 = ucs2CMap.lookup(cid); 18465 if (ucs2) { 18466 toUnicode[charcode] = String.fromCharCode((ucs2.charCodeAt(0) << 8) + ucs2.charCodeAt(1)); 18467 } 18468 }); 18469 return new _fonts.ToUnicodeMap(toUnicode); 18470 }); 18471 } 18472 return Promise.resolve(new _fonts.IdentityToUnicodeMap(properties.firstChar, properties.lastChar)); 18473 }, 18474 readToUnicode: function PartialEvaluator_readToUnicode(toUnicode) { 18475 var cmapObj = toUnicode; 18476 if ((0, _primitives.isName)(cmapObj)) { 18477 return _cmap.CMapFactory.create({ 18478 encoding: cmapObj, 18479 fetchBuiltInCMap: this.fetchBuiltInCMap, 18480 useCMap: null 18481 }).then(function (cmap) { 18482 if (cmap instanceof _cmap.IdentityCMap) { 18483 return new _fonts.IdentityToUnicodeMap(0, 0xFFFF); 18484 } 18485 return new _fonts.ToUnicodeMap(cmap.getMap()); 18486 }); 18487 } else if ((0, _primitives.isStream)(cmapObj)) { 18488 return _cmap.CMapFactory.create({ 18489 encoding: cmapObj, 18490 fetchBuiltInCMap: this.fetchBuiltInCMap, 18491 useCMap: null 18492 }).then(function (cmap) { 18493 if (cmap instanceof _cmap.IdentityCMap) { 18494 return new _fonts.IdentityToUnicodeMap(0, 0xFFFF); 18495 } 18496 var map = new Array(cmap.length); 18497 cmap.forEach(function (charCode, token) { 18498 var str = []; 18499 for (var k = 0; k < token.length; k += 2) {
18500 var w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); 18501 if ((w1 & 0xF800) !== 0xD800) { 18502 str.push(w1); 18503 continue; 18504 } 18505 k += 2; 18506 var w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); 18507 str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); 18508 } 18509 map[charCode] = String.fromCharCode.apply(String, str); 18510 }); 18511 return new _fonts.ToUnicodeMap(map); 18512 }); 18513 } 18514 return Promise.resolve(null); 18515 }, 18516 readCidToGidMap: function PartialEvaluator_readCidToGidMap(cidToGidStream) { 18517 var glyphsData = cidToGidStream.getBytes(); 18518 var result = []; 18519 for (var j = 0, jj = glyphsData.length; j < jj; j++) { 18520 var glyphID = glyphsData[j++] << 8 | glyphsData[j]; 18521 if (glyphID === 0) { 18522 continue; 18523 } 18524 var code = j >> 1; 18525 result[code] = glyphID; 18526 } 18527 return result; 18528 }, 18529 extractWidths: function PartialEvaluator_extractWidths(dict, descriptor, properties) { 18530 var xref = this.xref; 18531 var glyphsWidths = []; 18532 var defaultWidth = 0; 18533 var glyphsVMetrics = []; 18534 var defaultVMetrics; 18535 var i, ii, j, jj, start, code, widths; 18536 if (properties.composite) { 18537 defaultWidth = dict.has('DW') ? dict.get('DW') : 1000; 18538 widths = dict.get('W'); 18539 if (widths) { 18540 for (i = 0, ii = widths.length; i < ii; i++) { 18541 start = xref.fetchIfRef(widths[i++]); 18542 code = xref.fetchIfRef(widths[i]); 18543 if (Array.isArray(code)) { 18544 for (j = 0, jj = code.length; j < jj; j++) { 18545 glyphsWidths[start++] = xref.fetchIfRef(code[j]); 18546 } 18547 } else { 18548 var width = xref.fetchIfRef(widths[++i]); 18549 for (j = start; j <= code; j++) { 18550 glyphsWidths[j] = width; 18551 } 18552 } 18553 } 18554 } 18555 if (properties.vertical) { 18556 var vmetrics = dict.getArray('DW2') || [880, -1000]; 18557 defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; 18558 vmetrics = dict.get('W2'); 18559 if (vmetrics) { 18560 for (i = 0, ii = vmetrics.length; i < ii; i++) { 18561 start = xref.fetchIfRef(vmetrics[i++]); 18562 code = xref.fetchIfRef(vmetrics[i]); 18563 if (Array.isArray(code)) { 18564 for (j = 0, jj = code.length; j < jj; j++) { 18565 glyphsVMetrics[start++] = [xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j])]; 18566 } 18567 } else { 18568 var vmetric = [xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i])]; 18569 for (j = start; j <= code; j++) { 18570 glyphsVMetrics[j] = vmetric; 18571 } 18572 } 18573 } 18574 } 18575 } 18576 } else { 18577 var firstChar = properties.firstChar; 18578 widths = dict.get('Widths'); 18579 if (widths) { 18580 j = firstChar; 18581 for (i = 0, ii = widths.length; i < ii; i++) { 18582 glyphsWidths[j++] = xref.fetchIfRef(widths[i]); 18583 } 18584 defaultWidth = parseFloat(descriptor.get('MissingWidth')) || 0; 18585 } else { 18586 var baseFontName = dict.get('BaseFont'); 18587 if ((0, _primitives.isName)(baseFontName)) { 18588 var metrics = this.getBaseFontMetrics(baseFontName.name); 18589 glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties); 18590 defaultWidth = metrics.defaultWidth; 18591 } 18592 } 18593 } 18594 var isMonospace = true; 18595 var firstWidth = defaultWidth; 18596 for (var glyph in glyphsWidths) { 18597 var glyphWidth = glyphsWidths[glyph]; 18598 if (!glyphWidth) { 18599 continue; 18600 } 18601 if (!firstWidth) { 18602 firstWidth = glyphWidth; 18603 continue; 18604 } 18605 if (firstWidth !== glyphWidth) { 18606 isMonospace = false; 18607 break; 18608 } 18609 } 18610 if (isMonospace) { 18611 properties.flags |= _fonts.FontFlags.FixedPitch; 18612 } 18613 properties.defaultWidth = defaultWidth; 18614 properties.widths = glyphsWidths; 18615 properties.defaultVMetrics = defaultVMetrics; 18616 properties.vmetrics = glyphsVMetrics; 18617 }, 18618 isSerifFont: function PartialEvaluator_isSerifFont(baseFontName) { 18619 var fontNameWoStyle = baseFontName.split('-')[0]; 18620 return fontNameWoStyle in (0, _standard_fonts.getSerifFonts)() || fontNameWoStyle.search(/serif/gi) !== -1; 18621 }, 18622 getBaseFontMetrics: function PartialEvaluator_getBaseFontMetrics(name) { 18623 var defaultWidth = 0; 18624 var widths = []; 18625 var monospace = false;
18626 var stdFontMap = (0, _standard_fonts.getStdFontMap)(); 18627 var lookupName = stdFontMap[name] || name; 18628 var Metrics = (0, _metrics.getMetrics)(); 18629 if (!(lookupName in Metrics)) { 18630 if (this.isSerifFont(name)) { 18631 lookupName = 'Times-Roman'; 18632 } else { 18633 lookupName = 'Helvetica'; 18634 } 18635 } 18636 var glyphWidths = Metrics[lookupName]; 18637 if ((0, _util.isNum)(glyphWidths)) { 18638 defaultWidth = glyphWidths; 18639 monospace = true; 18640 } else { 18641 widths = glyphWidths(); 18642 } 18643 return { 18644 defaultWidth: defaultWidth, 18645 monospace: monospace, 18646 widths: widths 18647 }; 18648 }, 18649 buildCharCodeToWidth: function PartialEvaluator_bulildCharCodeToWidth(widthsByGlyphName, properties) { 18650 var widths = Object.create(null); 18651 var differences = properties.differences; 18652 var encoding = properties.defaultEncoding; 18653 for (var charCode = 0; charCode < 256; charCode++) { 18654 if (charCode in differences && widthsByGlyphName[differences[charCode]]) { 18655 widths[charCode] = widthsByGlyphName[differences[charCode]]; 18656 continue; 18657 } 18658 if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { 18659 widths[charCode] = widthsByGlyphName[encoding[charCode]]; 18660 continue; 18661 } 18662 } 18663 return widths; 18664 }, 18665 preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict) { 18666 var baseDict = dict; 18667 var type = dict.get('Subtype'); 18668 if (!(0, _primitives.isName)(type)) { 18669 throw new _util.FormatError('invalid font Subtype'); 18670 } 18671 var composite = false; 18672 var uint8array; 18673 if (type.name === 'Type0') { 18674 var df = dict.get('DescendantFonts'); 18675 if (!df) { 18676 throw new _util.FormatError('Descendant fonts are not specified'); 18677 } 18678 dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df; 18679 type = dict.get('Subtype'); 18680 if (!(0, _primitives.isName)(type)) { 18681 throw new _util.FormatError('invalid font Subtype'); 18682 } 18683 composite = true; 18684 } 18685 var descriptor = dict.get('FontDescriptor'); 18686 if (descriptor) { 18687 var hash = new _murmurhash.MurmurHash3_64(); 18688 var encoding = baseDict.getRaw('Encoding'); 18689 if ((0, _primitives.isName)(encoding)) { 18690 hash.update(encoding.name); 18691 } else if ((0, _primitives.isRef)(encoding)) { 18692 hash.update(encoding.toString()); 18693 } else if ((0, _primitives.isDict)(encoding)) { 18694 var keys = encoding.getKeys(); 18695 for (var i = 0, ii = keys.length; i < ii; i++) { 18696 var entry = encoding.getRaw(keys[i]); 18697 if ((0, _primitives.isName)(entry)) { 18698 hash.update(entry.name); 18699 } else if ((0, _primitives.isRef)(entry)) { 18700 hash.update(entry.toString()); 18701 } else if (Array.isArray(entry)) { 18702 var diffLength = entry.length, 18703 diffBuf = new Array(diffLength); 18704 for (var j = 0; j < diffLength; j++) { 18705 var diffEntry = entry[j]; 18706 if ((0, _primitives.isName)(diffEntry)) { 18707 diffBuf[j] = diffEntry.name; 18708 } else if ((0, _util.isNum)(diffEntry) || (0, _primitives.isRef)(diffEntry)) { 18709 diffBuf[j] = diffEntry.toString(); 18710 } 18711 } 18712 hash.update(diffBuf.join()); 18713 } 18714 } 18715 } 18716 var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode'); 18717 if ((0, _primitives.isStream)(toUnicode)) { 18718 var stream = toUnicode.str || toUnicode; 18719 uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start); 18720 hash.update(uint8array); 18721 } else if ((0, _primitives.isName)(toUnicode)) { 18722 hash.update(toUnicode.name); 18723 } 18724 var widths = dict.get('Widths') || baseDict.get('Widths'); 18725 if (widths) { 18726 uint8array = new Uint8Array(new Uint32Array(widths).buffer); 18727 hash.update(uint8array); 18728 } 18729 } 18730 return { 18731 descriptor: descriptor, 18732 dict: dict, 18733 baseDict: baseDict, 18734 composite: composite,
18735 type: type.name, 18736 hash: hash ? hash.hexdigest() : '' 18737 }; 18738 }, 18739 translateFont: function PartialEvaluator_translateFont(preEvaluatedFont) { 18740 var _this11 = this; 18741 18742 var baseDict = preEvaluatedFont.baseDict; 18743 var dict = preEvaluatedFont.dict; 18744 var composite = preEvaluatedFont.composite; 18745 var descriptor = preEvaluatedFont.descriptor; 18746 var type = preEvaluatedFont.type; 18747 var maxCharIndex = composite ? 0xFFFF : 0xFF; 18748 var properties; 18749 if (!descriptor) { 18750 if (type === 'Type3') { 18751 descriptor = new _primitives.Dict(null); 18752 descriptor.set('FontName', _primitives.Name.get(type)); 18753 descriptor.set('FontBBox', dict.getArray('FontBBox')); 18754 } else { 18755 var baseFontName = dict.get('BaseFont'); 18756 if (!(0, _primitives.isName)(baseFontName)) { 18757 throw new _util.FormatError('Base font is not specified'); 18758 } 18759 baseFontName = baseFontName.name.replace(/[,_]/g, '-'); 18760 var metrics = this.getBaseFontMetrics(baseFontName); 18761 var fontNameWoStyle = baseFontName.split('-')[0]; 18762 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); 18763 properties = { 18764 type: type, 18765 name: baseFontName, 18766 widths: metrics.widths, 18767 defaultWidth: metrics.defaultWidth, 18768 flags: flags, 18769 firstChar: 0, 18770 lastChar: maxCharIndex 18771 }; 18772 return this.extractDataStructures(dict, dict, properties).then(function (properties) { 18773 properties.widths = _this11.buildCharCodeToWidth(metrics.widths, properties); 18774 return new _fonts.Font(baseFontName, null, properties); 18775 }); 18776 } 18777 } 18778 var firstChar = dict.get('FirstChar') || 0; 18779 var lastChar = dict.get('LastChar') || maxCharIndex; 18780 var fontName = descriptor.get('FontName'); 18781 var baseFont = dict.get('BaseFont'); 18782 if ((0, _util.isString)(fontName)) { 18783 fontName = _primitives.Name.get(fontName); 18784 } 18785 if ((0, _util.isString)(baseFont)) { 18786 baseFont = _primitives.Name.get(baseFont); 18787 } 18788 if (type !== 'Type3') { 18789 var fontNameStr = fontName && fontName.name; 18790 var baseFontStr = baseFont && baseFont.name; 18791 if (fontNameStr !== baseFontStr) { 18792 (0, _util.info)('The FontDescriptor\'s FontName is "' + fontNameStr + '" but should be the same as the Font\'s BaseFont "' + baseFontStr + '"'); 18793 if (fontNameStr && baseFontStr && baseFontStr.indexOf(fontNameStr) === 0) { 18794 fontName = baseFont; 18795 } 18796 } 18797 } 18798 fontName = fontName || baseFont; 18799 if (!(0, _primitives.isName)(fontName)) { 18800 throw new _util.FormatError('invalid font name'); 18801 } 18802 var fontFile = descriptor.get('FontFile', 'FontFile2', 'FontFile3'); 18803 if (fontFile) { 18804 if (fontFile.dict) { 18805 var subtype = fontFile.dict.get('Subtype'); 18806 if (subtype) { 18807 subtype = subtype.name; 18808 } 18809 var length1 = fontFile.dict.get('Length1'); 18810 var length2 = fontFile.dict.get('Length2'); 18811 var length3 = fontFile.dict.get('Length3'); 18812 } 18813 } 18814 properties = { 18815 type: type, 18816 name: fontName.name, 18817 subtype: subtype, 18818 file: fontFile, 18819 length1: length1, 18820 length2: length2, 18821 length3: length3, 18822 loadedName: baseDict.loadedName, 18823 composite: composite, 18824 wideChars: composite, 18825 fixedPitch: false, 18826 fontMatrix: dict.getArray('FontMatrix') || _util.FONT_IDENTITY_MATRIX, 18827 firstChar: firstChar || 0, 18828 lastChar: lastChar || maxCharIndex, 18829 bbox: descriptor.getArray('FontBBox'), 18830 ascent: descriptor.get('Ascent'), 18831 descent: descriptor.get('Descent'), 18832 xHeight: descriptor.get('XHeight'), 18833 capHeight: descriptor.get('CapHeight'), 18834 flags: descriptor.get('Flags'), 18835 italicAngle: descriptor.get('ItalicAngle'), 18836 isType3Font: false 18837 }; 18838 var cMapPromise; 18839 if (composite) { 18840 var cidEncoding = baseDict.get('Encoding'); 18841 if ((0, _primitives.isName)(cidEncoding)) { 18842 properties.cidEncoding = cidEncoding.name; 18843 } 18844 cMapPromise = _cmap.CMapFactory.create({ 18845 encoding: cidEncoding, 18846 fetchBuiltInCMap: this.fetchBuiltInCMap, 18847 useCMap: null 18848 }).then(function (cMap) { 18849 properties.cMap = cMap; 18850 properties.vertical = properties.cMap.vertical; 18851 }); 18852 } else { 18853 cMapPromise = Promise.resolve(undefined); 18854 } 18855 return cMapPromise.then(function () { 18856 return _this11.extractDataStructures(dict, baseDict, properties); 18857 }).then(function (properties) { 18858 _this11.extractWidths(dict, descriptor, properties); 18859 if (type === 'Type3') { 18860 properties.isType3Font = true; 18861 } 18862 return new _fonts.Font(fontName.name, fontFile, properties); 18863 }); 18864 } 18865 }; 18866 return PartialEvaluator; 18867}(); 18868var TranslatedFont = function TranslatedFontClosure() { 18869 function TranslatedFont(loadedName, font, dict) { 18870 this.loadedName = loadedName; 18871 this.font = font; 18872 this.dict = dict; 18873 this.type3Loaded = null; 18874 this.sent = false;
18875 } 18876 TranslatedFont.prototype = { 18877 send: function send(handler) { 18878 if (this.sent) { 18879 return; 18880 } 18881 var fontData = this.font.exportData(); 18882 handler.send('commonobj', [this.loadedName, 'Font', fontData]); 18883 this.sent = true; 18884 }, 18885 loadType3Data: function loadType3Data(evaluator, resources, parentOperatorList, task) { 18886 if (!this.font.isType3Font) { 18887 throw new Error('Must be a Type3 font.'); 18888 } 18889 if (this.type3Loaded) { 18890 return this.type3Loaded; 18891 } 18892 var type3Options = Object.create(evaluator.options); 18893 type3Options.ignoreErrors = false; 18894 var type3Evaluator = evaluator.clone(type3Options); 18895 var translatedFont = this.font; 18896 var loadCharProcsPromise = Promise.resolve(); 18897 var charProcs = this.dict.get('CharProcs'); 18898 var fontResources = this.dict.get('Resources') || resources; 18899 var charProcKeys = charProcs.getKeys(); 18900 var charProcOperatorList = Object.create(null); 18901 18902 var _loop2 = function _loop2() { 18903 var key = charProcKeys[i]; 18904 loadCharProcsPromise = loadCharProcsPromise.then(function () { 18905 var glyphStream = charProcs.get(key); 18906 var operatorList = new OperatorList(); 18907 return type3Evaluator.getOperatorList({ 18908 stream: glyphStream, 18909 task: task, 18910 resources: fontResources, 18911 operatorList: operatorList 18912 }).then(function () { 18913 charProcOperatorList[key] = operatorList.getIR(); 18914 parentOperatorList.addDependencies(operatorList.dependencies); 18915 }).catch(function (reason) { 18916 (0, _util.warn)('Type3 font resource "' + key + '" is not available.'); 18917 var operatorList = new OperatorList(); 18918 charProcOperatorList[key] = operatorList.getIR(); 18919 }); 18920 }); 18921 }; 18922 18923 for (var i = 0, n = charProcKeys.length; i < n; ++i) { 18924 _loop2(); 18925 } 18926 this.type3Loaded = loadCharProcsPromise.then(function () { 18927 translatedFont.charProcOperatorList = charProcOperatorList; 18928 }); 18929 return this.type3Loaded; 18930 } 18931 }; 18932 return TranslatedFont; 18933}(); 18934var OperatorList = function OperatorListClosure() { 18935 var CHUNK_SIZE = 1000; 18936 var CHUNK_SIZE_ABOUT = CHUNK_SIZE - 5; 18937 function getTransfers(queue) { 18938 var transfers = []; 18939 var fnArray = queue.fnArray, 18940 argsArray = queue.argsArray; 18941 for (var i = 0, ii = queue.length; i < ii; i++) { 18942 switch (fnArray[i]) { 18943 case _util.OPS.paintInlineImageXObject: 18944 case _util.OPS.paintInlineImageXObjectGroup: 18945 case _util.OPS.paintImageMaskXObject: 18946 var arg = argsArray[i][0]; 18947 if (!arg.cached) { 18948 transfers.push(arg.data.buffer); 18949 } 18950 break; 18951 } 18952 } 18953 return transfers; 18954 } 18955 function OperatorList(intent, messageHandler, pageIndex) { 18956 this.messageHandler = messageHandler; 18957 this.fnArray = []; 18958 this.argsArray = []; 18959 this.dependencies = Object.create(null); 18960 this._totalLength = 0; 18961 this.pageIndex = pageIndex; 18962 this.intent = intent; 18963 } 18964 OperatorList.prototype = { 18965 get length() { 18966 return this.argsArray.length; 18967 }, 18968 get totalLength() { 18969 return this._totalLength + this.length; 18970 }, 18971 addOp: function addOp(fn, args) { 18972 this.fnArray.push(fn); 18973 this.argsArray.push(args); 18974 if (this.messageHandler) { 18975 if (this.fnArray.length >= CHUNK_SIZE) { 18976 this.flush(); 18977 } else if (this.fnArray.length >= CHUNK_SIZE_ABOUT && (fn === _util.OPS.restore || fn === _util.OPS.endText)) { 18978 this.flush(); 18979 } 18980 } 18981 }, 18982 addDependency: function addDependency(dependency) { 18983 if (dependency in this.dependencies) { 18984 return; 18985 } 18986 this.dependencies[dependency] = true; 18987 this.addOp(_util.OPS.dependency, [dependency]); 18988 }, 18989 addDependencies: function addDependencies(dependencies) { 18990 for (var key in dependencies) { 18991 this.addDependency(key); 18992 } 18993 }, 18994 addOpList: function addOpList(opList) { 18995 _util.Util.extendObj(this.dependencies, opList.dependencies); 18996 for (var i = 0, ii = opList.length; i < ii; i++) { 18997 this.addOp(opList.fnArray[i], opList.argsArray[i]); 18998 } 18999 }, 19000 getIR: function getIR() { 19001 return { 19002 fnArray: this.fnArray, 19003 argsArray: this.argsArray, 19004 length: this.length 19005 }; 19006 }, 19007 flush: function flush(lastChunk) { 19008 if (this.intent !== 'oplist') { 19009 new QueueOptimizer().optimize(this); 19010 } 19011 var transfers = getTransfers(this); 19012 var length = this.length; 19013 this._totalLength += length; 19014 this.messageHandler.send('RenderPageChunk', { 19015 operatorList: { 19016 fnArray: this.fnArray, 19017 argsArray: this.argsArray, 19018 lastChunk: lastChunk, 19019 length: length 19020 }, 19021 pageIndex: this.pageIndex, 19022 intent: this.intent 19023 }, transfers); 19024 this.dependencies = Object.create(null); 19025 this.fnArray.length = 0; 19026 this.argsArray.length = 0; 19027 } 19028 }; 19029 return OperatorList; 19030}(); 19031var StateManager = function StateManagerClosure() { 19032 function StateManager(initialState) { 19033 this.state = initialState; 19034 this.stateStack = []; 19035 } 19036 StateManager.prototype = { 19037 save: function save() { 19038 var old = this.state; 19039 this.stateStack.push(this.state); 19040 this.state = old.clone(); 19041 },
19042 restore: function restore() { 19043 var prev = this.stateStack.pop(); 19044 if (prev) { 19045 this.state = prev; 19046 } 19047 }, 19048 transform: function transform(args) { 19049 this.state.ctm = _util.Util.transform(this.state.ctm, args); 19050 } 19051 }; 19052 return StateManager; 19053}(); 19054var TextState = function TextStateClosure() { 19055 function TextState() { 19056 this.ctm = new Float32Array(_util.IDENTITY_MATRIX); 19057 this.fontName = null; 19058 this.fontSize = 0; 19059 this.font = null; 19060 this.fontMatrix = _util.FONT_IDENTITY_MATRIX; 19061 this.textMatrix = _util.IDENTITY_MATRIX.slice(); 19062 this.textLineMatrix = _util.IDENTITY_MATRIX.slice(); 19063 this.charSpacing = 0; 19064 this.wordSpacing = 0; 19065 this.leading = 0; 19066 this.textHScale = 1; 19067 this.textRise = 0; 19068 } 19069 TextState.prototype = { 19070 setTextMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { 19071 var m = this.textMatrix; 19072 m[0] = a; 19073 m[1] = b; 19074 m[2] = c; 19075 m[3] = d; 19076 m[4] = e; 19077 m[5] = f; 19078 }, 19079 setTextLineMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) {
19080 var m = this.textLineMatrix; 19081 m[0] = a; 19082 m[1] = b; 19083 m[2] = c; 19084 m[3] = d; 19085 m[4] = e; 19086 m[5] = f; 19087 }, 19088 translateTextMatrix: function TextState_translateTextMatrix(x, y) { 19089 var m = this.textMatrix; 19090 m[4] = m[0] * x + m[2] * y + m[4]; 19091 m[5] = m[1] * x + m[3] * y + m[5]; 19092 }, 19093 translateTextLineMatrix: function TextState_translateTextMatrix(x, y) { 19094 var m = this.textLineMatrix; 19095 m[4] = m[0] * x + m[2] * y + m[4]; 19096 m[5] = m[1] * x + m[3] * y + m[5]; 19097 }, 19098 calcTextLineMatrixAdvance: function TextState_calcTextLineMatrixAdvance(a, b, c, d, e, f) { 19099 var font = this.font; 19100 if (!font) { 19101 return null; 19102 } 19103 var m = this.textLineMatrix; 19104 if (!(a === m[0] && b === m[1] && c === m[2] && d === m[3])) { 19105 return null; 19106 } 19107 var txDiff = e - m[4], 19108 tyDiff = f - m[5]; 19109 if (font.vertical && txDiff !== 0 || !font.vertical && tyDiff !== 0) { 19110 return null; 19111 } 19112 var tx, 19113 ty, 19114 denominator = a * d - b * c; 19115 if (font.vertical) { 19116 tx = -tyDiff * c / denominator; 19117 ty = tyDiff * a / denominator; 19118 } else { 19119 tx = txDiff * d / denominator; 19120 ty = -txDiff * b / denominator; 19121 } 19122 return { 19123 width: tx, 19124 height: ty, 19125 value: font.vertical ? ty : tx 19126 }; 19127 }, 19128 calcRenderMatrix: function TextState_calcRendeMatrix(ctm) { 19129 var tsm = [this.fontSize * this.textHScale, 0, 0, this.fontSize, 0, this.textRise]; 19130 return _util.Util.transform(ctm, _util.Util.transform(this.textMatrix, tsm)); 19131 }, 19132 carriageReturn: function TextState_carriageReturn() { 19133 this.translateTextLineMatrix(0, -this.leading);
vendor: 5,934 bytes, lines 19134-19412
19134 this.textMatrix = this.textLineMatrix.slice(); 19135 }, 19136 clone: function TextState_clone() { 19137 var clone = Object.create(this); 19138 clone.textMatrix = this.textMatrix.slice(); 19139 clone.textLineMatrix = this.textLineMatrix.slice(); 19140 clone.fontMatrix = this.fontMatrix.slice(); 19141 return clone; 19142 } 19143 }; 19144 return TextState; 19145}(); 19146var EvalState = function EvalStateClosure() { 19147 function EvalState() { 19148 this.ctm = new Float32Array(_util.IDENTITY_MATRIX); 19149 this.font = null; 19150 this.textRenderingMode = _util.TextRenderingMode.FILL; 19151 this.fillColorSpace = _colorspace.ColorSpace.singletons.gray; 19152 this.strokeColorSpace = _colorspace.ColorSpace.singletons.gray; 19153 } 19154 EvalState.prototype = { 19155 clone: function CanvasExtraState_clone() { 19156 return Object.create(this); 19157 } 19158 }; 19159 return EvalState; 19160}(); 19161var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() { 19162 var getOPMap = (0, _util.getLookupTableFactory)(function (t) { 19163 t['w'] = { 19164 id: _util.OPS.setLineWidth, 19165 numArgs: 1, 19166 variableArgs: false 19167 }; 19168 t['J'] = { 19169 id: _util.OPS.setLineCap, 19170 numArgs: 1, 19171 variableArgs: false 19172 }; 19173 t['j'] = { 19174 id: _util.OPS.setLineJoin, 19175 numArgs: 1, 19176 variableArgs: false 19177 }; 19178 t['M'] = { 19179 id: _util.OPS.setMiterLimit, 19180 numArgs: 1, 19181 variableArgs: false 19182 }; 19183 t['d'] = { 19184 id: _util.OPS.setDash, 19185 numArgs: 2, 19186 variableArgs: false 19187 }; 19188 t['ri'] = { 19189 id: _util.OPS.setRenderingIntent, 19190 numArgs: 1, 19191 variableArgs: false 19192 }; 19193 t['i'] = { 19194 id: _util.OPS.setFlatness, 19195 numArgs: 1, 19196 variableArgs: false 19197 }; 19198 t['gs'] = { 19199 id: _util.OPS.setGState, 19200 numArgs: 1, 19201 variableArgs: false 19202 }; 19203 t['q'] = { 19204 id: _util.OPS.save, 19205 numArgs: 0, 19206 variableArgs: false 19207 }; 19208 t['Q'] = { 19209 id: _util.OPS.restore, 19210 numArgs: 0, 19211 variableArgs: false 19212 }; 19213 t['cm'] = { 19214 id: _util.OPS.transform, 19215 numArgs: 6, 19216 variableArgs: false 19217 }; 19218 t['m'] = { 19219 id: _util.OPS.moveTo, 19220 numArgs: 2, 19221 variableArgs: false 19222 }; 19223 t['l'] = { 19224 id: _util.OPS.lineTo, 19225 numArgs: 2, 19226 variableArgs: false 19227 }; 19228 t['c'] = { 19229 id: _util.OPS.curveTo, 19230 numArgs: 6, 19231 variableArgs: false 19232 }; 19233 t['v'] = { 19234 id: _util.OPS.curveTo2, 19235 numArgs: 4, 19236 variableArgs: false 19237 }; 19238 t['y'] = { 19239 id: _util.OPS.curveTo3, 19240 numArgs: 4, 19241 variableArgs: false 19242 }; 19243 t['h'] = { 19244 id: _util.OPS.closePath, 19245 numArgs: 0, 19246 variableArgs: false 19247 }; 19248 t['re'] = { 19249 id: _util.OPS.rectangle, 19250 numArgs: 4, 19251 variableArgs: false 19252 }; 19253 t['S'] = { 19254 id: _util.OPS.stroke, 19255 numArgs: 0, 19256 variableArgs: false 19257 }; 19258 t['s'] = { 19259 id: _util.OPS.closeStroke, 19260 numArgs: 0, 19261 variableArgs: false 19262 }; 19263 t['f'] = { 19264 id: _util.OPS.fill, 19265 numArgs: 0, 19266 variableArgs: false 19267 }; 19268 t['F'] = { 19269 id: _util.OPS.fill, 19270 numArgs: 0, 19271 variableArgs: false 19272 }; 19273 t['f*'] = { 19274 id: _util.OPS.eoFill, 19275 numArgs: 0, 19276 variableArgs: false 19277 }; 19278 t['B'] = { 19279 id: _util.OPS.fillStroke, 19280 numArgs: 0, 19281 variableArgs: false 19282 }; 19283 t['B*'] = { 19284 id: _util.OPS.eoFillStroke, 19285 numArgs: 0, 19286 variableArgs: false 19287 }; 19288 t['b'] = { 19289 id: _util.OPS.closeFillStroke, 19290 numArgs: 0, 19291 variableArgs: false 19292 }; 19293 t['b*'] = { 19294 id: _util.OPS.closeEOFillStroke, 19295 numArgs: 0, 19296 variableArgs: false 19297 }; 19298 t['n'] = { 19299 id: _util.OPS.endPath, 19300 numArgs: 0, 19301 variableArgs: false 19302 }; 19303 t['W'] = { 19304 id: _util.OPS.clip, 19305 numArgs: 0, 19306 variableArgs: false 19307 }; 19308 t['W*'] = { 19309 id: _util.OPS.eoClip, 19310 numArgs: 0, 19311 variableArgs: false 19312 }; 19313 t['BT'] = { 19314 id: _util.OPS.beginText, 19315 numArgs: 0, 19316 variableArgs: false 19317 }; 19318 t['ET'] = { 19319 id: _util.OPS.endText, 19320 numArgs: 0, 19321 variableArgs: false 19322 }; 19323 t['Tc'] = { 19324 id: _util.OPS.setCharSpacing, 19325 numArgs: 1, 19326 variableArgs: false 19327 }; 19328 t['Tw'] = { 19329 id: _util.OPS.setWordSpacing, 19330 numArgs: 1, 19331 variableArgs: false 19332 }; 19333 t['Tz'] = { 19334 id: _util.OPS.setHScale, 19335 numArgs: 1, 19336 variableArgs: false 19337 }; 19338 t['TL'] = { 19339 id: _util.OPS.setLeading, 19340 numArgs: 1, 19341 variableArgs: false 19342 }; 19343 t['Tf'] = { 19344 id: _util.OPS.setFont, 19345 numArgs: 2, 19346 variableArgs: false 19347 }; 19348 t['Tr'] = { 19349 id: _util.OPS.setTextRenderingMode, 19350 numArgs: 1, 19351 variableArgs: false 19352 }; 19353 t['Ts'] = { 19354 id: _util.OPS.setTextRise, 19355 numArgs: 1, 19356 variableArgs: false 19357 }; 19358 t['Td'] = { 19359 id: _util.OPS.moveText, 19360 numArgs: 2, 19361 variableArgs: false 19362 }; 19363 t['TD'] = { 19364 id: _util.OPS.setLeadingMoveText, 19365 numArgs: 2, 19366 variableArgs: false 19367 }; 19368 t['Tm'] = { 19369 id: _util.OPS.setTextMatrix, 19370 numArgs: 6, 19371 variableArgs: false 19372 }; 19373 t['T*'] = { 19374 id: _util.OPS.nextLine, 19375 numArgs: 0, 19376 variableArgs: false 19377 }; 19378 t['Tj'] = { 19379 id: _util.OPS.showText, 19380 numArgs: 1, 19381 variableArgs: false 19382 }; 19383 t['TJ'] = { 19384 id: _util.OPS.showSpacedText, 19385 numArgs: 1, 19386 variableArgs: false 19387 }; 19388 t['\''] = { 19389 id: _util.OPS.nextLineShowText, 19390 numArgs: 1, 19391 variableArgs: false 19392 }; 19393 t['"'] = { 19394 id: _util.OPS.nextLineSetSpacingShowText, 19395 numArgs: 3, 19396 variableArgs: false 19397 }; 19398 t['d0'] = { 19399 id: _util.OPS.setCharWidth, 19400 numArgs: 2, 19401 variableArgs: false 19402 }; 19403 t['d1'] = { 19404 id: _util.OPS.setCharWidthAndBounds, 19405 numArgs: 6, 19406 variableArgs: false 19407 }; 19408 t['CS'] = { 19409 id: _util.OPS.setStrokeColorSpace, 19410 numArgs: 1, 19411 variableArgs: false 19412 };
19413 t['cs'] = { 19414 id: _util.OPS.setFillColorSpace, 19415 numArgs: 1, 19416 variableArgs: false 19417 }; 19418 t['SC'] = { 19419 id: _util.OPS.setStrokeColor, 19420 numArgs: 4, 19421 variableArgs: true 19422 }; 19423 t['SCN'] = { 19424 id: _util.OPS.setStrokeColorN, 19425 numArgs: 33, 19426 variableArgs: true 19427 }; 19428 t['sc'] = { 19429 id: _util.OPS.setFillColor, 19430 numArgs: 4, 19431 variableArgs: true 19432 }; 19433 t['scn'] = { 19434 id: _util.OPS.setFillColorN, 19435 numArgs: 33, 19436 variableArgs: true 19437 }; 19438 t['G'] = { 19439 id: _util.OPS.setStrokeGray, 19440 numArgs: 1, 19441 variableArgs: false 19442 }; 19443 t['g'] = { 19444 id: _util.OPS.setFillGray, 19445 numArgs: 1, 19446 variableArgs: false 19447 }; 19448 t['RG'] = { 19449 id: _util.OPS.setStrokeRGBColor, 19450 numArgs: 3, 19451 variableArgs: false 19452 }; 19453 t['rg'] = { 19454 id: _util.OPS.setFillRGBColor, 19455 numArgs: 3, 19456 variableArgs: false 19457 }; 19458 t['K'] = { 19459 id: _util.OPS.setStrokeCMYKColor, 19460 numArgs: 4, 19461 variableArgs: false 19462 }; 19463 t['k'] = { 19464 id: _util.OPS.setFillCMYKColor, 19465 numArgs: 4, 19466 variableArgs: false 19467 }; 19468 t['sh'] = { 19469 id: _util.OPS.shadingFill, 19470 numArgs: 1, 19471 variableArgs: false 19472 }; 19473 t['BI'] = { 19474 id: _util.OPS.beginInlineImage, 19475 numArgs: 0, 19476 variableArgs: false 19477 }; 19478 t['ID'] = { 19479 id: _util.OPS.beginImageData, 19480 numArgs: 0, 19481 variableArgs: false 19482 }; 19483 t['EI'] = { 19484 id: _util.OPS.endInlineImage, 19485 numArgs: 1, 19486 variableArgs: false 19487 }; 19488 t['Do'] = { 19489 id: _util.OPS.paintXObject, 19490 numArgs: 1, 19491 variableArgs: false 19492 }; 19493 t['MP'] = { 19494 id: _util.OPS.markPoint, 19495 numArgs: 1, 19496 variableArgs: false 19497 }; 19498 t['DP'] = { 19499 id: _util.OPS.markPointProps, 19500 numArgs: 2, 19501 variableArgs: false 19502 }; 19503 t['BMC'] = { 19504 id: _util.OPS.beginMarkedContent, 19505 numArgs: 1, 19506 variableArgs: false 19507 }; 19508 t['BDC'] = { 19509 id: _util.OPS.beginMarkedContentProps, 19510 numArgs: 2, 19511 variableArgs: false 19512 }; 19513 t['EMC'] = { 19514 id: _util.OPS.endMarkedContent, 19515 numArgs: 0, 19516 variableArgs: false 19517 }; 19518 t['BX'] = { 19519 id: _util.OPS.beginCompat, 19520 numArgs: 0, 19521 variableArgs: false 19522 }; 19523 t['EX'] = { 19524 id: _util.OPS.endCompat, 19525 numArgs: 0, 19526 variableArgs: false 19527 }; 19528 t['BM'] = null; 19529 t['BD'] = null; 19530 t['true'] = null; 19531 t['fa'] = null; 19532 t['fal'] = null; 19533 t['fals'] = null; 19534 t['false'] = null; 19535 t['nu'] = null; 19536 t['nul'] = null; 19537 t['null'] = null; 19538 }); 19539 function EvaluatorPreprocessor(stream, xref, stateManager) { 19540 this.opMap = getOPMap(); 19541 this.parser = new _parser.Parser(new _parser.Lexer(stream, this.opMap), false, xref); 19542 this.stateManager = stateManager; 19543 this.nonProcessedArgs = []; 19544 } 19545 EvaluatorPreprocessor.prototype = { 19546 get savedStatesDepth() { 19547 return this.stateManager.stateStack.length; 19548 }, 19549 read: function EvaluatorPreprocessor_read(operation) { 19550 var args = operation.args; 19551 while (true) { 19552 var obj = this.parser.getObj(); 19553 if ((0, _primitives.isCmd)(obj)) { 19554 var cmd = obj.cmd; 19555 var opSpec = this.opMap[cmd]; 19556 if (!opSpec) { 19557 (0, _util.warn)('Unknown command "' + cmd + '"'); 19558 continue; 19559 } 19560 var fn = opSpec.id; 19561 var numArgs = opSpec.numArgs; 19562 var argsLength = args !== null ? args.length : 0; 19563 if (!opSpec.variableArgs) { 19564 if (argsLength !== numArgs) { 19565 var nonProcessedArgs = this.nonProcessedArgs; 19566 while (argsLength > numArgs) { 19567 nonProcessedArgs.push(args.shift()); 19568 argsLength--; 19569 } 19570 while (argsLength < numArgs && nonProcessedArgs.length !== 0) { 19571 if (args === null) { 19572 args = []; 19573 } 19574 args.unshift(nonProcessedArgs.pop()); 19575 argsLength++; 19576 } 19577 } 19578 if (argsLength < numArgs) { 19579 (0, _util.warn)('Skipping command ' + fn + ': expected ' + numArgs + ' args, but received ' + argsLength + ' args.'); 19580 if (args !== null) { 19581 args.length = 0; 19582 } 19583 continue; 19584 } 19585 } else if (argsLength > numArgs) { 19586 (0, _util.info)('Command ' + fn + ': expected [0,' + numArgs + '] args, but received ' + argsLength + ' args.'); 19587 } 19588 this.preprocessCommand(fn, args); 19589 operation.fn = fn; 19590 operation.args = args; 19591 return true; 19592 } 19593 if ((0, _primitives.isEOF)(obj)) { 19594 return false;
vendor: 5,251 bytes, lines 19595-19736
19595 } 19596 if (obj !== null) { 19597 if (args === null) { 19598 args = []; 19599 } 19600 args.push(obj); 19601 if (args.length > 33) { 19602 throw new _util.FormatError('Too many arguments'); 19603 } 19604 } 19605 } 19606 }, 19607 preprocessCommand: function EvaluatorPreprocessor_preprocessCommand(fn, args) { 19608 switch (fn | 0) { 19609 case _util.OPS.save: 19610 this.stateManager.save(); 19611 break; 19612 case _util.OPS.restore: 19613 this.stateManager.restore(); 19614 break; 19615 case _util.OPS.transform: 19616 this.stateManager.transform(args); 19617 break; 19618 } 19619 } 19620 }; 19621 return EvaluatorPreprocessor; 19622}(); 19623var QueueOptimizer = function QueueOptimizerClosure() { 19624 function addState(parentState, pattern, fn) { 19625 var state = parentState; 19626 for (var i = 0, ii = pattern.length - 1; i < ii; i++) { 19627 var item = pattern[i]; 19628 state = state[item] || (state[item] = []); 19629 } 19630 state[pattern[pattern.length - 1]] = fn; 19631 } 19632 function handlePaintSolidColorImageMask(iFirstSave, count, fnArray, argsArray) { 19633 var iFirstPIMXO = iFirstSave + 2; 19634 for (var i = 0; i < count; i++) { 19635 var arg = argsArray[iFirstPIMXO + 4 * i]; 19636 var imageMask = arg.length === 1 && arg[0]; 19637 if (imageMask && imageMask.width === 1 && imageMask.height === 1 && (!imageMask.data.length || imageMask.data.length === 1 && imageMask.data[0] === 0)) { 19638 fnArray[iFirstPIMXO + 4 * i] = _util.OPS.paintSolidColorImageMask; 19639 continue; 19640 } 19641 break; 19642 } 19643 return count - i; 19644 } 19645 var InitialState = []; 19646 addState(InitialState, [_util.OPS.save, _util.OPS.transform, _util.OPS.paintInlineImageXObject, _util.OPS.restore], function foundInlineImageGroup(context) { 19647 var MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10; 19648 var MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200; 19649 var MAX_WIDTH = 1000; 19650 var IMAGE_PADDING = 1; 19651 var fnArray = context.fnArray, 19652 argsArray = context.argsArray; 19653 var curr = context.iCurr; 19654 var iFirstSave = curr - 3; 19655 var iFirstTransform = curr - 2; 19656 var iFirstPIIXO = curr - 1; 19657 var i = iFirstSave + 4; 19658 var ii = fnArray.length; 19659 while (i + 3 < ii) { 19660 if (fnArray[i] !== _util.OPS.save || fnArray[i + 1] !== _util.OPS.transform || fnArray[i + 2] !== _util.OPS.paintInlineImageXObject || fnArray[i + 3] !== _util.OPS.restore) { 19661 break; 19662 } 19663 i += 4; 19664 } 19665 var count = Math.min((i - iFirstSave) / 4, MAX_IMAGES_IN_INLINE_IMAGES_BLOCK); 19666 if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) { 19667 return i; 19668 } 19669 var maxX = 0; 19670 var map = [], 19671 maxLineHeight = 0; 19672 var currentX = IMAGE_PADDING, 19673 currentY = IMAGE_PADDING; 19674 var q; 19675 for (q = 0; q < count; q++) { 19676 var transform = argsArray[iFirstTransform + (q << 2)]; 19677 var img = argsArray[iFirstPIIXO + (q << 2)][0]; 19678 if (currentX + img.width > MAX_WIDTH) { 19679 maxX = Math.max(maxX, currentX); 19680 currentY += maxLineHeight + 2 * IMAGE_PADDING; 19681 currentX = 0; 19682 maxLineHeight = 0; 19683 } 19684 map.push({ 19685 transform: transform, 19686 x: currentX, 19687 y: currentY, 19688 w: img.width, 19689 h: img.height 19690 }); 19691 currentX += img.width + 2 * IMAGE_PADDING; 19692 maxLineHeight = Math.max(maxLineHeight, img.height); 19693 } 19694 var imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING; 19695 var imgHeight = currentY + maxLineHeight + IMAGE_PADDING; 19696 var imgData = new Uint8Array(imgWidth * imgHeight * 4); 19697 var imgRowSize = imgWidth << 2; 19698 for (q = 0; q < count; q++) { 19699 var data = argsArray[iFirstPIIXO + (q << 2)][0].data; 19700 var rowSize = map[q].w << 2; 19701 var dataOffset = 0; 19702 var offset = map[q].x + map[q].y * imgWidth << 2; 19703 imgData.set(data.subarray(0, rowSize), offset - imgRowSize); 19704 for (var k = 0, kk = map[q].h; k < kk; k++) { 19705 imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset); 19706 dataOffset += rowSize; 19707 offset += imgRowSize; 19708 } 19709 imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset); 19710 while (offset >= 0) { 19711 data[offset - 4] = data[offset]; 19712 data[offset - 3] = data[offset + 1]; 19713 data[offset - 2] = data[offset + 2]; 19714 data[offset - 1] = data[offset + 3]; 19715 data[offset + rowSize] = data[offset + rowSize - 4]; 19716 data[offset + rowSize + 1] = data[offset + rowSize - 3]; 19717 data[offset + rowSize + 2] = data[offset + rowSize - 2]; 19718 data[offset + rowSize + 3] = data[offset + rowSize - 1]; 19719 offset -= imgRowSize; 19720 } 19721 } 19722 fnArray.splice(iFirstSave, count * 4, _util.OPS.paintInlineImageXObjectGroup); 19723 argsArray.splice(iFirstSave, count * 4, [{ 19724 width: imgWidth, 19725 height: imgHeight, 19726 kind: _util.ImageKind.RGBA_32BPP, 19727 data: imgData 19728 }, map]); 19729 return iFirstSave + 1; 19730 }); 19731 addState(InitialState, [_util.OPS.save, _util.OPS.transform, _util.OPS.paintImageMaskXObject, _util.OPS.restore], function foundImageMaskGroup(context) { 19732 var MIN_IMAGES_IN_MASKS_BLOCK = 10; 19733 var MAX_IMAGES_IN_MASKS_BLOCK = 100; 19734 var MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000; 19735 var fnArray = context.fnArray, 19736 argsArray = context.argsArray;
vendor: 21,365 bytes, lines 19737-20287
19737 var curr = context.iCurr; 19738 var iFirstSave = curr - 3; 19739 var iFirstTransform = curr - 2; 19740 var iFirstPIMXO = curr - 1; 19741 var i = iFirstSave + 4; 19742 var ii = fnArray.length; 19743 while (i + 3 < ii) { 19744 if (fnArray[i] !== _util.OPS.save || fnArray[i + 1] !== _util.OPS.transform || fnArray[i + 2] !== _util.OPS.paintImageMaskXObject || fnArray[i + 3] !== _util.OPS.restore) { 19745 break; 19746 } 19747 i += 4; 19748 } 19749 var count = (i - iFirstSave) / 4; 19750 count = handlePaintSolidColorImageMask(iFirstSave, count, fnArray, argsArray); 19751 if (count < MIN_IMAGES_IN_MASKS_BLOCK) { 19752 return i; 19753 } 19754 var q; 19755 var isSameImage = false; 19756 var iTransform, transformArgs; 19757 var firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; 19758 if (argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0) { 19759 isSameImage = true; 19760 var firstTransformArg0 = argsArray[iFirstTransform][0]; 19761 var firstTransformArg3 = argsArray[iFirstTransform][3]; 19762 iTransform = iFirstTransform + 4; 19763 var iPIMXO = iFirstPIMXO + 4; 19764 for (q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { 19765 transformArgs = argsArray[iTransform]; 19766 if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || transformArgs[0] !== firstTransformArg0 || transformArgs[1] !== 0 || transformArgs[2] !== 0 || transformArgs[3] !== firstTransformArg3) { 19767 if (q < MIN_IMAGES_IN_MASKS_BLOCK) { 19768 isSameImage = false; 19769 } else { 19770 count = q; 19771 } 19772 break; 19773 } 19774 } 19775 } 19776 if (isSameImage) { 19777 count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK); 19778 var positions = new Float32Array(count * 2); 19779 iTransform = iFirstTransform; 19780 for (q = 0; q < count; q++, iTransform += 4) { 19781 transformArgs = argsArray[iTransform]; 19782 positions[q << 1] = transformArgs[4]; 19783 positions[(q << 1) + 1] = transformArgs[5]; 19784 } 19785 fnArray.splice(iFirstSave, count * 4, _util.OPS.paintImageMaskXObjectRepeat); 19786 argsArray.splice(iFirstSave, count * 4, [firstPIMXOArg0, firstTransformArg0, firstTransformArg3, positions]); 19787 } else { 19788 count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); 19789 var images = []; 19790 for (q = 0; q < count; q++) { 19791 transformArgs = argsArray[iFirstTransform + (q << 2)]; 19792 var maskParams = argsArray[iFirstPIMXO + (q << 2)][0]; 19793 images.push({ 19794 data: maskParams.data, 19795 width: maskParams.width, 19796 height: maskParams.height, 19797 transform: transformArgs 19798 }); 19799 } 19800 fnArray.splice(iFirstSave, count * 4, _util.OPS.paintImageMaskXObjectGroup); 19801 argsArray.splice(iFirstSave, count * 4, [images]); 19802 } 19803 return iFirstSave + 1; 19804 }); 19805 addState(InitialState, [_util.OPS.save, _util.OPS.transform, _util.OPS.paintImageXObject, _util.OPS.restore], function (context) { 19806 var MIN_IMAGES_IN_BLOCK = 3; 19807 var MAX_IMAGES_IN_BLOCK = 1000; 19808 var fnArray = context.fnArray, 19809 argsArray = context.argsArray; 19810 var curr = context.iCurr; 19811 var iFirstSave = curr - 3; 19812 var iFirstTransform = curr - 2; 19813 var iFirstPIXO = curr - 1; 19814 var iFirstRestore = curr; 19815 if (argsArray[iFirstTransform][1] !== 0 || argsArray[iFirstTransform][2] !== 0) { 19816 return iFirstRestore + 1; 19817 } 19818 var firstPIXOArg0 = argsArray[iFirstPIXO][0]; 19819 var firstTransformArg0 = argsArray[iFirstTransform][0]; 19820 var firstTransformArg3 = argsArray[iFirstTransform][3]; 19821 var i = iFirstSave + 4; 19822 var ii = fnArray.length; 19823 while (i + 3 < ii) { 19824 if (fnArray[i] !== _util.OPS.save || fnArray[i + 1] !== _util.OPS.transform || fnArray[i + 2] !== _util.OPS.paintImageXObject || fnArray[i + 3] !== _util.OPS.restore) { 19825 break; 19826 } 19827 if (argsArray[i + 1][0] !== firstTransformArg0 || argsArray[i + 1][1] !== 0 || argsArray[i + 1][2] !== 0 || argsArray[i + 1][3] !== firstTransformArg3) { 19828 break; 19829 } 19830 if (argsArray[i + 2][0] !== firstPIXOArg0) { 19831 break; 19832 } 19833 i += 4; 19834 } 19835 var count = Math.min((i - iFirstSave) / 4, MAX_IMAGES_IN_BLOCK); 19836 if (count < MIN_IMAGES_IN_BLOCK) { 19837 return i; 19838 } 19839 var positions = new Float32Array(count * 2); 19840 var iTransform = iFirstTransform; 19841 for (var q = 0; q < count; q++, iTransform += 4) { 19842 var transformArgs = argsArray[iTransform]; 19843 positions[q << 1] = transformArgs[4]; 19844 positions[(q << 1) + 1] = transformArgs[5]; 19845 } 19846 var args = [firstPIXOArg0, firstTransformArg0, firstTransformArg3, positions]; 19847 fnArray.splice(iFirstSave, count * 4, _util.OPS.paintImageXObjectRepeat); 19848 argsArray.splice(iFirstSave, count * 4, args); 19849 return iFirstSave + 1; 19850 }); 19851 addState(InitialState, [_util.OPS.beginText, _util.OPS.setFont, _util.OPS.setTextMatrix, _util.OPS.showText, _util.OPS.endText], function (context) { 19852 var MIN_CHARS_IN_BLOCK = 3; 19853 var MAX_CHARS_IN_BLOCK = 1000; 19854 var fnArray = context.fnArray, 19855 argsArray = context.argsArray; 19856 var curr = context.iCurr; 19857 var iFirstBeginText = curr - 4; 19858 var iFirstSetFont = curr - 3; 19859 var iFirstSetTextMatrix = curr - 2; 19860 var iFirstShowText = curr - 1; 19861 var iFirstEndText = curr; 19862 var firstSetFontArg0 = argsArray[iFirstSetFont][0]; 19863 var firstSetFontArg1 = argsArray[iFirstSetFont][1]; 19864 var i = iFirstBeginText + 5; 19865 var ii = fnArray.length; 19866 while (i + 4 < ii) { 19867 if (fnArray[i] !== _util.OPS.beginText || fnArray[i + 1] !== _util.OPS.setFont || fnArray[i + 2] !== _util.OPS.setTextMatrix || fnArray[i + 3] !== _util.OPS.showText || fnArray[i + 4] !== _util.OPS.endText) { 19868 break; 19869 } 19870 if (argsArray[i + 1][0] !== firstSetFontArg0 || argsArray[i + 1][1] !== firstSetFontArg1) { 19871 break; 19872 } 19873 i += 5; 19874 } 19875 var count = Math.min((i - iFirstBeginText) / 5, MAX_CHARS_IN_BLOCK); 19876 if (count < MIN_CHARS_IN_BLOCK) { 19877 return i; 19878 } 19879 var iFirst = iFirstBeginText; 19880 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) { 19881 count++; 19882 iFirst -= 5; 19883 } 19884 var iEndText = iFirst + 4; 19885 for (var q = 1; q < count; q++) { 19886 fnArray.splice(iEndText, 3); 19887 argsArray.splice(iEndText, 3); 19888 iEndText += 2; 19889 } 19890 return iEndText + 1; 19891 }); 19892 function QueueOptimizer() {} 19893 QueueOptimizer.prototype = { 19894 optimize: function QueueOptimizer_optimize(queue) { 19895 var fnArray = queue.fnArray, 19896 argsArray = queue.argsArray; 19897 var context = { 19898 iCurr: 0, 19899 fnArray: fnArray, 19900 argsArray: argsArray 19901 }; 19902 var state; 19903 var i = 0, 19904 ii = fnArray.length; 19905 while (i < ii) { 19906 state = (state || InitialState)[fnArray[i]]; 19907 if (typeof state === 'function') { 19908 context.iCurr = i; 19909 i = state(context); 19910 state = undefined; 19911 ii = context.fnArray.length; 19912 } else { 19913 i++; 19914 } 19915 } 19916 } 19917 }; 19918 return QueueOptimizer; 19919}(); 19920exports.OperatorList = OperatorList; 19921exports.PartialEvaluator = PartialEvaluator; 19922 19923/***/ }), 19924/* 68 */ 19925/***/ (function(module, exports, __w_pdfjs_require__) { 19926 19927"use strict"; 19928 19929 19930Object.defineProperty(exports, "__esModule", { 19931 value: true 19932}); 19933exports.CFFCompiler = exports.CFFPrivateDict = exports.CFFTopDict = exports.CFFCharset = exports.CFFIndex = exports.CFFStrings = exports.CFFHeader = exports.CFF = exports.CFFParser = exports.CFFStandardStrings = undefined; 19934 19935var _util = __w_pdfjs_require__(0); 19936 19937var _charsets = __w_pdfjs_require__(115); 19938 19939var _encodings = __w_pdfjs_require__(22); 19940 19941var MAX_SUBR_NESTING = 10; 19942var 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']; 19943var CFFParser = function CFFParserClosure() { 19944 var CharstringValidationData = [null, { 19945 id: 'hstem', 19946 min: 2, 19947 stackClearing: true, 19948 stem: true 19949 }, null, { 19950 id: 'vstem', 19951 min: 2, 19952 stackClearing: true, 19953 stem: true 19954 }, { 19955 id: 'vmoveto', 19956 min: 1, 19957 stackClearing: true 19958 }, { 19959 id: 'rlineto', 19960 min: 2, 19961 resetStack: true 19962 }, { 19963 id: 'hlineto', 19964 min: 1, 19965 resetStack: true 19966 }, { 19967 id: 'vlineto', 19968 min: 1, 19969 resetStack: true 19970 }, { 19971 id: 'rrcurveto', 19972 min: 6, 19973 resetStack: true 19974 }, null, { 19975 id: 'callsubr', 19976 min: 1, 19977 undefStack: true 19978 }, { 19979 id: 'return', 19980 min: 0, 19981 undefStack: true 19982 }, null, null, { 19983 id: 'endchar', 19984 min: 0, 19985 stackClearing: true 19986 }, null, null, null, { 19987 id: 'hstemhm', 19988 min: 2, 19989 stackClearing: true, 19990 stem: true 19991 }, { 19992 id: 'hintmask', 19993 min: 0, 19994 stackClearing: true 19995 }, { 19996 id: 'cntrmask', 19997 min: 0, 19998 stackClearing: true 19999 }, { 20000 id: 'rmoveto', 20001 min: 2, 20002 stackClearing: true 20003 }, { 20004 id: 'hmoveto', 20005 min: 1, 20006 stackClearing: true 20007 }, { 20008 id: 'vstemhm', 20009 min: 2, 20010 stackClearing: true, 20011 stem: true 20012 }, { 20013 id: 'rcurveline', 20014 min: 8, 20015 resetStack: true 20016 }, { 20017 id: 'rlinecurve', 20018 min: 8, 20019 resetStack: true 20020 }, { 20021 id: 'vvcurveto', 20022 min: 4, 20023 resetStack: true 20024 }, { 20025 id: 'hhcurveto', 20026 min: 4, 20027 resetStack: true 20028 }, null, { 20029 id: 'callgsubr', 20030 min: 1, 20031 undefStack: true 20032 }, { 20033 id: 'vhcurveto', 20034 min: 4, 20035 resetStack: true 20036 }, { 20037 id: 'hvcurveto', 20038 min: 4, 20039 resetStack: true 20040 }]; 20041 var CharstringValidationData12 = [null, null, null, { 20042 id: 'and', 20043 min: 2, 20044 stackDelta: -1 20045 }, { 20046 id: 'or', 20047 min: 2, 20048 stackDelta: -1 20049 }, { 20050 id: 'not', 20051 min: 1, 20052 stackDelta: 0 20053 }, null, null, null, { 20054 id: 'abs', 20055 min: 1, 20056 stackDelta: 0 20057 }, { 20058 id: 'add', 20059 min: 2, 20060 stackDelta: -1, 20061 stackFn: function stack_div(stack, index) { 20062 stack[index - 2] = stack[index - 2] + stack[index - 1]; 20063 } 20064 }, { 20065 id: 'sub', 20066 min: 2, 20067 stackDelta: -1, 20068 stackFn: function stack_div(stack, index) { 20069 stack[index - 2] = stack[index - 2] - stack[index - 1]; 20070 } 20071 }, { 20072 id: 'div', 20073 min: 2, 20074 stackDelta: -1, 20075 stackFn: function stack_div(stack, index) { 20076 stack[index - 2] = stack[index - 2] / stack[index - 1]; 20077 } 20078 }, null, { 20079 id: 'neg', 20080 min: 1, 20081 stackDelta: 0, 20082 stackFn: function stack_div(stack, index) { 20083 stack[index - 1] = -stack[index - 1]; 20084 } 20085 }, { 20086 id: 'eq', 20087 min: 2, 20088 stackDelta: -1 20089 }, null, null, { 20090 id: 'drop', 20091 min: 1, 20092 stackDelta: -1 20093 }, null, { 20094 id: 'put', 20095 min: 2, 20096 stackDelta: -2 20097 }, { 20098 id: 'get', 20099 min: 1, 20100 stackDelta: 0 20101 }, { 20102 id: 'ifelse', 20103 min: 4, 20104 stackDelta: -3 20105 }, { 20106 id: 'random', 20107 min: 0, 20108 stackDelta: 1 20109 }, { 20110 id: 'mul', 20111 min: 2, 20112 stackDelta: -1, 20113 stackFn: function stack_div(stack, index) { 20114 stack[index - 2] = stack[index - 2] * stack[index - 1]; 20115 } 20116 }, null, { 20117 id: 'sqrt', 20118 min: 1, 20119 stackDelta: 0 20120 }, { 20121 id: 'dup', 20122 min: 1, 20123 stackDelta: 1 20124 }, { 20125 id: 'exch', 20126 min: 2, 20127 stackDelta: 0 20128 }, { 20129 id: 'index', 20130 min: 2, 20131 stackDelta: 0 20132 }, { 20133 id: 'roll', 20134 min: 3, 20135 stackDelta: -2 20136 }, null, null, null, { 20137 id: 'hflex', 20138 min: 7, 20139 resetStack: true 20140 }, { 20141 id: 'flex', 20142 min: 13, 20143 resetStack: true 20144 }, { 20145 id: 'hflex1', 20146 min: 9, 20147 resetStack: true 20148 }, { 20149 id: 'flex1', 20150 min: 11, 20151 resetStack: true 20152 }]; 20153 function CFFParser(file, properties, seacAnalysisEnabled) { 20154 this.bytes = file.getBytes(); 20155 this.properties = properties; 20156 this.seacAnalysisEnabled = !!seacAnalysisEnabled; 20157 } 20158 CFFParser.prototype = { 20159 parse: function CFFParser_parse() { 20160 var properties = this.properties; 20161 var cff = new CFF(); 20162 this.cff = cff; 20163 var header = this.parseHeader(); 20164 var nameIndex = this.parseIndex(header.endPos); 20165 var topDictIndex = this.parseIndex(nameIndex.endPos); 20166 var stringIndex = this.parseIndex(topDictIndex.endPos); 20167 var globalSubrIndex = this.parseIndex(stringIndex.endPos); 20168 var topDictParsed = this.parseDict(topDictIndex.obj.get(0)); 20169 var topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings); 20170 cff.header = header.obj; 20171 cff.names = this.parseNameIndex(nameIndex.obj); 20172 cff.strings = this.parseStringIndex(stringIndex.obj); 20173 cff.topDict = topDict; 20174 cff.globalSubrIndex = globalSubrIndex.obj; 20175 this.parsePrivateDict(cff.topDict); 20176 cff.isCIDFont = topDict.hasName('ROS'); 20177 var charStringOffset = topDict.getByName('CharStrings'); 20178 var charStringIndex = this.parseIndex(charStringOffset).obj; 20179 var fontMatrix = topDict.getByName('FontMatrix'); 20180 if (fontMatrix) { 20181 properties.fontMatrix = fontMatrix; 20182 } 20183 var fontBBox = topDict.getByName('FontBBox'); 20184 if (fontBBox) { 20185 properties.ascent = Math.max(fontBBox[3], fontBBox[1]); 20186 properties.descent = Math.min(fontBBox[1], fontBBox[3]); 20187 properties.ascentScaled = true; 20188 } 20189 var charset, encoding; 20190 if (cff.isCIDFont) { 20191 var fdArrayIndex = this.parseIndex(topDict.getByName('FDArray')).obj; 20192 for (var i = 0, ii = fdArrayIndex.count; i < ii; ++i) { 20193 var dictRaw = fdArrayIndex.get(i); 20194 var fontDict = this.createDict(CFFTopDict, this.parseDict(dictRaw), cff.strings); 20195 this.parsePrivateDict(fontDict); 20196 cff.fdArray.push(fontDict); 20197 } 20198 encoding = null; 20199 charset = this.parseCharsets(topDict.getByName('charset'), charStringIndex.count, cff.strings, true); 20200 cff.fdSelect = this.parseFDSelect(topDict.getByName('FDSelect'), charStringIndex.count); 20201 } else { 20202 charset = this.parseCharsets(topDict.getByName('charset'), charStringIndex.count, cff.strings, false); 20203 encoding = this.parseEncoding(topDict.getByName('Encoding'), properties, cff.strings, charset.charset); 20204 } 20205 cff.charset = charset; 20206 cff.encoding = encoding; 20207 var charStringsAndSeacs = this.parseCharStrings({ 20208 charStrings: charStringIndex, 20209 localSubrIndex: topDict.privateDict.subrsIndex, 20210 globalSubrIndex: globalSubrIndex.obj, 20211 fdSelect: cff.fdSelect, 20212 fdArray: cff.fdArray, 20213 privateDict: topDict.privateDict 20214 }); 20215 cff.charStrings = charStringsAndSeacs.charStrings; 20216 cff.seacs = charStringsAndSeacs.seacs; 20217 cff.widths = charStringsAndSeacs.widths; 20218 return cff; 20219 }, 20220 parseHeader: function CFFParser_parseHeader() { 20221 var bytes = this.bytes; 20222 var bytesLength = bytes.length; 20223 var offset = 0; 20224 while (offset < bytesLength && bytes[offset] !== 1) { 20225 ++offset; 20226 } 20227 if (offset >= bytesLength) { 20228 throw new _util.FormatError('Invalid CFF header'); 20229 } 20230 if (offset !== 0) { 20231 (0, _util.info)('cff data is shifted'); 20232 bytes = bytes.subarray(offset); 20233 this.bytes = bytes; 20234 } 20235 var major = bytes[0]; 20236 var minor = bytes[1]; 20237 var hdrSize = bytes[2]; 20238 var offSize = bytes[3]; 20239 var header = new CFFHeader(major, minor, hdrSize, offSize); 20240 return { 20241 obj: header, 20242 endPos: hdrSize 20243 }; 20244 }, 20245 parseDict: function CFFParser_parseDict(dict) { 20246 var pos = 0; 20247 function parseOperand() { 20248 var value = dict[pos++]; 20249 if (value === 30) { 20250 return parseFloatOperand(); 20251 } else if (value === 28) { 20252 value = dict[pos++]; 20253 value = (value << 24 | dict[pos++] << 16) >> 16; 20254 return value; 20255 } else if (value === 29) { 20256 value = dict[pos++]; 20257 value = value << 8 | dict[pos++]; 20258 value = value << 8 | dict[pos++]; 20259 value = value << 8 | dict[pos++]; 20260 return value; 20261 } else if (value >= 32 && value <= 246) { 20262 return value - 139; 20263 } else if (value >= 247 && value <= 250) { 20264 return (value - 247) * 256 + dict[pos++] + 108; 20265 } else if (value >= 251 && value <= 254) { 20266 return -((value - 251) * 256) - dict[pos++] - 108; 20267 } 20268 (0, _util.warn)('CFFParser_parseDict: "' + value + '" is a reserved command.'); 20269 return NaN; 20270 } 20271 function parseFloatOperand() { 20272 var str = ''; 20273 var eof = 15; 20274 var lookup = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', 'E', 'E-', null, '-']; 20275 var length = dict.length; 20276 while (pos < length) { 20277 var b = dict[pos++]; 20278 var b1 = b >> 4; 20279 var b2 = b & 15; 20280 if (b1 === eof) { 20281 break; 20282 } 20283 str += lookup[b1]; 20284 if (b2 === eof) { 20285 break; 20286 } 20287 str
20287+= lookup[b2]; 20288 } 20289 return parseFloat(str); 20290 } 20291 var operands = []; 20292 var entries = []; 20293 pos = 0; 20294 var end = dict.length; 20295 while (pos < end) { 20296 var b = dict[pos]; 20297 if (b <= 21) { 20298 if (b === 12) { 20299 b = b << 8 | dict[++pos]; 20300 } 20301 entries.push([b, operands]); 20302 operands = []; 20303 ++pos; 20304 } else { 20305 operands.push(parseOperand()); 20306 } 20307 } 20308 return entries; 20309 }, 20310 parseIndex: function CFFParser_parseIndex(pos) { 20311 var cffIndex = new CFFIndex(); 20312 var bytes = this.bytes; 20313 var count = bytes[pos++] << 8 | bytes[pos++]; 20314 var offsets = []; 20315 var end = pos; 20316 var i, ii; 20317 if (count !== 0) { 20318 var offsetSize = bytes[pos++]; 20319 var startPos = pos + (count + 1) * offsetSize - 1; 20320 for (i = 0, ii = count + 1; i < ii; ++i) { 20321 var offset = 0; 20322 for (var j = 0; j < offsetSize; ++j) { 20323 offset <<= 8; 20324 offset += bytes[pos++]; 20325 } 20326 offsets.push(startPos + offset); 20327 } 20328 end = offsets[count]; 20329 } 20330 for (i = 0, ii = offsets.length - 1; i < ii; ++i) { 20331 var offsetStart = offsets[i]; 20332 var offsetEnd = offsets[i + 1]; 20333 cffIndex.add(bytes.subarray(offsetStart, offsetEnd)); 20334 } 20335 return { 20336 obj: cffIndex, 20337 endPos: end 20338 }; 20339 }, 20340 parseNameIndex: function CFFParser_parseNameIndex(index) { 20341 var names = []; 20342 for (var i = 0, ii = index.count; i < ii; ++i) { 20343 var name = index.get(i); 20344 var length = Math.min(name.length, 127); 20345 var data = []; 20346 for (var j = 0; j < length; ++j) { 20347 var c = name[j]; 20348 if (j === 0 && c === 0) { 20349 data[j] = c; 20350 continue; 20351 } 20352 if (c < 33 || c > 126 || c === 91 || c === 93 || c === 40 || c === 41 || c === 123 || c === 125 || c === 60 || c === 62 || c === 47 || c === 37 || c === 35) { 20353 data[j] = 95; 20354 continue; 20355 } 20356 data[j] = c; 20357 } 20358 names.push((0, _util.bytesToString)(data)); 20359 } 20360 return names; 20361 }, 20362 parseStringIndex: function CFFParser_parseStringIndex(index) { 20363 var strings = new CFFStrings(); 20364 for (var i = 0, ii = index.count; i < ii; ++i) { 20365 var data = index.get(i); 20366 strings.add((0, _util.bytesToString)(data)); 20367 } 20368 return strings; 20369 }, 20370 createDict: function CFFParser_createDict(Type, dict, strings) { 20371 var cffDict = new Type(strings); 20372 for (var i = 0, ii = dict.length; i < ii; ++i) { 20373 var pair = dict[i]; 20374 var key = pair[0]; 20375 var value = pair[1]; 20376 cffDict.setByKey(key, value); 20377 } 20378 return cffDict; 20379 }, 20380 parseCharString: function CFFParser_parseCharString(state, data, localSubrIndex, globalSubrIndex) { 20381 if (!data || state.callDepth > MAX_SUBR_NESTING) { 20382 return false; 20383 } 20384 var stackSize = state.stackSize; 20385 var stack = state.stack; 20386 var length = data.length; 20387 for (var j = 0; j < length;) { 20388 var value = data[j++]; 20389 var validationCommand = null; 20390 if (value === 12) { 20391 var q = data[j++]; 20392 if (q === 0) { 20393 data[j - 2] = 139; 20394 data[j - 1] = 22; 20395 stackSize = 0; 20396 } else { 20397 validationCommand = CharstringValidationData12[q]; 20398 } 20399 } else if (value === 28) { 20400 stack[stackSize] = (data[j] << 24 | data[j + 1] << 16) >> 16; 20401 j += 2; 20402 stackSize++; 20403 } else if (value === 14) { 20404 if (stackSize >= 4) { 20405 stackSize -= 4; 20406 if (this.seacAnalysisEnabled) { 20407 state.seac = stack.slice(stackSize, stackSize + 4); 20408 return false; 20409 } 20410 } 20411 validationCommand = CharstringValidationData[value]; 20412 } else if (value >= 32 && value <= 246) { 20413 stack[stackSize] = value - 139; 20414 stackSize++; 20415 } else if (value >= 247 && value <= 254) { 20416 stack[stackSize] = value < 251 ? (value - 247 << 8) + data[j] + 108 : -(value - 251 << 8) - data[j] - 108; 20417 j++; 20418 stackSize++; 20419 }
20419 else if (value === 255) { 20420 stack[stackSize] = (data[j] << 24 | data[j + 1] << 16 | data[j + 2] << 8 | data[j + 3]) / 65536; 20421 j += 4; 20422 stackSize++; 20423 } else if (value === 19 || value === 20) { 20424 state.hints += stackSize >> 1; 20425 j += state.hints + 7 >> 3; 20426 stackSize %= 2; 20427 validationCommand = CharstringValidationData[value]; 20428 } else if (value === 10 || value === 29) { 20429 var subrsIndex; 20430 if (value === 10) { 20431 subrsIndex = localSubrIndex; 20432 } else { 20433 subrsIndex = globalSubrIndex; 20434 } 20435 if (!subrsIndex) { 20436 validationCommand = CharstringValidationData[value]; 20437 (0, _util.warn)('Missing subrsIndex for ' + validationCommand.id); 20438 return false; 20439 } 20440 var bias = 32768; 20441 if (subrsIndex.count < 1240) { 20442 bias = 107; 20443 } else if (subrsIndex.count < 33900) { 20444 bias = 1131; 20445 } 20446 var subrNumber = stack[--stackSize] + bias; 20447 if (subrNumber < 0 || subrNumber >= subrsIndex.count || isNaN(subrNumber)) { 20448 validationCommand = CharstringValidationData[value]; 20449 (0, _util.warn)('Out of bounds subrIndex for ' + validationCommand.id); 20450 return false; 20451 } 20452 state.stackSize = stackSize; 20453 state.callDepth++; 20454 var valid = this.parseCharString(state, subrsIndex.get(subrNumber), localSubrIndex, globalSubrIndex); 20455 if (!valid) { 20456 return false; 20457 } 20458 state.callDepth--; 20459 stackSize = state.stackSize; 20460 continue; 20461 } else if (value === 11) { 20462 state.stackSize = stackSize; 20463 return true; 20464 } else { 20465 validationCommand = CharstringValidationData[value]; 20466 } 20467 if (validationCommand) { 20468 if (validationCommand.stem) { 20469 state.hints += stackSize >> 1; 20470 } 20471 if ('min' in validationCommand) { 20472 if (!state.undefStack && stackSize < validationCommand.min) { 20473 (0, _util.warn)('Not enough parameters for ' + validationCommand.id + '; actual: ' + stackSize + ', expected: ' + validationCommand.min); 20474 return false; 20475 } 20476 } 20477 if (state.firstStackClearing && validationCommand.stackClearing) { 20478 state.firstStackClearing = false; 20479 stackSize -= validationCommand.min; 20480 if (stackSize >= 2 && validationCommand.stem) { 20481 stackSize %= 2; 20482 } else if (stackSize > 1) { 20483 (0, _util.warn)('Found too many parameters for stack-clearing command'); 20484 } 20485 if (stackSize > 0 && stack[stackSize - 1] >= 0) { 20486 state.width = stack[stackSize - 1]; 20487 } 20488 } 20489 if ('stackDelta' in validationCommand) { 20490 if ('stackFn' in validationCommand) { 20491 validationCommand.stackFn(stack, stackSize); 20492 } 20493 stackSize += validationCommand.stackDelta; 20494 } else if (validationCommand.stackClearing) { 20495 stackSize = 0; 20496 } else if (validationCommand.resetStack) { 20497 stackSize = 0; 20498 state.undefStack = false; 20499 } else if (validationCommand.undefStack) { 20500 stackSize = 0; 20501 state.undefStack = true; 20502 state.firstStackClearing = false; 20503 } 20504 } 20505 } 20506 state.stackSize = stackSize; 20507 return true; 20508 }, 20509 parseCharStrings: function parseCharStrings(_ref) { 20510 var charStrings = _ref.charStrings, 20511 localSubrIndex = _ref.localSubrIndex, 20512 globalSubrIndex = _ref.globalSubrIndex, 20513 fdSelect = _ref.fdSelect, 20514 fdArray = _ref.fdArray, 20515 privateDict = _ref.privateDict; 20516 20517 var seacs = []; 20518 var widths = []; 20519 var count = charStrings.count; 20520 for (var i = 0; i < count; i++) { 20521 var charstring = charStrings.get(i); 20522 var state = { 20523 callDepth: 0, 20524 stackSize: 0, 20525 stack: [], 20526 undefStack: true, 20527 hints: 0, 20528 firstStackClearing: true, 20529 seac: null, 20530 width: null 20531 };
20532 var valid = true; 20533 var localSubrToUse = null; 20534 var privateDictToUse = privateDict; 20535 if (fdSelect && fdArray.length) { 20536 var fdIndex = fdSelect.getFDIndex(i); 20537 if (fdIndex === -1) { 20538 (0, _util.warn)('Glyph index is not in fd select.'); 20539 valid = false; 20540 } 20541 if (fdIndex >= fdArray.length) { 20542 (0, _util.warn)('Invalid fd index for glyph index.'); 20543 valid = false; 20544 } 20545 if (valid) { 20546 privateDictToUse = fdArray[fdIndex].privateDict; 20547 localSubrToUse = privateDictToUse.subrsIndex; 20548 } 20549 } else if (localSubrIndex) { 20550 localSubrToUse = localSubrIndex; 20551 } 20552 if (valid) { 20553 valid = this.parseCharString(state, charstring, localSubrToUse, globalSubrIndex); 20554 } 20555 if (state.width !== null) { 20556 var nominalWidth = privateDictToUse.getByName('nominalWidthX'); 20557 widths[i] = nominalWidth + state.width; 20558 } else { 20559 var defaultWidth = privateDictToUse.getByName('defaultWidthX'); 20560 widths[i] = defaultWidth; 20561 } 20562 if (state.seac !== null) { 20563 seacs[i] = state.seac; 20564 } 20565 if (!valid) { 20566 charStrings.set(i, new Uint8Array([14])); 20567 } 20568 } 20569 return { 20570 charStrings: charStrings, 20571 seacs: seacs, 20572 widths: widths 20573 }; 20574 }, 20575 20576 emptyPrivateDictionary: function CFFParser_emptyPrivateDictionary(parentDict) { 20577 var privateDict = this.createDict(CFFPrivateDict, [], parentDict.strings); 20578 parentDict.setByKey(18, [0, 0]); 20579 parentDict.privateDict = privateDict; 20580 }, 20581 parsePrivateDict: function CFFParser_parsePrivateDict(parentDict) { 20582 if (!parentDict.hasName('Private')) { 20583 this.emptyPrivateDictionary(parentDict); 20584 return; 20585 } 20586 var privateOffset = parentDict.getByName('Private'); 20587 if (!Array.isArray(privateOffset) || privateOffset.length !== 2) { 20588 parentDict.removeByName('Private'); 20589 return; 20590 } 20591 var size = privateOffset[0]; 20592 var offset = privateOffset[1]; 20593 if (size === 0 || offset >= this.bytes.length) { 20594 this.emptyPrivateDictionary(parentDict); 20595 return; 20596 } 20597 var privateDictEnd = offset + size; 20598 var dictData = this.bytes.subarray(offset, privateDictEnd); 20599 var dict = this.parseDict(dictData); 20600 var privateDict = this.createDict(CFFPrivateDict, dict, parentDict.strings); 20601 parentDict.privateDict = privateDict; 20602 if (!privateDict.getByName('Subrs')) { 20603 return; 20604 } 20605 var subrsOffset = privateDict.getByName('Subrs'); 20606 var relativeOffset = offset + subrsOffset; 20607 if (subrsOffset === 0 || relativeOffset >= this.bytes.length) { 20608 this.emptyPrivateDictionary(parentDict); 20609 return; 20610 } 20611 var subrsIndex = this.parseIndex(relativeOffset); 20612 privateDict.subrsIndex = subrsIndex.obj; 20613 }, 20614 parseCharsets: function CFFParser_parseCharsets(pos, length, strings, cid) { 20615 if (pos === 0) { 20616 return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, _charsets.ISOAdobeCharset); 20617 } else if (pos === 1) { 20618 return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT, _charsets.ExpertCharset); 20619 } else if (pos === 2) { 20620 return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT_SUBSET, _charsets.ExpertSubsetCharset); 20621 } 20622 var bytes = this.bytes; 20623 var start = pos; 20624 var format = bytes[pos++]; 20625 var charset = ['.notdef']; 20626 var id, count, i; 20627 length -= 1; 20628 switch (format) { 20629 case 0: 20630 for (i = 0; i < length; i++) { 20631 id = bytes[pos++] << 8 | bytes[pos++]; 20632 charset.push(cid ? id : strings.get(id)); 20633 } 20634 break; 20635 case 1: 20636 while (charset.length <= length) { 20637 id = bytes[pos++] << 8 | bytes[pos++]; 20638 count = bytes[pos++]; 20639 for (i = 0; i <= count; i++) { 20640 charset.push(cid ? id++ : strings.get(id++)); 20641 } 20642 } 20643 break; 20644 case 2: 20645 while (charset.length <= length) {
vendor: 4,401 bytes, lines 20646-20778
20646 id = bytes[pos++] << 8 | bytes[pos++]; 20647 count = bytes[pos++] << 8 | bytes[pos++]; 20648 for (i = 0; i <= count; i++) { 20649 charset.push(cid ? id++ : strings.get(id++)); 20650 } 20651 } 20652 break; 20653 default: 20654 throw new _util.FormatError('Unknown charset format'); 20655 } 20656 var end = pos; 20657 var raw = bytes.subarray(start, end); 20658 return new CFFCharset(false, format, charset, raw); 20659 }, 20660 parseEncoding: function CFFParser_parseEncoding(pos, properties, strings, charset) { 20661 var encoding = Object.create(null); 20662 var bytes = this.bytes; 20663 var predefined = false; 20664 var format, i, ii; 20665 var raw = null; 20666 function readSupplement() { 20667 var supplementsCount = bytes[pos++]; 20668 for (i = 0; i < supplementsCount; i++) { 20669 var code = bytes[pos++]; 20670 var sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff); 20671 encoding[code] = charset.indexOf(strings.get(sid)); 20672 } 20673 } 20674 if (pos === 0 || pos === 1) { 20675 predefined = true; 20676 format = pos; 20677 var baseEncoding = pos ? _encodings.ExpertEncoding : _encodings.StandardEncoding; 20678 for (i = 0, ii = charset.length; i < ii; i++) { 20679 var index = baseEncoding.indexOf(charset[i]); 20680 if (index !== -1) { 20681 encoding[index] = i; 20682 } 20683 } 20684 } else { 20685 var dataStart = pos; 20686 format = bytes[pos++]; 20687 switch (format & 0x7f) { 20688 case 0: 20689 var glyphsCount = bytes[pos++]; 20690 for (i = 1; i <= glyphsCount; i++) { 20691 encoding[bytes[pos++]] = i; 20692 } 20693 break; 20694 case 1: 20695 var rangesCount = bytes[pos++]; 20696 var gid = 1; 20697 for (i = 0; i < rangesCount; i++) { 20698 var start = bytes[pos++]; 20699 var left = bytes[pos++]; 20700 for (var j = start; j <= start + left; j++) { 20701 encoding[j] = gid++; 20702 } 20703 } 20704 break; 20705 default: 20706 throw new _util.FormatError('Unknown encoding format: ' + format + ' in CFF'); 20707 } 20708 var dataEnd = pos; 20709 if (format & 0x80) { 20710 bytes[dataStart] &= 0x7f; 20711 readSupplement(); 20712 } 20713 raw = bytes.subarray(dataStart, dataEnd); 20714 } 20715 format = format & 0x7f; 20716 return new CFFEncoding(predefined, format, encoding, raw); 20717 }, 20718 parseFDSelect: function CFFParser_parseFDSelect(pos, length) { 20719 var start = pos; 20720 var bytes = this.bytes; 20721 var format = bytes[pos++]; 20722 var fdSelect = [], 20723 rawBytes; 20724 var i, 20725 invalidFirstGID = false; 20726 switch (format) { 20727 case 0: 20728 for (i = 0; i < length; ++i) { 20729 var id = bytes[pos++]; 20730 fdSelect.push(id); 20731 } 20732 rawBytes = bytes.subarray(start, pos); 20733 break; 20734 case 3: 20735 var rangesCount = bytes[pos++] << 8 | bytes[pos++]; 20736 for (i = 0; i < rangesCount; ++i) { 20737 var first = bytes[pos++] << 8 | bytes[pos++]; 20738 if (i === 0 && first !== 0) { 20739 (0, _util.warn)('parseFDSelect: The first range must have a first GID of 0' + ' -- trying to recover.'); 20740 invalidFirstGID = true; 20741 first = 0; 20742 } 20743 var fdIndex = bytes[pos++]; 20744 var next = bytes[pos] << 8 | bytes[pos + 1]; 20745 for (var j = first; j < next; ++j) { 20746 fdSelect.push(fdIndex); 20747 } 20748 } 20749 pos += 2; 20750 rawBytes = bytes.subarray(start, pos); 20751 if (invalidFirstGID) { 20752 rawBytes[3] = rawBytes[4] = 0; 20753 } 20754 break; 20755 default: 20756 throw new _util.FormatError('parseFDSelect: Unknown format "' + format + '".'); 20757 } 20758 if (fdSelect.length !== length) { 20759 throw new _util.FormatError('parseFDSelect: Invalid font data.'); 20760 } 20761 return new CFFFDSelect(fdSelect, rawBytes); 20762 } 20763 }; 20764 return CFFParser; 20765}(); 20766var CFF = function CFFClosure() { 20767 function CFF() { 20768 this.header = null; 20769 this.names = []; 20770 this.topDict = null; 20771 this.strings = new CFFStrings(); 20772 this.globalSubrIndex = null; 20773 this.encoding = null; 20774 this.charset = null; 20775 this.charStrings = null; 20776 this.fdArray = []; 20777 this.fdSelect = null; 20778 this.isCIDFont = false;
vendor: 4,118 bytes, lines 20779-20917
20779 } 20780 return CFF; 20781}(); 20782var CFFHeader = function CFFHeaderClosure() { 20783 function CFFHeader(major, minor, hdrSize, offSize) { 20784 this.major = major; 20785 this.minor = minor; 20786 this.hdrSize = hdrSize; 20787 this.offSize = offSize; 20788 } 20789 return CFFHeader; 20790}(); 20791var CFFStrings = function CFFStringsClosure() { 20792 function CFFStrings() { 20793 this.strings = []; 20794 } 20795 CFFStrings.prototype = { 20796 get: function CFFStrings_get(index) { 20797 if (index >= 0 && index <= 390) { 20798 return CFFStandardStrings[index]; 20799 } 20800 if (index - 391 <= this.strings.length) { 20801 return this.strings[index - 391]; 20802 } 20803 return CFFStandardStrings[0]; 20804 }, 20805 add: function CFFStrings_add(value) { 20806 this.strings.push(value); 20807 }, 20808 get count() { 20809 return this.strings.length; 20810 } 20811 }; 20812 return CFFStrings; 20813}(); 20814var CFFIndex = function CFFIndexClosure() { 20815 function CFFIndex() { 20816 this.objects = []; 20817 this.length = 0; 20818 } 20819 CFFIndex.prototype = { 20820 add: function CFFIndex_add(data) { 20821 this.length += data.length; 20822 this.objects.push(data); 20823 }, 20824 set: function CFFIndex_set(index, data) { 20825 this.length += data.length - this.objects[index].length; 20826 this.objects[index] = data; 20827 }, 20828 get: function CFFIndex_get(index) { 20829 return this.objects[index]; 20830 }, 20831 get count() { 20832 return this.objects.length; 20833 } 20834 }; 20835 return CFFIndex; 20836}(); 20837var CFFDict = function CFFDictClosure() { 20838 function CFFDict(tables, strings) { 20839 this.keyToNameMap = tables.keyToNameMap; 20840 this.nameToKeyMap = tables.nameToKeyMap; 20841 this.defaults = tables.defaults; 20842 this.types = tables.types; 20843 this.opcodes = tables.opcodes; 20844 this.order = tables.order; 20845 this.strings = strings; 20846 this.values = Object.create(null); 20847 } 20848 CFFDict.prototype = { 20849 setByKey: function CFFDict_setByKey(key, value) { 20850 if (!(key in this.keyToNameMap)) { 20851 return false; 20852 } 20853 var valueLength = value.length; 20854 if (valueLength === 0) { 20855 return true; 20856 } 20857 for (var i = 0; i < valueLength; i++) { 20858 if (isNaN(value[i])) { 20859 (0, _util.warn)('Invalid CFFDict value: "' + value + '" for key "' + key + '".'); 20860 return true; 20861 } 20862 } 20863 var type = this.types[key]; 20864 if (type === 'num' || type === 'sid' || type === 'offset') { 20865 value = value[0]; 20866 } 20867 this.values[key] = value; 20868 return true; 20869 }, 20870 setByName: function CFFDict_setByName(name, value) { 20871 if (!(name in this.nameToKeyMap)) { 20872 throw new _util.FormatError('Invalid dictionary name "' + name + '"'); 20873 } 20874 this.values[this.nameToKeyMap[name]] = value; 20875 }, 20876 hasName: function CFFDict_hasName(name) { 20877 return this.nameToKeyMap[name] in this.values; 20878 }, 20879 getByName: function CFFDict_getByName(name) { 20880 if (!(name in this.nameToKeyMap)) { 20881 throw new _util.FormatError('Invalid dictionary name ' + name + '"'); 20882 } 20883 var key = this.nameToKeyMap[name]; 20884 if (!(key in this.values)) { 20885 return this.defaults[key]; 20886 } 20887 return this.values[key]; 20888 }, 20889 removeByName: function CFFDict_removeByName(name) { 20890 delete this.values[this.nameToKeyMap[name]]; 20891 } 20892 }; 20893 CFFDict.createTables = function CFFDict_createTables(layout) { 20894 var tables = { 20895 keyToNameMap: {}, 20896 nameToKeyMap: {}, 20897 defaults: {}, 20898 types: {}, 20899 opcodes: {}, 20900 order: [] 20901 }; 20902 for (var i = 0, ii = layout.length; i < ii; ++i) { 20903 var entry = layout[i]; 20904 var key = Array.isArray(entry[0]) ? (entry[0][0] << 8) + entry[0][1] : entry[0]; 20905 tables.keyToNameMap[key] = entry[1]; 20906 tables.nameToKeyMap[entry[1]] = key; 20907 tables.types[key] = entry[2]; 20908 tables.defaults[key] = entry[3]; 20909 tables.opcodes[key] = Array.isArray(entry[0]) ? entry[0] : [entry[0]]; 20910 tables.order.push(key); 20911 } 20912 return tables; 20913 }; 20914 return CFFDict; 20915}(); 20916var CFFTopDict = function CFFTopDictClosure() { 20917 var layout = [[[12, 30], 'ROS', ['sid', 'sid', 'num'], null], [[12, 20], 'SyntheticBase', 'num', null], [0, 'version', 'sid', null], [1, '
20917Notice', '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]]; 20918 var tables = null; 20919 function CFFTopDict(strings) { 20920 if (tables === null) { 20921 tables = CFFDict.createTables(layout); 20922 } 20923 CFFDict.call(this, tables, strings); 20924 this.privateDict = null; 20925 } 20926 CFFTopDict.prototype = Object.create(CFFDict.prototype); 20927 return CFFTopDict; 20928}(); 20929var CFFPrivateDict = function CFFPrivateDictClosure() { 20930 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]]; 20931 var tables = null; 20932 function CFFPrivateDict(strings) { 20933 if (tables === null) { 20934 tables = CFFDict.createTables(layout); 20935 } 20936 CFFDict.call(this, tables, strings); 20937 this.subrsIndex = null; 20938 } 20939 CFFPrivateDict.prototype = Object.create(CFFDict.prototype); 20940 return CFFPrivateDict; 20941}(); 20942var CFFCharsetPredefinedTypes = { 20943 ISO_ADOBE: 0, 20944 EXPERT: 1, 20945 EXPERT_SUBSET: 2 20946}; 20947var CFFCharset = function CFFCharsetClosure() { 20948 function CFFCharset(predefined, format, charset, raw) { 20949 this.predefined = predefined; 20950 this.format = format; 20951 this.charset = charset; 20952 this.raw = raw; 20953 } 20954 return CFFCharset; 20955}(); 20956var CFFEncoding = function CFFEncodingClosure() { 20957 function CFFEncoding(predefined, format, encoding, raw) { 20958 this.predefined = predefined; 20959 this.format = format; 20960 this.encoding = encoding; 20961 this.raw = raw; 20962 } 20963 return CFFEncoding; 20964}(); 20965var CFFFDSelect = function CFFFDSelectClosure() { 20966 function CFFFDSelect(fdSelect, raw) { 20967 this.fdSelect = fdSelect; 20968 this.raw = raw; 20969 } 20970 CFFFDSelect.prototype = { 20971 getFDIndex: function CFFFDSelect_get(glyphIndex) { 20972 if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { 20973 return -1; 20974 } 20975 return this.fdSelect[glyphIndex]; 20976 } 20977 }; 20978 return CFFFDSelect; 20979}(); 20980var CFFOffsetTracker = function CFFOffsetTrackerClosure() { 20981 function CFFOffsetTracker() { 20982 this.offsets = Object.create(null); 20983 } 20984 CFFOffsetTracker.prototype = { 20985 isTracking: function CFFOffsetTracker_isTracking(key) { 20986 return key in this.offsets; 20987 }, 20988 track: function CFFOffsetTracker_track(key, location) { 20989 if (key in this.offsets) { 20990 throw new _util.FormatError('Already tracking location of ' + key); 20991 } 20992 this.offsets[key] = location; 20993 }, 20994 offset: function CFFOffsetTracker_offset(value) { 20995 for (var key in this.offsets) { 20996 this.offsets[key] += value; 20997 } 20998 }, 20999 setEntryLocation: function CFFOffsetTracker_setEntryLocation(key, values, output) { 21000 if (!(key in this.offsets)) { 21001 throw new _util.FormatError('Not tracking location of ' + key); 21002 } 21003 var data = output.data; 21004 var dataOffset = this.offsets[key]; 21005 var size = 5; 21006 for (var i = 0, ii = values.length; i < ii; ++i) { 21007 var offset0 = i * size + dataOffset; 21008 var offset1 = offset0 + 1; 21009 var offset2 = offset0 + 2; 21010 var offset3 = offset0 + 3; 21011 var offset4 = offset0 + 4; 21012 if (data[offset0] !== 0x1d || data[offset1] !== 0 || data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { 21013 throw new _util.FormatError('writing to an offset that is not empty'); 21014 } 21015 var value = values[i]; 21016 data[offset0] = 0x1d; 21017 data[offset1] = value >> 24 & 0xFF; 21018 data[offset2] = value >> 16 & 0xFF; 21019 data[offset3] = value >> 8 & 0xFF; 21020 data[offset4] = value & 0xFF; 21021 } 21022 } 21023 }; 21024 return CFFOffsetTracker; 21025}(); 21026var CFFCompiler = function CFFCompilerClosure() { 21027 function CFFCompiler(cff) { 21028 this.cff = cff; 21029 } 21030 CFFCompiler.prototype = { 21031 compile: function CFFCompiler_compile() { 21032 var cff = this.cff; 21033 var output = { 21034 data: [], 21035 length: 0, 21036 add: function CFFCompiler_add(data) { 21037 this.data = this.data.concat(data); 21038 this.length = this.data.length; 21039 } 21040 }; 21041 var header = this.compileHeader(cff.header); 21042 output.add(header);
vendor: 17,357 bytes, lines 21043-21502
21043 var nameIndex = this.compileNameIndex(cff.names); 21044 output.add(nameIndex); 21045 if (cff.isCIDFont) { 21046 if (cff.topDict.hasName('FontMatrix')) { 21047 var base = cff.topDict.getByName('FontMatrix'); 21048 cff.topDict.removeByName('FontMatrix'); 21049 for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { 21050 var subDict = cff.fdArray[i]; 21051 var matrix = base.slice(0); 21052 if (subDict.hasName('FontMatrix')) { 21053 matrix = _util.Util.transform(matrix, subDict.getByName('FontMatrix')); 21054 } 21055 subDict.setByName('FontMatrix', matrix); 21056 } 21057 } 21058 } 21059 var compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont); 21060 output.add(compiled.output); 21061 var topDictTracker = compiled.trackers[0]; 21062 var stringIndex = this.compileStringIndex(cff.strings.strings); 21063 output.add(stringIndex); 21064 var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); 21065 output.add(globalSubrIndex); 21066 if (cff.encoding && cff.topDict.hasName('Encoding')) { 21067 if (cff.encoding.predefined) { 21068 topDictTracker.setEntryLocation('Encoding', [cff.encoding.format], output); 21069 } else { 21070 var encoding = this.compileEncoding(cff.encoding); 21071 topDictTracker.setEntryLocation('Encoding', [output.length], output); 21072 output.add(encoding); 21073 } 21074 } 21075 if (cff.charset && cff.topDict.hasName('charset')) { 21076 if (cff.charset.predefined) { 21077 topDictTracker.setEntryLocation('charset', [cff.charset.format], output); 21078 } else { 21079 var charset = this.compileCharset(cff.charset); 21080 topDictTracker.setEntryLocation('charset', [output.length], output); 21081 output.add(charset); 21082 } 21083 } 21084 var charStrings = this.compileCharStrings(cff.charStrings); 21085 topDictTracker.setEntryLocation('CharStrings', [output.length], output); 21086 output.add(charStrings); 21087 if (cff.isCIDFont) { 21088 topDictTracker.setEntryLocation('FDSelect', [output.length], output); 21089 var fdSelect = this.compileFDSelect(cff.fdSelect.raw); 21090 output.add(fdSelect); 21091 compiled = this.compileTopDicts(cff.fdArray, output.length, true); 21092 topDictTracker.setEntryLocation('FDArray', [output.length], output); 21093 output.add(compiled.output); 21094 var fontDictTrackers = compiled.trackers; 21095 this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); 21096 } 21097 this.compilePrivateDicts([cff.topDict], [topDictTracker], output); 21098 output.add([0]); 21099 return output.data; 21100 }, 21101 encodeNumber: function CFFCompiler_encodeNumber(value) { 21102 if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) { 21103 return this.encodeInteger(value); 21104 } 21105 return this.encodeFloat(value); 21106 }, 21107 encodeFloat: function CFFCompiler_encodeFloat(num) { 21108 var value = num.toString(); 21109 var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(value); 21110 if (m) { 21111 var epsilon = parseFloat('1e' + ((m[2] ? +m[2] : 0) + m[1].length)); 21112 value = (Math.round(num * epsilon) / epsilon).toString(); 21113 } 21114 var nibbles = ''; 21115 var i, ii; 21116 for (i = 0, ii = value.length; i < ii; ++i) { 21117 var a = value[i]; 21118 if (a === 'e') { 21119 nibbles += value[++i] === '-' ? 'c' : 'b'; 21120 } else if (a === '.') { 21121 nibbles += 'a'; 21122 } else if (a === '-') { 21123 nibbles += 'e'; 21124 } else { 21125 nibbles += a; 21126 } 21127 } 21128 nibbles += nibbles.length & 1 ? 'f' : 'ff'; 21129 var out = [30]; 21130 for (i = 0, ii = nibbles.length; i < ii; i += 2) { 21131 out.push(parseInt(nibbles.substr(i, 2), 16)); 21132 } 21133 return out; 21134 }, 21135 encodeInteger: function CFFCompiler_encodeInteger(value) { 21136 var code; 21137 if (value >= -107 && value <= 107) { 21138 code = [value + 139]; 21139 } else if (value >= 108 && value <= 1131) { 21140 value = value - 108; 21141 code = [(value >> 8) + 247, value & 0xFF]; 21142 } else if (value >= -1131 && value <= -108) { 21143 value = -value - 108; 21144 code = [(value >> 8) + 251, value & 0xFF]; 21145 } else if (value >= -32768 && value <= 32767) { 21146 code = [0x1c, value >> 8 & 0xFF, value & 0xFF]; 21147 } else { 21148 code = [0x1d, value >> 24 & 0xFF, value >> 16 & 0xFF, value >> 8 & 0xFF, value & 0xFF]; 21149 } 21150 return code; 21151 }, 21152 compileHeader: function CFFCompiler_compileHeader(header) { 21153 return [header.major, header.minor, header.hdrSize, header.offSize]; 21154 }, 21155 compileNameIndex: function CFFCompiler_compileNameIndex(names) { 21156 var nameIndex = new CFFIndex(); 21157 for (var i = 0, ii = names.length; i < ii; ++i) { 21158 nameIndex.add((0, _util.stringToBytes)(names[i])); 21159 } 21160 return this.compileIndex(nameIndex); 21161 }, 21162 compileTopDicts: function CFFCompiler_compileTopDicts(dicts, length, removeCidKeys) { 21163 var fontDictTrackers = []; 21164 var fdArrayIndex = new CFFIndex(); 21165 for (var i = 0, ii = dicts.length; i < ii; ++i) { 21166 var fontDict = dicts[i]; 21167 if (removeCidKeys) { 21168 fontDict.removeByName('CIDFontVersion'); 21169 fontDict.removeByName('CIDFontRevision'); 21170 fontDict.removeByName('CIDFontType'); 21171 fontDict.removeByName('CIDCount'); 21172 fontDict.removeByName('UIDBase'); 21173 } 21174 var fontDictTracker = new CFFOffsetTracker(); 21175 var fontDictData = this.compileDict(fontDict, fontDictTracker); 21176 fontDictTrackers.push(fontDictTracker); 21177 fdArrayIndex.add(fontDictData); 21178 fontDictTracker.offset(length); 21179 } 21180 fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); 21181 return { 21182 trackers: fontDictTrackers, 21183 output: fdArrayIndex 21184 }; 21185 }, 21186 compilePrivateDicts: function CFFCompiler_compilePrivateDicts(dicts, trackers, output) { 21187 for (var i = 0, ii = dicts.length; i < ii; ++i) { 21188 var fontDict = dicts[i]; 21189 var privateDict = fontDict.privateDict; 21190 if (!privateDict || !fontDict.hasName('Private')) { 21191 throw new _util.FormatError('There must be a private dictionary.'); 21192 } 21193 var privateDictTracker = new CFFOffsetTracker(); 21194 var privateDictData = this.compileDict(privateDict, privateDictTracker); 21195 var outputLength = output.length; 21196 privateDictTracker.offset(outputLength); 21197 if (!privateDictData.length) { 21198 outputLength = 0; 21199 } 21200 trackers[i].setEntryLocation('Private', [privateDictData.length, outputLength], output); 21201 output.add(privateDictData); 21202 if (privateDict.subrsIndex && privateDict.hasName('Subrs')) { 21203 var subrs = this.compileIndex(privateDict.subrsIndex); 21204 privateDictTracker.setEntryLocation('Subrs', [privateDictData.length], output); 21205 output.add(subrs); 21206 } 21207 } 21208 }, 21209 compileDict: function CFFCompiler_compileDict(dict, offsetTracker) { 21210 var out = []; 21211 var order = dict.order; 21212 for (var i = 0; i < order.length; ++i) { 21213 var key = order[i]; 21214 if (!(key in dict.values)) { 21215 continue; 21216 } 21217 var values = dict.values[key]; 21218 var types = dict.types[key]; 21219 if (!Array.isArray(types)) { 21220 types = [types]; 21221 } 21222 if (!Array.isArray(values)) { 21223 values = [values]; 21224 } 21225 if (values.length === 0) { 21226 continue; 21227 } 21228 for (var j = 0, jj = types.length; j < jj; ++j) { 21229 var type = types[j]; 21230 var value = values[j]; 21231 switch (type) { 21232 case 'num': 21233 case 'sid': 21234 out = out.concat(this.encodeNumber(value)); 21235 break; 21236 case 'offset': 21237 var name = dict.keyToNameMap[key]; 21238 if (!offsetTracker.isTracking(name)) { 21239 offsetTracker.track(name, out.length); 21240 } 21241 out = out.concat([0x1d, 0, 0, 0, 0]); 21242 break; 21243 case 'array': 21244 case 'delta': 21245 out = out.concat(this.encodeNumber(value)); 21246 for (var k = 1, kk = values.length; k < kk; ++k) { 21247 out = out.concat(this.encodeNumber(values[k])); 21248 } 21249 break; 21250 default: 21251 throw new _util.FormatError('Unknown data type of ' + type); 21252 } 21253 } 21254 out = out.concat(dict.opcodes[key]); 21255 } 21256 return out; 21257 }, 21258 compileStringIndex: function CFFCompiler_compileStringIndex(strings) { 21259 var stringIndex = new CFFIndex(); 21260 for (var i = 0, ii = strings.length; i < ii; ++i) { 21261 stringIndex.add((0, _util.stringToBytes)(strings[i])); 21262 } 21263 return this.compileIndex(stringIndex); 21264 }, 21265 compileGlobalSubrIndex: function CFFCompiler_compileGlobalSubrIndex() { 21266 var globalSubrIndex = this.cff.globalSubrIndex; 21267 this.out.writeByteArray(this.compileIndex(globalSubrIndex)); 21268 }, 21269 compileCharStrings: function CFFCompiler_compileCharStrings(charStrings) { 21270 return this.compileIndex(charStrings); 21271 }, 21272 compileCharset: function CFFCompiler_compileCharset(charset) { 21273 return this.compileTypedArray(charset.raw); 21274 }, 21275 compileEncoding: function CFFCompiler_compileEncoding(encoding) { 21276 return this.compileTypedArray(encoding.raw); 21277 }, 21278 compileFDSelect: function CFFCompiler_compileFDSelect(fdSelect) { 21279 return this.compileTypedArray(fdSelect); 21280 }, 21281 compileTypedArray: function CFFCompiler_compileTypedArray(data) { 21282 var out = []; 21283 for (var i = 0, ii = data.length; i < ii; ++i) { 21284 out[i] = data[i]; 21285 } 21286 return out; 21287 }, 21288 compileIndex: function CFFCompiler_compileIndex(index, trackers) { 21289 trackers = trackers || []; 21290 var objects = index.objects; 21291 var count = objects.length; 21292 if (count === 0) { 21293 return [0, 0, 0]; 21294 } 21295 var data = [count >> 8 & 0xFF, count & 0xff]; 21296 var lastOffset = 1, 21297 i; 21298 for (i = 0; i < count; ++i) { 21299 lastOffset += objects[i].length; 21300 } 21301 var offsetSize; 21302 if (lastOffset < 0x100) { 21303 offsetSize = 1; 21304 } else if (lastOffset < 0x10000) { 21305 offsetSize = 2; 21306 } else if (lastOffset < 0x1000000) { 21307 offsetSize = 3; 21308 } else { 21309 offsetSize = 4; 21310 } 21311 data.push(offsetSize); 21312 var relativeOffset = 1; 21313 for (i = 0; i < count + 1; i++) { 21314 if (offsetSize === 1) { 21315 data.push(relativeOffset & 0xFF); 21316 } else if (offsetSize === 2) { 21317 data.push(relativeOffset >> 8 & 0xFF, relativeOffset & 0xFF); 21318 } else if (offsetSize === 3) { 21319 data.push(relativeOffset >> 16 & 0xFF, relativeOffset >> 8 & 0xFF, relativeOffset & 0xFF); 21320 } else { 21321 data.push(relativeOffset >>> 24 & 0xFF, relativeOffset >> 16 & 0xFF, relativeOffset >> 8 & 0xFF, relativeOffset & 0xFF); 21322 } 21323 if (objects[i]) { 21324 relativeOffset += objects[i].length; 21325 } 21326 } 21327 for (i = 0; i < count; i++) { 21328 if (trackers[i]) { 21329 trackers[i].offset(data.length); 21330 } 21331 for (var j = 0, jj = objects[i].length; j < jj; j++) { 21332 data.push(objects[i][j]); 21333 } 21334 } 21335 return data; 21336 } 21337 }; 21338 return CFFCompiler; 21339}(); 21340exports.CFFStandardStrings = CFFStandardStrings; 21341exports.CFFParser = CFFParser; 21342exports.CFF = CFF; 21343exports.CFFHeader = CFFHeader; 21344exports.CFFStrings = CFFStrings; 21345exports.CFFIndex = CFFIndex; 21346exports.CFFCharset = CFFCharset; 21347exports.CFFTopDict = CFFTopDict; 21348exports.CFFPrivateDict = CFFPrivateDict; 21349exports.CFFCompiler = CFFCompiler; 21350 21351/***/ }), 21352/* 69 */ 21353/***/ (function(module, exports, __w_pdfjs_require__) { 21354 21355"use strict"; 21356 21357 21358Object.defineProperty(exports, "__esModule", { 21359 value: true 21360}); 21361exports.getSupplementalGlyphMapForArialBlack = exports.getGlyphMapForStandardFonts = exports.getSymbolsFonts = exports.getSerifFonts = exports.getNonStdFontMap = exports.getStdFontMap = undefined; 21362 21363var _util = __w_pdfjs_require__(0); 21364 21365var getStdFontMap = (0, _util.getLookupTableFactory)(function (t) { 21366 t['ArialNarrow'] = 'Helvetica'; 21367 t['ArialNarrow-Bold'] = 'Helvetica-Bold'; 21368 t['ArialNarrow-BoldItalic'] = 'Helvetica-BoldOblique'; 21369 t['ArialNarrow-Italic'] = 'Helvetica-Oblique'; 21370 t['ArialBlack'] = 'Helvetica'; 21371 t['ArialBlack-Bold'] = 'Helvetica-Bold'; 21372 t['ArialBlack-BoldItalic'] = 'Helvetica-BoldOblique'; 21373 t['ArialBlack-Italic'] = 'Helvetica-Oblique'; 21374 t['Arial-Black'] = 'Helvetica'; 21375 t['Arial-Black-Bold'] = 'Helvetica-Bold'; 21376 t['Arial-Black-BoldItalic'] = 'Helvetica-BoldOblique'; 21377 t['Arial-Black-Italic'] = 'Helvetica-Oblique'; 21378 t['Arial'] = 'Helvetica'; 21379 t['Arial-Bold'] = 'Helvetica-Bold'; 21380 t['Arial-BoldItalic'] = 'Helvetica-BoldOblique'; 21381 t['Arial-Italic'] = 'Helvetica-Oblique'; 21382 t['Arial-BoldItalicMT'] = 'Helvetica-BoldOblique'; 21383 t['Arial-BoldMT'] = 'Helvetica-Bold'; 21384 t['Arial-ItalicMT'] = 'Helvetica-Oblique'; 21385 t['ArialMT'] = 'Helvetica'; 21386 t['Courier-Bold'] = 'Courier-Bold'; 21387 t['Courier-BoldItalic'] = 'Courier-BoldOblique'; 21388 t['Courier-Italic'] = 'Courier-Oblique'; 21389 t['CourierNew'] = 'Courier'; 21390 t['CourierNew-Bold'] = 'Courier-Bold'; 21391 t['CourierNew-BoldItalic'] = 'Courier-BoldOblique'; 21392 t['CourierNew-Italic'] = 'Courier-Oblique'; 21393 t['CourierNewPS-BoldItalicMT'] = 'Courier-BoldOblique'; 21394 t['CourierNewPS-BoldMT'] = 'Courier-Bold'; 21395 t['CourierNewPS-ItalicMT'] = 'Courier-Oblique'; 21396 t['CourierNewPSMT'] = 'Courier'; 21397 t['Helvetica'] = 'Helvetica'; 21398 t['Helvetica-Bold'] = 'Helvetica-Bold'; 21399 t['Helvetica-BoldItalic'] = 'Helvetica-BoldOblique'; 21400 t['Helvetica-BoldOblique'] = 'Helvetica-BoldOblique'; 21401 t['Helvetica-Italic'] = 'Helvetica-Oblique'; 21402 t['Helvetica-Oblique'] = 'Helvetica-Oblique'; 21403 t['SegoeUISymbol'] = 'Helvetica'; 21404 t['Symbol-Bold'] = 'Symbol'; 21405 t['Symbol-BoldItalic'] = 'Symbol'; 21406 t['Symbol-Italic'] = 'Symbol'; 21407 t['TimesNewRoman'] = 'Times-Roman'; 21408 t['TimesNewRoman-Bold'] = 'Times-Bold'; 21409 t['TimesNewRoman-BoldItalic'] = 'Times-BoldItalic'; 21410 t['TimesNewRoman-Italic'] = 'Times-Italic'; 21411 t['TimesNewRomanPS'] = 'Times-Roman'; 21412 t['TimesNewRomanPS-Bold'] = 'Times-Bold'; 21413 t['TimesNewRomanPS-BoldItalic'] = 'Times-BoldItalic'; 21414 t['TimesNewRomanPS-BoldItalicMT'] = 'Times-BoldItalic'; 21415 t['TimesNewRomanPS-BoldMT'] = 'Times-Bold'; 21416 t['TimesNewRomanPS-Italic'] = 'Times-Italic'; 21417 t['TimesNewRomanPS-ItalicMT'] = 'Times-Italic'; 21418 t['TimesNewRomanPSMT'] = 'Times-Roman'; 21419 t['TimesNewRomanPSMT-Bold'] = 'Times-Bold'; 21420 t['TimesNewRomanPSMT-BoldItalic'] = 'Times-BoldItalic'; 21421 t['TimesNewRomanPSMT-Italic'] = 'Times-Italic'; 21422}); 21423var getNonStdFontMap = (0, _util.getLookupTableFactory)(function (t) { 21424 t['CenturyGothic'] = 'Helvetica'; 21425 t['CenturyGothic-Bold'] = 'Helvetica-Bold'; 21426 t['CenturyGothic-BoldItalic'] = 'Helvetica-BoldOblique'; 21427 t['CenturyGothic-Italic'] = 'Helvetica-Oblique'; 21428 t['ComicSansMS'] = 'Comic Sans MS'; 21429 t['ComicSansMS-Bold'] = 'Comic Sans MS-Bold'; 21430 t['ComicSansMS-BoldItalic'] = 'Comic Sans MS-BoldItalic'; 21431 t['ComicSansMS-Italic'] = 'Comic Sans MS-Italic'; 21432 t['LucidaConsole'] = 'Courier'; 21433 t['LucidaConsole-Bold'] = 'Courier-Bold'; 21434 t['LucidaConsole-BoldItalic'] = 'Courier-BoldOblique'; 21435 t['LucidaConsole-Italic'] = 'Courier-Oblique'; 21436 t['MS-Gothic'] = 'MS Gothic'; 21437 t['MS-Gothic-Bold'] = 'MS Gothic-Bold'; 21438 t['MS-Gothic-BoldItalic'] = 'MS Gothic-BoldItalic'; 21439 t['MS-Gothic-Italic'] = 'MS Gothic-Italic'; 21440 t['MS-Mincho'] = 'MS Mincho'; 21441 t['MS-Mincho-Bold'] = 'MS Mincho-Bold'; 21442 t['MS-Mincho-BoldItalic'] = 'MS Mincho-BoldItalic'; 21443 t['MS-Mincho-Italic'] = 'MS Mincho-Italic'; 21444 t['MS-PGothic'] = 'MS PGothic'; 21445 t['MS-PGothic-Bold'] = 'MS PGothic-Bold'; 21446 t['MS-PGothic-BoldItalic'] = 'MS PGothic-BoldItalic'; 21447 t['MS-PGothic-Italic'] = 'MS PGothic-Italic'; 21448 t['MS-PMincho'] = 'MS PMincho'; 21449 t['MS-PMincho-Bold'] = 'MS PMincho-Bold'; 21450 t['MS-PMincho-BoldItalic'] = 'MS PMincho-BoldItalic'; 21451 t['MS-PMincho-Italic'] = 'MS PMincho-Italic'; 21452 t['NuptialScript'] = 'Times-Italic'; 21453 t['Wingdings'] = 'ZapfDingbats'; 21454}); 21455var getSerifFonts = (0, _util.getLookupTableFactory)(function (t) { 21456 t['Adobe Jenson'] = true; 21457 t['Adobe Text'] = true; 21458 t['Albertus'] = true; 21459 t['Aldus'] = true; 21460 t['Alexandria'] = true; 21461 t['Algerian'] = true; 21462 t['American Typewriter'] = true; 21463 t['Antiqua'] = true; 21464 t['Apex'] = true; 21465 t['Arno'] = true; 21466 t['Aster'] = true; 21467 t['Aurora'] = true; 21468 t['Baskerville'] = true; 21469 t['Bell'] = true; 21470 t['Bembo'] = true; 21471 t['Bembo Schoolbook'] = true; 21472 t['Benguiat'] = true; 21473 t['Berkeley Old Style'] = true; 21474 t['Bernhard Modern'] = true; 21475 t['Berthold City'] = true; 21476 t['Bodoni'] = true; 21477 t['Bauer Bodoni'] = true; 21478 t['Book Antiqua'] = true; 21479 t['Bookman'] = true; 21480 t['Bordeaux Roman'] = true; 21481 t['Californian FB'] = true; 21482 t['Calisto'] = true; 21483 t['Calvert'] = true; 21484 t['Capitals'] = true; 21485 t['Cambria'] = true; 21486 t['Cartier'] = true; 21487 t['Caslon'] = true; 21488 t['Catull'] = true; 21489 t['Centaur'] = true; 21490 t['Century Old Style'] = true; 21491 t['Century Schoolbook'] = true; 21492 t['Chaparral'] = true; 21493 t['Charis SIL'] = true; 21494 t['Cheltenham'] = true; 21495 t['Cholla Slab'] = true; 21496 t['Clarendon'] = true; 21497 t['Clearface'] = true; 21498 t['Cochin'] = true; 21499 t['Colonna'] = true; 21500 t['Computer Modern'] = true; 21501 t['Concrete Roman'] = true; 21502 t['Constantia'] = true;
21503 t['Cooper Black'] = true; 21504 t['Corona'] = true; 21505 t['Ecotype'] = true; 21506 t['Egyptienne'] = true; 21507 t['Elephant'] = true; 21508 t['Excelsior'] = true; 21509 t['Fairfield'] = true; 21510 t['FF Scala'] = true; 21511 t['Folkard'] = true; 21512 t['Footlight'] = true; 21513 t['FreeSerif'] = true; 21514 t['Friz Quadrata'] = true; 21515 t['Garamond'] = true; 21516 t['Gentium'] = true; 21517 t['Georgia'] = true; 21518 t['Gloucester'] = true; 21519 t['Goudy Old Style'] = true; 21520 t['Goudy Schoolbook'] = true; 21521 t['Goudy Pro Font'] = true; 21522 t['Granjon'] = true; 21523 t['Guardian Egyptian'] = true; 21524 t['Heather'] = true; 21525 t['Hercules'] = true; 21526 t['High Tower Text'] = true; 21527 t['Hiroshige'] = true; 21528 t['Hoefler Text'] = true; 21529 t['Humana Serif'] = true; 21530 t['Imprint'] = true; 21531 t['Ionic No. 5'] = true; 21532 t['Janson'] = true; 21533 t['Joanna'] = true; 21534 t['Korinna'] = true; 21535 t['Lexicon'] = true; 21536 t['Liberation Serif'] = true; 21537 t['Linux Libertine'] = true; 21538 t['Literaturnaya'] = true; 21539 t['Lucida'] = true; 21540 t['Lucida Bright'] = true; 21541 t['Melior'] = true; 21542 t['Memphis'] = true; 21543 t['Miller'] = true; 21544 t['Minion'] = true; 21545 t['Modern'] = true; 21546 t['Mona Lisa'] = true; 21547 t['Mrs Eaves'] = true; 21548 t['MS Serif'] = true; 21549 t['Museo Slab'] = true; 21550 t['New York'] = true; 21551 t['Nimbus Roman'] = true; 21552 t['NPS Rawlinson Roadway'] = true; 21553 t['NuptialScript'] = true; 21554 t['Palatino'] = true; 21555 t['Perpetua'] = true; 21556 t['Plantin'] = true; 21557 t['Plantin Schoolbook'] = true; 21558 t['Playbill'] = true; 21559 t['Poor Richard'] = true; 21560 t['Rawlinson Roadway'] = true; 21561 t['Renault'] = true; 21562 t['Requiem'] = true; 21563 t['Rockwell'] = true; 21564 t['Roman'] = true; 21565 t['Rotis Serif'] = true; 21566 t['Sabon'] = true; 21567 t['Scala'] = true; 21568 t['Seagull'] = true; 21569 t['Sistina'] = true; 21570 t['Souvenir'] = true; 21571 t['STIX'] = true; 21572 t['Stone Informal'] = true; 21573 t['Stone Serif'] = true; 21574 t['Sylfaen'] = true; 21575 t['Times'] = true; 21576 t['Trajan'] = true; 21577 t['Trinité'] = true; 21578 t['Trump Mediaeval'] = true; 21579 t['Utopia'] = true; 21580 t['Vale Type'] = true; 21581 t['Bitstream Vera'] = true; 21582 t['Vera Serif'] = true; 21583 t['Versailles'] = true;
21584 t['Wanted'] = true; 21585 t['Weiss'] = true; 21586 t['Wide Latin'] = true; 21587 t['Windsor'] = true; 21588 t['XITS'] = true; 21589}); 21590var getSymbolsFonts = (0, _util.getLookupTableFactory)(function (t) { 21591 t['Dingbats'] = true; 21592 t['Symbol'] = true; 21593 t['ZapfDingbats'] = true; 21594}); 21595var getGlyphMapForStandardFonts = (0, _util.getLookupTableFactory)(function (t) { 21596 t[2] = 10; 21597 t[3] = 32; 21598 t[4] = 33; 21599 t[5] = 34; 21600 t[6] = 35; 21601 t[7] = 36; 21602 t[8] = 37; 21603 t[9] = 38; 21604 t[10] = 39; 21605 t[11] = 40; 21606 t[12] = 41; 21607 t[13] = 42; 21608 t[14] = 43; 21609 t[15] = 44; 21610 t[16] = 45; 21611 t[17] = 46; 21612 t[18] = 47; 21613 t[19] = 48; 21614 t[20] = 49; 21615 t[21] = 50; 21616 t[22] = 51; 21617 t[23] = 52; 21618 t[24] = 53; 21619 t[25] = 54; 21620 t[26] = 55; 21621 t[27] = 56; 21622 t[28] = 57; 21623 t[29] = 58; 21624 t[30] = 894; 21625 t[31] = 60; 21626 t[32] = 61; 21627 t[33] = 62; 21628 t[34] = 63; 21629 t[35] = 64; 21630 t[36] = 65; 21631 t[37] = 66; 21632 t[38] = 67; 21633 t[39] = 68; 21634 t[40] = 69; 21635 t[41] = 70; 21636 t[42] = 71; 21637 t[43] = 72; 21638 t[44] = 73; 21639 t[45] = 74; 21640 t[46] = 75; 21641 t[47] = 76; 21642 t[48] = 77; 21643 t[49] = 78; 21644 t[50] = 79; 21645 t[51] = 80; 21646 t[52] = 81; 21647 t[53] = 82; 21648 t[54] = 83; 21649 t[55] = 84; 21650 t[56] = 85; 21651 t[57] = 86; 21652 t[58] = 87; 21653 t[59] = 88; 21654 t[60] = 89; 21655 t[61] = 90; 21656 t[62] = 91; 21657 t[63] = 92; 21658 t[64] = 93; 21659 t[65] = 94; 21660 t[66] = 95; 21661 t[67] = 96; 21662 t[68] = 97; 21663 t[69] = 98; 21664 t[70] = 99; 21665 t[71] = 100; 21666 t[72] = 101; 21667 t[73] = 102; 21668 t[74] = 103; 21669 t[75] = 104; 21670 t[76] = 105; 21671 t[77] = 106; 21672 t[78] = 107; 21673 t[79] = 108; 21674 t[80] = 109; 21675 t[81] = 110; 21676 t[82] = 111; 21677 t[83] = 112; 21678 t[84] = 113; 21679 t[85] = 114; 21680 t[86] = 115; 21681 t[87] = 116; 21682 t[88] = 117; 21683 t[89] = 118; 21684 t[90] = 119; 21685 t[91] = 120; 21686 t[92] = 121; 21687 t[93] = 122; 21688 t[94] = 123; 21689 t[95] = 124; 21690 t[96] = 125; 21691 t[97] = 126; 21692 t[98] = 196; 21693 t[99] = 197; 21694 t[100] = 199; 21695 t[101] = 201; 21696 t[102] = 209; 21697 t[103] = 214; 21698 t[104] = 220; 21699 t[105] = 225; 21700 t[106] = 224; 21701 t[107] = 226; 21702 t[108] = 228; 21703 t[109] = 227; 21704 t[110] = 229; 21705 t[111] = 231; 21706 t[112] = 233; 21707 t[113] = 232; 21708 t[114] = 234; 21709 t[115] = 235; 21710 t[116] = 237; 21711 t[117] = 236; 21712 t[118] = 238; 21713 t[119] = 239; 21714 t[120] = 241; 21715 t[121] = 243; 21716 t[122] = 242; 21717 t[123] = 244; 21718 t[124] = 246; 21719 t[125] = 245; 21720 t[126] = 250; 21721 t[127] = 249; 21722 t[128] = 251; 21723 t[129] = 252; 21724 t[130] = 8224; 21725 t[131] = 176; 21726 t[132] = 162; 21727 t[133] = 163; 21728 t[134] = 167; 21729 t[135] = 8226; 21730 t[136] = 182; 21731 t[137] = 223; 21732 t[138] = 174; 21733 t[139] = 169; 21734 t[140] = 8482; 21735 t[141] = 180; 21736 t[142] = 168; 21737 t[143] = 8800; 21738 t[144] = 198; 21739 t[145] = 216; 21740 t[146] = 8734; 21741 t[147] = 177; 21742 t[148] = 8804; 21743 t[149] = 8805; 21744 t[150] = 165; 21745 t[151] = 181; 21746 t[152] = 8706; 21747 t[153] = 8721; 21748 t[154] = 8719; 21749 t[156] = 8747; 21750 t[157] = 170; 21751 t[158] = 186; 21752 t[159] = 8486; 21753 t[160] = 230; 21754 t[161] = 248; 21755 t[162] = 191; 21756 t[163] = 161; 21757 t[164] = 172; 21758 t[165] = 8730; 21759 t[166] = 402; 21760 t[167] = 8776; 21761 t[168] = 8710; 21762 t[169] = 171; 21763 t[170] = 187; 21764 t[171] = 8230; 21765 t[210] = 218; 21766 t[223] = 711; 21767 t[224] = 321; 21768 t[225] = 322; 21769 t[227] = 353; 21770 t[229] = 382; 21771 t[234] = 253; 21772 t[252] = 263; 21773 t[253] = 268; 21774 t[254] = 269; 21775 t[258] = 258; 21776 t[260] = 260; 21777 t[261] = 261; 21778 t[265] = 280; 21779 t[266] = 281; 21780 t[268] = 283; 21781 t[269] = 313; 21782 t[275] = 323; 21783 t[276] = 324; 21784 t[278] = 328; 21785 t[284] = 345; 21786 t[285] = 346; 21787 t[286] = 347; 21788 t[292] = 367; 21789 t[295] = 377; 21790 t[296] = 378; 21791 t[298] = 380; 21792 t[305] = 963; 21793 t[306] = 964; 21794 t[307] = 966; 21795 t[308] = 8215; 21796 t[309] = 8252; 21797 t[310] = 8319; 21798 t[311] = 8359; 21799 t[312] = 8592; 21800 t[313] = 8593; 21801 t[337] = 9552; 21802 t[493] = 1039; 21803 t[494] = 1040; 21804 t[705] = 1524; 21805 t[706] = 8362; 21806 t[710] = 64288; 21807 t[711] = 64298; 21808 t[759] = 1617; 21809 t[761] = 1776; 21810 t[763] = 1778; 21811 t[775] = 1652; 21812 t[777] = 1764; 21813 t[778] = 1780; 21814 t[779] = 1781; 21815 t[780] = 1782; 21816 t[782] = 771; 21817 t[783] = 64726; 21818 t[786] = 8363; 21819 t[788] = 8532; 21820 t[790] = 768; 21821 t[791] = 769; 21822 t[792] = 768; 21823 t[795] = 803; 21824 t[797] = 64336; 21825 t[798] = 64337; 21826 t[799] = 64342; 21827 t[800] = 64343; 21828 t[801] = 64344; 21829 t[802] = 64345; 21830 t[803] = 64362; 21831 t[804] = 64363; 21832 t[805] = 64364; 21833 t[2424] = 7821; 21834 t[2425] = 7822; 21835 t[2426] = 7823; 21836 t[2427] = 7824; 21837 t[2428] = 7825; 21838 t[2429] = 7826; 21839 t[2430] = 7827; 21840 t[2433] = 7682; 21841 t[2678] = 8045; 21842 t[2679] = 8046; 21843 t[2830] = 1552; 21844 t[2838] = 686; 21845 t[2840] = 751; 21846 t[2842] = 753; 21847 t[2843] = 754; 21848 t[2844] = 755; 21849 t[2846] = 757; 21850 t[2856] = 767; 21851 t[2857] = 848; 21852 t[2858] = 849; 21853 t[2862] = 853; 21854 t[2863] = 854; 21855 t[2864] = 855; 21856 t[2865] = 861; 21857 t[2866] = 862; 21858 t[2906] = 7460; 21859 t[2908] = 7462; 21860 t[2909] = 7463; 21861 t[2910] = 7464; 21862 t[2912] = 7466; 21863 t[2913] = 7467; 21864 t[2914] = 7468; 21865 t[2916] = 7470; 21866 t[2917] = 7471; 21867 t[2918] = 7472; 21868 t[2920] = 7474; 21869 t[2921] = 7475; 21870 t[2922] = 7476; 21871 t[2924] = 7478; 21872 t[2925] = 7479; 21873 t[2926] = 7480; 21874 t[2928] = 7482;
21875 t[2929] = 7483; 21876 t[2930] = 7484; 21877 t[2932] = 7486; 21878 t[2933] = 7487; 21879 t[2934] = 7488; 21880 t[2936] = 7490; 21881 t[2937] = 7491; 21882 t[2938] = 7492; 21883 t[2940] = 7494; 21884 t[2941] = 7495; 21885 t[2942] = 7496; 21886 t[2944] = 7498; 21887 t[2946] = 7500; 21888 t[2948] = 7502; 21889 t[2950] = 7504; 21890 t[2951] = 7505; 21891 t[2952] = 7506; 21892 t[2954] = 7508; 21893 t[2955] = 7509; 21894 t[2956] = 7510; 21895 t[2958] = 7512; 21896 t[2959] = 7513; 21897 t[2960] = 7514; 21898 t[2962] = 7516; 21899 t[2963] = 7517; 21900 t[2964] = 7518; 21901 t[2966] = 7520; 21902 t[2967] = 7521; 21903 t[2968] = 7522; 21904 t[2970] = 7524; 21905 t[2971] = 7525; 21906 t[2972] = 7526; 21907 t[2974] = 7528; 21908 t[2975] = 7529; 21909 t[2976] = 7530; 21910 t[2978] = 1537; 21911 t[2979] = 1538; 21912 t[2980] = 1539; 21913 t[2982] = 1549; 21914 t[2983] = 1551; 21915 t[2984] = 1552; 21916 t[2986] = 1554; 21917 t[2987] = 1555; 21918 t[2988] = 1556; 21919 t[2990] = 1623; 21920 t[2991] = 1624; 21921 t[2995] = 1775; 21922 t[2999] = 1791; 21923 t[3002] = 64290; 21924 t[3003] = 64291; 21925 t[3004] = 64292; 21926 t[3006] = 64294; 21927 t[3007] = 64295; 21928 t[3008] = 64296; 21929 t[3011] = 1900; 21930 t[3014] = 8223; 21931 t[3015] = 8244; 21932 t[3017] = 7532; 21933 t[3018] = 7533; 21934 t[3019] = 7534; 21935 t[3075] = 7590; 21936 t[3076] = 7591; 21937 t[3079] = 7594; 21938 t[3080] = 7595; 21939 t[3083] = 7598; 21940 t[3084] = 7599; 21941 t[3087] = 7602; 21942 t[3088] = 7603; 21943 t[3091] = 7606; 21944 t[3092] = 7607; 21945 t[3095] = 7610; 21946 t[3096] = 7611; 21947 t[3099] = 7614; 21948 t[3100] = 7615; 21949 t[3103] = 7618; 21950 t[3104] = 7619; 21951 t[3107] = 8337; 21952 t[3108] = 8338; 21953 t[3116] = 1884; 21954 t[3119] = 1885; 21955 t[3120] = 1885; 21956 t[3123] = 1886; 21957 t[3124] = 1886; 21958 t[3127] = 1887; 21959 t[3128] = 1887; 21960 t[3131] = 1888; 21961 t[3132] = 1888; 21962 t[3135] = 1889; 21963 t[3136] = 1889; 21964 t[3139] = 1890; 21965 t[3140] = 1890; 21966 t[3143] = 1891; 21967 t[3144] = 1891; 21968 t[3147] = 1892; 21969 t[3148] = 1892; 21970 t[3153] = 580; 21971 t[3154] = 581; 21972 t[3157] = 584; 21973 t[3158] = 585; 21974 t[3161] = 588; 21975 t[3162] = 589; 21976 t[3165] = 891; 21977 t[3166] = 892; 21978 t[3169] = 1274; 21979 t[3170] = 1275; 21980 t[3173] = 1278; 21981 t[3174] = 1279; 21982 t[3181] = 7622; 21983 t[3182] = 7623; 21984 t[3282] = 11799; 21985 t[3316] = 578; 21986 t[3379] = 42785; 21987 t[3393] = 1159; 21988 t[3416] = 8377; 21989}); 21990var getSupplementalGlyphMapForArialBlack = (0, _util.getLookupTableFactory)(function (t) { 21991 t[227] = 322; 21992 t[264] = 261; 21993 t[291] = 346; 21994}); 21995exports.getStdFontMap = getStdFontMap; 21996exports.getNonStdFontMap = getNonStdFontMap; 21997exports.getSerifFonts = getSerifFonts; 21998exports.getSymbolsFonts = getSymbolsFonts; 21999exports.getGlyphMapForStandardFonts = getGlyphMapForStandardFonts; 22000exports.getSupplementalGlyphMapForArialBlack = getSupplementalGlyphMapForArialBlack; 22001 22002/***/ }), 22003/* 70 */ 22004/***/ (function(module, exports, __w_pdfjs_require__) { 22005 22006var getLookupTableFactory = __w_pdfjs_require__(0).getLookupTableFactory;
22007var getSpecialPUASymbols = getLookupTableFactory(function (t) { 22008 t[63721] = 0x00A9; 22009 t[63193] = 0x00A9; 22010 t[63720] = 0x00AE; 22011 t[63194] = 0x00AE; 22012 t[63722] = 0x2122; 22013 t[63195] = 0x2122; 22014 t[63729] = 0x23A7; 22015 t[63730] = 0x23A8; 22016 t[63731] = 0x23A9; 22017 t[63740] = 0x23AB; 22018 t[63741] = 0x23AC; 22019 t[63742] = 0x23AD; 22020 t[63726] = 0x23A1; 22021 t[63727] = 0x23A2; 22022 t[63728] = 0x23A3; 22023 t[63737] = 0x23A4; 22024 t[63738] = 0x23A5; 22025 t[63739] = 0x23A6; 22026 t[63723] = 0x239B; 22027 t[63724] = 0x239C; 22028 t[63725] = 0x239D; 22029 t[63734] = 0x239E; 22030 t[63735] = 0x239F; 22031 t[63736] = 0x23A0; 22032}); 22033function mapSpecialUnicodeValues(code) { 22034 if (code >= 0xFFF0 && code <= 0xFFFF) { 22035 return 0; 22036 } else if (code >= 0xF600 && code <= 0xF8FF) { 22037 return getSpecialPUASymbols()[code] || code; 22038 } 22039 return code; 22040} 22041function getUnicodeForGlyph(name, glyphsUnicodeMap) { 22042 var unicode = glyphsUnicodeMap[name]; 22043 if (unicode !== undefined) { 22044 return unicode; 22045 } 22046 if (!name) { 22047 return -1; 22048 } 22049 if (name[0] === 'u') { 22050 var nameLen = name.length, hexStr; 22051 if (nameLen === 7 && name[1] === 'n' && name[2] === 'i') { 22052 hexStr = name.substr(3); 22053 } else if (nameLen >= 5 && nameLen <= 7) { 22054 hexStr = name.substr(1); 22055 } else { 22056 return -1; 22057 } 22058 if (hexStr === hexStr.toUpperCase()) { 22059 unicode = parseInt(hexStr, 16); 22060 if (unicode >= 0) { 22061 return unicode; 22062 } 22063 } 22064 } 22065 return -1; 22066} 22067var UnicodeRanges = [ 22068 { 22069 'begin': 0x0000, 22070 'end': 0x007F 22071 }, 22072 { 22073 'begin': 0x0080, 22074 'end': 0x00FF 22075 }, 22076 { 22077 'begin': 0x0100, 22078 'end': 0x017F 22079 }, 22080 { 22081 'begin': 0x0180, 22082 'end': 0x024F 22083 }, 22084 { 22085 'begin': 0x0250, 22086 'end': 0x02AF 22087 }, 22088 { 22089 'begin': 0x02B0, 22090 'end': 0x02FF 22091 }, 22092 { 22093 'begin': 0x0300, 22094 'end': 0x036F 22095 }, 22096 { 22097 'begin': 0x0370, 22098 'end': 0x03FF 22099 }, 22100 { 22101 'begin': 0x2C80, 22102 'end': 0x2CFF 22103 }, 22104 { 22105 'begin': 0x0400, 22106 'end': 0x04FF 22107 }, 22108 { 22109 'begin': 0x0530, 22110 'end': 0x058F 22111 }, 22112 { 22113 'begin': 0x0590, 22114 'end': 0x05FF 22115 }, 22116 { 22117 'begin': 0xA500, 22118 'end': 0xA63F 22119 }, 22120 { 22121 'begin': 0x0600, 22122 'end': 0x06FF 22123 }, 22124 { 22125 'begin': 0x07C0, 22126 'end': 0x07FF 22127 }, 22128 { 22129 'begin': 0x0900, 22130 'end': 0x097F 22131 }, 22132 { 22133 'begin': 0x0980, 22134 'end': 0x09FF 22135 }, 22136 { 22137 'begin': 0x0A00, 22138 'end': 0x0A7F 22139 }, 22140 { 22141 'begin': 0x0A80, 22142 'end': 0x0AFF 22143 }, 22144 { 22145 'begin': 0x0B00, 22146 'end': 0x0B7F 22147 }, 22148 { 22149 'begin': 0x0B80, 22150 'end': 0x0BFF 22151 }, 22152 { 22153 'begin': 0x0C00, 22154 'end': 0x0C7F 22155 }, 22156 { 22157 'begin': 0x0C80, 22158 'end': 0x0CFF 22159 }, 22160 { 22161 'begin': 0x0D00, 22162 'end': 0x0D7F 22163 }, 22164 { 22165 'begin': 0x0E00, 22166 'end': 0x0E7F 22167 }, 22168 { 22169 'begin': 0x0E80, 22170 'end': 0x0EFF 22171 }, 22172 { 22173 'begin': 0x10A0, 22174 'end': 0x10FF 22175 }, 22176 { 22177 'begin': 0x1B00, 22178 'end': 0x1B7F 22179 }, 22180 { 22181 'begin': 0x1100, 22182 'end': 0x11FF 22183 }, 22184 { 22185 'begin': 0x1E00, 22186 'end': 0x1EFF 22187 }, 22188 { 22189 'begin': 0x1F00, 22190 'end': 0x1FFF 22191 }, 22192 { 22193 'begin': 0x2000, 22194 'end': 0x206F 22195 }, 22196 { 22197 'begin': 0x2070, 22198 'end': 0x209F 22199 }, 22200 { 22201 'begin': 0x20A0, 22202 'end': 0x20CF 22203 }, 22204 { 22205 'begin': 0x20D0, 22206 'end': 0x20FF 22207 }, 22208 { 22209 'begin': 0x2100, 22210 'end': 0x214F 22211 }, 22212 { 22213 'begin': 0x2150, 22214 'end': 0x218F 22215 }, 22216 { 22217 'begin': 0x2190, 22218 'end': 0x21FF 22219 }, 22220 { 22221 'begin': 0x2200, 22222 'end': 0x22FF 22223 }, 22224 { 22225 'begin': 0x2300, 22226 'end': 0x23FF 22227 }, 22228 { 22229 'begin': 0x2400, 22230 'end': 0x243F 22231 }, 22232 { 22233 'begin': 0x2440, 22234 'end': 0x245F 22235 }, 22236 { 22237 'begin': 0x2460, 22238 'end': 0x24FF 22239 }, 22240 { 22241 'begin': 0x2500, 22242 'end': 0x257F 22243 }, 22244 { 22245 'begin': 0x2580, 22246 'end': 0x259F 22247 }, 22248 { 22249 'begin': 0x25A0, 22250 'end': 0x25FF 22251 }, 22252 { 22253 'begin': 0x2600, 22254 'end': 0x26FF 22255 }, 22256 { 22257 'begin': 0x2700, 22258 'end': 0x27BF 22259 }, 22260 { 22261 'begin': 0x3000, 22262 'end': 0x303F 22263 }, 22264 { 22265 'begin': 0x3040, 22266 'end': 0x309F 22267 }, 22268 { 22269 'begin': 0x30A0, 22270 'end': 0x30FF 22271 }, 22272 { 22273 'begin': 0x3100, 22274 'end': 0x312F 22275 }, 22276 { 22277 'begin': 0x3130, 22278 'end': 0x318F 22279 }, 22280 { 22281 'begin': 0xA840, 22282 'end': 0xA87F 22283 }, 22284 { 22285 'begin': 0x3200, 22286 'end': 0x32FF 22287 }, 22288 { 22289 'begin': 0x3300, 22290 'end': 0x33FF 22291 }, 22292 { 22293 'begin': 0xAC00, 22294 'end': 0xD7AF 22295 }, 22296 { 22297 'begin': 0xD800, 22298 'end': 0xDFFF 22299 }, 22300 { 22301 'begin': 0x10900, 22302 'end': 0x1091F 22303 }, 22304 { 22305 'begin': 0x4E00, 22306 'end': 0x9FFF 22307 }, 22308 { 22309 'begin': 0xE000, 22310 'end': 0xF8FF 22311 }, 22312 { 22313 'begin': 0x31C0, 22314 'end': 0x31EF 22315 }, 22316 { 22317 'begin': 0xFB00, 22318 'end': 0xFB4F 22319 }, 22320 { 22321 'begin': 0xFB50, 22322 'end': 0xFDFF 22323 }, 22324 { 22325 'begin': 0xFE20, 22326 'end': 0xFE2F 22327 }, 22328 { 22329 'begin': 0xFE10, 22330 'end': 0xFE1F 22331 }, 22332 { 22333 'begin': 0xFE50, 22334 'end': 0xFE6F 22335 }, 22336 { 22337 'begin': 0xFE70, 22338 'end': 0xFEFF 22339 }, 22340 { 22341 'begin': 0xFF00, 22342 'end': 0xFFEF 22343 }, 22344 { 22345 'begin': 0xFFF0, 22346 'end': 0xFFFF 22347 },
22348 { 22349 'begin': 0x0F00, 22350 'end': 0x0FFF 22351 }, 22352 { 22353 'begin': 0x0700, 22354 'end': 0x074F 22355 }, 22356 { 22357 'begin': 0x0780, 22358 'end': 0x07BF 22359 }, 22360 { 22361 'begin': 0x0D80, 22362 'end': 0x0DFF 22363 }, 22364 { 22365 'begin': 0x1000, 22366 'end': 0x109F 22367 }, 22368 { 22369 'begin': 0x1200, 22370 'end': 0x137F 22371 }, 22372 { 22373 'begin': 0x13A0, 22374 'end': 0x13FF 22375 }, 22376 { 22377 'begin': 0x1400, 22378 'end': 0x167F 22379 }, 22380 { 22381 'begin': 0x1680, 22382 'end': 0x169F 22383 }, 22384 { 22385 'begin': 0x16A0, 22386 'end': 0x16FF 22387 }, 22388 { 22389 'begin': 0x1780, 22390 'end': 0x17FF 22391 }, 22392 { 22393 'begin': 0x1800, 22394 'end': 0x18AF 22395 }, 22396 { 22397 'begin': 0x2800, 22398 'end': 0x28FF 22399 }, 22400 { 22401 'begin': 0xA000, 22402 'end': 0xA48F 22403 }, 22404 { 22405 'begin': 0x1700, 22406 'end': 0x171F 22407 }, 22408 { 22409 'begin': 0x10300, 22410 'end': 0x1032F 22411 }, 22412 { 22413 'begin': 0x10330, 22414 'end': 0x1034F 22415 }, 22416 { 22417 'begin': 0x10400, 22418 'end': 0x1044F 22419 }, 22420 { 22421 'begin': 0x1D000, 22422 'end': 0x1D0FF 22423 }, 22424 { 22425 'begin': 0x1D400, 22426 'end': 0x1D7FF 22427 }, 22428 { 22429 'begin': 0xFF000, 22430 'end': 0xFFFFD 22431 }, 22432 { 22433 'begin': 0xFE00, 22434 'end': 0xFE0F 22435 }, 22436 { 22437 'begin': 0xE0000, 22438 'end': 0xE007F 22439 }, 22440 { 22441 'begin': 0x1900, 22442 'end': 0x194F 22443 }, 22444 { 22445 'begin': 0x1950, 22446 'end': 0x197F 22447 }, 22448 { 22449 'begin': 0x1980, 22450 'end': 0x19DF 22451 }, 22452 { 22453 'begin': 0x1A00, 22454 'end': 0x1A1F 22455 }, 22456 { 22457 'begin': 0x2C00, 22458 'end': 0x2C5F 22459 }, 22460 { 22461 'begin': 0x2D30, 22462 'end': 0x2D7F 22463 }, 22464 { 22465 'begin': 0x4DC0, 22466 'end': 0x4DFF 22467 }, 22468 { 22469 'begin': 0xA800, 22470 'end': 0xA82F 22471 }, 22472 { 22473 'begin': 0x10000, 22474 'end': 0x1007F 22475 }, 22476 { 22477 'begin': 0x10140, 22478 'end': 0x1018F 22479 }, 22480 { 22481 'begin': 0x10380, 22482 'end': 0x1039F 22483 }, 22484 { 22485 'begin': 0x103A0, 22486 'end': 0x103DF 22487 }, 22488 { 22489 'begin': 0x10450, 22490 'end': 0x1047F 22491 }, 22492 { 22493 'begin': 0x10480, 22494 'end': 0x104AF 22495 }, 22496 { 22497 'begin': 0x10800, 22498 'end': 0x1083F 22499 }, 22500 { 22501 'begin': 0x10A00, 22502 'end': 0x10A5F 22503 }, 22504 { 22505 'begin': 0x1D300, 22506 'end': 0x1D35F 22507 }, 22508 { 22509 'begin': 0x12000, 22510 'end': 0x123FF 22511 }, 22512 { 22513 'begin': 0x1D360, 22514 'end': 0x1D37F 22515 }, 22516 { 22517 'begin': 0x1B80, 22518 'end': 0x1BBF 22519 }, 22520 { 22521 'begin': 0x1C00, 22522 'end': 0x1C4F 22523 }, 22524 { 22525 'begin': 0x1C50, 22526 'end': 0x1C7F 22527 }, 22528 { 22529 'begin': 0xA880, 22530 'end': 0xA8DF 22531 }, 22532 { 22533 'begin': 0xA900, 22534 'end': 0xA92F 22535 }, 22536 { 22537 'begin': 0xA930, 22538 'end': 0xA95F 22539 }, 22540 { 22541 'begin': 0xAA00, 22542 'end': 0xAA5F 22543 }, 22544 { 22545 'begin': 0x10190, 22546 'end': 0x101CF 22547 }, 22548 { 22549 'begin': 0x101D0, 22550 'end': 0x101FF 22551 }, 22552 { 22553 'begin': 0x102A0, 22554 'end': 0x102DF 22555 }, 22556 { 22557 'begin': 0x1F030, 22558 'end': 0x1F09F 22559 } 22560]; 22561function getUnicodeRangeFor(value) { 22562 for (var i = 0, ii = UnicodeRanges.length; i < ii; i++) { 22563 var range = UnicodeRanges[i]; 22564 if (value >= range.begin && value < range.end) { 22565 return i; 22566 } 22567 } 22568 return -1; 22569} 22570function isRTLRangeFor(value) { 22571 var range = UnicodeRanges[13]; 22572 if (value >= range.begin && value < range.end) { 22573 return true; 22574 } 22575 range = UnicodeRanges[11]; 22576 if (value >= range.begin && value < range.end) { 22577 return true; 22578 } 22579 return false; 22580} 22581var getNormalizedUnicodes = getLookupTableFactory(function (t) { 22582 t['\u00A8'] = '\u0020\u0308'; 22583 t['\u00AF'] = '\u0020\u0304'; 22584 t['\u00B4'] = '\u0020\u0301'; 22585 t['\u00B5'] = '\u03BC'; 22586 t['\u00B8'] = '\u0020\u0327'; 22587 t['\u0132'] = '\u0049\u004A'; 22588 t['\u0133'] = '\u0069\u006A'; 22589 t['\u013F'] = '\u004C\u00B7'; 22590 t['\u0140'] = '\u006C\u00B7'; 22591 t['\u0149'] = '\u02BC\u006E'; 22592 t['\u017F'] = '\u0073'; 22593 t['\u01C4'] = '\u0044\u017D'; 22594 t['\u01C5'] = '\u0044\u017E'; 22595 t['\u01C6'] = '\u0064\u017E'; 22596 t['\u01C7'] = '\u004C\u004A'; 22597 t['\u01C8'] = '\u004C\u006A'; 22598 t['\u01C9'] = '\u006C\u006A'; 22599 t['\u01CA'] = '\u004E\u004A'; 22600 t['\u01CB'] = '\u004E\u006A'; 22601 t['\u01CC'] = '\u006E\u006A'; 22602 t['\u01F1'] = '\u0044\u005A'; 22603 t['\u01F2'] = '\u0044\u007A'; 22604 t['\u01F3'] = '\u0064\u007A'; 22605 t['\u02D8'] = '\u0020\u0306'; 22606 t['\u02D9'] = '\u0020\u0307'; 22607 t['\u02DA'] = '\u0020\u030A'; 22608 t['\u02DB'] = '\u0020\u0328'; 22609 t['\u02DC'] = '\u0020\u0303'; 22610 t['\u02DD'] = '\u0020\u030B'; 22611 t['\u037A'] = '\u0020\u0345'; 22612 t['\u0384'] = '\u0020\u0301'; 22613 t['\u03D0'] = '\u03B2'; 22614 t['\u03D1'] = '\u03B8'; 22615 t['\u03D2'] = '\u03A5'; 22616 t['\u03D5'] = '\u03C6'; 22617 t['\u03D6'] = '\u03C0'; 22618 t['\u03F0'] = '\u03BA'; 22619 t['\u03F1'] = '\u03C1'; 22620 t['\u03F2'] = '\u03C2'; 22621 t['\u03F4'] = '\u0398'; 22622 t['\u03F5'] = '\u03B5'; 22623 t['\u03F9'] = '\u03A3'; 22624 t['\u0587'] = '\u0565\u0582'; 22625 t['\u0675'] = '\u0627\u0674'; 22626 t['\u0676'] = '\u0648\u0674';
22627 t['\u0677'] = '\u06C7\u0674'; 22628 t['\u0678'] = '\u064A\u0674'; 22629 t['\u0E33'] = '\u0E4D\u0E32'; 22630 t['\u0EB3'] = '\u0ECD\u0EB2'; 22631 t['\u0EDC'] = '\u0EAB\u0E99'; 22632 t['\u0EDD'] = '\u0EAB\u0EA1'; 22633 t['\u0F77'] = '\u0FB2\u0F81'; 22634 t['\u0F79'] = '\u0FB3\u0F81'; 22635 t['\u1E9A'] = '\u0061\u02BE'; 22636 t['\u1FBD'] = '\u0020\u0313'; 22637 t['\u1FBF'] = '\u0020\u0313'; 22638 t['\u1FC0'] = '\u0020\u0342'; 22639 t['\u1FFE'] = '\u0020\u0314'; 22640 t['\u2002'] = '\u0020'; 22641 t['\u2003'] = '\u0020'; 22642 t['\u2004'] = '\u0020'; 22643 t['\u2005'] = '\u0020'; 22644 t['\u2006'] = '\u0020'; 22645 t['\u2008'] = '\u0020'; 22646 t['\u2009'] = '\u0020'; 22647 t['\u200A'] = '\u0020'; 22648 t['\u2017'] = '\u0020\u0333'; 22649 t['\u2024'] = '\u002E'; 22650 t['\u2025'] = '\u002E\u002E'; 22651 t['\u2026'] = '\u002E\u002E\u002E'; 22652 t['\u2033'] = '\u2032\u2032'; 22653 t['\u2034'] = '\u2032\u2032\u2032'; 22654 t['\u2036'] = '\u2035\u2035'; 22655 t['\u2037'] = '\u2035\u2035\u2035'; 22656 t['\u203C'] = '\u0021\u0021'; 22657 t['\u203E'] = '\u0020\u0305'; 22658 t['\u2047'] = '\u003F\u003F'; 22659 t['\u2048'] = '\u003F\u0021'; 22660 t['\u2049'] = '\u0021\u003F'; 22661 t['\u2057'] = '\u2032\u2032\u2032\u2032'; 22662 t['\u205F'] = '\u0020'; 22663 t['\u20A8'] = '\u0052\u0073'; 22664 t['\u2100'] = '\u0061\u002F\u0063'; 22665 t['\u2101'] = '\u0061\u002F\u0073'; 22666 t['\u2103'] = '\u00B0\u0043'; 22667 t['\u2105'] = '\u0063\u002F\u006F'; 22668 t['\u2106'] = '\u0063\u002F\u0075'; 22669 t['\u2107'] = '\u0190'; 22670 t['\u2109'] = '\u00B0\u0046'; 22671 t['\u2116'] = '\u004E\u006F'; 22672 t['\u2121'] = '\u0054\u0045\u004C'; 22673 t['\u2135'] = '\u05D0'; 22674 t['\u2136'] = '\u05D1'; 22675 t['\u2137'] = '\u05D2'; 22676 t['\u2138'] = '\u05D3'; 22677 t['\u213B'] = '\u0046\u0041\u0058'; 22678 t['\u2160'] = '\u0049'; 22679 t['\u2161'] = '\u0049\u0049'; 22680 t['\u2162'] = '\u0049\u0049\u0049'; 22681 t['\u2163'] = '\u0049\u0056'; 22682 t['\u2164'] = '\u0056'; 22683 t['\u2165'] = '\u0056\u0049'; 22684 t['\u2166'] = '\u0056\u0049\u0049'; 22685 t['\u2167'] = '\u0056\u0049\u0049\u0049'; 22686 t['\u2168'] = '\u0049\u0058'; 22687 t['\u2169'] = '\u0058'; 22688 t['\u216A'] = '\u0058\u0049'; 22689 t['\u216B'] = '\u0058\u0049\u0049'; 22690 t['\u216C'] = '\u004C'; 22691 t['\u216D'] = '\u0043'; 22692 t['\u216E'] = '\u0044'; 22693 t['\u216F'] = '\u004D'; 22694 t['\u2170'] = '\u0069'; 22695 t['\u2171'] = '\u0069\u0069'; 22696 t['\u2172'] = '\u0069\u0069\u0069'; 22697 t['\u2173'] = '\u0069\u0076'; 22698 t['\u2174'] = '\u0076'; 22699 t['\u2175'] = '\u0076\u0069'; 22700 t['\u2176'] = '\u0076\u0069\u0069'; 22701 t['\u2177'] = '\u0076\u0069\u0069\u0069'; 22702 t['\u2178'] = '\u0069\u0078'; 22703 t['\u2179'] = '\u0078'; 22704 t['\u217A'] = '\u0078\u0069'; 22705 t['\u217B'] = '\u0078\u0069\u0069'; 22706 t['\u217C'] = '\u006C'; 22707 t['\u217D'] = '\u0063'; 22708 t['\u217E'] = '\u0064'; 22709 t['\u217F'] = '\u006D'; 22710 t['\u222C'] = '\u222B\u222B'; 22711 t['\u222D'] = '\u222B\u222B\u222B'; 22712 t['\u222F'] = '\u222E\u222E'; 22713 t['\u2230'] = '\u222E\u222E\u222E'; 22714 t['\u2474'] = '\u0028\u0031\u0029'; 22715 t['\u2475'] = '\u0028\u0032\u0029'; 22716 t['\u2476'] = '\u0028\u0033\u0029'; 22717 t['\u2477'] = '\u0028\u0034\u0029'; 22718 t['\u2478'] = '\u0028\u0035\u0029'; 22719 t['\u2479'] = '\u0028\u0036\u0029'; 22720 t['\u247A'] = '\u0028\u0037\u0029'; 22721 t['\u247B'] = '\u0028\u0038\u0029'; 22722 t['\u247C'] = '\u0028\u0039\u0029'; 22723 t['\u247D'] = '\u0028\u0031\u0030\u0029'; 22724 t['\u247E'] = '\u0028\u0031\u0031\u0029'; 22725 t['\u247F'] = '\u0028\u0031\u0032\u0029'; 22726 t['\u2480'] = '\u0028\u0031\u0033\u0029'; 22727 t['\u2481'] = '\u0028\u0031\u0034\u0029'; 22728 t['\u2482'] = '\u0028\u0031\u0035\u0029'; 22729 t['\u2483'] = '\u0028\u0031\u0036\u0029'; 22730 t['\u2484'] = '\u0028\u0031\u0037\u0029'; 22731 t['\u2485'] = '\u0028\u0031\u0038\u0029'; 22732 t['\u2486'] = '\u0028\u0031\u0039\u0029'; 22733 t['\u2487'] = '\u0028\u0032\u0030\u0029'; 22734 t['\u2488'] = '\u0031\u002E'; 22735 t['\u2489'] = '\u0032\u002E'; 22736 t['\u248A'] = '\u0033\u002E'; 22737 t['\u248B'] = '\u0034\u002E'; 22738 t['\u248C'] = '\u0035\u002E'; 22739 t['\u248D'] = '\u0036\u002E'; 22740 t['\u248E'] = '\u0037\u002E'; 22741 t['\u248F'] = '\u0038\u002E'; 22742 t['\u2490'] = '\u0039\u002E'; 22743 t['\u2491'] = '\u0031\u0030\u002E'; 22744 t['\u2492'] = '\u0031\u0031\u002E'; 22745 t['\u2493'] = '\u0031\u0032\u002E'; 22746 t['\u2494'] = '\u0031\u0033\u002E'; 22747 t['\u2495'] = '\u0031\u0034\u002E'; 22748 t['\u2496'] = '\u0031\u0035\u002E'; 22749 t['\u2497'] = '\u0031\u0036\u002E'; 22750 t['\u2498'] = '\u0031\u0037\u002E'; 22751 t['\u2499'] = '\u0031\u0038\u002E'; 22752 t['\u249A'] = '\u0031\u0039\u002E'; 22753 t['\u249B'] = '\u0032\u0030\u002E'; 22754 t['\u249C'] = '\u0028\u0061\u0029'; 22755 t['\u249D'] = '\u0028\u0062\u0029'; 22756 t['\u249E'] = '\u0028\u0063\u0029'; 22757 t['\u249F'] = '\u0028\u0064\u0029'; 22758 t['\u24A0'] = '\u0028\u0065\u0029'; 22759 t['\u24A1'] = '\u0028\u0066\u0029'; 22760 t['\u24A2'] = '\u0028\u0067\u0029'; 22761 t['\u24A3'] = '\u0028\u0068\u0029'; 22762 t['\u24A4'] = '\u0028\u0069\u0029'; 22763 t['\u24A5'] = '\u0028\u006A\u0029'; 22764 t['\u24A6'] = '\u0028\u006B\u0029'; 22765 t['\u24A7'] = '\u0028\u006C\u0029'; 22766 t['\u24A8'] = '\u0028\u006D\u0029'; 22767 t['\u24A9'] = '\u0028\u006E\u0029'; 22768 t['\u24AA'] = '\u0028\u006F\u0029'; 22769 t['\u24AB'] = '\u0028\u0070\u0029'; 22770 t['\u24AC'] = '\u0028\u0071\u0029';
22771 t['\u24AD'] = '\u0028\u0072\u0029'; 22772 t['\u24AE'] = '\u0028\u0073\u0029'; 22773 t['\u24AF'] = '\u0028\u0074\u0029'; 22774 t['\u24B0'] = '\u0028\u0075\u0029'; 22775 t['\u24B1'] = '\u0028\u0076\u0029'; 22776 t['\u24B2'] = '\u0028\u0077\u0029'; 22777 t['\u24B3'] = '\u0028\u0078\u0029'; 22778 t['\u24B4'] = '\u0028\u0079\u0029'; 22779 t['\u24B5'] = '\u0028\u007A\u0029'; 22780 t['\u2A0C'] = '\u222B\u222B\u222B\u222B'; 22781 t['\u2A74'] = '\u003A\u003A\u003D'; 22782 t['\u2A75'] = '\u003D\u003D'; 22783 t['\u2A76'] = '\u003D\u003D\u003D'; 22784 t['\u2E9F'] = '\u6BCD'; 22785 t['\u2EF3'] = '\u9F9F'; 22786 t['\u2F00'] = '\u4E00'; 22787 t['\u2F01'] = '\u4E28'; 22788 t['\u2F02'] = '\u4E36'; 22789 t['\u2F03'] = '\u4E3F'; 22790 t['\u2F04'] = '\u4E59'; 22791 t['\u2F05'] = '\u4E85'; 22792 t['\u2F06'] = '\u4E8C'; 22793 t['\u2F07'] = '\u4EA0'; 22794 t['\u2F08'] = '\u4EBA'; 22795 t['\u2F09'] = '\u513F'; 22796 t['\u2F0A'] = '\u5165'; 22797 t['\u2F0B'] = '\u516B'; 22798 t['\u2F0C'] = '\u5182'; 22799 t['\u2F0D'] = '\u5196'; 22800 t['\u2F0E'] = '\u51AB'; 22801 t['\u2F0F'] = '\u51E0'; 22802 t['\u2F10'] = '\u51F5'; 22803 t['\u2F11'] = '\u5200'; 22804 t['\u2F12'] = '\u529B'; 22805 t['\u2F13'] = '\u52F9'; 22806 t['\u2F14'] = '\u5315'; 22807 t['\u2F15'] = '\u531A'; 22808 t['\u2F16'] = '\u5338'; 22809 t['\u2F17'] = '\u5341'; 22810 t['\u2F18'] = '\u535C'; 22811 t['\u2F19'] = '\u5369'; 22812 t['\u2F1A'] = '\u5382'; 22813 t['\u2F1B'] = '\u53B6'; 22814 t['\u2F1C'] = '\u53C8'; 22815 t['\u2F1D'] = '\u53E3'; 22816 t['\u2F1E'] = '\u56D7'; 22817 t['\u2F1F'] = '\u571F'; 22818 t['\u2F20'] = '\u58EB'; 22819 t['\u2F21'] = '\u5902'; 22820 t['\u2F22'] = '\u590A'; 22821 t['\u2F23'] = '\u5915'; 22822 t['\u2F24'] = '\u5927'; 22823 t['\u2F25'] = '\u5973'; 22824 t['\u2F26'] = '\u5B50'; 22825 t['\u2F27'] = '\u5B80'; 22826 t['\u2F28'] = '\u5BF8'; 22827 t['\u2F29'] = '\u5C0F'; 22828 t['\u2F2A'] = '\u5C22'; 22829 t['\u2F2B'] = '\u5C38'; 22830 t['\u2F2C'] = '\u5C6E'; 22831 t['\u2F2D'] = '\u5C71'; 22832 t['\u2F2E'] = '\u5DDB'; 22833 t['\u2F2F'] = '\u5DE5'; 22834 t['\u2F30'] = '\u5DF1'; 22835 t['\u2F31'] = '\u5DFE'; 22836 t['\u2F32'] = '\u5E72'; 22837 t['\u2F33'] = '\u5E7A'; 22838 t['\u2F34'] = '\u5E7F'; 22839 t['\u2F35'] = '\u5EF4'; 22840 t['\u2F36'] = '\u5EFE'; 22841 t['\u2F37'] = '\u5F0B'; 22842 t['\u2F38'] = '\u5F13'; 22843 t['\u2F39'] = '\u5F50'; 22844 t['\u2F3A'] = '\u5F61'; 22845 t['\u2F3B'] = '\u5F73'; 22846 t['\u2F3C'] = '\u5FC3'; 22847 t['\u2F3D'] = '\u6208'; 22848 t['\u2F3E'] = '\u6236'; 22849 t['\u2F3F'] = '\u624B'; 22850 t['\u2F40'] = '\u652F'; 22851 t['\u2F41'] = '\u6534'; 22852 t['\u2F42'] = '\u6587'; 22853 t['\u2F43'] = '\u6597'; 22854 t['\u2F44'] = '\u65A4'; 22855 t['\u2F45'] = '\u65B9'; 22856 t['\u2F46'] = '\u65E0'; 22857 t['\u2F47'] = '\u65E5'; 22858 t['\u2F48'] = '\u66F0'; 22859 t['\u2F49'] = '\u6708'; 22860 t['\u2F4A'] = '\u6728'; 22861 t['\u2F4B'] = '\u6B20'; 22862 t['\u2F4C'] = '\u6B62'; 22863 t['\u2F4D'] = '\u6B79'; 22864 t['\u2F4E'] = '\u6BB3'; 22865 t['\u2F4F'] = '\u6BCB'; 22866 t['\u2F50'] = '\u6BD4'; 22867 t['\u2F51'] = '\u6BDB'; 22868 t['\u2F52'] = '\u6C0F'; 22869 t['\u2F53'] = '\u6C14'; 22870 t['\u2F54'] = '\u6C34'; 22871 t['\u2F55'] = '\u706B'; 22872 t['\u2F56'] = '\u722A'; 22873 t['\u2F57'] = '\u7236'; 22874 t['\u2F58'] = '\u723B'; 22875 t['\u2F59'] = '\u723F'; 22876 t['\u2F5A'] = '\u7247'; 22877 t['\u2F5B'] = '\u7259'; 22878 t['\u2F5C'] = '\u725B'; 22879 t['\u2F5D'] = '\u72AC'; 22880 t['\u2F5E'] = '\u7384'; 22881 t['\u2F5F'] = '\u7389'; 22882 t['\u2F60'] = '\u74DC'; 22883 t['\u2F61'] = '\u74E6'; 22884 t['\u2F62'] = '\u7518'; 22885 t['\u2F63'] = '\u751F'; 22886 t['\u2F64'] = '\u7528'; 22887 t['\u2F65'] = '\u7530'; 22888 t['\u2F66'] = '\u758B'; 22889 t['\u2F67'] = '\u7592'; 22890 t['\u2F68'] = '\u7676'; 22891 t['\u2F69'] = '\u767D'; 22892 t['\u2F6A'] = '\u76AE'; 22893 t['\u2F6B'] = '\u76BF'; 22894 t['\u2F6C'] = '\u76EE'; 22895 t['\u2F6D'] = '\u77DB'; 22896 t['\u2F6E'] = '\u77E2'; 22897 t['\u2F6F'] = '\u77F3'; 22898 t['\u2F70'] = '\u793A'; 22899 t['\u2F71'] = '\u79B8'; 22900 t['\u2F72'] = '\u79BE'; 22901 t['\u2F73'] = '\u7A74'; 22902 t['\u2F74'] = '\u7ACB'; 22903 t['\u2F75'] = '\u7AF9'; 22904 t['\u2F76'] = '\u7C73'; 22905 t['\u2F77'] = '\u7CF8'; 22906 t['\u2F78'] = '\u7F36'; 22907 t['\u2F79'] = '\u7F51'; 22908 t['\u2F7A'] = '\u7F8A'; 22909 t['\u2F7B'] = '\u7FBD'; 22910 t['\u2F7C'] = '\u8001'; 22911 t['\u2F7D'] = '\u800C'; 22912 t['\u2F7E'] = '\u8012'; 22913 t['\u2F7F'] = '\u8033'; 22914 t['\u2F80'] = '\u807F'; 22915 t['\u2F81'] = '\u8089'; 22916 t['\u2F82'] = '\u81E3'; 22917 t['\u2F83'] = '\u81EA'; 22918 t['\u2F84'] = '\u81F3'; 22919 t['\u2F85'] = '\u81FC'; 22920 t['\u2F86'] = '\u820C'; 22921 t['\u2F87'] = '\u821B'; 22922 t['\u2F88'] = '\u821F'; 22923 t['\u2F89'] = '\u826E'; 22924 t['\u2F8A'] = '\u8272'; 22925 t['\u2F8B'] = '\u8278'; 22926 t['\u2F8C'] = '\u864D'; 22927 t['\u2F8D'] = '\u866B'; 22928 t['\u2F8E'] = '\u8840';
22929 t['\u2F8F'] = '\u884C'; 22930 t['\u2F90'] = '\u8863'; 22931 t['\u2F91'] = '\u897E'; 22932 t['\u2F92'] = '\u898B'; 22933 t['\u2F93'] = '\u89D2'; 22934 t['\u2F94'] = '\u8A00'; 22935 t['\u2F95'] = '\u8C37'; 22936 t['\u2F96'] = '\u8C46'; 22937 t['\u2F97'] = '\u8C55'; 22938 t['\u2F98'] = '\u8C78'; 22939 t['\u2F99'] = '\u8C9D'; 22940 t['\u2F9A'] = '\u8D64'; 22941 t['\u2F9B'] = '\u8D70'; 22942 t['\u2F9C'] = '\u8DB3'; 22943 t['\u2F9D'] = '\u8EAB'; 22944 t['\u2F9E'] = '\u8ECA'; 22945 t['\u2F9F'] = '\u8F9B'; 22946 t['\u2FA0'] = '\u8FB0'; 22947 t['\u2FA1'] = '\u8FB5'; 22948 t['\u2FA2'] = '\u9091'; 22949 t['\u2FA3'] = '\u9149'; 22950 t['\u2FA4'] = '\u91C6'; 22951 t['\u2FA5'] = '\u91CC'; 22952 t['\u2FA6'] = '\u91D1'; 22953 t['\u2FA7'] = '\u9577'; 22954 t['\u2FA8'] = '\u9580'; 22955 t['\u2FA9'] = '\u961C'; 22956 t['\u2FAA'] = '\u96B6'; 22957 t['\u2FAB'] = '\u96B9'; 22958 t['\u2FAC'] = '\u96E8'; 22959 t['\u2FAD'] = '\u9751'; 22960 t['\u2FAE'] = '\u975E'; 22961 t['\u2FAF'] = '\u9762'; 22962 t['\u2FB0'] = '\u9769'; 22963 t['\u2FB1'] = '\u97CB'; 22964 t['\u2FB2'] = '\u97ED'; 22965 t['\u2FB3'] = '\u97F3'; 22966 t['\u2FB4'] = '\u9801'; 22967 t['\u2FB5'] = '\u98A8'; 22968 t['\u2FB6'] = '\u98DB'; 22969 t['\u2FB7'] = '\u98DF'; 22970 t['\u2FB8'] = '\u9996'; 22971 t['\u2FB9'] = '\u9999'; 22972 t['\u2FBA'] = '\u99AC'; 22973 t['\u2FBB'] = '\u9AA8'; 22974 t['\u2FBC'] = '\u9AD8'; 22975 t['\u2FBD'] = '\u9ADF'; 22976 t['\u2FBE'] = '\u9B25'; 22977 t['\u2FBF'] = '\u9B2F'; 22978 t['\u2FC0'] = '\u9B32'; 22979 t['\u2FC1'] = '\u9B3C'; 22980 t['\u2FC2'] = '\u9B5A'; 22981 t['\u2FC3'] = '\u9CE5'; 22982 t['\u2FC4'] = '\u9E75'; 22983 t['\u2FC5'] = '\u9E7F'; 22984 t['\u2FC6'] = '\u9EA5'; 22985 t['\u2FC7'] = '\u9EBB'; 22986 t['\u2FC8'] = '\u9EC3'; 22987 t['\u2FC9'] = '\u9ECD'; 22988 t['\u2FCA'] = '\u9ED1'; 22989 t['\u2FCB'] = '\u9EF9'; 22990 t['\u2FCC'] = '\u9EFD'; 22991 t['\u2FCD'] = '\u9F0E'; 22992 t['\u2FCE'] = '\u9F13'; 22993 t['\u2FCF'] = '\u9F20'; 22994 t['\u2FD0'] = '\u9F3B'; 22995 t['\u2FD1'] = '\u9F4A'; 22996 t['\u2FD2'] = '\u9F52'; 22997 t['\u2FD3'] = '\u9F8D'; 22998 t['\u2FD4'] = '\u9F9C'; 22999 t['\u2FD5'] = '\u9FA0'; 23000 t['\u3036'] = '\u3012'; 23001 t['\u3038'] = '\u5341'; 23002 t['\u3039'] = '\u5344'; 23003 t['\u303A'] = '\u5345'; 23004 t['\u309B'] = '\u0020\u3099'; 23005 t['\u309C'] = '\u0020\u309A'; 23006 t['\u3131'] = '\u1100'; 23007 t['\u3132'] = '\u1101'; 23008 t['\u3133'] = '\u11AA'; 23009 t['\u3134'] = '\u1102'; 23010 t['\u3135'] = '\u11AC'; 23011 t['\u3136'] = '\u11AD'; 23012 t['\u3137'] = '\u1103'; 23013 t['\u3138'] = '\u1104'; 23014 t['\u3139'] = '\u1105'; 23015 t['\u313A'] = '\u11B0'; 23016 t['\u313B'] = '\u11B1'; 23017 t['\u313C'] = '\u11B2'; 23018 t['\u313D'] = '\u11B3'; 23019 t['\u313E'] = '\u11B4'; 23020 t['\u313F'] = '\u11B5'; 23021 t['\u3140'] = '\u111A'; 23022 t['\u3141'] = '\u1106'; 23023 t['\u3142'] = '\u1107'; 23024 t['\u3143'] = '\u1108'; 23025 t['\u3144'] = '\u1121'; 23026 t['\u3145'] = '\u1109'; 23027 t['\u3146'] = '\u110A'; 23028 t['\u3147'] = '\u110B'; 23029 t['\u3148'] = '\u110C'; 23030 t['\u3149'] = '\u110D'; 23031 t['\u314A'] = '\u110E'; 23032 t['\u314B'] = '\u110F'; 23033 t['\u314C'] = '\u1110'; 23034 t['\u314D'] = '\u1111'; 23035 t['\u314E'] = '\u1112'; 23036 t['\u314F'] = '\u1161'; 23037 t['\u3150'] = '\u1162'; 23038 t['\u3151'] = '\u1163'; 23039 t['\u3152'] = '\u1164'; 23040 t['\u3153'] = '\u1165'; 23041 t['\u3154'] = '\u1166'; 23042 t['\u3155'] = '\u1167'; 23043 t['\u3156'] = '\u1168'; 23044 t['\u3157'] = '\u1169'; 23045 t['\u3158'] = '\u116A'; 23046 t['\u3159'] = '\u116B'; 23047 t['\u315A'] = '\u116C'; 23048 t['\u315B'] = '\u116D'; 23049 t['\u315C'] = '\u116E'; 23050 t['\u315D'] = '\u116F'; 23051 t['\u315E'] = '\u1170'; 23052 t['\u315F'] = '\u1171'; 23053 t['\u3160'] = '\u1172'; 23054 t['\u3161'] = '\u1173'; 23055 t['\u3162'] = '\u1174'; 23056 t['\u3163'] = '\u1175'; 23057 t['\u3164'] = '\u1160'; 23058 t['\u3165'] = '\u1114'; 23059 t['\u3166'] = '\u1115'; 23060 t['\u3167'] = '\u11C7'; 23061 t['\u3168'] = '\u11C8'; 23062 t['\u3169'] = '\u11CC'; 23063 t['\u316A'] = '\u11CE'; 23064 t['\u316B'] = '\u11D3'; 23065 t['\u316C'] = '\u11D7'; 23066 t['\u316D'] = '\u11D9'; 23067 t['\u316E'] = '\u111C'; 23068 t['\u316F'] = '\u11DD'; 23069 t['\u3170'] = '\u11DF'; 23070 t['\u3171'] = '\u111D'; 23071 t['\u3172'] = '\u111E'; 23072 t['\u3173'] = '\u1120'; 23073 t['\u3174'] = '\u1122'; 23074 t['\u3175'] = '\u1123'; 23075 t['\u3176'] = '\u1127'; 23076 t['\u3177'] = '\u1129'; 23077 t['\u3178'] = '\u112B'; 23078 t['\u3179'] = '\u112C'; 23079 t['\u317A'] = '\u112D'; 23080 t['\u317B'] = '\u112E'; 23081 t['\u317C'] = '\u112F'; 23082 t['\u317D'] = '\u1132'; 23083 t['\u317E'] = '\u1136'; 23084 t['\u317F'] = '\u1140'; 23085 t['\u3180'] = '\u1147'; 23086 t['\u3181'] = '\u114C'; 23087 t['\u3182'] = '\u11F1'; 23088 t['\u3183'] = '\u11F2'; 23089 t['\u3184'] = '\u1157'; 23090 t['\u3185'] = '\u1158'; 23091 t['\u3186'] = '\u1159'; 23092 t['\u3187'] = '\u1184'; 23093 t['\u3188'] = '\u1185'; 23094 t['\u3189'] = '\u1188'; 23095 t['\u318A'] = '\u1191'; 23096 t['\u318B'] = '\u1192'; 23097 t['\u318C'] = '\u1194'; 23098 t['\u318D'] = '\u119E'; 23099 t['\u318E'] = '\u11A1'; 23100 t['\u3200'] = '\u0028\u1100\u0029'; 23101 t['\u3201'] = '\u0028\u1102\u0029'; 23102 t['\u3202'] = '\u0028\u1103\u0029'; 23103 t['\u3203'] = '\u0028\u1105\u0029'; 23104 t['\u3204'] = '\u0028\u1106\u0029'; 23105 t['\u3205'] = '\u0028\u1107\u0029'; 23106 t['\u3206'] = '\u0028\u1109\u0029'; 23107 t['\u3207'] = '\u0028\u110B\u0029'; 23108 t['\u3208'] = '\u0028\u110C\u0029'; 23109 t['\u3209'] = '\u0028\u110E\u0029'; 23110 t['\u320A'] = '\u0028\u110F\u0029'; 23111 t['\u320B'] = '\u0028\u1110\u0029'; 23112 t['\u320C'] = '\u0028\u1111\u0029'; 23113 t['\u320D'] = '\u0028\u1112\u0029'; 23114 t['\u320E'] = '\u0028\u1100\u1161\u0029'; 23115 t['\u320F'] = '\u0028\u1102\u1161\u0029'; 23116 t['\u3210'] = '\u0028\u1103\u1161\u0029'; 23117 t['\u3211'] = '\u0028\u1105\u1161\u0029'; 23118 t['\u3212'] = '\u0028\u1106\u1161\u0029'; 23119 t['\u3213'] = '\u0028\u1107\u1161\u0029'; 23120 t['\u3214'] = '\u0028\u1109\u1161\u0029'; 23121 t['\u3215'] = '\u0028\u110B\u1161\u0029'; 23122 t['\u3216'] = '\u0028\u110C\u1161\u0029'; 23123 t['\u3217'] = '\u0028\u110E\u1161\u0029'; 23124 t['\u3218'] = '\u0028\u110F\u1161\u0029'; 23125 t['\u3219'] = '\u0028\u1110\u1161\u0029'; 23126 t['\u321A'] = '\u0028\u1111\u1161\u0029'; 23127 t['\u321B'] = '\u0028\u1112\u1161\u0029'; 23128 t['\u321C'] = '\u0028\u110C\u116E\u0029'; 23129 t['\u321D'] = '\u0028\u110B\u1169\u110C\u1165\u11AB\u0029'; 23130 t['\u321E'] = '\u0028\u110B\u1169\u1112\u116E\u0029'; 23131 t['\u3220'] = '\u0028\u4E00\u0029'; 23132 t['\u3221'] = '\u0028\u4E8C\u0029'; 23133 t['\u3222'] = '\u0028\u4E09\u0029'; 23134 t['\u3223'] = '\u0028\u56DB\u0029'; 23135 t['\u3224'] = '\u0028\u4E94\u0029'; 23136 t['\u3225'] = '\u0028\u516D\u0029'; 23137 t['\u3226'] = '\u0028\u4E03\u0029'; 23138 t['\u3227'] = '\u0028\u516B\u0029'; 23139 t['\u3228'] = '\u0028\u4E5D\u0029'; 23140 t['\u3229'] = '\u0028\u5341\u0029'; 23141 t['\u322A'] = '\u0028\u6708\u0029'; 23142 t['\u322B'] = '\u0028\u706B\u0029'; 23143 t['\u322C'] = '\u0028\u6C34\u0029'; 23144 t['\u322D'] = '\u0028\u6728\u0029'; 23145 t['\u322E'] = '\u0028\u91D1\u0029';
23146 t['\u322F'] = '\u0028\u571F\u0029'; 23147 t['\u3230'] = '\u0028\u65E5\u0029'; 23148 t['\u3231'] = '\u0028\u682A\u0029'; 23149 t['\u3232'] = '\u0028\u6709\u0029'; 23150 t['\u3233'] = '\u0028\u793E\u0029'; 23151 t['\u3234'] = '\u0028\u540D\u0029'; 23152 t['\u3235'] = '\u0028\u7279\u0029'; 23153 t['\u3236'] = '\u0028\u8CA1\u0029'; 23154 t['\u3237'] = '\u0028\u795D\u0029'; 23155 t['\u3238'] = '\u0028\u52B4\u0029'; 23156 t['\u3239'] = '\u0028\u4EE3\u0029'; 23157 t['\u323A'] = '\u0028\u547C\u0029'; 23158 t['\u323B'] = '\u0028\u5B66\u0029'; 23159 t['\u323C'] = '\u0028\u76E3\u0029'; 23160 t['\u323D'] = '\u0028\u4F01\u0029'; 23161 t['\u323E'] = '\u0028\u8CC7\u0029'; 23162 t['\u323F'] = '\u0028\u5354\u0029'; 23163 t['\u3240'] = '\u0028\u796D\u0029'; 23164 t['\u3241'] = '\u0028\u4F11\u0029'; 23165 t['\u3242'] = '\u0028\u81EA\u0029'; 23166 t['\u3243'] = '\u0028\u81F3\u0029'; 23167 t['\u32C0'] = '\u0031\u6708'; 23168 t['\u32C1'] = '\u0032\u6708'; 23169 t['\u32C2'] = '\u0033\u6708'; 23170 t['\u32C3'] = '\u0034\u6708'; 23171 t['\u32C4'] = '\u0035\u6708'; 23172 t['\u32C5'] = '\u0036\u6708'; 23173 t['\u32C6'] = '\u0037\u6708'; 23174 t['\u32C7'] = '\u0038\u6708'; 23175 t['\u32C8'] = '\u0039\u6708'; 23176 t['\u32C9'] = '\u0031\u0030\u6708'; 23177 t['\u32CA'] = '\u0031\u0031\u6708'; 23178 t['\u32CB'] = '\u0031\u0032\u6708'; 23179 t['\u3358'] = '\u0030\u70B9'; 23180 t['\u3359'] = '\u0031\u70B9'; 23181 t['\u335A'] = '\u0032\u70B9'; 23182 t['\u335B'] = '\u0033\u70B9'; 23183 t['\u335C'] = '\u0034\u70B9'; 23184 t['\u335D'] = '\u0035\u70B9'; 23185 t['\u335E'] = '\u0036\u70B9'; 23186 t['\u335F'] = '\u0037\u70B9'; 23187 t['\u3360'] = '\u0038\u70B9'; 23188 t['\u3361'] = '\u0039\u70B9'; 23189 t['\u3362'] = '\u0031\u0030\u70B9'; 23190 t['\u3363'] = '\u0031\u0031\u70B9'; 23191 t['\u3364'] = '\u0031\u0032\u70B9'; 23192 t['\u3365'] = '\u0031\u0033\u70B9'; 23193 t['\u3366'] = '\u0031\u0034\u70B9'; 23194 t['\u3367'] = '\u0031\u0035\u70B9'; 23195 t['\u3368'] = '\u0031\u0036\u70B9'; 23196 t['\u3369'] = '\u0031\u0037\u70B9'; 23197 t['\u336A'] = '\u0031\u0038\u70B9'; 23198 t['\u336B'] = '\u0031\u0039\u70B9'; 23199 t['\u336C'] = '\u0032\u0030\u70B9'; 23200 t['\u336D'] = '\u0032\u0031\u70B9'; 23201 t['\u336E'] = '\u0032\u0032\u70B9'; 23202 t['\u336F'] = '\u0032\u0033\u70B9'; 23203 t['\u3370'] = '\u0032\u0034\u70B9'; 23204 t['\u33E0'] = '\u0031\u65E5'; 23205 t['\u33E1'] = '\u0032\u65E5'; 23206 t['\u33E2'] = '\u0033\u65E5'; 23207 t['\u33E3'] = '\u0034\u65E5'; 23208 t['\u33E4'] = '\u0035\u65E5'; 23209 t['\u33E5'] = '\u0036\u65E5'; 23210 t['\u33E6'] = '\u0037\u65E5'; 23211 t['\u33E7'] = '\u0038\u65E5'; 23212 t['\u33E8'] = '\u0039\u65E5'; 23213 t['\u33E9'] = '\u0031\u0030\u65E5'; 23214 t['\u33EA'] = '\u0031\u0031\u65E5'; 23215 t['\u33EB'] = '\u0031\u0032\u65E5'; 23216 t['\u33EC'] = '\u0031\u0033\u65E5'; 23217 t['\u33ED'] = '\u0031\u0034\u65E5'; 23218 t['\u33EE'] = '\u0031\u0035\u65E5'; 23219 t['\u33EF'] = '\u0031\u0036\u65E5'; 23220 t['\u33F0'] = '\u0031\u0037\u65E5'; 23221 t['\u33F1'] = '\u0031\u0038\u65E5'; 23222 t['\u33F2'] = '\u0031\u0039\u65E5'; 23223 t['\u33F3'] = '\u0032\u0030\u65E5'; 23224 t['\u33F4'] = '\u0032\u0031\u65E5'; 23225 t['\u33F5'] = '\u0032\u0032\u65E5'; 23226 t['\u33F6'] = '\u0032\u0033\u65E5'; 23227 t['\u33F7'] = '\u0032\u0034\u65E5'; 23228 t['\u33F8'] = '\u0032\u0035\u65E5'; 23229 t['\u33F9'] = '\u0032\u0036\u65E5'; 23230 t['\u33FA'] = '\u0032\u0037\u65E5'; 23231 t['\u33FB'] = '\u0032\u0038\u65E5'; 23232 t['\u33FC'] = '\u0032\u0039\u65E5'; 23233 t['\u33FD'] = '\u0033\u0030\u65E5'; 23234 t['\u33FE'] = '\u0033\u0031\u65E5'; 23235 t['\uFB00'] = '\u0066\u0066'; 23236 t['\uFB01'] = '\u0066\u0069'; 23237 t['\uFB02'] = '\u0066\u006C'; 23238 t['\uFB03'] = '\u0066\u0066\u0069'; 23239 t['\uFB04'] = '\u0066\u0066\u006C'; 23240 t['\uFB05'] = '\u017F\u0074'; 23241 t['\uFB06'] = '\u0073\u0074'; 23242 t['\uFB13'] = '\u0574\u0576'; 23243 t['\uFB14'] = '\u0574\u0565'; 23244 t['\uFB15'] = '\u0574\u056B'; 23245 t['\uFB16'] = '\u057E\u0576'; 23246 t['\uFB17'] = '\u0574\u056D'; 23247 t['\uFB4F'] = '\u05D0\u05DC'; 23248 t['\uFB50'] = '\u0671'; 23249 t['\uFB51'] = '\u0671'; 23250 t['\uFB52'] = '\u067B'; 23251 t['\uFB53'] = '\u067B'; 23252 t['\uFB54'] = '\u067B'; 23253 t['\uFB55'] = '\u067B'; 23254 t['\uFB56'] = '\u067E'; 23255 t['\uFB57'] = '\u067E'; 23256 t['\uFB58'] = '\u067E'; 23257 t['\uFB59'] = '\u067E'; 23258 t['\uFB5A'] = '\u0680'; 23259 t['\uFB5B'] = '\u0680'; 23260 t['\uFB5C'] = '\u0680'; 23261 t['\uFB5D'] = '\u0680'; 23262 t['\uFB5E'] = '\u067A'; 23263 t['\uFB5F'] = '\u067A'; 23264 t['\uFB60'] = '\u067A'; 23265 t['\uFB61'] = '\u067A'; 23266 t['\uFB62'] = '\u067F'; 23267 t['\uFB63'] = '\u067F'; 23268 t['\uFB64'] = '\u067F'; 23269 t['\uFB65'] = '\u067F'; 23270 t['\uFB66'] = '\u0679'; 23271 t['\uFB67'] = '\u0679'; 23272 t['\uFB68'] = '\u0679'; 23273 t['\uFB69'] = '\u0679'; 23274 t['\uFB6A'] = '\u06A4'; 23275 t['\uFB6B'] = '\u06A4'; 23276 t['\uFB6C'] = '\u06A4'; 23277 t['\uFB6D'] = '\u06A4'; 23278 t['\uFB6E'] = '\u06A6'; 23279 t['\uFB6F'] = '\u06A6'; 23280 t['\uFB70'] = '\u06A6'; 23281 t['\uFB71'] = '\u06A6'; 23282 t['\uFB72'] = '\u0684'; 23283 t['\uFB73'] = '\u0684'; 23284 t['\uFB74'] = '\u0684'; 23285 t['\uFB75'] = '\u0684'; 23286 t['\uFB76'] = '\u0683'; 23287 t['\uFB77'] = '\u0683'; 23288 t['\uFB78'] = '\u0683'; 23289 t['\uFB79'] = '\u0683'; 23290 t['\uFB7A'] = '\u0686'; 23291 t['\uFB7B'] = '\u0686'; 23292 t['\uFB7C'] = '\u0686'; 23293 t['\uFB7D'] = '\u0686'; 23294 t['\uFB7E'] = '\u0687'; 23295 t['\uFB7F'] = '\u0687'; 23296 t['\uFB80'] = '\u0687'; 23297 t['\uFB81'] = '\u0687'; 23298 t['\uFB82'] = '\u068D'; 23299 t['\uFB83'] = '\u068D'; 23300 t['\uFB84'] = '\u068C'; 23301 t['\uFB85'] = '\u068C'; 23302 t['\uFB86'] = '\u068E'; 23303 t['\uFB87'] = '\u068E'; 23304 t['\uFB88'] = '\u0688'; 23305 t['\uFB89'] = '\u0688'; 23306 t['\uFB8A'] = '\u0698'; 23307 t['\uFB8B'] = '\u0698'; 23308 t['\uFB8C'] = '\u0691'; 23309 t['\uFB8D'] = '\u0691'; 23310 t['\uFB8E'] = '\u06A9';
23311 t['\uFB8F'] = '\u06A9'; 23312 t['\uFB90'] = '\u06A9'; 23313 t['\uFB91'] = '\u06A9'; 23314 t['\uFB92'] = '\u06AF'; 23315 t['\uFB93'] = '\u06AF'; 23316 t['\uFB94'] = '\u06AF'; 23317 t['\uFB95'] = '\u06AF'; 23318 t['\uFB96'] = '\u06B3'; 23319 t['\uFB97'] = '\u06B3'; 23320 t['\uFB98'] = '\u06B3'; 23321 t['\uFB99'] = '\u06B3'; 23322 t['\uFB9A'] = '\u06B1'; 23323 t['\uFB9B'] = '\u06B1'; 23324 t['\uFB9C'] = '\u06B1'; 23325 t['\uFB9D'] = '\u06B1'; 23326 t['\uFB9E'] = '\u06BA'; 23327 t['\uFB9F'] = '\u06BA'; 23328 t['\uFBA0'] = '\u06BB'; 23329 t['\uFBA1'] = '\u06BB'; 23330 t['\uFBA2'] = '\u06BB'; 23331 t['\uFBA3'] = '\u06BB'; 23332 t['\uFBA4'] = '\u06C0'; 23333 t['\uFBA5'] = '\u06C0'; 23334 t['\uFBA6'] = '\u06C1'; 23335 t['\uFBA7'] = '\u06C1'; 23336 t['\uFBA8'] = '\u06C1'; 23337 t['\uFBA9'] = '\u06C1'; 23338 t['\uFBAA'] = '\u06BE'; 23339 t['\uFBAB'] = '\u06BE'; 23340 t['\uFBAC'] = '\u06BE'; 23341 t['\uFBAD'] = '\u06BE'; 23342 t['\uFBAE'] = '\u06D2'; 23343 t['\uFBAF'] = '\u06D2'; 23344 t['\uFBB0'] = '\u06D3'; 23345 t['\uFBB1'] = '\u06D3'; 23346 t['\uFBD3'] = '\u06AD'; 23347 t['\uFBD4'] = '\u06AD'; 23348 t['\uFBD5'] = '\u06AD'; 23349 t['\uFBD6'] = '\u06AD'; 23350 t['\uFBD7'] = '\u06C7'; 23351 t['\uFBD8'] = '\u06C7'; 23352 t['\uFBD9'] = '\u06C6'; 23353 t['\uFBDA'] = '\u06C6'; 23354 t['\uFBDB'] = '\u06C8'; 23355 t['\uFBDC'] = '\u06C8'; 23356 t['\uFBDD'] = '\u0677'; 23357 t['\uFBDE'] = '\u06CB'; 23358 t['\uFBDF'] = '\u06CB'; 23359 t['\uFBE0'] = '\u06C5'; 23360 t['\uFBE1'] = '\u06C5'; 23361 t['\uFBE2'] = '\u06C9'; 23362 t['\uFBE3'] = '\u06C9'; 23363 t['\uFBE4'] = '\u06D0'; 23364 t['\uFBE5'] = '\u06D0'; 23365 t['\uFBE6'] = '\u06D0'; 23366 t['\uFBE7'] = '\u06D0'; 23367 t['\uFBE8'] = '\u0649'; 23368 t['\uFBE9'] = '\u0649'; 23369 t['\uFBEA'] = '\u0626\u0627'; 23370 t['\uFBEB'] = '\u0626\u0627'; 23371 t['\uFBEC'] = '\u0626\u06D5'; 23372 t['\uFBED'] = '\u0626\u06D5'; 23373 t['\uFBEE'] = '\u0626\u0648'; 23374 t['\uFBEF'] = '\u0626\u0648'; 23375 t['\uFBF0'] = '\u0626\u06C7'; 23376 t['\uFBF1'] = '\u0626\u06C7'; 23377 t['\uFBF2'] = '\u0626\u06C6'; 23378 t['\uFBF3'] = '\u0626\u06C6'; 23379 t['\uFBF4'] = '\u0626\u06C8'; 23380 t['\uFBF5'] = '\u0626\u06C8'; 23381 t['\uFBF6'] = '\u0626\u06D0'; 23382 t['\uFBF7'] = '\u0626\u06D0'; 23383 t['\uFBF8'] = '\u0626\u06D0'; 23384 t['\uFBF9'] = '\u0626\u0649'; 23385 t['\uFBFA'] = '\u0626\u0649'; 23386 t['\uFBFB'] = '\u0626\u0649'; 23387 t['\uFBFC'] = '\u06CC'; 23388 t['\uFBFD'] = '\u06CC'; 23389 t['\uFBFE'] = '\u06CC'; 23390 t['\uFBFF'] = '\u06CC'; 23391 t['\uFC00'] = '\u0626\u062C'; 23392 t['\uFC01'] = '\u0626\u062D'; 23393 t['\uFC02'] = '\u0626\u0645'; 23394 t['\uFC03'] = '\u0626\u0649'; 23395 t['\uFC04'] = '\u0626\u064A'; 23396 t['\uFC05'] = '\u0628\u062C'; 23397 t['\uFC06'] = '\u0628\u062D'; 23398 t['\uFC07'] = '\u0628\u062E'; 23399 t['\uFC08'] = '\u0628\u0645'; 23400 t['\uFC09'] = '\u0628\u0649'; 23401 t['\uFC0A'] = '\u0628\u064A'; 23402 t['\uFC0B'] = '\u062A\u062C'; 23403 t['\uFC0C'] = '\u062A\u062D'; 23404 t['\uFC0D'] = '\u062A\u062E'; 23405 t['\uFC0E'] = '\u062A\u0645'; 23406 t['\uFC0F'] = '\u062A\u0649'; 23407 t['\uFC10'] = '\u062A\u064A'; 23408 t['\uFC11'] = '\u062B\u062C'; 23409 t['\uFC12'] = '\u062B\u0645'; 23410 t['\uFC13'] = '\u062B\u0649'; 23411 t['\uFC14'] = '\u062B\u064A'; 23412 t['\uFC15'] = '\u062C\u062D'; 23413 t['\uFC16'] = '\u062C\u0645'; 23414 t['\uFC17'] = '\u062D\u062C'; 23415 t['\uFC18'] = '\u062D\u0645'; 23416 t['\uFC19'] = '\u062E\u062C'; 23417 t['\uFC1A'] = '\u062E\u062D'; 23418 t['\uFC1B'] = '\u062E\u0645'; 23419 t['\uFC1C'] = '\u0633\u062C'; 23420 t['\uFC1D'] = '\u0633\u062D'; 23421 t['\uFC1E'] = '\u0633\u062E'; 23422 t['\uFC1F'] = '\u0633\u0645'; 23423 t['\uFC20'] = '\u0635\u062D'; 23424 t['\uFC21'] = '\u0635\u0645'; 23425 t['\uFC22'] = '\u0636\u062C'; 23426 t['\uFC23'] = '\u0636\u062D'; 23427 t['\uFC24'] = '\u0636\u062E'; 23428 t['\uFC25'] = '\u0636\u0645'; 23429 t['\uFC26'] = '\u0637\u062D'; 23430 t['\uFC27'] = '\u0637\u0645'; 23431 t['\uFC28'] = '\u0638\u0645'; 23432 t['\uFC29'] = '\u0639\u062C'; 23433 t['\uFC2A'] = '\u0639\u0645'; 23434 t['\uFC2B'] = '\u063A\u062C'; 23435 t['\uFC2C'] = '\u063A\u0645'; 23436 t['\uFC2D'] = '\u0641\u062C'; 23437 t['\uFC2E'] = '\u0641\u062D'; 23438 t['\uFC2F'] = '\u0641\u062E'; 23439 t['\uFC30'] = '\u0641\u0645'; 23440 t['\uFC31'] = '\u0641\u0649'; 23441 t['\uFC32'] = '\u0641\u064A'; 23442 t['\uFC33'] = '\u0642\u062D'; 23443 t['\uFC34'] = '\u0642\u0645'; 23444 t['\uFC35'] = '\u0642\u0649'; 23445 t['\uFC36'] = '\u0642\u064A'; 23446 t['\uFC37'] = '\u0643\u0627'; 23447 t['\uFC38'] = '\u0643\u062C'; 23448 t['\uFC39'] = '\u0643\u062D'; 23449 t['\uFC3A'] = '\u0643\u062E'; 23450 t['\uFC3B'] = '\u0643\u0644'; 23451 t['\uFC3C'] = '\u0643\u0645'; 23452 t['\uFC3D'] = '\u0643\u0649'; 23453 t['\uFC3E'] = '\u0643\u064A'; 23454 t['\uFC3F'] = '\u0644\u062C'; 23455 t['\uFC40'] = '\u0644\u062D'; 23456 t['\uFC41'] = '\u0644\u062E'; 23457 t['\uFC42'] = '\u0644\u0645'; 23458 t['\uFC43'] = '\u0644\u0649'; 23459 t['\uFC44'] = '\u0644\u064A'; 23460 t['\uFC45'] = '\u0645\u062C';
23461 t['\uFC46'] = '\u0645\u062D'; 23462 t['\uFC47'] = '\u0645\u062E'; 23463 t['\uFC48'] = '\u0645\u0645'; 23464 t['\uFC49'] = '\u0645\u0649'; 23465 t['\uFC4A'] = '\u0645\u064A'; 23466 t['\uFC4B'] = '\u0646\u062C'; 23467 t['\uFC4C'] = '\u0646\u062D'; 23468 t['\uFC4D'] = '\u0646\u062E'; 23469 t['\uFC4E'] = '\u0646\u0645'; 23470 t['\uFC4F'] = '\u0646\u0649'; 23471 t['\uFC50'] = '\u0646\u064A'; 23472 t['\uFC51'] = '\u0647\u062C'; 23473 t['\uFC52'] = '\u0647\u0645'; 23474 t['\uFC53'] = '\u0647\u0649'; 23475 t['\uFC54'] = '\u0647\u064A'; 23476 t['\uFC55'] = '\u064A\u062C'; 23477 t['\uFC56'] = '\u064A\u062D'; 23478 t['\uFC57'] = '\u064A\u062E'; 23479 t['\uFC58'] = '\u064A\u0645'; 23480 t['\uFC59'] = '\u064A\u0649'; 23481 t['\uFC5A'] = '\u064A\u064A'; 23482 t['\uFC5B'] = '\u0630\u0670'; 23483 t['\uFC5C'] = '\u0631\u0670'; 23484 t['\uFC5D'] = '\u0649\u0670'; 23485 t['\uFC5E'] = '\u0020\u064C\u0651'; 23486 t['\uFC5F'] = '\u0020\u064D\u0651'; 23487 t['\uFC60'] = '\u0020\u064E\u0651'; 23488 t['\uFC61'] = '\u0020\u064F\u0651'; 23489 t['\uFC62'] = '\u0020\u0650\u0651'; 23490 t['\uFC63'] = '\u0020\u0651\u0670'; 23491 t['\uFC64'] = '\u0626\u0631'; 23492 t['\uFC65'] = '\u0626\u0632'; 23493 t['\uFC66'] = '\u0626\u0645'; 23494 t['\uFC67'] = '\u0626\u0646'; 23495 t['\uFC68'] = '\u0626\u0649'; 23496 t['\uFC69'] = '\u0626\u064A'; 23497 t['\uFC6A'] = '\u0628\u0631'; 23498 t['\uFC6B'] = '\u0628\u0632'; 23499 t['\uFC6C'] = '\u0628\u0645'; 23500 t['\uFC6D'] = '\u0628\u0646'; 23501 t['\uFC6E'] = '\u0628\u0649'; 23502 t['\uFC6F'] = '\u0628\u064A'; 23503 t['\uFC70'] = '\u062A\u0631'; 23504 t['\uFC71'] = '\u062A\u0632'; 23505 t['\uFC72'] = '\u062A\u0645'; 23506 t['\uFC73'] = '\u062A\u0646'; 23507 t['\uFC74'] = '\u062A\u0649'; 23508 t['\uFC75'] = '\u062A\u064A'; 23509 t['\uFC76'] = '\u062B\u0631'; 23510 t['\uFC77'] = '\u062B\u0632'; 23511 t['\uFC78'] = '\u062B\u0645'; 23512 t['\uFC79'] = '\u062B\u0646'; 23513 t['\uFC7A'] = '\u062B\u0649'; 23514 t['\uFC7B'] = '\u062B\u064A'; 23515 t['\uFC7C'] = '\u0641\u0649'; 23516 t['\uFC7D'] = '\u0641\u064A'; 23517 t['\uFC7E'] = '\u0642\u0649'; 23518 t['\uFC7F'] = '\u0642\u064A'; 23519 t['\uFC80'] = '\u0643\u0627'; 23520 t['\uFC81'] = '\u0643\u0644'; 23521 t['\uFC82'] = '\u0643\u0645'; 23522 t['\uFC83'] = '\u0643\u0649'; 23523 t['\uFC84'] = '\u0643\u064A'; 23524 t['\uFC85'] = '\u0644\u0645'; 23525 t['\uFC86'] = '\u0644\u0649'; 23526 t['\uFC87'] = '\u0644\u064A'; 23527 t['\uFC88'] = '\u0645\u0627'; 23528 t['\uFC89'] = '\u0645\u0645'; 23529 t['\uFC8A'] = '\u0646\u0631'; 23530 t['\uFC8B'] = '\u0646\u0632'; 23531 t['\uFC8C'] = '\u0646\u0645'; 23532 t['\uFC8D'] = '\u0646\u0646'; 23533 t['\uFC8E'] = '\u0646\u0649'; 23534 t['\uFC8F'] = '\u0646\u064A'; 23535 t['\uFC90'] = '\u0649\u0670'; 23536 t['\uFC91'] = '\u064A\u0631'; 23537 t['\uFC92'] = '\u064A\u0632'; 23538 t['\uFC93'] = '\u064A\u0645'; 23539 t['\uFC94'] = '\u064A\u0646'; 23540 t['\uFC95'] = '\u064A\u0649'; 23541 t['\uFC96'] = '\u064A\u064A'; 23542 t['\uFC97'] = '\u0626\u062C'; 23543 t['\uFC98'] = '\u0626\u062D'; 23544 t['\uFC99'] = '\u0626\u062E'; 23545 t['\uFC9A'] = '\u0626\u0645'; 23546 t['\uFC9B'] = '\u0626\u0647'; 23547 t['\uFC9C'] = '\u0628\u062C'; 23548 t['\uFC9D'] = '\u0628\u062D'; 23549 t['\uFC9E'] = '\u0628\u062E'; 23550 t['\uFC9F'] = '\u0628\u0645'; 23551 t['\uFCA0'] = '\u0628\u0647'; 23552 t['\uFCA1'] = '\u062A\u062C'; 23553 t['\uFCA2'] = '\u062A\u062D'; 23554 t['\uFCA3'] = '\u062A\u062E'; 23555 t['\uFCA4'] = '\u062A\u0645'; 23556 t['\uFCA5'] = '\u062A\u0647'; 23557 t['\uFCA6'] = '\u062B\u0645'; 23558 t['\uFCA7'] = '\u062C\u062D'; 23559 t['\uFCA8'] = '\u062C\u0645'; 23560 t['\uFCA9'] = '\u062D\u062C'; 23561 t['\uFCAA'] = '\u062D\u0645'; 23562 t['\uFCAB'] = '\u062E\u062C'; 23563 t['\uFCAC'] = '\u062E\u0645'; 23564 t['\uFCAD'] = '\u0633\u062C'; 23565 t['\uFCAE'] = '\u0633\u062D'; 23566 t['\uFCAF'] = '\u0633\u062E'; 23567 t['\uFCB0'] = '\u0633\u0645'; 23568 t['\uFCB1'] = '\u0635\u062D'; 23569 t['\uFCB2'] = '\u0635\u062E'; 23570 t['\uFCB3'] = '\u0635\u0645'; 23571 t['\uFCB4'] = '\u0636\u062C'; 23572 t['\uFCB5'] = '\u0636\u062D'; 23573 t['\uFCB6'] = '\u0636\u062E'; 23574 t['\uFCB7'] = '\u0636\u0645'; 23575 t['\uFCB8'] = '\u0637\u062D'; 23576 t['\uFCB9'] = '\u0638\u0645'; 23577 t['\uFCBA'] = '\u0639\u062C'; 23578 t['\uFCBB'] = '\u0639\u0645'; 23579 t['\uFCBC'] = '\u063A\u062C'; 23580 t['\uFCBD'] = '\u063A\u0645'; 23581 t['\uFCBE'] = '\u0641\u062C'; 23582 t['\uFCBF'] = '\u0641\u062D'; 23583 t['\uFCC0'] = '\u0641\u062E'; 23584 t['\uFCC1'] = '\u0641\u0645'; 23585 t['\uFCC2'] = '\u0642\u062D'; 23586 t['\uFCC3'] = '\u0642\u0645'; 23587 t['\uFCC4'] = '\u0643\u062C'; 23588 t['\uFCC5'] = '\u0643\u062D'; 23589 t['\uFCC6'] = '\u0643\u062E'; 23590 t['\uFCC7'] = '\u0643\u0644'; 23591 t['\uFCC8'] = '\u0643\u0645'; 23592 t['\uFCC9'] = '\u0644\u062C'; 23593 t['\uFCCA'] = '\u0644\u062D'; 23594 t['\uFCCB'] = '\u0644\u062E'; 23595 t['\uFCCC'] = '\u0644\u0645'; 23596 t['\uFCCD'] = '\u0644\u0647'; 23597 t['\uFCCE'] = '\u0645\u062C'; 23598 t['\uFCCF'] = '\u0645\u062D'; 23599 t['\uFCD0'] = '\u0645\u062E'; 23600 t['\uFCD1'] = '\u0645\u0645'; 23601 t['\uFCD2'] = '\u0646\u062C'; 23602 t['\uFCD3'] = '\u0646\u062D'; 23603 t['\uFCD4'] = '\u0646\u062E'; 23604 t['\uFCD5'] = '\u0646\u0645'; 23605 t['\uFCD6'] = '\u0646\u0647'; 23606 t['\uFCD7'] = '\u0647\u062C'; 23607 t['\uFCD8'] = '\u0647\u0645'; 23608 t['\uFCD9'] = '\u0647\u0670'; 23609 t['\uFCDA'] = '\u064A\u062C'; 23610 t['\uFCDB'] = '\u064A\u062D'; 23611 t['\uFCDC'] = '\u064A\u062E'; 23612 t['\uFCDD'] = '\u064A\u0645'; 23613 t['\uFCDE'] = '\u064A\u0647'; 23614 t['\uFCDF'] = '\u0626\u0645';
23615 t['\uFCE0'] = '\u0626\u0647'; 23616 t['\uFCE1'] = '\u0628\u0645'; 23617 t['\uFCE2'] = '\u0628\u0647'; 23618 t['\uFCE3'] = '\u062A\u0645'; 23619 t['\uFCE4'] = '\u062A\u0647'; 23620 t['\uFCE5'] = '\u062B\u0645'; 23621 t['\uFCE6'] = '\u062B\u0647'; 23622 t['\uFCE7'] = '\u0633\u0645'; 23623 t['\uFCE8'] = '\u0633\u0647'; 23624 t['\uFCE9'] = '\u0634\u0645'; 23625 t['\uFCEA'] = '\u0634\u0647'; 23626 t['\uFCEB'] = '\u0643\u0644'; 23627 t['\uFCEC'] = '\u0643\u0645'; 23628 t['\uFCED'] = '\u0644\u0645'; 23629 t['\uFCEE'] = '\u0646\u0645'; 23630 t['\uFCEF'] = '\u0646\u0647'; 23631 t['\uFCF0'] = '\u064A\u0645'; 23632 t['\uFCF1'] = '\u064A\u0647'; 23633 t['\uFCF2'] = '\u0640\u064E\u0651'; 23634 t['\uFCF3'] = '\u0640\u064F\u0651'; 23635 t['\uFCF4'] = '\u0640\u0650\u0651'; 23636 t['\uFCF5'] = '\u0637\u0649'; 23637 t['\uFCF6'] = '\u0637\u064A'; 23638 t['\uFCF7'] = '\u0639\u0649'; 23639 t['\uFCF8'] = '\u0639\u064A'; 23640 t['\uFCF9'] = '\u063A\u0649'; 23641 t['\uFCFA'] = '\u063A\u064A'; 23642 t['\uFCFB'] = '\u0633\u0649'; 23643 t['\uFCFC'] = '\u0633\u064A'; 23644 t['\uFCFD'] = '\u0634\u0649'; 23645 t['\uFCFE'] = '\u0634\u064A'; 23646 t['\uFCFF'] = '\u062D\u0649'; 23647 t['\uFD00'] = '\u062D\u064A'; 23648 t['\uFD01'] = '\u062C\u0649'; 23649 t['\uFD02'] = '\u062C\u064A'; 23650 t['\uFD03'] = '\u062E\u0649'; 23651 t['\uFD04'] = '\u062E\u064A'; 23652 t['\uFD05'] = '\u0635\u0649'; 23653 t['\uFD06'] = '\u0635\u064A'; 23654 t['\uFD07'] = '\u0636\u0649'; 23655 t['\uFD08'] = '\u0636\u064A'; 23656 t['\uFD09'] = '\u0634\u062C'; 23657 t['\uFD0A'] = '\u0634\u062D'; 23658 t['\uFD0B'] = '\u0634\u062E'; 23659 t['\uFD0C'] = '\u0634\u0645'; 23660 t['\uFD0D'] = '\u0634\u0631'; 23661 t['\uFD0E'] = '\u0633\u0631'; 23662 t['\uFD0F'] = '\u0635\u0631'; 23663 t['\uFD10'] = '\u0636\u0631'; 23664 t['\uFD11'] = '\u0637\u0649'; 23665 t['\uFD12'] = '\u0637\u064A'; 23666 t['\uFD13'] = '\u0639\u0649'; 23667 t['\uFD14'] = '\u0639\u064A'; 23668 t['\uFD15'] = '\u063A\u0649'; 23669 t['\uFD16'] = '\u063A\u064A'; 23670 t['\uFD17'] = '\u0633\u0649'; 23671 t['\uFD18'] = '\u0633\u064A'; 23672 t['\uFD19'] = '\u0634\u0649'; 23673 t['\uFD1A'] = '\u0634\u064A'; 23674 t['\uFD1B'] = '\u062D\u0649'; 23675 t['\uFD1C'] = '\u062D\u064A'; 23676 t['\uFD1D'] = '\u062C\u0649'; 23677 t['\uFD1E'] = '\u062C\u064A'; 23678 t['\uFD1F'] = '\u062E\u0649'; 23679 t['\uFD20'] = '\u062E\u064A'; 23680 t['\uFD21'] = '\u0635\u0649'; 23681 t['\uFD22'] = '\u0635\u064A'; 23682 t['\uFD23'] = '\u0636\u0649'; 23683 t['\uFD24'] = '\u0636\u064A'; 23684 t['\uFD25'] = '\u0634\u062C'; 23685 t['\uFD26'] = '\u0634\u062D'; 23686 t['\uFD27'] = '\u0634\u062E'; 23687 t['\uFD28'] = '\u0634\u0645'; 23688 t['\uFD29'] = '\u0634\u0631'; 23689 t['\uFD2A'] = '\u0633\u0631'; 23690 t['\uFD2B'] = '\u0635\u0631'; 23691 t['\uFD2C'] = '\u0636\u0631'; 23692 t['\uFD2D'] = '\u0634\u062C'; 23693 t['\uFD2E'] = '\u0634\u062D'; 23694 t['\uFD2F'] = '\u0634\u062E'; 23695 t['\uFD30'] = '\u0634\u0645'; 23696 t['\uFD31'] = '\u0633\u0647'; 23697 t['\uFD32'] = '\u0634\u0647'; 23698 t['\uFD33'] = '\u0637\u0645'; 23699 t['\uFD34'] = '\u0633\u062C'; 23700 t['\uFD35'] = '\u0633\u062D'; 23701 t['\uFD36'] = '\u0633\u062E'; 23702 t['\uFD37'] = '\u0634\u062C'; 23703 t['\uFD38'] = '\u0634\u062D'; 23704 t['\uFD39'] = '\u0634\u062E'; 23705 t['\uFD3A'] = '\u0637\u0645'; 23706 t['\uFD3B'] = '\u0638\u0645'; 23707 t['\uFD3C'] = '\u0627\u064B'; 23708 t['\uFD3D'] = '\u0627\u064B'; 23709 t['\uFD50'] = '\u062A\u062C\u0645'; 23710 t['\uFD51'] = '\u062A\u062D\u062C'; 23711 t['\uFD52'] = '\u062A\u062D\u062C'; 23712 t['\uFD53'] = '\u062A\u062D\u0645'; 23713 t['\uFD54'] = '\u062A\u062E\u0645'; 23714 t['\uFD55'] = '\u062A\u0645\u062C'; 23715 t['\uFD56'] = '\u062A\u0645\u062D'; 23716 t['\uFD57'] = '\u062A\u0645\u062E'; 23717 t['\uFD58'] = '\u062C\u0645\u062D'; 23718 t['\uFD59'] = '\u062C\u0645\u062D'; 23719 t['\uFD5A'] = '\u062D\u0645\u064A'; 23720 t['\uFD5B'] = '\u062D\u0645\u0649'; 23721 t['\uFD5C'] = '\u0633\u062D\u062C'; 23722 t['\uFD5D'] = '\u0633\u062C\u062D'; 23723 t['\uFD5E'] = '\u0633\u062C\u0649'; 23724 t['\uFD5F'] = '\u0633\u0645\u062D'; 23725 t['\uFD60'] = '\u0633\u0645\u062D'; 23726 t['\uFD61'] = '\u0633\u0645\u062C'; 23727 t['\uFD62'] = '\u0633\u0645\u0645'; 23728 t['\uFD63'] = '\u0633\u0645\u0645'; 23729 t['\uFD64'] = '\u0635\u062D\u062D'; 23730 t['\uFD65'] = '\u0635\u062D\u062D'; 23731 t['\uFD66'] = '\u0635\u0645\u0645'; 23732 t['\uFD67'] = '\u0634\u062D\u0645'; 23733 t['\uFD68'] = '\u0634\u062D\u0645'; 23734 t['\uFD69'] = '\u0634\u062C\u064A'; 23735 t['\uFD6A'] = '\u0634\u0645\u062E'; 23736 t['\uFD6B'] = '\u0634\u0645\u062E'; 23737 t['\uFD6C'] = '\u0634\u0645\u0645'; 23738 t['\uFD6D'] = '\u0634\u0645\u0645'; 23739 t['\uFD6E'] = '\u0636\u062D\u0649'; 23740 t['\uFD6F'] = '\u0636\u062E\u0645'; 23741 t['\uFD70'] = '\u0636\u062E\u0645'; 23742 t['\uFD71'] = '\u0637\u0645\u062D'; 23743 t['\uFD72'] = '\u0637\u0645\u062D'; 23744 t['\uFD73'] = '\u0637\u0645\u0645'; 23745 t['\uFD74'] = '\u0637\u0645\u064A'; 23746 t['\uFD75'] = '\u0639\u062C\u0645'; 23747 t['\uFD76'] = '\u0639\u0645\u0645'; 23748 t['\uFD77'] = '\u0639\u0645\u0645'; 23749 t['\uFD78'] = '\u0639\u0645\u0649'; 23750 t['\uFD79'] = '\u063A\u0645\u0645'; 23751 t['\uFD7A'] = '\u063A\u0645\u064A'; 23752 t['\uFD7B'] = '\u063A\u0645\u0649'; 23753 t['\uFD7C'] = '\u0641\u062E\u0645'; 23754 t['\uFD7D'] = '\u0641\u062E\u0645'; 23755 t['\uFD7E'] = '\u0642\u0645\u062D'; 23756 t['\uFD7F'] = '\u0642\u0645\u0645'; 23757 t['\uFD80'] = '\u0644\u062D\u0645'; 23758 t['\uFD81'] = '\u0644\u062D\u064A'; 23759 t['\uFD82'] = '\u0644\u062D\u0649'; 23760 t['\uFD83'] = '\u0644\u062C\u062C'; 23761 t['\uFD84'] = '\u0644\u062C\u062C'; 23762 t['\uFD85'] = '\u0644\u062E\u0645'; 23763 t['\uFD86'] = '\u0644\u062E\u0645'; 23764 t['\uFD87'] = '\u0644\u0645\u062D'; 23765 t['\uFD88'] = '\u0644\u0645\u062D'; 23766 t['\uFD89'] = '\u0645\u062D\u062C'; 23767 t['\uFD8A'] = '\u0645\u062D\u0645'; 23768 t['\uFD8B'] = '\u0645\u062D\u064A'; 23769 t['\uFD8C'] = '\u0645\u062C\u062D'; 23770 t['\uFD8D'] = '\u0645\u062C\u0645'; 23771 t['\uFD8E'] = '\u0645\u062E\u062C'; 23772 t['\uFD8F'] = '\u0645\u062E\u0645'; 23773 t['\uFD92'] = '\u0645\u062C\u062E'; 23774 t['\uFD93'] = '\u0647\u0645\u062C'; 23775 t['\uFD94'] = '\u0647\u0645\u0645'; 23776 t['\uFD95'] = '\u0646\u062D\u0645'; 23777 t['\uFD96'] = '\u0646\u062D\u0649'; 23778 t['\uFD97'] = '\u0646\u062C\u0645'; 23779 t['\uFD98'] = '\u0646\u062C\u0645'; 23780 t['\uFD99'] = '\u0646\u062C\u0649'; 23781 t['\uFD9A'] = '\u0646\u0645\u064A'; 23782 t['\uFD9B'] = '\u0646\u0645\u0649'; 23783 t['\uFD9C'] = '\u064A\u0645\u0645'; 23784 t['\uFD9D'] = '\u064A\u0645\u0645'; 23785 t['\uFD9E'] = '\u0628\u062E\u064A'; 23786 t['\uFD9F'] = '\u062A\u062C\u064A'; 23787 t['\uFDA0'] = '\u062A\u062C\u0649'; 23788 t['\uFDA1'] = '\u062A\u062E\u064A'; 23789 t['\uFDA2'] = '\u062A\u062E\u0649'; 23790 t['\uFDA3'] = '\u062A\u0645\u064A'; 23791 t['\uFDA4'] = '\u062A\u0645\u0649'; 23792 t['\uFDA5'] = '\u062C\u0645\u064A'; 23793 t['\uFDA6'] = '\u062C\u062D\u0649'; 23794 t['\uFDA7'] = '\u062C\u0645\u0649'; 23795 t['\uFDA8'] = '\u0633\u062E\u0649'; 23796 t['\uFDA9'] = '\u0635\u062D\u064A'; 23797 t['\uFDAA'] = '\u0634\u062D\u064A'; 23798 t['\uFDAB'] = '\u0636\u062D\u064A'; 23799 t['\uFDAC'] = '\u0644\u062C\u064A'; 23800 t['\uFDAD'] = '\u0644\u0645\u064A'; 23801 t['\uFDAE'] = '\u064A\u062D\u064A'; 23802 t['\uFDAF'] = '\u064A\u062C\u064A'; 23803 t['\uFDB0'] = '\u064A\u0645\u064A'; 23804 t['\uFDB1'] = '\u0645\u0645\u064A'; 23805 t['\uFDB2'] = '\u0642\u0645\u064A'; 23806 t['\uFDB3'] = '\u0646\u062D\u064A'; 23807 t['\uFDB4'] = '\u0642\u0645\u062D'; 23808 t['\uFDB5'] = '\u0644\u062D\u0645'; 23809 t['\uFDB6'] = '\u0639\u0645\u064A'; 23810 t['\uFDB7'] = '\u0643\u0645\u064A'; 23811 t['\uFDB8'] = '\u0646\u062C\u062D'; 23812 t['\uFDB9'] = '\u0645\u062E\u064A'; 23813 t['\uFDBA'] = '\u0644\u062C\u0645'; 23814 t['\uFDBB'] = '\u0643\u0645\u0645'; 23815 t['\uFDBC'] = '\u0644\u062C\u0645'; 23816 t['\uFDBD'] = '\u0646\u062C\u062D'; 23817 t['\uFDBE'] = '\u062C\u062D\u064A'; 23818 t['\uFDBF'] = '\u062D\u062C\u064A'; 23819 t['\uFDC0'] = '\u0645\u062C\u064A'; 23820 t['\uFDC1'] = '\u0641\u0645\u064A'; 23821 t['\uFDC2'] = '\u0628\u062D\u064A'; 23822 t['\uFDC3'] = '\u0643\u0645\u0645'; 23823 t['\uFDC4'] = '\u0639\u062C\u0645'; 23824 t['\uFDC5'] = '\u0635\u0645\u0645'; 23825 t['\uFDC6'] = '\u0633\u062E\u064A'; 23826 t['\uFDC7'] = '\u0646\u062C\u064A'; 23827 t['\uFE49'] = '\u203E'; 23828 t['\uFE4A'] = '\u203E';
23829 t['\uFE4B'] = '\u203E'; 23830 t['\uFE4C'] = '\u203E'; 23831 t['\uFE4D'] = '\u005F'; 23832 t['\uFE4E'] = '\u005F'; 23833 t['\uFE4F'] = '\u005F'; 23834 t['\uFE80'] = '\u0621'; 23835 t['\uFE81'] = '\u0622'; 23836 t['\uFE82'] = '\u0622'; 23837 t['\uFE83'] = '\u0623'; 23838 t['\uFE84'] = '\u0623'; 23839 t['\uFE85'] = '\u0624'; 23840 t['\uFE86'] = '\u0624'; 23841 t['\uFE87'] = '\u0625'; 23842 t['\uFE88'] = '\u0625'; 23843 t['\uFE89'] = '\u0626'; 23844 t['\uFE8A'] = '\u0626'; 23845 t['\uFE8B'] = '\u0626'; 23846 t['\uFE8C'] = '\u0626'; 23847 t['\uFE8D'] = '\u0627'; 23848 t['\uFE8E'] = '\u0627'; 23849 t['\uFE8F'] = '\u0628'; 23850 t['\uFE90'] = '\u0628'; 23851 t['\uFE91'] = '\u0628'; 23852 t['\uFE92'] = '\u0628'; 23853 t['\uFE93'] = '\u0629'; 23854 t['\uFE94'] = '\u0629'; 23855 t['\uFE95'] = '\u062A'; 23856 t['\uFE96'] = '\u062A'; 23857 t['\uFE97'] = '\u062A'; 23858 t['\uFE98'] = '\u062A'; 23859 t['\uFE99'] = '\u062B'; 23860 t['\uFE9A'] = '\u062B'; 23861 t['\uFE9B'] = '\u062B'; 23862 t['\uFE9C'] = '\u062B'; 23863 t['\uFE9D'] = '\u062C'; 23864 t['\uFE9E'] = '\u062C'; 23865 t['\uFE9F'] = '\u062C'; 23866 t['\uFEA0'] = '\u062C'; 23867 t['\uFEA1'] = '\u062D'; 23868 t['\uFEA2'] = '\u062D'; 23869 t['\uFEA3'] = '\u062D'; 23870 t['\uFEA4'] = '\u062D'; 23871 t['\uFEA5'] = '\u062E'; 23872 t['\uFEA6'] = '\u062E'; 23873 t['\uFEA7'] = '\u062E'; 23874 t['\uFEA8'] = '\u062E'; 23875 t['\uFEA9'] = '\u062F'; 23876 t['\uFEAA'] = '\u062F'; 23877 t['\uFEAB'] = '\u0630'; 23878 t['\uFEAC'] = '\u0630'; 23879 t['\uFEAD'] = '\u0631'; 23880 t['\uFEAE'] = '\u0631'; 23881 t['\uFEAF'] = '\u0632'; 23882 t['\uFEB0'] = '\u0632'; 23883 t['\uFEB1'] = '\u0633'; 23884 t['\uFEB2'] = '\u0633'; 23885 t['\uFEB3'] = '\u0633'; 23886 t['\uFEB4'] = '\u0633'; 23887 t['\uFEB5'] = '\u0634'; 23888 t['\uFEB6'] = '\u0634'; 23889 t['\uFEB7'] = '\u0634'; 23890 t['\uFEB8'] = '\u0634'; 23891 t['\uFEB9'] = '\u0635'; 23892 t['\uFEBA'] = '\u0635'; 23893 t['\uFEBB'] = '\u0635'; 23894 t['\uFEBC'] = '\u0635'; 23895 t['\uFEBD'] = '\u0636'; 23896 t['\uFEBE'] = '\u0636'; 23897 t['\uFEBF'] = '\u0636'; 23898 t['\uFEC0'] = '\u0636'; 23899 t['\uFEC1'] = '\u0637'; 23900 t['\uFEC2'] = '\u0637'; 23901 t['\uFEC3'] = '\u0637'; 23902 t['\uFEC4'] = '\u0637'; 23903 t['\uFEC5'] = '\u0638'; 23904 t['\uFEC6'] = '\u0638'; 23905 t['\uFEC7'] = '\u0638'; 23906 t['\uFEC8'] = '\u0638'; 23907 t['\uFEC9'] = '\u0639'; 23908 t['\uFECA'] = '\u0639'; 23909 t['\uFECB'] = '\u0639'; 23910 t['\uFECC'] = '\u0639'; 23911 t['\uFECD'] = '\u063A'; 23912 t['\uFECE'] = '\u063A'; 23913 t['\uFECF'] = '\u063A'; 23914 t['\uFED0'] = '\u063A'; 23915 t['\uFED1'] = '\u0641'; 23916 t['\uFED2'] = '\u0641'; 23917 t['\uFED3'] = '\u0641'; 23918 t['\uFED4'] = '\u0641'; 23919 t['\uFED5'] = '\u0642'; 23920 t['\uFED6'] = '\u0642'; 23921 t['\uFED7'] = '\u0642'; 23922 t['\uFED8'] = '\u0642'; 23923 t['\uFED9'] = '\u0643'; 23924 t['\uFEDA'] = '\u0643'; 23925 t['\uFEDB'] = '\u0643'; 23926 t['\uFEDC'] = '\u0643'; 23927 t['\uFEDD'] = '\u0644'; 23928 t['\uFEDE'] = '\u0644'; 23929 t['\uFEDF'] = '\u0644'; 23930 t['\uFEE0'] = '\u0644'; 23931 t['\uFEE1'] = '\u0645'; 23932 t['\uFEE2'] = '\u0645'; 23933 t['\uFEE3'] = '\u0645'; 23934 t['\uFEE4'] = '\u0645'; 23935 t['\uFEE5'] = '\u0646'; 23936 t['\uFEE6'] = '\u0646'; 23937 t['\uFEE7'] = '\u0646'; 23938 t['\uFEE8'] = '\u0646'; 23939 t['\uFEE9'] = '\u0647'; 23940 t['\uFEEA'] = '\u0647'; 23941 t['\uFEEB'] = '\u0647'; 23942 t['\uFEEC'] = '\u0647'; 23943 t['\uFEED'] = '\u0648'; 23944 t['\uFEEE'] = '\u0648'; 23945 t['\uFEEF'] = '\u0649'; 23946 t['\uFEF0'] = '\u0649'; 23947 t['\uFEF1'] = '\u064A'; 23948 t['\uFEF2'] = '\u064A'; 23949 t['\uFEF3'] = '\u064A'; 23950 t['\uFEF4'] = '\u064A'; 23951 t['\uFEF5'] = '\u0644\u0622'; 23952 t['\uFEF6'] = '\u0644\u0622'; 23953 t['\uFEF7'] = '\u0644\u0623'; 23954 t['\uFEF8'] = '\u0644\u0623'; 23955 t['\uFEF9'] = '\u0644\u0625'; 23956 t['\uFEFA'] = '\u0644\u0625'; 23957 t['\uFEFB'] = '\u0644\u0627'; 23958 t['\uFEFC'] = '\u0644\u0627'; 23959}); 23960function reverseIfRtl(chars) { 23961 var charsLength = chars.length; 23962 if (charsLength <= 1 || !isRTLRangeFor(chars.charCodeAt(0))) { 23963 return chars; 23964 } 23965 var s = ''; 23966 for (var ii = charsLength - 1; ii >= 0; ii--) { 23967 s += chars[ii]; 23968 } 23969 return s; 23970} 23971exports.mapSpecialUnicodeValues = mapSpecialUnicodeValues; 23972exports.reverseIfRtl = reverseIfRtl; 23973exports.getUnicodeRangeFor = getUnicodeRangeFor; 23974exports.getNormalizedUnicodes = getNormalizedUnicodes; 23975exports.getUnicodeForGlyph = getUnicodeForGlyph; 23976 23977/***/ }), 23978/* 71 */ 23979/***/ (function(module, exports, __w_pdfjs_require__) { 23980 23981"use strict"; 23982 23983 23984Object.defineProperty(exports, "__esModule", { 23985 value: true 23986}); 23987exports.PostScriptCompiler = exports.PostScriptEvaluator = exports.PDFFunctionFactory = exports.isPDFFunction = undefined; 23988 23989var _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; }; 23990 23991var _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; }; }(); 23992 23993var _util = __w_pdfjs_require__(0); 23994 23995var _primitives = __w_pdfjs_require__(2); 23996 23997var _ps_parser = __w_pdfjs_require__(121); 23998 23999function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 24000 24001var IsEvalSupportedCached = { 24002 get value() { 24003 return (0, _util.shadow)(this, 'value', (0, _util.isEvalSupported)()); 24004 } 24005}; 24006 24007var PDFFunctionFactory = function () { 24008 function PDFFunctionFactory(_ref) { 24009 var xref = _ref.xref, 24010 _ref$isEvalSupported = _ref.isEvalSupported, 24011 isEvalSupported = _ref$isEvalSupported === undefined ? true : _ref$isEvalSupported; 24012 24013 _classCallCheck(this, PDFFunctionFactory); 24014 24015 this.xref = xref; 24016 this.isEvalSupported = isEvalSupported !== false; 24017 } 24018 24019 _createClass(PDFFunctionFactory, [{ 24020 key: 'create', 24021 value: function create(fn) { 24022 return PDFFunction.parse({ 24023 xref: this.xref, 24024 isEvalSupported: this.isEvalSupported, 24025 fn: fn 24026 }); 24027 } 24028 }, { 24029 key: 'createFromArray', 24030 value: function createFromArray(fnObj) { 24031 return PDFFunction.parseArray({ 24032 xref: this.xref, 24033 isEvalSupported: this.isEvalSupported, 24034 fnObj: fnObj 24035 }); 24036 } 24037 }, { 24038 key: 'createFromIR', 24039 value: function createFromIR(IR) { 24040 return PDFFunction.fromIR({ 24041 xref: this.xref, 24042 isEvalSupported: this.isEvalSupported, 24043 IR: IR 24044 }); 24045 } 24046 }, { 24047 key: 'createIR', 24048 value: function createIR(fn) { 24049 return PDFFunction.getIR({ 24050 xref: this.xref, 24051 isEvalSupported: this.isEvalSupported, 24052 fn: fn 24053 }); 24054 } 24055 }]); 24056 24057 return PDFFunctionFactory; 24058}(); 24059 24060var PDFFunction = function PDFFunctionClosure() { 24061 var CONSTRUCT_SAMPLED = 0; 24062 var CONSTRUCT_INTERPOLATED = 2; 24063 var CONSTRUCT_STICHED = 3; 24064 var CONSTRUCT_POSTSCRIPT = 4; 24065 return { 24066 getSampleArray: function getSampleArray(size, outputSize, bps, stream) { 24067 var i, ii; 24068 var length = 1; 24069 for (i = 0, ii = size.length; i < ii; i++) { 24070 length *= size[i]; 24071 } 24072 length *= outputSize; 24073 var array = new Array(length); 24074 var codeSize = 0; 24075 var codeBuf = 0; 24076 var sampleMul = 1.0 / (Math.pow(2.0, bps) - 1); 24077 var strBytes = stream.getBytes((length * bps + 7) / 8); 24078 var strIdx = 0; 24079 for (i = 0; i < length; i++) { 24080 while (codeSize < bps) { 24081 codeBuf <<= 8; 24082 codeBuf |= strBytes[strIdx++]; 24083 codeSize += 8; 24084 } 24085 codeSize -= bps; 24086 array[i] = (codeBuf >> codeSize) * sampleMul; 24087 codeBuf &= (1 << codeSize) - 1; 24088 } 24089 return array; 24090 }, 24091 getIR: function getIR(_ref2) { 24092 var xref = _ref2.xref, 24093 isEvalSupported = _ref2.isEvalSupported, 24094 fn = _ref2.fn; 24095 24096 var dict = fn.dict; 24097 if (!dict) { 24098 dict = fn; 24099 } 24100 var types = [this.constructSampled, null, this.constructInterpolated, this.constructStiched, this.constructPostScript]; 24101 var typeNum = dict.get('FunctionType'); 24102 var typeFn = types[typeNum]; 24103 if (!typeFn) { 24104 throw new _util.FormatError('Unknown type of function'); 24105 } 24106 return typeFn.call(this, { 24107 xref: xref, 24108 isEvalSupported: isEvalSupported, 24109 fn: fn, 24110 dict: dict 24111 }); 24112 }, 24113 fromIR: function fromIR(_ref3) { 24114 var xref = _ref3.xref, 24115 isEvalSupported = _ref3.isEvalSupported, 24116 IR = _ref3.IR; 24117 24118 var type = IR[0]; 24119 switch (type) { 24120 case CONSTRUCT_SAMPLED: 24121 return this.constructSampledFromIR({ 24122 xref: xref, 24123 isEvalSupported: isEvalSupported, 24124 IR: IR 24125 }); 24126 case CONSTRUCT_INTERPOLATED: 24127 return this.constructInterpolatedFromIR({ 24128 xref: xref, 24129 isEvalSupported: isEvalSupported, 24130 IR: IR 24131 }); 24132 case CONSTRUCT_STICHED: 24133 return this.constructStichedFromIR({ 24134 xref: xref, 24135 isEvalSupported: isEvalSupported, 24136 IR: IR 24137 }); 24138 default: 24139 return this.constructPostScriptFromIR({ 24140 xref: xref, 24141 isEvalSupported: isEvalSupported, 24142 IR: IR 24143 }); 24144 } 24145 }, 24146 parse: function parse(_ref4) { 24147 var xref = _ref4.xref, 24148 isEvalSupported = _ref4.isEvalSupported, 24149 fn = _ref4.fn; 24150 24151 var IR = this.getIR({ 24152 xref: xref, 24153 isEvalSupported: isEvalSupported, 24154 fn: fn 24155 }); 24156 return this.fromIR({ 24157 xref: xref, 24158 isEvalSupported: isEvalSupported, 24159 IR: IR 24160 }); 24161 }, 24162 parseArray: function parseArray(_ref5) { 24163 var xref = _ref5.xref, 24164 isEvalSupported = _ref5.isEvalSupported, 24165 fnObj = _ref5.fnObj; 24166 24167 if (!Array.isArray(fnObj)) { 24168 return this.parse({ 24169 xref: xref, 24170 isEvalSupported: isEvalSupported, 24171 fn: fnObj 24172 }); 24173 } 24174 var fnArray = []; 24175 for (var j = 0, jj = fnObj.length; j < jj; j++) { 24176 fnArray.push(this.parse({ 24177 xref: xref, 24178 isEvalSupported: isEvalSupported, 24179 fn: xref.fetchIfRef(fnObj[j]) 24180 })); 24181 }
vendor: 4,969 bytes, lines 24182-24325
24182 return function (src, srcOffset, dest, destOffset) { 24183 for (var i = 0, ii = fnArray.length; i < ii; i++) { 24184 fnArray[i](src, srcOffset, dest, destOffset + i); 24185 } 24186 }; 24187 }, 24188 constructSampled: function constructSampled(_ref6) { 24189 var xref = _ref6.xref, 24190 isEvalSupported = _ref6.isEvalSupported, 24191 fn = _ref6.fn, 24192 dict = _ref6.dict; 24193 24194 function toMultiArray(arr) { 24195 var inputLength = arr.length; 24196 var out = []; 24197 var index = 0; 24198 for (var i = 0; i < inputLength; i += 2) { 24199 out[index] = [arr[i], arr[i + 1]]; 24200 ++index; 24201 } 24202 return out; 24203 } 24204 var domain = dict.getArray('Domain'); 24205 var range = dict.getArray('Range'); 24206 if (!domain || !range) { 24207 throw new _util.FormatError('No domain or range'); 24208 } 24209 var inputSize = domain.length / 2; 24210 var outputSize = range.length / 2; 24211 domain = toMultiArray(domain); 24212 range = toMultiArray(range); 24213 var size = dict.get('Size'); 24214 var bps = dict.get('BitsPerSample'); 24215 var order = dict.get('Order') || 1; 24216 if (order !== 1) { 24217 (0, _util.info)('No support for cubic spline interpolation: ' + order); 24218 } 24219 var encode = dict.getArray('Encode'); 24220 if (!encode) { 24221 encode = []; 24222 for (var i = 0; i < inputSize; ++i) { 24223 encode.push(0); 24224 encode.push(size[i] - 1); 24225 } 24226 } 24227 encode = toMultiArray(encode); 24228 var decode = dict.getArray('Decode'); 24229 if (!decode) { 24230 decode = range; 24231 } else { 24232 decode = toMultiArray(decode); 24233 } 24234 var samples = this.getSampleArray(size, outputSize, bps, fn); 24235 return [CONSTRUCT_SAMPLED, inputSize, domain, encode, decode, samples, size, outputSize, Math.pow(2, bps) - 1, range]; 24236 }, 24237 constructSampledFromIR: function constructSampledFromIR(_ref7) { 24238 var xref = _ref7.xref, 24239 isEvalSupported = _ref7.isEvalSupported, 24240 IR = _ref7.IR; 24241 24242 function interpolate(x, xmin, xmax, ymin, ymax) { 24243 return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); 24244 } 24245 return function constructSampledFromIRResult(src, srcOffset, dest, destOffset) { 24246 var m = IR[1]; 24247 var domain = IR[2]; 24248 var encode = IR[3]; 24249 var decode = IR[4]; 24250 var samples = IR[5]; 24251 var size = IR[6]; 24252 var n = IR[7]; 24253 var range = IR[9]; 24254 var cubeVertices = 1 << m; 24255 var cubeN = new Float64Array(cubeVertices); 24256 var cubeVertex = new Uint32Array(cubeVertices); 24257 var i, j; 24258 for (j = 0; j < cubeVertices; j++) { 24259 cubeN[j] = 1; 24260 } 24261 var k = n, 24262 pos = 1; 24263 for (i = 0; i < m; ++i) { 24264 var domain_2i = domain[i][0]; 24265 var domain_2i_1 = domain[i][1]; 24266 var xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1); 24267 var e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]); 24268 var size_i = size[i]; 24269 e = Math.min(Math.max(e, 0), size_i - 1); 24270 var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; 24271 var n0 = e0 + 1 - e; 24272 var n1 = e - e0; 24273 var offset0 = e0 * k; 24274 var offset1 = offset0 + k; 24275 for (j = 0; j < cubeVertices; j++) { 24276 if (j & pos) { 24277 cubeN[j] *= n1; 24278 cubeVertex[j] += offset1; 24279 } else { 24280 cubeN[j] *= n0; 24281 cubeVertex[j] += offset0; 24282 } 24283 } 24284 k *= size_i; 24285 pos <<= 1; 24286 } 24287 for (j = 0; j < n; ++j) { 24288 var rj = 0; 24289 for (i = 0; i < cubeVertices; i++) { 24290 rj += samples[cubeVertex[i] + j] * cubeN[i]; 24291 } 24292 rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); 24293 dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]); 24294 } 24295 }; 24296 }, 24297 constructInterpolated: function constructInterpolated(_ref8) { 24298 var xref = _ref8.xref, 24299 isEvalSupported = _ref8.isEvalSupported, 24300 fn = _ref8.fn, 24301 dict = _ref8.dict; 24302 24303 var c0 = dict.getArray('C0') || [0]; 24304 var c1 = dict.getArray('C1') || [1]; 24305 var n = dict.get('N'); 24306 if (!Array.isArray(c0) || !Array.isArray(c1)) { 24307 throw new _util.FormatError('Illegal dictionary for interpolated function'); 24308 } 24309 var length = c0.length; 24310 var diff = []; 24311 for (var i = 0; i < length; ++i) { 24312 diff.push(c1[i] - c0[i]); 24313 } 24314 return [CONSTRUCT_INTERPOLATED, c0, diff, n]; 24315 }, 24316 constructInterpolatedFromIR: function constructInterpolatedFromIR(_ref9) { 24317 var xref = _ref9.xref, 24318 isEvalSupported = _ref9.isEvalSupported, 24319 IR = _ref9.IR; 24320 24321 var c0 = IR[1]; 24322 var diff = IR[2]; 24323 var n = IR[3]; 24324 var length = diff.length; 24325 return function constructInterpolatedFromIRResult(src, srcOffset, dest, destOff
24325set) { 24326 var x = n === 1 ? src[srcOffset] : Math.pow(src[srcOffset], n); 24327 for (var j = 0; j < length; ++j) { 24328 dest[destOffset + j] = c0[j] + x * diff[j]; 24329 } 24330 }; 24331 }, 24332 constructStiched: function constructStiched(_ref10) { 24333 var xref = _ref10.xref, 24334 isEvalSupported = _ref10.isEvalSupported, 24335 fn = _ref10.fn, 24336 dict = _ref10.dict; 24337 24338 var domain = dict.getArray('Domain'); 24339 if (!domain) { 24340 throw new _util.FormatError('No domain'); 24341 } 24342 var inputSize = domain.length / 2; 24343 if (inputSize !== 1) { 24344 throw new _util.FormatError('Bad domain for stiched function'); 24345 } 24346 var fnRefs = dict.get('Functions'); 24347 var fns = []; 24348 for (var i = 0, ii = fnRefs.length; i < ii; ++i) { 24349 fns.push(this.getIR({ 24350 xref: xref, 24351 isEvalSupported: isEvalSupported, 24352 fn: xref.fetchIfRef(fnRefs[i]) 24353 })); 24354 } 24355 var bounds = dict.getArray('Bounds'); 24356 var encode = dict.getArray('Encode'); 24357 return [CONSTRUCT_STICHED, domain, bounds, encode, fns]; 24358 }, 24359 constructStichedFromIR: function constructStichedFromIR(_ref11) { 24360 var xref = _ref11.xref, 24361 isEvalSupported = _ref11.isEvalSupported, 24362 IR = _ref11.IR; 24363 24364 var domain = IR[1]; 24365 var bounds = IR[2]; 24366 var encode = IR[3]; 24367 var fnsIR = IR[4]; 24368 var fns = []; 24369 var tmpBuf = new Float32Array(1); 24370 for (var i = 0, ii = fnsIR.length; i < ii; i++) { 24371 fns.push(this.fromIR({ 24372 xref: xref, 24373 isEvalSupported: isEvalSupported, 24374 IR: fnsIR[i] 24375 })); 24376 } 24377 return function constructStichedFromIRResult(src, srcOffset, dest, destOffset) { 24378 var clip = function constructStichedFromIRClip(v, min, max) { 24379 if (v > max) { 24380 v = max; 24381 } else if (v < min) { 24382 v = min; 24383 } 24384 return v; 24385 }; 24386 var v = clip(src[srcOffset], domain[0], domain[1]); 24387 for (var i = 0, ii = bounds.length; i < ii; ++i) { 24388 if (v < bounds[i]) { 24389 break; 24390 } 24391 } 24392 var dmin = domain[0]; 24393 if (i > 0) { 24394 dmin = bounds[i - 1]; 24395 } 24396 var dmax = domain[1]; 24397 if (i < bounds.length) { 24398 dmax = bounds[i]; 24399 } 24400 var rmin = encode[2 * i]; 24401 var rmax = encode[2 * i + 1]; 24402 tmpBuf[0] = dmin === dmax ? rmin : rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); 24403 fns[i](tmpBuf, 0, dest, destOffset); 24404 }; 24405 }, 24406 constructPostScript: function constructPostScript(_ref12) { 24407 var xref = _ref12.xref, 24408 isEvalSupported = _ref12.isEvalSupported, 24409 fn = _ref12.fn, 24410 dict = _ref12.dict; 24411 24412 var domain = dict.getArray('Domain'); 24413 var range = dict.getArray('Range'); 24414 if (!domain) { 24415 throw new _util.FormatError('No domain.'); 24416 } 24417 if (!range) { 24418 throw new _util.FormatError('No range.'); 24419 } 24420 var lexer = new _ps_parser.PostScriptLexer(fn); 24421 var parser = new _ps_parser.PostScriptParser(lexer); 24422 var code = parser.parse(); 24423 return [CONSTRUCT_POSTSCRIPT, domain, range, code]; 24424 }, 24425 constructPostScriptFromIR: function constructPostScriptFromIR(_ref13) { 24426 var xref = _ref13.xref, 24427 isEvalSupported = _ref13.isEvalSupported, 24428 IR = _ref13.IR; 24429 24430 var domain = IR[1]; 24431 var range = IR[2]; 24432 var code = IR[3]; 24433 if (isEvalSupported && IsEvalSupportedCached.value) { 24434 var compiled = new PostScriptCompiler().compile(code, domain, range); 24435 if (compiled) { 24436 return new Function('src', 'srcOffset', 'dest', 'destOffset', compiled); 24437 } 24438 } 24439 (0, _util.info)('Unable to compile PS function'); 24440 var numOutputs = range.length >> 1; 24441 var numInputs = domain.length >> 1; 24442 var evaluator = new PostScriptEvaluator(code); 24443 var cache = Object.create(null); 24444 var MAX_CACHE_SIZE = 2048 * 4; 24445 var cache_available = MAX_CACHE_SIZE; 24446 var tmpBuf = new Float32Array(numInputs); 24447 return function constructPostScriptFromIRResult(src, srcOffset, dest, destOff
vendor: 20,941 bytes, lines 24447-25146
24447set) { 24448 var i, value; 24449 var key = ''; 24450 var input = tmpBuf; 24451 for (i = 0; i < numInputs; i++) { 24452 value = src[srcOffset + i]; 24453 input[i] = value; 24454 key += value + '_'; 24455 } 24456 var cachedValue = cache[key]; 24457 if (cachedValue !== undefined) { 24458 dest.set(cachedValue, destOffset); 24459 return; 24460 } 24461 var output = new Float32Array(numOutputs); 24462 var stack = evaluator.execute(input); 24463 var stackIndex = stack.length - numOutputs; 24464 for (i = 0; i < numOutputs; i++) { 24465 value = stack[stackIndex + i]; 24466 var bound = range[i * 2]; 24467 if (value < bound) { 24468 value = bound; 24469 } else { 24470 bound = range[i * 2 + 1]; 24471 if (value > bound) { 24472 value = bound; 24473 } 24474 } 24475 output[i] = value; 24476 } 24477 if (cache_available > 0) { 24478 cache_available--; 24479 cache[key] = output; 24480 } 24481 dest.set(output, destOffset); 24482 }; 24483 } 24484 }; 24485}(); 24486function isPDFFunction(v) { 24487 var fnDict; 24488 if ((typeof v === 'undefined' ? 'undefined' : _typeof(v)) !== 'object') { 24489 return false; 24490 } else if ((0, _primitives.isDict)(v)) { 24491 fnDict = v; 24492 } else if ((0, _primitives.isStream)(v)) { 24493 fnDict = v.dict; 24494 } else { 24495 return false; 24496 } 24497 return fnDict.has('FunctionType'); 24498} 24499var PostScriptStack = function PostScriptStackClosure() { 24500 var MAX_STACK_SIZE = 100; 24501 function PostScriptStack(initialStack) { 24502 this.stack = !initialStack ? [] : Array.prototype.slice.call(initialStack, 0); 24503 } 24504 PostScriptStack.prototype = { 24505 push: function PostScriptStack_push(value) { 24506 if (this.stack.length >= MAX_STACK_SIZE) { 24507 throw new Error('PostScript function stack overflow.'); 24508 } 24509 this.stack.push(value); 24510 }, 24511 pop: function PostScriptStack_pop() { 24512 if (this.stack.length <= 0) { 24513 throw new Error('PostScript function stack underflow.'); 24514 } 24515 return this.stack.pop(); 24516 }, 24517 copy: function PostScriptStack_copy(n) { 24518 if (this.stack.length + n >= MAX_STACK_SIZE) { 24519 throw new Error('PostScript function stack overflow.'); 24520 } 24521 var stack = this.stack; 24522 for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { 24523 stack.push(stack[i]); 24524 } 24525 }, 24526 index: function PostScriptStack_index(n) { 24527 this.push(this.stack[this.stack.length - n - 1]); 24528 }, 24529 roll: function PostScriptStack_roll(n, p) { 24530 var stack = this.stack; 24531 var l = stack.length - n; 24532 var r = stack.length - 1, 24533 c = l + (p - Math.floor(p / n) * n), 24534 i, 24535 j, 24536 t; 24537 for (i = l, j = r; i < j; i++, j--) { 24538 t = stack[i]; 24539 stack[i] = stack[j]; 24540 stack[j] = t; 24541 } 24542 for (i = l, j = c - 1; i < j; i++, j--) { 24543 t = stack[i]; 24544 stack[i] = stack[j]; 24545 stack[j] = t; 24546 } 24547 for (i = c, j = r; i < j; i++, j--) { 24548 t = stack[i]; 24549 stack[i] = stack[j]; 24550 stack[j] = t; 24551 } 24552 } 24553 }; 24554 return PostScriptStack; 24555}(); 24556var PostScriptEvaluator = function PostScriptEvaluatorClosure() { 24557 function PostScriptEvaluator(operators) { 24558 this.operators = operators; 24559 } 24560 PostScriptEvaluator.prototype = { 24561 execute: function PostScriptEvaluator_execute(initialStack) { 24562 var stack = new PostScriptStack(initialStack); 24563 var counter = 0; 24564 var operators = this.operators; 24565 var length = operators.length; 24566 var operator, a, b; 24567 while (counter < length) { 24568 operator = operators[counter++]; 24569 if (typeof operator === 'number') { 24570 stack.push(operator); 24571 continue; 24572 } 24573 switch (operator) { 24574 case 'jz': 24575 b = stack.pop(); 24576 a = stack.pop(); 24577 if (!a) { 24578 counter = b; 24579 } 24580 break; 24581 case 'j': 24582 a = stack.pop(); 24583 counter = a; 24584 break; 24585 case 'abs': 24586 a = stack.pop(); 24587 stack.push(Math.abs(a)); 24588 break; 24589 case 'add': 24590 b = stack.pop(); 24591 a = stack.pop(); 24592 stack.push(a + b); 24593 break; 24594 case 'and': 24595 b = stack.pop(); 24596 a = stack.pop(); 24597 if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { 24598 stack.push(a && b); 24599 } else { 24600 stack.push(a & b); 24601 } 24602 break; 24603 case 'atan': 24604 a = stack.pop(); 24605 stack.push(Math.atan(a)); 24606 break; 24607 case 'bitshift': 24608 b = stack.pop(); 24609 a = stack.pop(); 24610 if (a > 0) { 24611 stack.push(a << b); 24612 } else { 24613 stack.push(a >> b); 24614 } 24615 break; 24616 case 'ceiling': 24617 a = stack.pop(); 24618 stack.push(Math.ceil(a)); 24619 break; 24620 case 'copy': 24621 a = stack.pop(); 24622 stack.copy(a); 24623 break; 24624 case 'cos': 24625 a = stack.pop(); 24626 stack.push(Math.cos(a)); 24627 break; 24628 case 'cvi': 24629 a = stack.pop() | 0; 24630 stack.push(a); 24631 break; 24632 case 'cvr': 24633 break; 24634 case 'div': 24635 b = stack.pop(); 24636 a = stack.pop(); 24637 stack.push(a / b); 24638 break; 24639 case 'dup': 24640 stack.copy(1); 24641 break; 24642 case 'eq': 24643 b = stack.pop(); 24644 a = stack.pop(); 24645 stack.push(a === b); 24646 break; 24647 case 'exch': 24648 stack.roll(2, 1); 24649 break; 24650 case 'exp': 24651 b = stack.pop(); 24652 a = stack.pop(); 24653 stack.push(Math.pow(a, b)); 24654 break; 24655 case 'false': 24656 stack.push(false); 24657 break; 24658 case 'floor': 24659 a = stack.pop(); 24660 stack.push(Math.floor(a)); 24661 break; 24662 case 'ge': 24663 b = stack.pop(); 24664 a = stack.pop(); 24665 stack.push(a >= b); 24666 break; 24667 case 'gt': 24668 b = stack.pop(); 24669 a = stack.pop(); 24670 stack.push(a > b); 24671 break; 24672 case 'idiv': 24673 b = stack.pop(); 24674 a = stack.pop(); 24675 stack.push(a / b | 0); 24676 break; 24677 case 'index': 24678 a = stack.pop(); 24679 stack.index(a); 24680 break; 24681 case 'le': 24682 b = stack.pop(); 24683 a = stack.pop(); 24684 stack.push(a <= b); 24685 break; 24686 case 'ln': 24687 a = stack.pop(); 24688 stack.push(Math.log(a)); 24689 break; 24690 case 'log': 24691 a = stack.pop(); 24692 stack.push(Math.log(a) / Math.LN10); 24693 break; 24694 case 'lt': 24695 b = stack.pop(); 24696 a = stack.pop(); 24697 stack.push(a < b); 24698 break; 24699 case 'mod': 24700 b = stack.pop(); 24701 a = stack.pop(); 24702 stack.push(a % b); 24703 break; 24704 case 'mul': 24705 b = stack.pop(); 24706 a = stack.pop(); 24707 stack.push(a * b); 24708 break; 24709 case 'ne': 24710 b = stack.pop(); 24711 a = stack.pop(); 24712 stack.push(a !== b); 24713 break; 24714 case 'neg': 24715 a = stack.pop(); 24716 stack.push(-a); 24717 break; 24718 case 'not': 24719 a = stack.pop(); 24720 if ((0, _util.isBool)(a)) { 24721 stack.push(!a); 24722 } else { 24723 stack.push(~a); 24724 } 24725 break; 24726 case 'or': 24727 b = stack.pop(); 24728 a = stack.pop(); 24729 if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { 24730 stack.push(a || b); 24731 } else { 24732 stack.push(a | b); 24733 } 24734 break; 24735 case 'pop': 24736 stack.pop(); 24737 break; 24738 case 'roll': 24739 b = stack.pop(); 24740 a = stack.pop(); 24741 stack.roll(a, b); 24742 break; 24743 case 'round': 24744 a = stack.pop(); 24745 stack.push(Math.round(a)); 24746 break; 24747 case 'sin': 24748 a = stack.pop(); 24749 stack.push(Math.sin(a)); 24750 break; 24751 case 'sqrt': 24752 a = stack.pop(); 24753 stack.push(Math.sqrt(a)); 24754 break; 24755 case 'sub': 24756 b = stack.pop(); 24757 a = stack.pop(); 24758 stack.push(a - b); 24759 break; 24760 case 'true': 24761 stack.push(true); 24762 break; 24763 case 'truncate': 24764 a = stack.pop(); 24765 a = a < 0 ? Math.ceil(a) : Math.floor(a); 24766 stack.push(a); 24767 break; 24768 case 'xor': 24769 b = stack.pop(); 24770 a = stack.pop(); 24771 if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { 24772 stack.push(a !== b); 24773 } else { 24774 stack.push(a ^ b); 24775 } 24776 break; 24777 default: 24778 throw new _util.FormatError('Unknown operator ' + operator); 24779 } 24780 } 24781 return stack.stack; 24782 } 24783 }; 24784 return PostScriptEvaluator; 24785}(); 24786var PostScriptCompiler = function PostScriptCompilerClosure() { 24787 function AstNode(type) { 24788 this.type = type; 24789 } 24790 AstNode.prototype.visit = function (visitor) { 24791 throw new Error('abstract method'); 24792 }; 24793 function AstArgument(index, min, max) { 24794 AstNode.call(this, 'args'); 24795 this.index = index; 24796 this.min = min; 24797 this.max = max; 24798 } 24799 AstArgument.prototype = Object.create(AstNode.prototype); 24800 AstArgument.prototype.visit = function (visitor) { 24801 visitor.visitArgument(this); 24802 }; 24803 function AstLiteral(number) { 24804 AstNode.call(this, 'literal'); 24805 this.number = number; 24806 this.min = number; 24807 this.max = number; 24808 } 24809 AstLiteral.prototype = Object.create(AstNode.prototype); 24810 AstLiteral.prototype.visit = function (visitor) { 24811 visitor.visitLiteral(this); 24812 }; 24813 function AstBinaryOperation(op, arg1, arg2, min, max) { 24814 AstNode.call(this, 'binary'); 24815 this.op = op; 24816 this.arg1 = arg1; 24817 this.arg2 = arg2; 24818 this.min = min; 24819 this.max = max; 24820 } 24821 AstBinaryOperation.prototype = Object.create(AstNode.prototype); 24822 AstBinaryOperation.prototype.visit = function (visitor) { 24823 visitor.visitBinaryOperation(this); 24824 }; 24825 function AstMin(arg, max) { 24826 AstNode.call(this, 'max'); 24827 this.arg = arg; 24828 this.min = arg.min; 24829 this.max = max; 24830 } 24831 AstMin.prototype = Object.create(AstNode.prototype); 24832 AstMin.prototype.visit = function (visitor) { 24833 visitor.visitMin(this); 24834 }; 24835 function AstVariable(index, min, max) { 24836 AstNode.call(this, 'var'); 24837 this.index = index; 24838 this.min = min; 24839 this.max = max; 24840 } 24841 AstVariable.prototype = Object.create(AstNode.prototype); 24842 AstVariable.prototype.visit = function (visitor) { 24843 visitor.visitVariable(this); 24844 }; 24845 function AstVariableDefinition(variable, arg) { 24846 AstNode.call(this, 'definition'); 24847 this.variable = variable; 24848 this.arg = arg; 24849 } 24850 AstVariableDefinition.prototype = Object.create(AstNode.prototype); 24851 AstVariableDefinition.prototype.visit = function (visitor) { 24852 visitor.visitVariableDefinition(this); 24853 }; 24854 function ExpressionBuilderVisitor() { 24855 this.parts = []; 24856 } 24857 ExpressionBuilderVisitor.prototype = { 24858 visitArgument: function visitArgument(arg) { 24859 this.parts.push('Math.max(', arg.min, ', Math.min(', arg.max, ', src[srcOffset + ', arg.index, ']))'); 24860 }, 24861 visitVariable: function visitVariable(variable) { 24862 this.parts.push('v', variable.index); 24863 }, 24864 visitLiteral: function visitLiteral(literal) { 24865 this.parts.push(literal.number); 24866 }, 24867 visitBinaryOperation: function visitBinaryOperation(operation) { 24868 this.parts.push('('); 24869 operation.arg1.visit(this); 24870 this.parts.push(' ', operation.op, ' '); 24871 operation.arg2.visit(this); 24872 this.parts.push(')'); 24873 }, 24874 visitVariableDefinition: function visitVariableDefinition(definition) { 24875 this.parts.push('var '); 24876 definition.variable.visit(this); 24877 this.parts.push(' = '); 24878 definition.arg.visit(this); 24879 this.parts.push(';'); 24880 }, 24881 visitMin: function visitMin(max) { 24882 this.parts.push('Math.min('); 24883 max.arg.visit(this); 24884 this.parts.push(', ', max.max, ')'); 24885 }, 24886 toString: function toString() { 24887 return this.parts.join(''); 24888 } 24889 }; 24890 function buildAddOperation(num1, num2) { 24891 if (num2.type === 'literal' && num2.number === 0) { 24892 return num1; 24893 } 24894 if (num1.type === 'literal' && num1.number === 0) { 24895 return num2; 24896 } 24897 if (num2.type === 'literal' && num1.type === 'literal') { 24898 return new AstLiteral(num1.number + num2.number); 24899 } 24900 return new AstBinaryOperation('+', num1, num2, num1.min + num2.min, num1.max + num2.max); 24901 } 24902 function buildMulOperation(num1, num2) { 24903 if (num2.type === 'literal') { 24904 if (num2.number === 0) { 24905 return new AstLiteral(0); 24906 } else if (num2.number === 1) { 24907 return num1; 24908 } else if (num1.type === 'literal') { 24909 return new AstLiteral(num1.number * num2.number); 24910 } 24911 } 24912 if (num1.type === 'literal') { 24913 if (num1.number === 0) { 24914 return new AstLiteral(0); 24915 } else if (num1.number === 1) { 24916 return num2; 24917 } 24918 } 24919 var min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); 24920 var max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); 24921 return new AstBinaryOperation('*', num1, num2, min, max); 24922 } 24923 function buildSubOperation(num1, num2) { 24924 if (num2.type === 'literal') { 24925 if (num2.number === 0) { 24926 return num1; 24927 } else if (num1.type === 'literal') { 24928 return new AstLiteral(num1.number - num2.number); 24929 } 24930 } 24931 if (num2.type === 'binary' && num2.op === '-' && num1.type === 'literal' && num1.number === 1 && num2.arg1.type === 'literal' && num2.arg1.number === 1) { 24932 return num2.arg2; 24933 } 24934 return new AstBinaryOperation('-', num1, num2, num1.min - num2.max, num1.max - num2.min); 24935 } 24936 function buildMinOperation(num1, max) { 24937 if (num1.min >= max) { 24938 return new AstLiteral(max); 24939 } else if (num1.max <= max) { 24940 return num1; 24941 } 24942 return new AstMin(num1, max); 24943 } 24944 function PostScriptCompiler() {} 24945 PostScriptCompiler.prototype = { 24946 compile: function PostScriptCompiler_compile(code, domain, range) { 24947 var stack = []; 24948 var i, ii; 24949 var instructions = []; 24950 var inputSize = domain.length >> 1, 24951 outputSize = range.length >> 1; 24952 var lastRegister = 0; 24953 var n, j; 24954 var num1, num2, ast1, ast2, tmpVar, item; 24955 for (i = 0; i < inputSize; i++) { 24956 stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); 24957 } 24958 for (i = 0, ii = code.length; i < ii; i++) { 24959 item = code[i]; 24960 if (typeof item === 'number') { 24961 stack.push(new AstLiteral(item)); 24962 continue; 24963 } 24964 switch (item) { 24965 case 'add': 24966 if (stack.length < 2) { 24967 return null; 24968 } 24969 num2 = stack.pop(); 24970 num1 = stack.pop(); 24971 stack.push(buildAddOperation(num1, num2)); 24972 break; 24973 case 'cvr': 24974 if (stack.length < 1) { 24975 return null; 24976 } 24977 break; 24978 case 'mul': 24979 if (stack.length < 2) { 24980 return null; 24981 } 24982 num2 = stack.pop(); 24983 num1 = stack.pop(); 24984 stack.push(buildMulOperation(num1, num2)); 24985 break; 24986 case 'sub': 24987 if (stack.length < 2) { 24988 return null; 24989 } 24990 num2 = stack.pop(); 24991 num1 = stack.pop(); 24992 stack.push(buildSubOperation(num1, num2)); 24993 break; 24994 case 'exch': 24995 if (stack.length < 2) { 24996 return null; 24997 } 24998 ast1 = stack.pop(); 24999 ast2 = stack.pop(); 25000 stack.push(ast1, ast2); 25001 break; 25002 case 'pop': 25003 if (stack.length < 1) { 25004 return null; 25005 } 25006 stack.pop(); 25007 break; 25008 case 'index': 25009 if (stack.length < 1) { 25010 return null; 25011 } 25012 num1 = stack.pop(); 25013 if (num1.type !== 'literal') { 25014 return null; 25015 } 25016 n = num1.number; 25017 if (n < 0 || !Number.isInteger(n) || stack.length < n) { 25018 return null; 25019 } 25020 ast1 = stack[stack.length - n - 1]; 25021 if (ast1.type === 'literal' || ast1.type === 'var') { 25022 stack.push(ast1); 25023 break; 25024 } 25025 tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); 25026 stack[stack.length - n - 1] = tmpVar; 25027 stack.push(tmpVar); 25028 instructions.push(new AstVariableDefinition(tmpVar, ast1)); 25029 break; 25030 case 'dup': 25031 if (stack.length < 1) { 25032 return null; 25033 } 25034 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]) { 25035 num1 = stack.pop(); 25036 stack.push(buildMinOperation(num1, code[i + 1])); 25037 i += 6; 25038 break; 25039 } 25040 ast1 = stack[stack.length - 1]; 25041 if (ast1.type === 'literal' || ast1.type === 'var') { 25042 stack.push(ast1); 25043 break; 25044 } 25045 tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); 25046 stack[stack.length - 1] = tmpVar; 25047 stack.push(tmpVar); 25048 instructions.push(new AstVariableDefinition(tmpVar, ast1)); 25049 break; 25050 case 'roll': 25051 if (stack.length < 2) { 25052 return null; 25053 } 25054 num2 = stack.pop(); 25055 num1 = stack.pop(); 25056 if (num2.type !== 'literal' || num1.type !== 'literal') { 25057 return null; 25058 } 25059 j = num2.number; 25060 n = num1.number; 25061 if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) { 25062 return null; 25063 } 25064 j = (j % n + n) % n; 25065 if (j === 0) { 25066 break; 25067 } 25068 Array.prototype.push.apply(stack, stack.splice(stack.length - n, n - j)); 25069 break; 25070 default: 25071 return null; 25072 } 25073 } 25074 if (stack.length !== outputSize) { 25075 return null; 25076 } 25077 var result = []; 25078 instructions.forEach(function (instruction) { 25079 var statementBuilder = new ExpressionBuilderVisitor(); 25080 instruction.visit(statementBuilder); 25081 result.push(statementBuilder.toString()); 25082 }); 25083 stack.forEach(function (expr, i) { 25084 var statementBuilder = new ExpressionBuilderVisitor(); 25085 expr.visit(statementBuilder); 25086 var min = range[i * 2], 25087 max = range[i * 2 + 1]; 25088 var out = [statementBuilder.toString()]; 25089 if (min > expr.min) { 25090 out.unshift('Math.max(', min, ', '); 25091 out.push(')'); 25092 } 25093 if (max < expr.max) { 25094 out.unshift('Math.min(', max, ', '); 25095 out.push(')'); 25096 } 25097 out.unshift('dest[destOffset + ', i, '] = '); 25098 out.push(';'); 25099 result.push(out.join('')); 25100 }); 25101 return result.join('\n'); 25102 } 25103 }; 25104 return PostScriptCompiler; 25105}(); 25106exports.isPDFFunction = isPDFFunction; 25107exports.PDFFunctionFactory = PDFFunctionFactory; 25108exports.PostScriptEvaluator = PostScriptEvaluator; 25109exports.PostScriptCompiler = PostScriptCompiler; 25110 25111/***/ }), 25112/* 72 */ 25113/***/ (function(module, exports, __w_pdfjs_require__) { 25114 25115"use strict"; 25116 25117 25118var pdfjsVersion = '1.9.648'; 25119var pdfjsBuild = '56c14e27'; 25120var pdfjsCoreWorker = __w_pdfjs_require__(73); 25121exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler; 25122 25123/***/ }), 25124/* 73 */ 25125/***/ (function(module, exports, __w_pdfjs_require__) { 25126 25127"use strict"; 25128 25129 25130Object.defineProperty(exports, "__esModule", { 25131 value: true 25132}); 25133exports.WorkerMessageHandler = exports.WorkerTask = undefined; 25134 25135var _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; }; 25136 25137var _util = __w_pdfjs_require__(0); 25138 25139var _pdf_manager = __w_pdfjs_require__(109); 25140 25141var _primitives = __w_pdfjs_require__(2); 25142 25143var WorkerTask = function WorkerTaskClosure() { 25144 function WorkerTask(name) { 25145 this.name = name; 25146 this.terminated = false;
25147 this._capability = (0, _util.createPromiseCapability)(); 25148 } 25149 WorkerTask.prototype = { 25150 get finished() { 25151 return this._capability.promise; 25152 }, 25153 finish: function finish() { 25154 this._capability.resolve(); 25155 }, 25156 terminate: function terminate() { 25157 this.terminated = true; 25158 }, 25159 ensureNotTerminated: function ensureNotTerminated() { 25160 if (this.terminated) { 25161 throw new Error('Worker task was terminated'); 25162 } 25163 } 25164 }; 25165 return WorkerTask; 25166}(); 25167; 25168var PDFWorkerStream = function PDFWorkerStreamClosure() { 25169 function PDFWorkerStream(msgHandler) { 25170 this._msgHandler = msgHandler; 25171 this._contentLength = null; 25172 this._fullRequestReader = null; 25173 this._rangeRequestReaders = []; 25174 } 25175 PDFWorkerStream.prototype = { 25176 getFullReader: function getFullReader() { 25177 (0, _util.assert)(!this._fullRequestReader); 25178 this._fullRequestReader = new PDFWorkerStreamReader(this._msgHandler); 25179 return this._fullRequestReader; 25180 }, 25181 getRangeReader: function getRangeReader(begin, end) { 25182 var reader = new PDFWorkerStreamRangeReader(begin, end, this._msgHandler); 25183 this._rangeRequestReaders.push(reader); 25184 return reader; 25185 }, 25186 cancelAllRequests: function cancelAllRequests(reason) { 25187 if (this._fullRequestReader) { 25188 this._fullRequestReader.cancel(reason); 25189 } 25190 var readers = this._rangeRequestReaders.slice(0); 25191 readers.forEach(function (reader) { 25192 reader.cancel(reason); 25193 }); 25194 } 25195 }; 25196 function PDFWorkerStreamReader(msgHandler) { 25197 var _this = this; 25198 25199 this._msgHandler = msgHandler; 25200 this._contentLength = null; 25201 this._isRangeSupported = false; 25202 this._isStreamingSupported = false; 25203 var readableStream = this._msgHandler.sendWithStream('GetReader'); 25204 this._reader = readableStream.getReader(); 25205 this._headersReady = this._msgHandler.sendWithPromise('ReaderHeadersReady').then(function (data) { 25206 _this._isStreamingSupported = data.isStreamingSupported; 25207 _this._isRangeSupported = data.isRangeSupported; 25208 _this._contentLength = data.contentLength; 25209 }); 25210 } 25211 PDFWorkerStreamReader.prototype = { 25212 get headersReady() { 25213 return this._headersReady; 25214 }, 25215 get contentLength() { 25216 return this._contentLength; 25217 }, 25218 get isStreamingSupported() { 25219 return this._isStreamingSupported; 25220 }, 25221 get isRangeSupported() { 25222 return this._isRangeSupported; 25223 }, 25224 read: function read() { 25225 return this._reader.read().then(function (_ref) { 25226 var value = _ref.value, 25227 done = _ref.done; 25228 25229 if (done) { 25230 return { 25231 value: undefined, 25232 done: true 25233 }; 25234 } 25235 return { 25236 value: value.buffer, 25237 done: false 25238 }; 25239 }); 25240 }, 25241 cancel: function cancel(reason) { 25242 this._reader.cancel(reason); 25243 } 25244 }; 25245 function PDFWorkerStreamRangeReader(begin, end, msgHandler) { 25246 this._msgHandler = msgHandler; 25247 this.onProgress = null; 25248 var readableStream = this._msgHandler.sendWithStream('GetRangeReader', { 25249 begin: begin, 25250 end: end 25251 }); 25252 this._reader = readableStream.getReader(); 25253 } 25254 PDFWorkerStreamRangeReader.prototype = { 25255 get isStreamingSupported() { 25256 return false; 25257 }, 25258 read: function read() { 25259 return this._reader.read().then(function (_ref2) { 25260 var value = _ref2.value, 25261 done = _ref2.done; 25262 25263 if (done) { 25264 return { 25265 value: undefined, 25266 done: true 25267 }; 25268 } 25269 return { 25270 value: value.buffer, 25271 done: false 25272 }; 25273 }); 25274 }, 25275 cancel: function cancel(reason) { 25276 this._reader.cancel(reason); 25277 } 25278 }; 25279 return PDFWorkerStream; 25280}(); 25281var WorkerMessageHandler = { 25282 setup: function setup(handler, port) { 25283 var testMessageProcessed = false; 25284 handler.on('test', function wphSetupTest(data) { 25285 if (testMessageProcessed) { 25286 return; 25287 } 25288 testMessageProcessed = true; 25289 if (!(data instanceof Uint8Array)) { 25290 handler.send('test', 'main', false); 25291 return; 25292 } 25293 var supportTransfers = data[0] === 255; 25294 handler.postMessageTransfers = supportTransfers; 25295 var xhr = new XMLHttpRequest(); 25296 var responseExists = 'response' in xhr;
25297 try { 25298 xhr.responseType; 25299 } catch (e) { 25300 responseExists = false; 25301 } 25302 if (!responseExists) { 25303 handler.send('test', false); 25304 return; 25305 } 25306 handler.send('test', { 25307 supportTypedArray: true, 25308 supportTransfers: supportTransfers 25309 }); 25310 }); 25311 handler.on('configure', function wphConfigure(data) { 25312 (0, _util.setVerbosityLevel)(data.verbosity); 25313 }); 25314 handler.on('GetDocRequest', function wphSetupDoc(data) { 25315 return WorkerMessageHandler.createDocumentHandler(data, port); 25316 }); 25317 }, 25318 createDocumentHandler: function createDocumentHandler(docParams, port) { 25319 var pdfManager; 25320 var terminated = false; 25321 var cancelXHRs = null; 25322 var WorkerTasks = []; 25323 var apiVersion = docParams.apiVersion; 25324 var workerVersion = '1.9.648'; 25325 if (apiVersion !== null && apiVersion !== workerVersion) { 25326 throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".')); 25327 } 25328 var docId = docParams.docId; 25329 var docBaseUrl = docParams.docBaseUrl; 25330 var workerHandlerName = docParams.docId + '_worker'; 25331 var handler = new _util.MessageHandler(workerHandlerName, docId, port); 25332 handler.postMessageTransfers = docParams.postMessageTransfers; 25333 function ensureNotTerminated() { 25334 if (terminated) { 25335 throw new Error('Worker was terminated'); 25336 } 25337 } 25338 function startWorkerTask(task) { 25339 WorkerTasks.push(task); 25340 } 25341 function finishWorkerTask(task) { 25342 task.finish(); 25343 var i = WorkerTasks.indexOf(task); 25344 WorkerTasks.splice(i, 1); 25345 } 25346 function loadDocument(recoveryMode) { 25347 var loadDocumentCapability = (0, _util.createPromiseCapability)(); 25348 var parseSuccess = function parseSuccess() { 25349 var numPagesPromise = pdfManager.ensureDoc('numPages'); 25350 var fingerprintPromise = pdfManager.ensureDoc('fingerprint'); 25351 var encryptedPromise = pdfManager.ensureXRef('encrypt'); 25352 Promise.all([numPagesPromise, fingerprintPromise, encryptedPromise]).then(function onDocReady(results) { 25353 var doc = { 25354 numPages: results[0], 25355 fingerprint: results[1], 25356 encrypted: !!results[2] 25357 }; 25358 loadDocumentCapability.resolve(doc); 25359 }, parseFailure); 25360 }; 25361 var parseFailure = function parseFailure(e) { 25362 loadDocumentCapability.reject(e); 25363 }; 25364 pdfManager.ensureDoc('checkHeader', []).then(function () { 25365 pdfManager.ensureDoc('parseStartXRef', []).then(function () { 25366 pdfManager.ensureDoc('parse', [recoveryMode]).then(parseSuccess, parseFailure); 25367 }, parseFailure); 25368 }, parseFailure); 25369 return loadDocumentCapability.promise; 25370 } 25371 function getPdfManager(data, evaluatorOptions) { 25372 var pdfManagerCapability = (0, _util.createPromiseCapability)(); 25373 var pdfManager; 25374 var source = data.source; 25375 if (source.data) { 25376 try { 25377 pdfManager = new _pdf_manager.LocalPdfManager(docId, source.data, source.password, evaluatorOptions, docBaseUrl); 25378 pdfManagerCapability.resolve(pdfManager); 25379 } catch (ex) { 25380 pdfManagerCapability.reject(ex); 25381 } 25382 return pdfManagerCapability.promise; 25383 } 25384 var pdfStream, 25385 cachedChunks = [];
25386 try { 25387 pdfStream = new PDFWorkerStream(handler); 25388 } catch (ex) { 25389 pdfManagerCapability.reject(ex); 25390 return pdfManagerCapability.promise; 25391 } 25392 var fullRequest = pdfStream.getFullReader(); 25393 fullRequest.headersReady.then(function () { 25394 if (!fullRequest.isRangeSupported) { 25395 return; 25396 } 25397 var disableAutoFetch = source.disableAutoFetch || fullRequest.isStreamingSupported; 25398 pdfManager = new _pdf_manager.NetworkPdfManager(docId, pdfStream, { 25399 msgHandler: handler, 25400 url: source.url, 25401 password: source.password, 25402 length: fullRequest.contentLength, 25403 disableAutoFetch: disableAutoFetch, 25404 rangeChunkSize: source.rangeChunkSize 25405 }, evaluatorOptions, docBaseUrl); 25406 for (var i = 0; i < cachedChunks.length; i++) { 25407 pdfManager.sendProgressiveData(cachedChunks[i]); 25408 } 25409 cachedChunks = []; 25410 pdfManagerCapability.resolve(pdfManager); 25411 cancelXHRs = null; 25412 }).catch(function (reason) { 25413 pdfManagerCapability.reject(reason); 25414 cancelXHRs = null; 25415 }); 25416 var loaded = 0; 25417 var flushChunks = function flushChunks() { 25418 var pdfFile = (0, _util.arraysToBytes)(cachedChunks); 25419 if (source.length && pdfFile.length !== source.length) { 25420 (0, _util.warn)('reported HTTP length is different from actual'); 25421 } 25422 try { 25423 pdfManager = new _pdf_manager.LocalPdfManager(docId, pdfFile, source.password, evaluatorOptions, docBaseUrl); 25424 pdfManagerCapability.resolve(pdfManager); 25425 } catch (ex) { 25426 pdfManagerCapability.reject(ex); 25427 } 25428 cachedChunks = []; 25429 }; 25430 var readPromise = new Promise(function (resolve, reject) { 25431 var readChunk = function readChunk(chunk) { 25432 try { 25433 ensureNotTerminated(); 25434 if (chunk.done) { 25435 if (!pdfManager) { 25436 flushChunks(); 25437 } 25438 cancelXHRs = null; 25439 return; 25440 } 25441 var data = chunk.value; 25442 loaded += (0, _util.arrayByteLength)(data); 25443 if (!fullRequest.isStreamingSupported) { 25444 handler.send('DocProgress', { 25445 loaded: loaded, 25446 total: Math.max(loaded, fullRequest.contentLength || 0) 25447 }); 25448 } 25449 if (pdfManager) { 25450 pdfManager.sendProgressiveData(data); 25451 } else { 25452 cachedChunks.push(data); 25453 } 25454 fullRequest.read().then(readChunk, reject); 25455 } catch (e) { 25456 reject(e); 25457 } 25458 }; 25459 fullRequest.read().then(readChunk, reject); 25460 }); 25461 readPromise.catch(function (e) { 25462 pdfManagerCapability.reject(e); 25463 cancelXHRs = null; 25464 }); 25465 cancelXHRs = function cancelXHRs() { 25466 pdfStream.cancelAllRequests('abort'); 25467 }; 25468 return pdfManagerCapability.promise; 25469 } 25470 function setupDoc(data) { 25471 function onSuccess(doc) { 25472 ensureNotTerminated(); 25473 handler.send('GetDoc', { pdfInfo: doc }); 25474 } 25475 function onFailure(e) { 25476 ensureNotTerminated(); 25477 if (e instanceof _util.PasswordException) { 25478 var task = new WorkerTask('PasswordException: response ' + e.code); 25479 startWorkerTask(task); 25480 handler.sendWithPromise('PasswordRequest', e).then(function (data) { 25481 finishWorkerTask(task); 25482 pdfManager.updatePassword(data.password); 25483 pdfManagerReady(); 25484 }).catch(function (ex) { 25485 finishWorkerTask(task); 25486 handler.send('PasswordException', ex); 25487 }.bind(null, e)); 25488 } else if (e instanceof _util.InvalidPDFException) { 25489 handler.send('InvalidPDF', e); 25490 } else if (e instanceof _util.MissingPDFException) { 25491 handler.send('MissingPDF', e); 25492 } else if (e instanceof _util.UnexpectedResponseException) { 25493 handler.send('UnexpectedResponse', e); 25494 } else { 25495 handler.send('UnknownError', new _util.UnknownErrorException(e.message, e.toString())); 25496 } 25497 } 25498 function pdfManagerReady() { 25499 ensureNotTerminated(); 25500 loadDocument(false).then(onSuccess, function loadFailure(ex) { 25501 ensureNotTerminated(); 25502 if (!(ex instanceof _util.XRefParseException)) { 25503 onFailure(ex); 25504 return; 25505 } 25506 pdfManager.requestLoadedStream(); 25507 pdfManager.onLoadedStream().then(function () { 25508 ensureNotTerminated();
25509 loadDocument(true).then(onSuccess, onFailure); 25510 }); 25511 }, onFailure); 25512 } 25513 ensureNotTerminated(); 25514 var evaluatorOptions = { 25515 forceDataSchema: data.disableCreateObjectURL, 25516 maxImageSize: data.maxImageSize === undefined ? -1 : data.maxImageSize, 25517 disableFontFace: data.disableFontFace, 25518 nativeImageDecoderSupport: data.nativeImageDecoderSupport, 25519 ignoreErrors: data.ignoreErrors, 25520 isEvalSupported: data.isEvalSupported 25521 }; 25522 getPdfManager(data, evaluatorOptions).then(function (newPdfManager) { 25523 if (terminated) { 25524 newPdfManager.terminate(); 25525 throw new Error('Worker was terminated'); 25526 } 25527 pdfManager = newPdfManager; 25528 handler.send('PDFManagerReady', null); 25529 pdfManager.onLoadedStream().then(function (stream) { 25530 handler.send('DataLoaded', { length: stream.bytes.byteLength }); 25531 }); 25532 }).then(pdfManagerReady, onFailure); 25533 } 25534 handler.on('GetPage', function wphSetupGetPage(data) { 25535 return pdfManager.getPage(data.pageIndex).then(function (page) { 25536 var rotatePromise = pdfManager.ensure(page, 'rotate'); 25537 var refPromise = pdfManager.ensure(page, 'ref'); 25538 var userUnitPromise = pdfManager.ensure(page, 'userUnit'); 25539 var viewPromise = pdfManager.ensure(page, 'view'); 25540 return Promise.all([rotatePromise, refPromise, userUnitPromise, viewPromise]).then(function (results) { 25541 return { 25542 rotate: results[0], 25543 ref: results[1], 25544 userUnit: results[2], 25545 view: results[3] 25546 }; 25547 }); 25548 }); 25549 }); 25550 handler.on('GetPageIndex', function wphSetupGetPageIndex(data) { 25551 var ref = new _primitives.Ref(data.ref.num, data.ref.gen); 25552 var catalog = pdfManager.pdfDocument.catalog; 25553 return catalog.getPageIndex(ref); 25554 }); 25555 handler.on('GetDestinations', function wphSetupGetDestinations(data) { 25556 return pdfManager.ensureCatalog('destinations'); 25557 }); 25558 handler.on('GetDestination', function wphSetupGetDestination(data) { 25559 return pdfManager.ensureCatalog('getDestination', [data.id]); 25560 }); 25561 handler.on('GetPageLabels', function wphSetupGetPageLabels(data) { 25562 return pdfManager.ensureCatalog('pageLabels'); 25563 }); 25564 handler.on('GetPageMode', function wphSetupGetPageMode(data) { 25565 return pdfManager.ensureCatalog('pageMode'); 25566 }); 25567 handler.on('GetAttachments', function wphSetupGetAttachments(data) { 25568 return pdfManager.ensureCatalog('attachments'); 25569 }); 25570 handler.on('GetJavaScript', function wphSetupGetJavaScript(data) { 25571 return pdfManager.ensureCatalog('javaScript'); 25572 }); 25573 handler.on('GetOutline', function wphSetupGetOutline(data) { 25574 return pdfManager.ensureCatalog('documentOutline'); 25575 }); 25576 handler.on('GetMetadata', function wphSetupGetMetadata(data) { 25577 return Promise.all([pdfManager.ensureDoc('documentInfo'), pdfManager.ensureCatalog('metadata')]); 25578 }); 25579 handler.on('GetData', function wphSetupGetData(data) { 25580 pdfManager.requestLoadedStream(); 25581 return pdfManager.onLoadedStream().then(function (stream) { 25582 return stream.bytes; 25583 }); 25584 }); 25585 handler.on('GetStats', function wphSetupGetStats(data) { 25586 return pdfManager.pdfDocument.xref.stats; 25587 }); 25588 handler.on('GetAnnotations', function wphSetupGetAnnotations(data) { 25589 return pdfManager.getPage(data.pageIndex).then(function (page) { 25590 return pdfManager.ensure(page, 'getAnnotationsData', [data.intent]); 25591 }); 25592 }); 25593 handler.on('RenderPageRequest', function wphSetupRenderPage(data) { 25594 var pageIndex = data.pageIndex; 25595 pdfManager.getPage(pageIndex).then(function (page) { 25596 var task = new WorkerTask('RenderPageRequest: page ' + pageIndex); 25597 startWorkerTask(task); 25598 var pageNum = pageIndex + 1; 25599 var start = Date.now(); 25600 page.getOperatorList({ 25601 handler: handler, 25602 task: task, 25603 intent: data.intent, 25604 renderInteractiveForms: data.renderInteractiveForms 25605 }).then(function (operatorList) { 25606 finishWorkerTask(task); 25607 (0, _util.info)('page=' + pageNum + ' - getOperatorList: time=' + (Date.now() - start) + 'ms, len=' + operatorList.totalLength); 25608 }, function (e) { 25609 finishWorkerTask(task); 25610 if (task.terminated) { 25611 return; 25612 } 25613 handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.unknown }); 25614 var minimumStackMessage = 'worker.js: while trying to getPage() and getOperatorList()'; 25615 var wrappedException; 25616 if (typeof e === 'string') { 25617 wrappedException = { 25618 message: e, 25619 stack: minimumStackMessage 25620 }; 25621 } else if ((typeof e === 'undefined' ? 'undefined' : _typeof(e)) === 'object') { 25622 wrappedException = { 25623 message: e.message || e.toString(), 25624 stack: e.stack || minimumStackMessage 25625 }; 25626 } else { 25627 wrappedException = { 25628 message: 'Unknown exception type: ' + (typeof e === 'undefined' ? 'undefined' : _typeof(e)), 25629 stack: minimumStackMessage 25630 }; 25631 } 25632 handler.send('PageError', { 25633 pageNum: pageNum, 25634 error: wrappedException, 25635 intent: data.intent 25636 }); 25637 }); 25638 }); 25639 }, this); 25640 handler.on('GetTextContent', function wphExtractText(data, sink) { 25641 var pageIndex = data.pageIndex; 25642 sink.onPull = function (desiredSize) {}; 25643 sink.onCancel = function (reason) {}; 25644 pdfManager.getPage(pageIndex).then(function (page) { 25645 var task = new WorkerTask('GetTextContent: page ' + pageIndex); 25646 startWorkerTask(task); 25647 var pageNum = pageIndex + 1; 25648 var start = Date.now(); 25649 page.extractTextContent({ 25650 handler: handler, 25651 task: task, 25652 sink: sink, 25653 normalizeWhitespace: data.normalizeWhitespace, 25654 combineTextItems: data.combineTextItems 25655 }).then(function () { 25656 finishWorkerTask(task); 25657 (0, _util.info)('text indexing: page=' + pageNum + ' - time=' + (Date.now() - start) + 'ms'); 25658 sink.close(); 25659 }, function (reason) { 25660 finishWorkerTask(task); 25661 if (task.terminated) { 25662 return; 25663 } 25664 sink.error(reason); 25665 throw reason; 25666 }); 25667 }); 25668 }); 25669 handler.on('Cleanup', function wphCleanup(data) { 25670 return pdfManager.cleanup(); 25671 }); 25672 handler.on('Terminate', function wphTerminate(data) { 25673 terminated = true; 25674 if (pdfManager) { 25675 pdfManager.terminate(); 25676 pdfManager = null; 25677 } 25678 if (cancelXHRs) { 25679 cancelXHRs(); 25680 } 25681 var waitOn = []; 25682 WorkerTasks.forEach(function (task) { 25683 waitOn.push(task.finished); 25684 task.terminate(); 25685 }); 25686 return Promise.all(waitOn).then(function () { 25687 handler.destroy(); 25688 handler = null; 25689 }); 25690 }); 25691 handler.on('Ready', function wphReady(data) { 25692 setupDoc(docParams); 25693 docParams = null; 25694 }); 25695 return workerHandlerName; 25696 }, 25697 initializeFromPort: function initializeFromPort(port) { 25698 var handler = new _util.MessageHandler('worker', 'main', port); 25699 WorkerMessageHandler.setup(handler, port); 25700 handler.send('ready', null); 25701 } 25702}; 25703function isMessagePort(maybePort) { 25704 return typeof maybePort.postMessage === 'function' && 'onmessage' in maybePort; 25705} 25706if (typeof window === 'undefined' && !(0, _util.isNodeJS)() && typeof self !== 'undefined' && isMessagePort(self)) { 25707 WorkerMessageHandler.initializeFromPort(self); 25708} 25709exports.WorkerTask = WorkerTask; 25710exports.WorkerMessageHandler = WorkerMessageHandler; 25711 25712/***/ }), 25713/* 74 */ 25714/***/ (function(module, exports, __w_pdfjs_require__) { 25715 25716"use strict"; 25717 25718 25719var _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; }; 25720 25721if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) { 25722 var globalScope = __w_pdfjs_require__(75); 25723 var userAgent = typeof navigator !== 'undefined' && navigator.userAgent || ''; 25724 var isAndroid = /Android/.test(userAgent); 25725 var isAndroidPre3 = /Android\s[0-2][^\d]/.test(userAgent); 25726 var isAndroidPre5 = /Android\s[0-4][^\d]/.test(userAgent); 25727 var isChrome = userAgent.indexOf('Chrom') >= 0; 25728 var isChromeWithRangeBug = /Chrome\/(39|40)\./.test(userAgent); 25729 var isIOSChrome = userAgent.indexOf('CriOS') >= 0; 25730 var isIE = userAgent.indexOf('Trident') >= 0; 25731 var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent); 25732 var isOpera = userAgent.indexOf('Opera') >= 0; 25733 var isSafari = /Safari\//.test(userAgent) && !/(Chrome\/|Android\s)/.test(userAgent); 25734 var hasDOM = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && (typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object'; 25735 if (typeof PDFJS === 'undefined') { 25736 globalScope.PDFJS = {}; 25737 } 25738 PDFJS.compatibilityChecked = true; 25739 (function checkTypedArrayCompatibility() { 25740 if (typeof Uint8ClampedArray === 'undefined') { 25741 globalScope.Uint8ClampedArray = __w_pdfjs_require__(76); 25742 } 25743 if (typeof Uint8Array !== 'undefined') { 25744 if (typeof Uint8Array.prototype.subarray === 'undefined') { 25745 Uint8Array.prototype.subarray = function subarray(start, end) { 25746 return new Uint8Array(this.slice(start, end)); 25747 }; 25748 Float32Array.prototype.subarray = function subarray(start, end) { 25749 return new Float32Array(this.slice(start, end)); 25750 }; 25751 } 25752 if (typeof Float64Array === 'undefined') { 25753 globalScope.Float64Array = Float32Array; 25754 } 25755 return; 25756 } 25757 function subarray(start, end) { 25758 return new TypedArray(this.slice(start, end)); 25759 } 25760 function setArrayOffset(array, offset) { 25761 if (arguments.length < 2) { 25762 offset = 0; 25763 } 25764 for (var i = 0, n = array.length; i < n; ++i, ++offset) { 25765 this[offset] = array[i] & 0xFF; 25766 } 25767 } 25768 function Uint32ArrayView(buffer, length) { 25769 this.buffer = buffer; 25770 this.byteLength = buffer.length; 25771 this.length = length; 25772 ensureUint32ArrayViewProps(this.length); 25773 } 25774 Uint32ArrayView.prototype = Object.create(null); 25775 var uint32ArrayViewSetters = 0; 25776 function createUint32ArrayProp(index) { 25777 return { 25778 get: function get() { 25779 var buffer = this.buffer, 25780 offset = index << 2; 25781 return (buffer[offset] | buffer[offset + 1] << 8 | buffer[offset + 2] << 16 | buffer[offset + 3] << 24) >>> 0; 25782 }, 25783 set: function set(value) { 25784 var buffer = this.buffer, 25785 offset = index << 2; 25786 buffer[offset] = value & 255; 25787 buffer[offset + 1] = value >> 8 & 255; 25788 buffer[offset + 2] = value >> 16 & 255; 25789 buffer[offset + 3] = value >>> 24 & 255; 25790 } 25791 }; 25792 } 25793 function ensureUint32ArrayViewProps(length) { 25794 while (uint32ArrayViewSetters < length) { 25795 Object.defineProperty(Uint32ArrayView.prototype, uint32ArrayViewSetters, createUint32ArrayProp(uint32ArrayViewSetters)); 25796 uint32ArrayViewSetters++; 25797 } 25798 } 25799 function TypedArray(arg1) { 25800 var result, i, n; 25801 if (typeof arg1 === 'number') { 25802 result = []; 25803 for (i = 0; i < arg1; ++i) { 25804 result[i] = 0; 25805 } 25806 } else if ('slice' in arg1) { 25807 result = arg1.slice(0); 25808 } else { 25809 result = []; 25810 for (i = 0, n = arg1.length; i < n; ++i) { 25811 result[i] = arg1[i]; 25812 } 25813 } 25814 result.subarray = subarray; 25815 result.buffer = result; 25816 result.byteLength = result.length; 25817 result.set = setArrayOffset; 25818 if ((typeof arg1 === 'undefined' ? 'undefined' : _typeof(arg1)) === 'object' && arg1.buffer) { 25819 result.buffer = arg1.buffer; 25820 } 25821 return result; 25822 } 25823 globalScope.Uint8Array = TypedArray; 25824 globalScope.Int8Array = TypedArray; 25825 globalScope.Int32Array = TypedArray; 25826 globalScope.Uint16Array = TypedArray; 25827 globalScope.Float32Array = TypedArray; 25828 globalScope.Float64Array = TypedArray; 25829 globalScope.Uint32Array = function () { 25830 if (arguments.length === 3) { 25831 if (arguments[1] !== 0) { 25832 throw new Error('offset !== 0 is not supported'); 25833 } 25834 return new Uint32ArrayView(arguments[0], arguments[2]); 25835 } 25836 return TypedArray.apply(this, arguments); 25837 }; 25838 })(); 25839 (function canvasPixelArrayBuffer() { 25840 if (!hasDOM || !window.CanvasPixelArray) { 25841 return; 25842 } 25843 var cpaProto = window.CanvasPixelArray.prototype; 25844 if ('buffer' in cpaProto) { 25845 return; 25846 } 25847 Object.defineProperty(cpaProto, 'buffer', { 25848 get: function get() { 25849 return this; 25850 }, 25851 25852 enumerable: false, 25853 configurable: true 25854 });
vendor: 4,320 bytes, lines 25855-25991
25855 Object.defineProperty(cpaProto, 'byteLength', { 25856 get: function get() { 25857 return this.length; 25858 }, 25859 25860 enumerable: false, 25861 configurable: true 25862 }); 25863 })(); 25864 (function normalizeURLObject() { 25865 if (!globalScope.URL) { 25866 globalScope.URL = globalScope.webkitURL; 25867 } 25868 })(); 25869 (function checkObjectDefinePropertyCompatibility() { 25870 if (typeof Object.defineProperty !== 'undefined') { 25871 var definePropertyPossible = true; 25872 try { 25873 if (hasDOM) { 25874 Object.defineProperty(new Image(), 'id', { value: 'test' }); 25875 } 25876 var Test = function Test() {}; 25877 Test.prototype = { 25878 get id() {} 25879 }; 25880 Object.defineProperty(new Test(), 'id', { 25881 value: '', 25882 configurable: true, 25883 enumerable: true, 25884 writable: false 25885 }); 25886 } catch (e) { 25887 definePropertyPossible = false; 25888 } 25889 if (definePropertyPossible) { 25890 return; 25891 } 25892 } 25893 Object.defineProperty = function objectDefineProperty(obj, name, def) { 25894 delete obj[name]; 25895 if ('get' in def) { 25896 obj.__defineGetter__(name, def['get']); 25897 } 25898 if ('set' in def) { 25899 obj.__defineSetter__(name, def['set']); 25900 } 25901 if ('value' in def) { 25902 obj.__defineSetter__(name, function objectDefinePropertySetter(value) { 25903 this.__defineGetter__(name, function objectDefinePropertyGetter() { 25904 return value; 25905 }); 25906 return value; 25907 }); 25908 obj[name] = def.value; 25909 } 25910 }; 25911 })(); 25912 (function checkXMLHttpRequestResponseCompatibility() { 25913 if (typeof XMLHttpRequest === 'undefined') { 25914 return; 25915 } 25916 var xhrPrototype = XMLHttpRequest.prototype; 25917 var xhr = new XMLHttpRequest(); 25918 if (!('overrideMimeType' in xhr)) { 25919 Object.defineProperty(xhrPrototype, 'overrideMimeType', { 25920 value: function xmlHttpRequestOverrideMimeType(mimeType) {} 25921 }); 25922 } 25923 if ('responseType' in xhr) { 25924 return; 25925 } 25926 Object.defineProperty(xhrPrototype, 'responseType', { 25927 get: function xmlHttpRequestGetResponseType() { 25928 return this._responseType || 'text'; 25929 }, 25930 set: function xmlHttpRequestSetResponseType(value) { 25931 if (value === 'text' || value === 'arraybuffer') { 25932 this._responseType = value; 25933 if (value === 'arraybuffer' && typeof this.overrideMimeType === 'function') { 25934 this.overrideMimeType('text/plain; charset=x-user-defined'); 25935 } 25936 } 25937 } 25938 }); 25939 if (typeof VBArray !== 'undefined') { 25940 Object.defineProperty(xhrPrototype, 'response', { 25941 get: function xmlHttpRequestResponseGet() { 25942 if (this.responseType === 'arraybuffer') { 25943 return new Uint8Array(new VBArray(this.responseBody).toArray()); 25944 } 25945 return this.responseText; 25946 } 25947 }); 25948 return; 25949 } 25950 Object.defineProperty(xhrPrototype, 'response', { 25951 get: function xmlHttpRequestResponseGet() { 25952 if (this.responseType !== 'arraybuffer') { 25953 return this.responseText; 25954 } 25955 var text = this.responseText; 25956 var i, 25957 n = text.length; 25958 var result = new Uint8Array(n); 25959 for (i = 0; i < n; ++i) { 25960 result[i] = text.charCodeAt(i) & 0xFF; 25961 } 25962 return result.buffer; 25963 } 25964 }); 25965 })(); 25966 (function checkWindowBtoaCompatibility() { 25967 if ('btoa' in globalScope) { 25968 return; 25969 } 25970 var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; 25971 globalScope.btoa = function (chars) { 25972 var buffer = ''; 25973 var i, n; 25974 for (i = 0, n = chars.length; i < n; i += 3) { 25975 var b1 = chars.charCodeAt(i) & 0xFF; 25976 var b2 = chars.charCodeAt(i + 1) & 0xFF; 25977 var b3 = chars.charCodeAt(i + 2) & 0xFF; 25978 var d1 = b1 >> 2, 25979 d2 = (b1 & 3) << 4 | b2 >> 4; 25980 var d3 = i + 1 < n ? (b2 & 0xF) << 2 | b3 >> 6 : 64; 25981 var d4 = i + 2 < n ? b3 & 0x3F : 64; 25982 buffer += digits.charAt(d1) + digits.charAt(d2) + digits.charAt(d3) + digits.charAt(d4); 25983 } 25984 return buffer; 25985 }; 25986 })(); 25987 (function checkWindowAtobCompatibility() { 25988 if ('atob' in globalScope) { 25989 return; 25990 } 25991 var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
25991+/='; 25992 globalScope.atob = function (input) { 25993 input = input.replace(/=+$/, ''); 25994 if (input.length % 4 === 1) { 25995 throw new Error('bad atob input'); 25996 } 25997 for (var bc = 0, bs, buffer, idx = 0, output = ''; buffer = input.charAt(idx++); ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0) { 25998 buffer = digits.indexOf(buffer); 25999 } 26000 return output; 26001 }; 26002 })(); 26003 (function checkFunctionPrototypeBindCompatibility() { 26004 if (typeof Function.prototype.bind !== 'undefined') { 26005 return; 26006 } 26007 Function.prototype.bind = function functionPrototypeBind(obj) { 26008 var fn = this, 26009 headArgs = Array.prototype.slice.call(arguments, 1); 26010 var bound = function functionPrototypeBindBound() { 26011 var args = headArgs.concat(Array.prototype.slice.call(arguments)); 26012 return fn.apply(obj, args); 26013 }; 26014 return bound; 26015 }; 26016 })(); 26017 (function checkDatasetProperty() { 26018 if (!hasDOM) { 26019 return; 26020 } 26021 var div = document.createElement('div'); 26022 if ('dataset' in div) { 26023 return; 26024 } 26025 Object.defineProperty(HTMLElement.prototype, 'dataset', { 26026 get: function get() { 26027 if (this._dataset) { 26028 return this._dataset; 26029 } 26030 var dataset = {}; 26031 for (var j = 0, jj = this.attributes.length; j < jj; j++) { 26032 var attribute = this.attributes[j]; 26033 if (attribute.name.substring(0, 5) !== 'data-') { 26034 continue; 26035 } 26036 var key = attribute.name.substring(5).replace(/\-([a-z])/g, function (all, ch) { 26037 return ch.toUpperCase(); 26038 }); 26039 dataset[key] = attribute.value; 26040 } 26041 Object.defineProperty(this, '_dataset', { 26042 value: dataset, 26043 writable: false, 26044 enumerable: false 26045 }); 26046 return dataset; 26047 }, 26048 26049 enumerable: true 26050 }); 26051 })(); 26052 (function checkClassListProperty() { 26053 function changeList(element, itemName, add, remove) { 26054 var s = element.className || ''; 26055 var list = s.split(/\s+/g); 26056 if (list[0] === '') { 26057 list.shift(); 26058 } 26059 var index = list.indexOf(itemName); 26060 if (index < 0 && add) { 26061 list.push(itemName); 26062 } 26063 if (index >= 0 && remove) { 26064 list.splice(index, 1); 26065 } 26066 element.className = list.join(' '); 26067 return index >= 0; 26068 } 26069 if (!hasDOM) { 26070 return; 26071 } 26072 var div = document.createElement('div'); 26073 if ('classList' in div) { 26074 return; 26075 } 26076 var classListPrototype = { 26077 add: function add(name) { 26078 changeList(this.element, name, true, false); 26079 }, 26080 contains: function contains(name) { 26081 return changeList(this.element, name, false, false); 26082 }, 26083 remove: function remove(name) { 26084 changeList(this.element, name, false, true); 26085 }, 26086 toggle: function toggle(name) { 26087 changeList(this.element, name, true, true); 26088 } 26089 }; 26090 Object.defineProperty(HTMLElement.prototype, 'classList', { 26091 get: function get() { 26092 if (this._classList) { 26093 return this._classList; 26094 } 26095 var classList = Object.create(classListPrototype, { 26096 element: { 26097 value: this, 26098 writable: false, 26099 enumerable: true 26100 } 26101 }); 26102 Object.defineProperty(this, '_classList', { 26103 value: classList, 26104 writable: false, 26105 enumerable: false 26106 }); 26107 return classList; 26108 }, 26109 26110 enumerable: true 26111 }); 26112 })(); 26113 (function checkWorkerConsoleCompatibility() { 26114 if (typeof importScripts === 'undefined' || 'console' in globalScope) { 26115 return; 26116 } 26117 var consoleTimer = {}; 26118 var workerConsole = { 26119 log: function log() { 26120 var args = Array.prototype.slice.call(arguments); 26121 globalScope.postMessage({ 26122 targetName: 'main', 26123 action: 'console_log', 26124 data: args 26125 }); 26126 }, 26127 error: function error() { 26128 var args = Array.prototype.slice.call(arguments); 26129 globalScope.postMessage({ 26130 targetName: 'main', 26131 action: 'console_error', 26132 data: args 26133 }); 26134 }, 26135 time: function time(name) { 26136 consoleTimer[name] = Date.now(); 26137 }, 26138 timeEnd: function timeEnd(name) { 26139 var time = consoleTimer[name]; 26140 if (!time) { 26141 throw new Error('Unknown timer name ' + name); 26142 } 26143 this.log('Timer:', name, Date.now() - time); 26144 } 26145 }; 26146 globalScope.console = workerConsole; 26147 })(); 26148 (function checkConsoleCompatibility() { 26149 if (!hasDOM) { 26150 return; 26151 } 26152 if (!('console' in window)) { 26153 window.console = { 26154 log: function log() {}, 26155 error: function error() {}, 26156 warn: function warn() {} 26157 }; 26158 return; 26159 } 26160 if (!('bind' in console.log)) { 26161 console.log = function (fn) { 26162 return function (msg) { 26163 return fn(msg); 26164 }; 26165 }(console.log); 26166 console.error = function (fn) { 26167 return function (msg) { 26168 return fn(msg); 26169 }; 26170 }(console.error); 26171 console.warn = function (fn) { 26172 return function (msg) { 26173 return fn(msg); 26174 }; 26175 }(console.warn); 26176 return; 26177 } 26178 })(); 26179 (function checkOnClickCompatibility() { 26180 function ignoreIfTargetDisabled(event) { 26181 if (isDisabled(event.target)) { 26182 event.stopPropagation(); 26183 } 26184 } 26185 function isDisabled(node) { 26186 return node.disabled || node.parentNode && isDisabled(node.parentNode); 26187 } 26188 if (isOpera) { 26189 document.addEventListener('click', ignoreIfTargetDisabled, true); 26190 } 26191 })(); 26192 (function checkOnBlobSupport() { 26193 if (isIE || isIOSChrome) { 26194 PDFJS.disableCreateObjectURL = true; 26195 } 26196 })(); 26197 (function checkNavigatorLanguage() { 26198 if (typeof navigator === 'undefined') { 26199 return; 26200 } 26201 if ('language' in navigator) { 26202 return; 26203 } 26204 PDFJS.locale = navigator.userLanguage || 'en-US'; 26205 })(); 26206 (function checkRangeRequests() {
26207 if (isSafari || isAndroidPre3 || isChromeWithRangeBug || isIOS) { 26208 PDFJS.disableRange = true; 26209 PDFJS.disableStream = true; 26210 } 26211 })(); 26212 (function checkHistoryManipulation() { 26213 if (!hasDOM) { 26214 return; 26215 } 26216 if (!history.pushState || isAndroidPre3) { 26217 PDFJS.disableHistory = true; 26218 } 26219 })(); 26220 (function checkSetPresenceInImageData() { 26221 if (!hasDOM) { 26222 return; 26223 } 26224 if (window.CanvasPixelArray) { 26225 if (typeof window.CanvasPixelArray.prototype.set !== 'function') { 26226 window.CanvasPixelArray.prototype.set = function (arr) { 26227 for (var i = 0, ii = this.length; i < ii; i++) { 26228 this[i] = arr[i]; 26229 } 26230 }; 26231 } 26232 } else { 26233 var polyfill = false, 26234 versionMatch; 26235 if (isChrome) { 26236 versionMatch = userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); 26237 polyfill = versionMatch && parseInt(versionMatch[2]) < 21; 26238 } else if (isAndroid) { 26239 polyfill = isAndroidPre5; 26240 } else if (isSafari) { 26241 versionMatch = userAgent.match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//); 26242 polyfill = versionMatch && parseInt(versionMatch[1]) < 6; 26243 } 26244 if (polyfill) { 26245 var contextPrototype = window.CanvasRenderingContext2D.prototype; 26246 var createImageData = contextPrototype.createImageData; 26247 contextPrototype.createImageData = function (w, h) { 26248 var imageData = createImageData.call(this, w, h); 26249 imageData.data.set = function (arr) { 26250 for (var i = 0, ii = this.length; i < ii; i++) { 26251 this[i] = arr[i]; 26252 } 26253 }; 26254 return imageData; 26255 }; 26256 contextPrototype = null; 26257 } 26258 } 26259 })(); 26260 (function checkRequestAnimationFrame() { 26261 function installFakeAnimationFrameFunctions() { 26262 window.requestAnimationFrame = function (callback) { 26263 return window.setTimeout(callback, 20); 26264 }; 26265 window.cancelAnimationFrame = function (timeoutID) { 26266 window.clearTimeout(timeoutID); 26267 }; 26268 } 26269 if (!hasDOM) { 26270 return; 26271 } 26272 if (isIOS) { 26273 installFakeAnimationFrameFunctions(); 26274 return; 26275 } 26276 if ('requestAnimationFrame' in window) { 26277 return; 26278 } 26279 window.requestAnimationFrame = window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame; 26280 if (window.requestAnimationFrame) { 26281 return; 26282 } 26283 installFakeAnimationFrameFunctions(); 26284 })(); 26285 (function checkCanvasSizeLimitation() { 26286 if (isIOS || isAndroid) { 26287 PDFJS.maxCanvasPixels = 5242880; 26288 } 26289 })(); 26290 (function checkFullscreenSupport() { 26291 if (!hasDOM) { 26292 return; 26293 } 26294 if (isIE && window.parent !== window) { 26295 PDFJS.disableFullscreen = true; 26296 } 26297 })(); 26298 (function checkCurrentScript() { 26299 if (!hasDOM) { 26300 return; 26301 } 26302 if ('currentScript' in document) { 26303 return; 26304 } 26305 Object.defineProperty(document, 'currentScript', { 26306 get: function get() { 26307 var scripts = document.getElementsByTagName('script'); 26308 return scripts[scripts.length - 1]; 26309 }, 26310 26311 enumerable: true, 26312 configurable: true 26313 }); 26314 })(); 26315 (function checkInputTypeNumberAssign() { 26316 if (!hasDOM) { 26317 return; 26318 } 26319 var el = document.createElement('input'); 26320 try { 26321 el.type = 'number'; 26322 } catch (ex) { 26323 var inputProto = el.constructor.prototype; 26324 var typeProperty = Object.getOwnPropertyDescriptor(inputProto, 'type'); 26325 Object.defineProperty(inputProto, 'type', { 26326 get: function get() { 26327 return typeProperty.get.call(this); 26328 }, 26329 set: function set(value) { 26330 typeProperty.set.call(this, value === 'number' ? 'text' : value); 26331 }, 26332 26333 enumerable: true, 26334 configurable: true 26335 }); 26336 } 26337 })(); 26338 (function checkDocumentReadyState() { 26339 if (!hasDOM) { 26340 return; 26341 } 26342 if (!document.attachEvent) { 26343 return; 26344 } 26345 var documentProto = document.constructor.prototype; 26346 var readyStateProto = Object.getOwnPropertyDescriptor(documentProto, 'readyState'); 26347 Object.defineProperty(documentProto, 'readyState', { 26348 get: function get() { 26349 var value = readyStateProto.get.call(this); 26350 return value === 'interactive' ? 'loading' : value; 26351 }, 26352 set: function set(value) { 26353 readyStateProto.set.call(this, value); 26354 }, 26355 26356 enumerable: true, 26357 configurable: true 26358 }); 26359 })(); 26360 (function checkChildNodeRemove() { 26361 if (!hasDOM) { 26362 return; 26363 } 26364 if (typeof Element.prototype.remove !== 'undefined') { 26365 return; 26366 } 26367 Element.prototype.remove = function () { 26368 if (this.parentNode) { 26369 this.parentNode.removeChild(this); 26370 } 26371 }; 26372 })(); 26373 (function checkNumberIsNaN() { 26374 if (Number.isNaN) { 26375 return; 26376 } 26377 Number.isNaN = function (value) { 26378 return typeof value === 'number' && isNaN(value); 26379 }; 26380 })(); 26381 (function checkNumberIsInteger() { 26382 if (Number.isInteger) { 26383 return; 26384 } 26385 Number.isInteger = function (value) { 26386 return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; 26387 }; 26388 })(); 26389 (function checkPromise() { 26390 if (globalScope.Promise) { 26391 if (typeof globalScope.Promise.all !== 'function') { 26392 globalScope.Promise.all = function (iterable) { 26393 var count = 0, 26394 results = [], 26395 resolve, 26396 reject; 26397 var promise = new globalScope.Promise(function (resolve_, reject_) { 26398 resolve = resolve_; 26399 reject = reject_; 26400 }); 26401 iterable.forEach(function (p, i) { 26402 count++; 26403 p.then(function (result) { 26404 results[i] = result; 26405 count--; 26406 if (count === 0) { 26407 resolve(results); 26408 } 26409 }, reject); 26410 }); 26411 if (count === 0) { 26412 resolve(results); 26413 } 26414 return promise; 26415 }; 26416 } 26417 if (typeof globalScope.Promise.resolve !== 'function') { 26418 globalScope.Promise.resolve = function (value) { 26419 return new globalScope.Promise(function (resolve) { 26420 resolve(value); 26421 }); 26422 }; 26423 } 26424 if (typeof globalScope.Promise.reject !== 'function') { 26425 globalScope.Promise.reject = function (reason) { 26426 return new globalScope.Promise(function (resolve, reject) { 26427 reject(reason); 26428 }); 26429 }; 26430 } 26431 if (typeof globalScope.Promise.prototype.catch !== 'function') { 26432 globalScope.Promise.prototype.catch = function (onReject) { 26433 return globalScope.Promise.prototype.then(undefined, onReject); 26434 }; 26435 } 26436 return; 26437 } 26438 var STATUS_PENDING = 0; 26439 var STATUS_RESOLVED = 1; 26440 var STATUS_REJECTED = 2; 26441 var REJECTION_TIMEOUT = 500; 26442 var HandlerManager = { 26443 handlers: [], 26444 running: false, 26445 unhandledRejections: [],
vendor: 3,463 bytes, lines 26446-26543
26446 pendingRejectionCheck: false, 26447 scheduleHandlers: function scheduleHandlers(promise) { 26448 if (promise._status === STATUS_PENDING) { 26449 return; 26450 } 26451 this.handlers = this.handlers.concat(promise._handlers); 26452 promise._handlers = []; 26453 if (this.running) { 26454 return; 26455 } 26456 this.running = true; 26457 setTimeout(this.runHandlers.bind(this), 0); 26458 }, 26459 runHandlers: function runHandlers() { 26460 var RUN_TIMEOUT = 1; 26461 var timeoutAt = Date.now() + RUN_TIMEOUT; 26462 while (this.handlers.length > 0) { 26463 var handler = this.handlers.shift(); 26464 var nextStatus = handler.thisPromise._status; 26465 var nextValue = handler.thisPromise._value; 26466 try { 26467 if (nextStatus === STATUS_RESOLVED) { 26468 if (typeof handler.onResolve === 'function') { 26469 nextValue = handler.onResolve(nextValue); 26470 } 26471 } else if (typeof handler.onReject === 'function') { 26472 nextValue = handler.onReject(nextValue); 26473 nextStatus = STATUS_RESOLVED; 26474 if (handler.thisPromise._unhandledRejection) { 26475 this.removeUnhandeledRejection(handler.thisPromise); 26476 } 26477 } 26478 } catch (ex) { 26479 nextStatus = STATUS_REJECTED; 26480 nextValue = ex; 26481 } 26482 handler.nextPromise._updateStatus(nextStatus, nextValue); 26483 if (Date.now() >= timeoutAt) { 26484 break; 26485 } 26486 } 26487 if (this.handlers.length > 0) { 26488 setTimeout(this.runHandlers.bind(this), 0); 26489 return; 26490 } 26491 this.running = false; 26492 }, 26493 addUnhandledRejection: function addUnhandledRejection(promise) { 26494 this.unhandledRejections.push({ 26495 promise: promise, 26496 time: Date.now() 26497 }); 26498 this.scheduleRejectionCheck(); 26499 }, 26500 removeUnhandeledRejection: function removeUnhandeledRejection(promise) { 26501 promise._unhandledRejection = false; 26502 for (var i = 0; i < this.unhandledRejections.length; i++) { 26503 if (this.unhandledRejections[i].promise === promise) { 26504 this.unhandledRejections.splice(i); 26505 i--; 26506 } 26507 } 26508 }, 26509 scheduleRejectionCheck: function scheduleRejectionCheck() { 26510 var _this = this; 26511 26512 if (this.pendingRejectionCheck) { 26513 return; 26514 } 26515 this.pendingRejectionCheck = true; 26516 setTimeout(function () { 26517 _this.pendingRejectionCheck = false; 26518 var now = Date.now(); 26519 for (var i = 0; i < _this.unhandledRejections.length; i++) { 26520 if (now - _this.unhandledRejections[i].time > REJECTION_TIMEOUT) { 26521 var unhandled = _this.unhandledRejections[i].promise._value; 26522 var msg = 'Unhandled rejection: ' + unhandled; 26523 if (unhandled.stack) { 26524 msg += '\n' + unhandled.stack; 26525 } 26526 try { 26527 throw new Error(msg); 26528 } catch (_) { 26529 console.warn(msg); 26530 } 26531 _this.unhandledRejections.splice(i); 26532 i--; 26533 } 26534 } 26535 if (_this.unhandledRejections.length) { 26536 _this.scheduleRejectionCheck(); 26537 } 26538 }, REJECTION_TIMEOUT); 26539 } 26540 }; 26541 var Promise = function Promise(resolver) { 26542 this._status = STATUS_PENDING; 26543 this._handlers = [];
26544 try { 26545 resolver.call(this, this._resolve.bind(this), this._reject.bind(this)); 26546 } catch (e) { 26547 this._reject(e); 26548 } 26549 }; 26550 Promise.all = function Promise_all(promises) { 26551 var resolveAll, rejectAll; 26552 var deferred = new Promise(function (resolve, reject) { 26553 resolveAll = resolve; 26554 rejectAll = reject; 26555 }); 26556 var unresolved = promises.length; 26557 var results = []; 26558 if (unresolved === 0) { 26559 resolveAll(results); 26560 return deferred; 26561 } 26562 function reject(reason) { 26563 if (deferred._status === STATUS_REJECTED) { 26564 return; 26565 } 26566 results = []; 26567 rejectAll(reason); 26568 } 26569 for (var i = 0, ii = promises.length; i < ii; ++i) { 26570 var promise = promises[i]; 26571 var resolve = function (i) { 26572 return function (value) { 26573 if (deferred._status === STATUS_REJECTED) { 26574 return; 26575 } 26576 results[i] = value; 26577 unresolved--; 26578 if (unresolved === 0) { 26579 resolveAll(results); 26580 } 26581 }; 26582 }(i); 26583 if (Promise.isPromise(promise)) { 26584 promise.then(resolve, reject); 26585 } else { 26586 resolve(promise); 26587 } 26588 } 26589 return deferred; 26590 }; 26591 Promise.isPromise = function Promise_isPromise(value) { 26592 return value && typeof value.then === 'function'; 26593 }; 26594 Promise.resolve = function Promise_resolve(value) { 26595 return new Promise(function (resolve) { 26596 resolve(value); 26597 }); 26598 }; 26599 Promise.reject = function Promise_reject(reason) { 26600 return new Promise(function (resolve, reject) { 26601 reject(reason); 26602 }); 26603 }; 26604 Promise.prototype = { 26605 _status: null, 26606 _value: null, 26607 _handlers: null, 26608 _unhandledRejection: null, 26609 _updateStatus: function Promise__updateStatus(status, value) { 26610 if (this._status === STATUS_RESOLVED || this._status === STATUS_REJECTED) { 26611 return; 26612 } 26613 if (status === STATUS_RESOLVED && Promise.isPromise(value)) { 26614 value.then(this._updateStatus.bind(this, STATUS_RESOLVED), this._updateStatus.bind(this, STATUS_REJECTED)); 26615 return; 26616 } 26617 this._status = status; 26618 this._value = value; 26619 if (status === STATUS_REJECTED && this._handlers.length === 0) { 26620 this._unhandledRejection = true; 26621 HandlerManager.addUnhandledRejection(this); 26622 } 26623 HandlerManager.scheduleHandlers(this); 26624 }, 26625 _resolve: function Promise_resolve(value) { 26626 this._updateStatus(STATUS_RESOLVED, value); 26627 }, 26628 _reject: function Promise_reject(reason) { 26629 this._updateStatus(STATUS_REJECTED, reason); 26630 }, 26631 then: function Promise_then(onResolve, onReject) { 26632 var nextPromise = new Promise(function (resolve, reject) { 26633 this.resolve = resolve; 26634 this.reject = reject; 26635 }); 26636 this._handlers.push({ 26637 thisPromise: this, 26638 onResolve: onResolve, 26639 onReject: onReject, 26640 nextPromise: nextPromise 26641 }); 26642 HandlerManager.scheduleHandlers(this); 26643 return nextPromise; 26644 }, 26645 catch: function Promise_catch(onReject) { 26646 return this.then(undefined, onReject); 26647 } 26648 }; 26649 globalScope.Promise = Promise; 26650 })(); 26651 (function checkWeakMap() { 26652 if (globalScope.WeakMap) { 26653 return; 26654 } 26655 globalScope.WeakMap = __w_pdfjs_require__(92); 26656 })(); 26657 (function checkURLConstructor() { 26658 var hasWorkingUrl = false; 26659 try { 26660 if (typeof URL === 'function' && _typeof(URL.prototype) === 'object' && 'origin' in URL.prototype) { 26661 var u = new URL('b', 'http://a'); 26662 u.pathname = 'c%20d'; 26663 hasWorkingUrl = u.href === 'http://a/c%20d'; 26664 } 26665 } catch (e) {} 26666 if (hasWorkingUrl) { 26667 return; 26668 } 26669 var relative = Object.create(null); 26670 relative['ftp'] = 21; 26671 relative['file'] = 0; 26672 relative['gopher'] = 70; 26673 relative['http'] = 80; 26674 relative['https'] = 443; 26675 relative['ws'] = 80; 26676 relative['wss'] = 443; 26677 var relativePathDotMapping = Object.create(null); 26678 relativePathDotMapping['%2e'] = '.'; 26679 relativePathDotMapping['.%2e'] = '..'; 26680 relativePathDotMapping['%2e.'] = '..'; 26681 relativePathDotMapping['%2e%2e'] = '..'; 26682 function isRelativeScheme(scheme) { 26683 return relative[scheme] !== undefined; 26684 }
26685 function invalid() { 26686 clear.call(this); 26687 this._isInvalid = true; 26688 } 26689 function IDNAToASCII(h) { 26690 if (h === '') { 26691 invalid.call(this); 26692 } 26693 return h.toLowerCase(); 26694 } 26695 function percentEscape(c) { 26696 var unicode = c.charCodeAt(0); 26697 if (unicode > 0x20 && unicode < 0x7F && [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) === -1) { 26698 return c; 26699 } 26700 return encodeURIComponent(c); 26701 } 26702 function percentEscapeQuery(c) { 26703 var unicode = c.charCodeAt(0); 26704 if (unicode > 0x20 && unicode < 0x7F && [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) === -1) { 26705 return c; 26706 } 26707 return encodeURIComponent(c); 26708 } 26709 var EOF, 26710 ALPHA = /[a-zA-Z]/, 26711 ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; 26712 function parse(input, stateOverride, base) { 26713 function err(message) { 26714 errors.push(message); 26715 } 26716 var state = stateOverride || 'scheme start', 26717 cursor = 0, 26718 buffer = '', 26719 seenAt = false, 26720 seenBracket = false, 26721 errors = []; 26722 loop: while ((input[cursor - 1] !== EOF || cursor === 0) && !this._isInvalid) { 26723 var c = input[cursor]; 26724 switch (state) { 26725 case 'scheme start': 26726 if (c && ALPHA.test(c)) { 26727 buffer += c.toLowerCase(); 26728 state = 'scheme'; 26729 } else if (!stateOverride) { 26730 buffer = ''; 26731 state = 'no scheme'; 26732 continue; 26733 } else { 26734 err('Invalid scheme.'); 26735 break loop; 26736 } 26737 break; 26738 case 'scheme': 26739 if (c && ALPHANUMERIC.test(c)) { 26740 buffer += c.toLowerCase(); 26741 } else if (c === ':') { 26742 this._scheme = buffer; 26743 buffer = ''; 26744 if (stateOverride) { 26745 break loop; 26746 } 26747 if (isRelativeScheme(this._scheme)) { 26748 this._isRelative = true; 26749 } 26750 if (this._scheme === 'file') { 26751 state = 'relative'; 26752 } else if (this._isRelative && base && base._scheme === this._scheme) { 26753 state = 'relative or authority'; 26754 } else if (this._isRelative) { 26755 state = 'authority first slash'; 26756 } else { 26757 state = 'scheme data'; 26758 } 26759 } else if (!stateOverride) { 26760 buffer = ''; 26761 cursor = 0; 26762 state = 'no scheme'; 26763 continue; 26764 } else if (c === EOF) { 26765 break loop; 26766 } else { 26767 err('Code point not allowed in scheme: ' + c); 26768 break loop; 26769 } 26770 break; 26771 case 'scheme data': 26772 if (c === '?') { 26773 this._query = '?'; 26774 state = 'query'; 26775 } else if (c === '#') { 26776 this._fragment = '#'; 26777 state = 'fragment'; 26778 } else { 26779 if (c !== EOF && c !== '\t' && c !== '\n' && c !== '\r') { 26780 this._schemeData += percentEscape(c); 26781 } 26782 } 26783 break; 26784 case 'no scheme': 26785 if (!base || !isRelativeScheme(base._scheme)) { 26786 err('Missing scheme.'); 26787 invalid.call(this); 26788 } else { 26789 state = 'relative'; 26790 continue; 26791 } 26792 break; 26793 case 'relative or authority': 26794 if (c === '/' && input[cursor + 1] === '/') { 26795 state = 'authority ignore slashes'; 26796 } else { 26797 err('Expected /, got: ' + c); 26798 state = 'relative'; 26799 continue; 26800 } 26801 break; 26802 case 'relative': 26803 this._isRelative = true; 26804 if (this._scheme !== 'file') { 26805 this._scheme = base._scheme; 26806 } 26807 if (c === EOF) { 26808 this._host = base._host; 26809 this._port = base._port; 26810 this._path = base._path.slice(); 26811 this._query = base._query; 26812 this._username = base._username; 26813 this._password = base._password; 26814 break loop; 26815 } else if (c === '/' || c === '\\') { 26816 if (c === '\\') {
26817 err('\\ is an invalid code point.'); 26818 } 26819 state = 'relative slash'; 26820 } else if (c === '?') { 26821 this._host = base._host; 26822 this._port = base._port; 26823 this._path = base._path.slice(); 26824 this._query = '?'; 26825 this._username = base._username; 26826 this._password = base._password; 26827 state = 'query'; 26828 } else if (c === '#') { 26829 this._host = base._host; 26830 this._port = base._port; 26831 this._path = base._path.slice(); 26832 this._query = base._query; 26833 this._fragment = '#'; 26834 this._username = base._username; 26835 this._password = base._password; 26836 state = 'fragment'; 26837 } else { 26838 var nextC = input[cursor + 1]; 26839 var nextNextC = input[cursor + 2]; 26840 if (this._scheme !== 'file' || !ALPHA.test(c) || nextC !== ':' && nextC !== '|' || nextNextC !== EOF && nextNextC !== '/' && nextNextC !== '\\' && nextNextC !== '?' && nextNextC !== '#') { 26841 this._host = base._host; 26842 this._port = base._port; 26843 this._username = base._username; 26844 this._password = base._password; 26845 this._path = base._path.slice(); 26846 this._path.pop(); 26847 } 26848 state = 'relative path'; 26849 continue; 26850 } 26851 break; 26852 case 'relative slash': 26853 if (c === '/' || c === '\\') { 26854 if (c === '\\') { 26855 err('\\ is an invalid code point.'); 26856 } 26857 if (this._scheme === 'file') { 26858 state = 'file host'; 26859 } else { 26860 state = 'authority ignore slashes'; 26861 } 26862 } else { 26863 if (this._scheme !== 'file') { 26864 this._host = base._host; 26865 this._port = base._port; 26866 this._username = base._username; 26867 this._password = base._password; 26868 } 26869 state = 'relative path'; 26870 continue; 26871 } 26872 break; 26873 case 'authority first slash': 26874 if (c === '/') { 26875 state = 'authority second slash'; 26876 } else { 26877 err('Expected \'/\', got: ' + c); 26878 state = 'authority ignore slashes'; 26879 continue; 26880 } 26881 break; 26882 case 'authority second slash': 26883 state = 'authority ignore slashes'; 26884 if (c !== '/') { 26885 err('Expected \'/\', got: ' + c); 26886 continue; 26887 } 26888 break; 26889 case 'authority ignore slashes': 26890 if (c !== '/' && c !== '\\') { 26891 state = 'authority'; 26892 continue; 26893 } else { 26894 err('Expected authority, got: ' + c); 26895 } 26896 break; 26897 case 'authority': 26898 if (c === '@') { 26899 if (seenAt) { 26900 err('@ already seen.'); 26901 buffer += '%40'; 26902 } 26903 seenAt = true; 26904 for (var i = 0; i < buffer.length; i++) { 26905 var cp = buffer[i]; 26906 if (cp === '\t' || cp === '\n' || cp === '\r') { 26907 err('Invalid whitespace in authority.'); 26908 continue; 26909 } 26910 if (cp === ':' && this._password === null) { 26911 this._password = ''; 26912 continue; 26913 } 26914 var tempC = percentEscape(cp); 26915 if (this._password !== null) { 26916 this._password += tempC; 26917 } else { 26918 this._username += tempC; 26919 } 26920 } 26921 buffer = ''; 26922 } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') { 26923 cursor -= buffer.length; 26924 buffer = ''; 26925 state = 'host'; 26926 continue; 26927 } else { 26928 buffer += c; 26929 } 26930 break; 26931 case 'file host': 26932 if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') { 26933 if (buffer.length === 2 && ALPHA.test(buffer[0]) && (buffer[1] === ':' || buffer[1] === '|')) { 26934 state = 'relative path'; 26935 } else if (buffer.length === 0) { 26936 state = 'relative path start'; 26937 } else {
26938 this._host = IDNAToASCII.call(this, buffer); 26939 buffer = ''; 26940 state = 'relative path start'; 26941 } 26942 continue; 26943 } else if (c === '\t' || c === '\n' || c === '\r') { 26944 err('Invalid whitespace in file host.'); 26945 } else { 26946 buffer += c; 26947 } 26948 break; 26949 case 'host': 26950 case 'hostname': 26951 if (c === ':' && !seenBracket) { 26952 this._host = IDNAToASCII.call(this, buffer); 26953 buffer = ''; 26954 state = 'port'; 26955 if (stateOverride === 'hostname') { 26956 break loop; 26957 } 26958 } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') { 26959 this._host = IDNAToASCII.call(this, buffer); 26960 buffer = ''; 26961 state = 'relative path start'; 26962 if (stateOverride) { 26963 break loop; 26964 } 26965 continue; 26966 } else if (c !== '\t' && c !== '\n' && c !== '\r') { 26967 if (c === '[') { 26968 seenBracket = true; 26969 } else if (c === ']') { 26970 seenBracket = false; 26971 } 26972 buffer += c; 26973 } else { 26974 err('Invalid code point in host/hostname: ' + c); 26975 } 26976 break; 26977 case 'port': 26978 if (/[0-9]/.test(c)) { 26979 buffer += c; 26980 } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#' || stateOverride) { 26981 if (buffer !== '') { 26982 var temp = parseInt(buffer, 10); 26983 if (temp !== relative[this._scheme]) { 26984 this._port = temp + ''; 26985 } 26986 buffer = ''; 26987 } 26988 if (stateOverride) { 26989 break loop; 26990 } 26991 state = 'relative path start'; 26992 continue; 26993 } else if (c === '\t' || c === '\n' || c === '\r') { 26994 err('Invalid code point in port: ' + c); 26995 } else { 26996 invalid.call(this); 26997 } 26998 break; 26999 case 'relative path start': 27000 if (c === '\\') { 27001 err('\'\\\' not allowed in path.'); 27002 } 27003 state = 'relative path'; 27004 if (c !== '/' && c !== '\\') { 27005 continue; 27006 } 27007 break; 27008 case 'relative path': 27009 if (c === EOF || c === '/' || c === '\\' || !stateOverride && (c === '?' || c === '#')) { 27010 if (c === '\\') { 27011 err('\\ not allowed in relative path.'); 27012 } 27013 var tmp; 27014 if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { 27015 buffer = tmp; 27016 } 27017 if (buffer === '..') { 27018 this._path.pop(); 27019 if (c !== '/' && c !== '\\') { 27020 this._path.push(''); 27021 } 27022 } else if (buffer === '.' && c !== '/' && c !== '\\') { 27023 this._path.push(''); 27024 } else if (buffer !== '.') { 27025 if (this._scheme === 'file' && this._path.length === 0 && buffer.length === 2 && ALPHA.test(buffer[0]) && buffer[1] === '|') { 27026 buffer = buffer[0] + ':'; 27027 } 27028 this._path.push(buffer); 27029 } 27030 buffer = ''; 27031 if (c === '?') { 27032 this._query = '?'; 27033 state = 'query'; 27034 } else if (c === '#') { 27035 this._fragment = '#'; 27036 state = 'fragment'; 27037 } 27038 } else if (c !== '\t' && c !== '\n' && c !== '\r') { 27039 buffer += percentEscape(c); 27040 } 27041 break; 27042 case 'query': 27043 if (!stateOverride && c === '#') { 27044 this._fragment = '#'; 27045 state = 'fragment'; 27046 } else if (c !== EOF && c !== '\t' && c !== '\n' && c !== '\r') { 27047 this._query += percentEscapeQuery(c); 27048 } 27049 break; 27050 case 'fragment': 27051 if (c !== EOF && c !== '\t' && c !== '\n' && c !== '\r') { 27052 this._fragment += c; 27053 } 27054 break; 27055 } 27056 cursor++; 27057 } 27058 } 27059 function clear() { 27060 this._scheme = ''; 27061 this._schemeData = ''; 27062 this._username = ''; 27063 this._password = null; 27064 this._host = ''; 27065 this._port = ''; 27066 this._path = []; 27067 this._query = ''; 27068 this._fragment = ''; 27069 this._isInvalid = false;
27070 this._isRelative = false; 27071 } 27072 function JURL(url, base) { 27073 if (base !== undefined && !(base instanceof JURL)) { 27074 base = new JURL(String(base)); 27075 } 27076 this._url = url; 27077 clear.call(this); 27078 var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ''); 27079 parse.call(this, input, null, base); 27080 } 27081 JURL.prototype = { 27082 toString: function toString() { 27083 return this.href; 27084 }, 27085 27086 get href() { 27087 if (this._isInvalid) { 27088 return this._url; 27089 } 27090 var authority = ''; 27091 if (this._username !== '' || this._password !== null) { 27092 authority = this._username + (this._password !== null ? ':' + this._password : '') + '@'; 27093 } 27094 return this.protocol + (this._isRelative ? '//' + authority + this.host : '') + this.pathname + this._query + this._fragment; 27095 }, 27096 set href(value) { 27097 clear.call(this); 27098 parse.call(this, value); 27099 }, 27100 get protocol() { 27101 return this._scheme + ':'; 27102 }, 27103 set protocol(value) { 27104 if (this._isInvalid) { 27105 return; 27106 } 27107 parse.call(this, value + ':', 'scheme start'); 27108 }, 27109 get host() { 27110 return this._isInvalid ? '' : this._port ? this._host + ':' + this._port : this._host; 27111 }, 27112 set host(value) { 27113 if (this._isInvalid || !this._isRelative) { 27114 return; 27115 } 27116 parse.call(this, value, 'host'); 27117 }, 27118 get hostname() { 27119 return this._host; 27120 }, 27121 set hostname(value) { 27122 if (this._isInvalid || !this._isRelative) { 27123 return; 27124 } 27125 parse.call(this, value, 'hostname'); 27126 }, 27127 get port() { 27128 return this._port; 27129 }, 27130 set port(value) { 27131 if (this._isInvalid || !this._isRelative) { 27132 return; 27133 } 27134 parse.call(this, value, 'port'); 27135 }, 27136 get pathname() { 27137 return this._isInvalid ? '' : this._isRelative ? '/' + this._path.join('/') : this._schemeData; 27138 }, 27139 set pathname(value) { 27140 if (this._isInvalid || !this._isRelative) { 27141 return; 27142 } 27143 this._path = []; 27144 parse.call(this, value, 'relative path start'); 27145 }, 27146 get search() { 27147 return this._isInvalid || !this._query || this._query === '?' ? '' : this._query; 27148 }, 27149 set search(value) { 27150 if (this._isInvalid || !this._isRelative) { 27151 return; 27152 } 27153 this._query = '?'; 27154 if (value[0] === '?') { 27155 value = value.slice(1); 27156 } 27157 parse.call(this, value, 'query'); 27158 }, 27159 get hash() { 27160 return this._isInvalid || !this._fragment || this._fragment === '#' ? '' : this._fragment; 27161 }, 27162 set hash(value) { 27163 if (this._isInvalid) { 27164 return; 27165 } 27166 this._fragment = '#'; 27167 if (value[0] === '#') { 27168 value = value.slice(1); 27169 } 27170 parse.call(this, value, 'fragment'); 27171 }, 27172 get origin() { 27173 var host; 27174 if (this._isInvalid || !this._scheme) { 27175 return ''; 27176 } 27177 switch (this._scheme) { 27178 case 'data': 27179 case 'file': 27180 case 'javascript': 27181 case 'mailto': 27182 return 'null'; 27183 case 'blob': 27184 try { 27185 return new JURL(this._schemeData).origin || 'null'; 27186 } catch (_) {} 27187 return 'null'; 27188 } 27189 host = this.host; 27190 if (!host) { 27191 return ''; 27192 } 27193 return this._scheme + '://' + host; 27194 } 27195 }; 27196 var OriginalURL = globalScope.URL; 27197 if (OriginalURL) { 27198 JURL.createObjectURL = function (blob) { 27199 return OriginalURL.createObjectURL.apply(OriginalURL, arguments); 27200 }; 27201 JURL.revokeObjectURL = function (url) { 27202 OriginalURL.revokeObjectURL(url); 27203 }; 27204 } 27205 globalScope.URL = JURL; 27206 })(); 27207} 27208 27209/***/ }), 27210/* 75 */ 27211/***/ (function(module, exports, __w_pdfjs_require__) { 27212 27213"use strict"; 27214 27215 27216module.exports = typeof window !== 'undefined' && window.Math === Math ? window : typeof global !== 'undefined' && global.Math === Math ? global : typeof self !== 'undefined' && self.Math === Math ? self : {}; 27217 27218/***/ }), 27219/* 76 */ 27220/***/ (function(module, exports, __w_pdfjs_require__) { 27221 27222"use strict"; 27223 27224 27225__w_pdfjs_require__(77); 27226module.exports = __w_pdfjs_require__(19).Uint8ClampedArray; 27227 27228/***/ }), 27229/* 77 */ 27230/***/ (function(module, exports, __w_pdfjs_require__) { 27231 27232"use strict"; 27233 27234 27235__w_pdfjs_require__(78)('Uint8', 1, function (init) { 27236 return function Uint8ClampedArray(data, byteOffset, length) { 27237 return init(this, data, byteOffset, length); 27238 }; 27239}, true); 27240 27241/***/ }), 27242/* 78 */ 27243/***/ (function(module, exports, __w_pdfjs_require__) { 27244 27245"use strict"; 27246 27247 27248var _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; }; 27249 27250if (__w_pdfjs_require__(8)) { 27251 var LIBRARY = __w_pdfjs_require__(30); 27252 var global = __w_pdfjs_require__(3); 27253 var fails = __w_pdfjs_require__(9); 27254 var $export = __w_pdfjs_require__(18); 27255 var $typed = __w_pdfjs_require__(45); 27256 var $buffer = __w_pdfjs_require__(79); 27257 var ctx = __w_pdfjs_require__(15); 27258 var anInstance = __w_pdfjs_require__(25); 27259 var propertyDesc = __w_pdfjs_require__(23); 27260 var hide = __w_pdfjs_require__(6); 27261 var redefineAll = __w_pdfjs_require__(24); 27262 var toInteger = __w_pdfjs_require__(20); 27263 var toLength = __w_pdfjs_require__(11); 27264 var toIndex = __w_pdfjs_require__(46); 27265 var toAbsoluteIndex = __w_pdfjs_require__(27); 27266 var toPrimitive = __w_pdfjs_require__(31); 27267 var has = __w_pdfjs_require__(7); 27268 var classof = __w_pdfjs_require__(37); 27269 var isObject = __w_pdfjs_require__(4); 27270 var toObject = __w_pdfjs_require__(16); 27271 var isArrayIter = __w_pdfjs_require__(53); 27272 var create = __w_pdfjs_require__(54); 27273 var getPrototypeOf = __w_pdfjs_require__(55); 27274 var gOPN = __w_pdfjs_require__(47).f; 27275 var getIterFn = __w_pdfjs_require__(56); 27276 var uid = __w_pdfjs_require__(14); 27277 var wks = __w_pdfjs_require__(1); 27278 var createArrayMethod = __w_pdfjs_require__(39); 27279 var createArrayIncludes = __w_pdfjs_require__(50); 27280 var speciesConstructor = __w_pdfjs_require__(85); 27281 var ArrayIterators = __w_pdfjs_require__(57); 27282 var Iterators = __w_pdfjs_require__(17); 27283 var $iterDetect = __w_pdfjs_require__(58); 27284 var setSpecies = __w_pdfjs_require__(90); 27285 var arrayFill = __w_pdfjs_require__(52); 27286 var arrayCopyWithin = __w_pdfjs_require__(91); 27287 var $DP = __w_pdfjs_require__(12); 27288 var $GOPD = __w_pdfjs_require__(59); 27289 var dP = $DP.f; 27290 var gOPD = $GOPD.f; 27291 var RangeError = global.RangeError; 27292 var TypeError = global.TypeError; 27293 var Uint8Array = global.Uint8Array; 27294 var ARRAY_BUFFER = 'ArrayBuffer'; 27295 var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; 27296 var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; 27297 var PROTOTYPE = 'prototype'; 27298 var ArrayProto = Array[PROTOTYPE]; 27299 var $ArrayBuffer = $buffer.ArrayBuffer; 27300 var $DataView = $buffer.DataView; 27301 var arrayForEach = createArrayMethod(0); 27302 var arrayFilter = createArrayMethod(2); 27303 var arraySome = createArrayMethod(3); 27304 var arrayEvery = createArrayMethod(4); 27305 var arrayFind = createArrayMethod(5); 27306 var arrayFindIndex = createArrayMethod(6); 27307 var arrayIncludes = createArrayIncludes(true); 27308 var arrayIndexOf = createArrayIncludes(false); 27309 var arrayValues = ArrayIterators.values; 27310 var arrayKeys = ArrayIterators.keys; 27311 var arrayEntries = ArrayIterators.entries; 27312 var arrayLastIndexOf = ArrayProto.lastIndexOf; 27313 var arrayReduce = ArrayProto.reduce; 27314 var arrayReduceRight = ArrayProto.reduceRight; 27315 var arrayJoin = ArrayProto.join; 27316 var arraySort = ArrayProto.sort; 27317 var arraySlice = ArrayProto.slice; 27318 var arrayToString = ArrayProto.toString;
vendor: 12,226 bytes, lines 27319-27636
27319 var arrayToLocaleString = ArrayProto.toLocaleString; 27320 var ITERATOR = wks('iterator'); 27321 var TAG = wks('toStringTag'); 27322 var TYPED_CONSTRUCTOR = uid('typed_constructor'); 27323 var DEF_CONSTRUCTOR = uid('def_constructor'); 27324 var ALL_CONSTRUCTORS = $typed.CONSTR; 27325 var TYPED_ARRAY = $typed.TYPED; 27326 var VIEW = $typed.VIEW; 27327 var WRONG_LENGTH = 'Wrong length!'; 27328 var $map = createArrayMethod(1, function (O, length) { 27329 return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); 27330 }); 27331 var LITTLE_ENDIAN = fails(function () { 27332 return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; 27333 }); 27334 var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { 27335 new Uint8Array(1).set({}); 27336 }); 27337 var toOffset = function toOffset(it, BYTES) { 27338 var offset = toInteger(it); 27339 if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); 27340 return offset; 27341 }; 27342 var validate = function validate(it) { 27343 if (isObject(it) && TYPED_ARRAY in it) return it; 27344 throw TypeError(it + ' is not a typed array!'); 27345 }; 27346 var allocate = function allocate(C, length) { 27347 if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { 27348 throw TypeError('It is not a typed array constructor!'); 27349 } 27350 return new C(length); 27351 }; 27352 var speciesFromList = function speciesFromList(O, list) { 27353 return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); 27354 }; 27355 var fromList = function fromList(C, list) { 27356 var index = 0; 27357 var length = list.length; 27358 var result = allocate(C, length); 27359 while (length > index) { 27360 result[index] = list[index++]; 27361 }return result; 27362 }; 27363 var addGetter = function addGetter(it, key, internal) { 27364 dP(it, key, { 27365 get: function get() { 27366 return this._d[internal]; 27367 } 27368 }); 27369 }; 27370 var $from = function from(source) { 27371 var O = toObject(source); 27372 var aLen = arguments.length; 27373 var mapfn = aLen > 1 ? arguments[1] : undefined; 27374 var mapping = mapfn !== undefined; 27375 var iterFn = getIterFn(O); 27376 var i, length, values, result, step, iterator; 27377 if (iterFn != undefined && !isArrayIter(iterFn)) { 27378 for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { 27379 values.push(step.value); 27380 } 27381 O = values; 27382 } 27383 if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); 27384 for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { 27385 result[i] = mapping ? mapfn(O[i], i) : O[i]; 27386 } 27387 return result; 27388 }; 27389 var $of = function of() { 27390 var index = 0; 27391 var length = arguments.length; 27392 var result = allocate(this, length); 27393 while (length > index) { 27394 result[index] = arguments[index++]; 27395 }return result; 27396 }; 27397 var TO_LOCALE_BUG = !!Uint8Array && fails(function () { 27398 arrayToLocaleString.call(new Uint8Array(1)); 27399 }); 27400 var $toLocaleString = function toLocaleString() { 27401 return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); 27402 }; 27403 var proto = { 27404 copyWithin: function copyWithin(target, start) { 27405 return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); 27406 }, 27407 every: function every(callbackfn) { 27408 return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); 27409 }, 27410 fill: function fill(value) { 27411 return arrayFill.apply(validate(this), arguments); 27412 }, 27413 filter: function filter(callbackfn) { 27414 return speciesFromList(this, arrayFilter(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined)); 27415 }, 27416 find: function find(predicate) { 27417 return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); 27418 }, 27419 findIndex: function findIndex(predicate) { 27420 return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); 27421 }, 27422 forEach: function forEach(callbackfn) { 27423 arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); 27424 }, 27425 indexOf: function indexOf(searchElement) { 27426 return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); 27427 }, 27428 includes: function includes(searchElement) { 27429 return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); 27430 }, 27431 join: function join(separator) { 27432 return arrayJoin.apply(validate(this), arguments); 27433 }, 27434 lastIndexOf: function lastIndexOf(searchElement) { 27435 return arrayLastIndexOf.apply(validate(this), arguments); 27436 }, 27437 map: function map(mapfn) { 27438 return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); 27439 }, 27440 reduce: function reduce(callbackfn) { 27441 return arrayReduce.apply(validate(this), arguments); 27442 }, 27443 reduceRight: function reduceRight(callbackfn) { 27444 return arrayReduceRight.apply(validate(this), arguments); 27445 }, 27446 reverse: function reverse() { 27447 var that = this; 27448 var length = validate(that).length; 27449 var middle = Math.floor(length / 2); 27450 var index = 0; 27451 var value; 27452 while (index < middle) { 27453 value = that[index]; 27454 that[index++] = that[--length]; 27455 that[length] = value; 27456 } 27457 return that; 27458 }, 27459 some: function some(callbackfn) { 27460 return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); 27461 }, 27462 sort: function sort(comparefn) { 27463 return arraySort.call(validate(this), comparefn); 27464 }, 27465 subarray: function subarray(begin, end) { 27466 var O = validate(this); 27467 var length = O.length; 27468 var $begin = toAbsoluteIndex(begin, length); 27469 return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(O.buffer, O.byteOffset + $begin * O.BYTES_PER_ELEMENT, toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)); 27470 } 27471 }; 27472 var $slice = function slice(start, end) { 27473 return speciesFromList(this, arraySlice.call(validate(this), start, end)); 27474 }; 27475 var $set = function set(arrayLike) { 27476 validate(this); 27477 var offset = toOffset(arguments[1], 1); 27478 var length = this.length; 27479 var src = toObject(arrayLike); 27480 var len = toLength(src.length); 27481 var index = 0; 27482 if (len + offset > length) throw RangeError(WRONG_LENGTH); 27483 while (index < len) { 27484 this[offset + index] = src[index++]; 27485 } 27486 }; 27487 var $iterators = { 27488 entries: function entries() { 27489 return arrayEntries.call(validate(this)); 27490 }, 27491 keys: function keys() { 27492 return arrayKeys.call(validate(this)); 27493 }, 27494 values: function values() { 27495 return arrayValues.call(validate(this)); 27496 } 27497 }; 27498 var isTAIndex = function isTAIndex(target, key) { 27499 return isObject(target) && target[TYPED_ARRAY] && (typeof key === 'undefined' ? 'undefined' : _typeof(key)) != 'symbol' && key in target && String(+key) == String(key); 27500 }; 27501 var $getDesc = function getOwnPropertyDescriptor(target, key) { 27502 return isTAIndex(target, key = toPrimitive(key, true)) ? propertyDesc(2, target[key]) : gOPD(target, key); 27503 }; 27504 var $setDesc = function defineProperty(target, key, desc) { 27505 if (isTAIndex(target, key = toPrimitive(key, true)) && isObject(desc) && has(desc, 'value') && !has(desc, 'get') && !has(desc, 'set') && !desc.configurable && (!has(desc, 'writable') || desc.writable) && (!has(desc, 'enumerable') || desc.enumerable)) { 27506 target[key] = desc.value; 27507 return target; 27508 } 27509 return dP(target, key, desc); 27510 }; 27511 if (!ALL_CONSTRUCTORS) { 27512 $GOPD.f = $getDesc; 27513 $DP.f = $setDesc; 27514 } 27515 $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { 27516 getOwnPropertyDescriptor: $getDesc, 27517 defineProperty: $setDesc 27518 }); 27519 if (fails(function () { 27520 arrayToString.call({}); 27521 })) { 27522 arrayToString = arrayToLocaleString = function toString() { 27523 return arrayJoin.call(this); 27524 }; 27525 } 27526 var $TypedArrayPrototype$ = redefineAll({}, proto); 27527 redefineAll($TypedArrayPrototype$, $iterators); 27528 hide($TypedArrayPrototype$, ITERATOR, $iterators.values); 27529 redefineAll($TypedArrayPrototype$, { 27530 slice: $slice, 27531 set: $set, 27532 constructor: function constructor() {}, 27533 toString: arrayToString, 27534 toLocaleString: $toLocaleString 27535 }); 27536 addGetter($TypedArrayPrototype$, 'buffer', 'b'); 27537 addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); 27538 addGetter($TypedArrayPrototype$, 'byteLength', 'l'); 27539 addGetter($TypedArrayPrototype$, 'length', 'e'); 27540 dP($TypedArrayPrototype$, TAG, { 27541 get: function get() { 27542 return this[TYPED_ARRAY]; 27543 } 27544 }); 27545 module.exports = function (KEY, BYTES, wrapper, CLAMPED) { 27546 CLAMPED = !!CLAMPED; 27547 var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; 27548 var GETTER = 'get' + KEY; 27549 var SETTER = 'set' + KEY; 27550 var TypedArray = global[NAME]; 27551 var Base = TypedArray || {}; 27552 var TAC = TypedArray && getPrototypeOf(TypedArray); 27553 var FORCED = !TypedArray || !$typed.ABV; 27554 var O = {}; 27555 var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; 27556 var getter = function getter(that, index) { 27557 var data = that._d; 27558 return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); 27559 }; 27560 var setter = function setter(that, index, value) { 27561 var data = that._d; 27562 if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; 27563 data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); 27564 }; 27565 var addElement = function addElement(that, index) { 27566 dP(that, index, { 27567 get: function get() { 27568 return getter(this, index); 27569 }, 27570 set: function set(value) { 27571 return setter(this, index, value); 27572 }, 27573 enumerable: true 27574 }); 27575 }; 27576 if (FORCED) { 27577 TypedArray = wrapper(function (that, data, $offset, $length) { 27578 anInstance(that, TypedArray, NAME, '_d'); 27579 var index = 0; 27580 var offset = 0; 27581 var buffer, byteLength, length, klass; 27582 if (!isObject(data)) { 27583 length = toIndex(data); 27584 byteLength = length * BYTES; 27585 buffer = new $ArrayBuffer(byteLength); 27586 } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { 27587 buffer = data; 27588 offset = toOffset($offset, BYTES); 27589 var $len = data.byteLength; 27590 if ($length === undefined) { 27591 if ($len % BYTES) throw RangeError(WRONG_LENGTH); 27592 byteLength = $len - offset; 27593 if (byteLength < 0) throw RangeError(WRONG_LENGTH); 27594 } else { 27595 byteLength = toLength($length) * BYTES; 27596 if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); 27597 } 27598 length = byteLength / BYTES; 27599 } else if (TYPED_ARRAY in data) { 27600 return fromList(TypedArray, data); 27601 } else { 27602 return $from.call(TypedArray, data); 27603 } 27604 hide(that, '_d', { 27605 b: buffer, 27606 o: offset, 27607 l: byteLength, 27608 e: length, 27609 v: new $DataView(buffer) 27610 }); 27611 while (index < length) { 27612 addElement(that, index++); 27613 } 27614 }); 27615 TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); 27616 hide(TypedArrayPrototype, 'constructor', TypedArray); 27617 } else if (!fails(function () { 27618 TypedArray(1); 27619 }) || !fails(function () { 27620 new TypedArray(-1); 27621 }) || !$iterDetect(function (iter) { 27622 new TypedArray(); 27623 new TypedArray(null); 27624 new TypedArray(1.5); 27625 new TypedArray(iter); 27626 }, true)) { 27627 TypedArray = wrapper(function (that, data, $offset, $length) { 27628 anInstance(that, TypedArray, NAME); 27629 var klass; 27630 if (!isObject(data)) return new Base(toIndex(data)); 27631 if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { 27632 return $length !== undefined ? new Base(data, toOffset($offset, BYTES), $length) : $offset !== undefined ? new Base(data, toOffset($offset, BYTES)) : new Base(data); 27633 } 27634 if (TYPED_ARRAY in data) return fromList(TypedArray, data); 27635 return $from.call(TypedArray, data); 27636 });
vendor: 23,656 bytes, lines 27637-28427
27637 arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { 27638 if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); 27639 }); 27640 TypedArray[PROTOTYPE] = TypedArrayPrototype; 27641 if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; 27642 } 27643 var $nativeIterator = TypedArrayPrototype[ITERATOR]; 27644 var CORRECT_ITER_NAME = !!$nativeIterator && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); 27645 var $iterator = $iterators.values; 27646 hide(TypedArray, TYPED_CONSTRUCTOR, true); 27647 hide(TypedArrayPrototype, TYPED_ARRAY, NAME); 27648 hide(TypedArrayPrototype, VIEW, true); 27649 hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); 27650 if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { 27651 dP(TypedArrayPrototype, TAG, { 27652 get: function get() { 27653 return NAME; 27654 } 27655 }); 27656 } 27657 O[NAME] = TypedArray; 27658 $export($export.G + $export.W + $export.F * (TypedArray != Base), O); 27659 $export($export.S, NAME, { BYTES_PER_ELEMENT: BYTES }); 27660 $export($export.S + $export.F * fails(function () { 27661 Base.of.call(TypedArray, 1); 27662 }), NAME, { 27663 from: $from, 27664 of: $of 27665 }); 27666 if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); 27667 $export($export.P, NAME, proto); 27668 setSpecies(NAME); 27669 $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); 27670 $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); 27671 if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; 27672 $export($export.P + $export.F * fails(function () { 27673 new TypedArray(1).slice(); 27674 }), NAME, { slice: $slice }); 27675 $export($export.P + $export.F * (fails(function () { 27676 return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); 27677 }) || !fails(function () { 27678 TypedArrayPrototype.toLocaleString.call([1, 2]); 27679 })), NAME, { toLocaleString: $toLocaleString }); 27680 Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; 27681 if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); 27682 }; 27683} else module.exports = function () {}; 27684 27685/***/ }), 27686/* 79 */ 27687/***/ (function(module, exports, __w_pdfjs_require__) { 27688 27689"use strict"; 27690 27691 27692var global = __w_pdfjs_require__(3); 27693var DESCRIPTORS = __w_pdfjs_require__(8); 27694var LIBRARY = __w_pdfjs_require__(30); 27695var $typed = __w_pdfjs_require__(45); 27696var hide = __w_pdfjs_require__(6); 27697var redefineAll = __w_pdfjs_require__(24); 27698var fails = __w_pdfjs_require__(9); 27699var anInstance = __w_pdfjs_require__(25); 27700var toInteger = __w_pdfjs_require__(20); 27701var toLength = __w_pdfjs_require__(11); 27702var toIndex = __w_pdfjs_require__(46); 27703var gOPN = __w_pdfjs_require__(47).f; 27704var dP = __w_pdfjs_require__(12).f; 27705var arrayFill = __w_pdfjs_require__(52); 27706var setToStringTag = __w_pdfjs_require__(28); 27707var ARRAY_BUFFER = 'ArrayBuffer'; 27708var DATA_VIEW = 'DataView'; 27709var PROTOTYPE = 'prototype'; 27710var WRONG_LENGTH = 'Wrong length!'; 27711var WRONG_INDEX = 'Wrong index!'; 27712var $ArrayBuffer = global[ARRAY_BUFFER]; 27713var $DataView = global[DATA_VIEW]; 27714var Math = global.Math; 27715var RangeError = global.RangeError; 27716var Infinity = global.Infinity; 27717var BaseBuffer = $ArrayBuffer; 27718var abs = Math.abs; 27719var pow = Math.pow; 27720var floor = Math.floor; 27721var log = Math.log; 27722var LN2 = Math.LN2; 27723var BUFFER = 'buffer'; 27724var BYTE_LENGTH = 'byteLength'; 27725var BYTE_OFFSET = 'byteOffset'; 27726var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; 27727var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; 27728var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; 27729function packIEEE754(value, mLen, nBytes) { 27730 var buffer = Array(nBytes); 27731 var eLen = nBytes * 8 - mLen - 1; 27732 var eMax = (1 << eLen) - 1; 27733 var eBias = eMax >> 1; 27734 var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; 27735 var i = 0; 27736 var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; 27737 var e, m, c; 27738 value = abs(value); 27739 if (value != value || value === Infinity) { 27740 m = value != value ? 1 : 0; 27741 e = eMax; 27742 } else { 27743 e = floor(log(value) / LN2); 27744 if (value * (c = pow(2, -e)) < 1) { 27745 e--; 27746 c *= 2; 27747 } 27748 if (e + eBias >= 1) { 27749 value += rt / c; 27750 } else { 27751 value += rt * pow(2, 1 - eBias); 27752 } 27753 if (value * c >= 2) { 27754 e++; 27755 c /= 2; 27756 } 27757 if (e + eBias >= eMax) { 27758 m = 0; 27759 e = eMax; 27760 } else if (e + eBias >= 1) { 27761 m = (value * c - 1) * pow(2, mLen); 27762 e = e + eBias; 27763 } else { 27764 m = value * pow(2, eBias - 1) * pow(2, mLen); 27765 e = 0; 27766 } 27767 } 27768 for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8) {} 27769 e = e << mLen | m; 27770 eLen += mLen; 27771 for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8) {} 27772 buffer[--i] |= s * 128; 27773 return buffer; 27774} 27775function unpackIEEE754(buffer, mLen, nBytes) { 27776 var eLen = nBytes * 8 - mLen - 1; 27777 var eMax = (1 << eLen) - 1; 27778 var eBias = eMax >> 1; 27779 var nBits = eLen - 7; 27780 var i = nBytes - 1; 27781 var s = buffer[i--]; 27782 var e = s & 127; 27783 var m; 27784 s >>= 7; 27785 for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8) {} 27786 m = e & (1 << -nBits) - 1; 27787 e >>= -nBits; 27788 nBits += mLen; 27789 for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8) {} 27790 if (e === 0) { 27791 e = 1 - eBias; 27792 } else if (e === eMax) { 27793 return m ? NaN : s ? -Infinity : Infinity; 27794 } else { 27795 m = m + pow(2, mLen); 27796 e = e - eBias; 27797 } 27798 return (s ? -1 : 1) * m * pow(2, e - mLen); 27799} 27800function unpackI32(bytes) { 27801 return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; 27802} 27803function packI8(it) { 27804 return [it & 0xff]; 27805} 27806function packI16(it) { 27807 return [it & 0xff, it >> 8 & 0xff]; 27808} 27809function packI32(it) { 27810 return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; 27811} 27812function packF64(it) { 27813 return packIEEE754(it, 52, 8); 27814} 27815function packF32(it) { 27816 return packIEEE754(it, 23, 4); 27817} 27818function addGetter(C, key, internal) { 27819 dP(C[PROTOTYPE], key, { 27820 get: function get() { 27821 return this[internal]; 27822 } 27823 }); 27824} 27825function get(view, bytes, index, isLittleEndian) { 27826 var numIndex = +index; 27827 var intIndex = toIndex(numIndex); 27828 if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); 27829 var store = view[$BUFFER]._b; 27830 var start = intIndex + view[$OFFSET]; 27831 var pack = store.slice(start, start + bytes); 27832 return isLittleEndian ? pack : pack.reverse(); 27833} 27834function set(view, bytes, index, conversion, value, isLittleEndian) { 27835 var numIndex = +index; 27836 var intIndex = toIndex(numIndex); 27837 if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); 27838 var store = view[$BUFFER]._b; 27839 var start = intIndex + view[$OFFSET]; 27840 var pack = conversion(+value); 27841 for (var i = 0; i < bytes; i++) { 27842 store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; 27843 } 27844} 27845if (!$typed.ABV) { 27846 $ArrayBuffer = function ArrayBuffer(length) { 27847 anInstance(this, $ArrayBuffer, ARRAY_BUFFER); 27848 var byteLength = toIndex(length); 27849 this._b = arrayFill.call(Array(byteLength), 0); 27850 this[$LENGTH] = byteLength; 27851 }; 27852 $DataView = function DataView(buffer, byteOffset, byteLength) { 27853 anInstance(this, $DataView, DATA_VIEW); 27854 anInstance(buffer, $ArrayBuffer, DATA_VIEW); 27855 var bufferLength = buffer[$LENGTH]; 27856 var offset = toInteger(byteOffset); 27857 if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); 27858 byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); 27859 if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); 27860 this[$BUFFER] = buffer; 27861 this[$OFFSET] = offset; 27862 this[$LENGTH] = byteLength; 27863 }; 27864 if (DESCRIPTORS) { 27865 addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); 27866 addGetter($DataView, BUFFER, '_b'); 27867 addGetter($DataView, BYTE_LENGTH, '_l'); 27868 addGetter($DataView, BYTE_OFFSET, '_o'); 27869 } 27870 redefineAll($DataView[PROTOTYPE], { 27871 getInt8: function getInt8(byteOffset) { 27872 return get(this, 1, byteOffset)[0] << 24 >> 24; 27873 }, 27874 getUint8: function getUint8(byteOffset) { 27875 return get(this, 1, byteOffset)[0]; 27876 }, 27877 getInt16: function getInt16(byteOffset) { 27878 var bytes = get(this, 2, byteOffset, arguments[1]); 27879 return (bytes[1] << 8 | bytes[0]) << 16 >> 16; 27880 }, 27881 getUint16: function getUint16(byteOffset) { 27882 var bytes = get(this, 2, byteOffset, arguments[1]); 27883 return bytes[1] << 8 | bytes[0]; 27884 }, 27885 getInt32: function getInt32(byteOffset) { 27886 return unpackI32(get(this, 4, byteOffset, arguments[1])); 27887 }, 27888 getUint32: function getUint32(byteOffset) { 27889 return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; 27890 }, 27891 getFloat32: function getFloat32(byteOffset) { 27892 return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); 27893 }, 27894 getFloat64: function getFloat64(byteOffset) { 27895 return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); 27896 }, 27897 setInt8: function setInt8(byteOffset, value) { 27898 set(this, 1, byteOffset, packI8, value); 27899 }, 27900 setUint8: function setUint8(byteOffset, value) { 27901 set(this, 1, byteOffset, packI8, value); 27902 }, 27903 setInt16: function setInt16(byteOffset, value) { 27904 set(this, 2, byteOffset, packI16, value, arguments[2]); 27905 }, 27906 setUint16: function setUint16(byteOffset, value) { 27907 set(this, 2, byteOffset, packI16, value, arguments[2]); 27908 }, 27909 setInt32: function setInt32(byteOffset, value) { 27910 set(this, 4, byteOffset, packI32, value, arguments[2]); 27911 }, 27912 setUint32: function setUint32(byteOffset, value) { 27913 set(this, 4, byteOffset, packI32, value, arguments[2]); 27914 }, 27915 setFloat32: function setFloat32(byteOffset, value) { 27916 set(this, 4, byteOffset, packF32, value, arguments[2]); 27917 }, 27918 setFloat64: function setFloat64(byteOffset, value) { 27919 set(this, 8, byteOffset, packF64, value, arguments[2]); 27920 } 27921 }); 27922} else { 27923 if (!fails(function () { 27924 $ArrayBuffer(1); 27925 }) || !fails(function () { 27926 new $ArrayBuffer(-1); 27927 }) || fails(function () { 27928 new $ArrayBuffer(); 27929 new $ArrayBuffer(1.5); 27930 new $ArrayBuffer(NaN); 27931 return $ArrayBuffer.name != ARRAY_BUFFER; 27932 })) { 27933 $ArrayBuffer = function ArrayBuffer(length) { 27934 anInstance(this, $ArrayBuffer); 27935 return new BaseBuffer(toIndex(length)); 27936 }; 27937 var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; 27938 for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { 27939 if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); 27940 } 27941 if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; 27942 } 27943 var view = new $DataView(new $ArrayBuffer(2)); 27944 var $setInt8 = $DataView[PROTOTYPE].setInt8; 27945 view.setInt8(0, 2147483648); 27946 view.setInt8(1, 2147483649); 27947 if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { 27948 setInt8: function setInt8(byteOffset, value) { 27949 $setInt8.call(this, byteOffset, value << 24 >> 24); 27950 }, 27951 setUint8: function setUint8(byteOffset, value) { 27952 $setInt8.call(this, byteOffset, value << 24 >> 24); 27953 } 27954 }, true); 27955} 27956setToStringTag($ArrayBuffer, ARRAY_BUFFER); 27957setToStringTag($DataView, DATA_VIEW); 27958hide($DataView[PROTOTYPE], $typed.VIEW, true); 27959exports[ARRAY_BUFFER] = $ArrayBuffer; 27960exports[DATA_VIEW] = $DataView; 27961 27962/***/ }), 27963/* 80 */ 27964/***/ (function(module, exports, __w_pdfjs_require__) { 27965 27966"use strict"; 27967 27968 27969var dP = __w_pdfjs_require__(12); 27970var anObject = __w_pdfjs_require__(10); 27971var getKeys = __w_pdfjs_require__(38); 27972module.exports = __w_pdfjs_require__(8) ? Object.defineProperties : function defineProperties(O, Properties) { 27973 anObject(O); 27974 var keys = getKeys(Properties); 27975 var length = keys.length; 27976 var i = 0; 27977 var P; 27978 while (length > i) { 27979 dP.f(O, P = keys[i++], Properties[P]); 27980 }return O; 27981}; 27982 27983/***/ }), 27984/* 81 */ 27985/***/ (function(module, exports, __w_pdfjs_require__) { 27986 27987"use strict"; 27988 27989 27990var document = __w_pdfjs_require__(3).document; 27991module.exports = document && document.documentElement; 27992 27993/***/ }), 27994/* 82 */ 27995/***/ (function(module, exports, __w_pdfjs_require__) { 27996 27997"use strict"; 27998 27999 28000var speciesConstructor = __w_pdfjs_require__(83); 28001module.exports = function (original, length) { 28002 return new (speciesConstructor(original))(length); 28003}; 28004 28005/***/ }), 28006/* 83 */ 28007/***/ (function(module, exports, __w_pdfjs_require__) { 28008 28009"use strict"; 28010 28011 28012var isObject = __w_pdfjs_require__(4); 28013var isArray = __w_pdfjs_require__(84); 28014var SPECIES = __w_pdfjs_require__(1)('species'); 28015module.exports = function (original) { 28016 var C; 28017 if (isArray(original)) { 28018 C = original.constructor; 28019 if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; 28020 if (isObject(C)) { 28021 C = C[SPECIES]; 28022 if (C === null) C = undefined; 28023 } 28024 } 28025 return C === undefined ? Array : C; 28026}; 28027 28028/***/ }), 28029/* 84 */ 28030/***/ (function(module, exports, __w_pdfjs_require__) { 28031 28032"use strict"; 28033 28034 28035var cof = __w_pdfjs_require__(34); 28036module.exports = Array.isArray || function isArray(arg) { 28037 return cof(arg) == 'Array'; 28038}; 28039 28040/***/ }), 28041/* 85 */ 28042/***/ (function(module, exports, __w_pdfjs_require__) { 28043 28044"use strict"; 28045 28046 28047var anObject = __w_pdfjs_require__(10); 28048var aFunction = __w_pdfjs_require__(32); 28049var SPECIES = __w_pdfjs_require__(1)('species'); 28050module.exports = function (O, D) { 28051 var C = anObject(O).constructor; 28052 var S; 28053 return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); 28054}; 28055 28056/***/ }), 28057/* 86 */ 28058/***/ (function(module, exports, __w_pdfjs_require__) { 28059 28060"use strict"; 28061 28062 28063var UNSCOPABLES = __w_pdfjs_require__(1)('unscopables'); 28064var ArrayProto = Array.prototype; 28065if (ArrayProto[UNSCOPABLES] == undefined) __w_pdfjs_require__(6)(ArrayProto, UNSCOPABLES, {}); 28066module.exports = function (key) { 28067 ArrayProto[UNSCOPABLES][key] = true; 28068}; 28069 28070/***/ }), 28071/* 87 */ 28072/***/ (function(module, exports, __w_pdfjs_require__) { 28073 28074"use strict"; 28075 28076 28077module.exports = function (done, value) { 28078 return { 28079 value: value, 28080 done: !!done 28081 }; 28082}; 28083 28084/***/ }), 28085/* 88 */ 28086/***/ (function(module, exports, __w_pdfjs_require__) { 28087 28088"use strict"; 28089 28090 28091var LIBRARY = __w_pdfjs_require__(30); 28092var $export = __w_pdfjs_require__(18); 28093var redefine = __w_pdfjs_require__(13); 28094var hide = __w_pdfjs_require__(6); 28095var has = __w_pdfjs_require__(7); 28096var Iterators = __w_pdfjs_require__(17); 28097var $iterCreate = __w_pdfjs_require__(89); 28098var setToStringTag = __w_pdfjs_require__(28); 28099var getPrototypeOf = __w_pdfjs_require__(55); 28100var ITERATOR = __w_pdfjs_require__(1)('iterator'); 28101var BUGGY = !([].keys && 'next' in [].keys()); 28102var FF_ITERATOR = '@@iterator'; 28103var KEYS = 'keys'; 28104var VALUES = 'values'; 28105var returnThis = function returnThis() { 28106 return this; 28107}; 28108module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { 28109 $iterCreate(Constructor, NAME, next); 28110 var getMethod = function getMethod(kind) { 28111 if (!BUGGY && kind in proto) return proto[kind]; 28112 switch (kind) { 28113 case KEYS: 28114 return function keys() { 28115 return new Constructor(this, kind); 28116 }; 28117 case VALUES: 28118 return function values() { 28119 return new Constructor(this, kind); 28120 }; 28121 } 28122 return function entries() { 28123 return new Constructor(this, kind); 28124 }; 28125 }; 28126 var TAG = NAME + ' Iterator'; 28127 var DEF_VALUES = DEFAULT == VALUES; 28128 var VALUES_BUG = false; 28129 var proto = Base.prototype; 28130 var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; 28131 var $default = $native || getMethod(DEFAULT); 28132 var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; 28133 var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; 28134 var methods, key, IteratorPrototype; 28135 if ($anyNative) { 28136 IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); 28137 if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { 28138 setToStringTag(IteratorPrototype, TAG, true); 28139 if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); 28140 } 28141 } 28142 if (DEF_VALUES && $native && $native.name !== VALUES) { 28143 VALUES_BUG = true; 28144 $default = function values() { 28145 return $native.call(this); 28146 }; 28147 } 28148 if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { 28149 hide(proto, ITERATOR, $default); 28150 } 28151 Iterators[NAME] = $default; 28152 Iterators[TAG] = returnThis; 28153 if (DEFAULT) { 28154 methods = { 28155 values: DEF_VALUES ? $default : getMethod(VALUES), 28156 keys: IS_SET ? $default : getMethod(KEYS), 28157 entries: $entries 28158 }; 28159 if (FORCED) for (key in methods) { 28160 if (!(key in proto)) redefine(proto, key, methods[key]); 28161 } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); 28162 } 28163 return methods; 28164}; 28165 28166/***/ }), 28167/* 89 */ 28168/***/ (function(module, exports, __w_pdfjs_require__) { 28169 28170"use strict"; 28171 28172 28173var create = __w_pdfjs_require__(54); 28174var descriptor = __w_pdfjs_require__(23); 28175var setToStringTag = __w_pdfjs_require__(28); 28176var IteratorPrototype = {}; 28177__w_pdfjs_require__(6)(IteratorPrototype, __w_pdfjs_require__(1)('iterator'), function () { 28178 return this; 28179}); 28180module.exports = function (Constructor, NAME, next) { 28181 Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); 28182 setToStringTag(Constructor, NAME + ' Iterator'); 28183}; 28184 28185/***/ }), 28186/* 90 */ 28187/***/ (function(module, exports, __w_pdfjs_require__) { 28188 28189"use strict"; 28190 28191 28192var global = __w_pdfjs_require__(3); 28193var dP = __w_pdfjs_require__(12); 28194var DESCRIPTORS = __w_pdfjs_require__(8); 28195var SPECIES = __w_pdfjs_require__(1)('species'); 28196module.exports = function (KEY) { 28197 var C = global[KEY]; 28198 if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { 28199 configurable: true, 28200 get: function get() { 28201 return this; 28202 } 28203 }); 28204}; 28205 28206/***/ }), 28207/* 91 */ 28208/***/ (function(module, exports, __w_pdfjs_require__) { 28209 28210"use strict"; 28211 28212 28213var toObject = __w_pdfjs_require__(16); 28214var toAbsoluteIndex = __w_pdfjs_require__(27); 28215var toLength = __w_pdfjs_require__(11); 28216module.exports = [].copyWithin || function copyWithin(target, start) { 28217 var O = toObject(this); 28218 var len = toLength(O.length); 28219 var to = toAbsoluteIndex(target, len); 28220 var from = toAbsoluteIndex(start, len); 28221 var end = arguments.length > 2 ? arguments[2] : undefined; 28222 var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); 28223 var inc = 1; 28224 if (from < to && to < from + count) { 28225 inc = -1; 28226 from += count - 1; 28227 to += count - 1; 28228 } 28229 while (count-- > 0) { 28230 if (from in O) O[to] = O[from];else delete O[to]; 28231 to += inc; 28232 from += inc; 28233 } 28234 return O; 28235}; 28236 28237/***/ }), 28238/* 92 */ 28239/***/ (function(module, exports, __w_pdfjs_require__) { 28240 28241"use strict"; 28242 28243 28244__w_pdfjs_require__(93); 28245__w_pdfjs_require__(94); 28246__w_pdfjs_require__(95); 28247__w_pdfjs_require__(103); 28248__w_pdfjs_require__(105); 28249module.exports = __w_pdfjs_require__(19).WeakMap; 28250 28251/***/ }), 28252/* 93 */ 28253/***/ (function(module, exports, __w_pdfjs_require__) { 28254 28255"use strict"; 28256 28257 28258var classof = __w_pdfjs_require__(37); 28259var test = {}; 28260test[__w_pdfjs_require__(1)('toStringTag')] = 'z'; 28261if (test + '' != '[object z]') { 28262 __w_pdfjs_require__(13)(Object.prototype, 'toString', function toString() { 28263 return '[object ' + classof(this) + ']'; 28264 }, true); 28265} 28266 28267/***/ }), 28268/* 94 */ 28269/***/ (function(module, exports, __w_pdfjs_require__) { 28270 28271"use strict"; 28272 28273 28274var $iterators = __w_pdfjs_require__(57); 28275var getKeys = __w_pdfjs_require__(38); 28276var redefine = __w_pdfjs_require__(13); 28277var global = __w_pdfjs_require__(3); 28278var hide = __w_pdfjs_require__(6); 28279var Iterators = __w_pdfjs_require__(17); 28280var wks = __w_pdfjs_require__(1); 28281var ITERATOR = wks('iterator'); 28282var TO_STRING_TAG = wks('toStringTag'); 28283var ArrayValues = Iterators.Array; 28284var DOMIterables = { 28285 CSSRuleList: true, 28286 CSSStyleDeclaration: false, 28287 CSSValueList: false, 28288 ClientRectList: false, 28289 DOMRectList: false, 28290 DOMStringList: false, 28291 DOMTokenList: true, 28292 DataTransferItemList: false, 28293 FileList: false, 28294 HTMLAllCollection: false, 28295 HTMLCollection: false, 28296 HTMLFormElement: false, 28297 HTMLSelectElement: false, 28298 MediaList: true, 28299 MimeTypeArray: false, 28300 NamedNodeMap: false, 28301 NodeList: true, 28302 PaintRequestList: false, 28303 Plugin: false, 28304 PluginArray: false, 28305 SVGLengthList: false, 28306 SVGNumberList: false, 28307 SVGPathSegList: false, 28308 SVGPointList: false, 28309 SVGStringList: false, 28310 SVGTransformList: false, 28311 SourceBufferList: false, 28312 StyleSheetList: true, 28313 TextTrackCueList: false, 28314 TextTrackList: false, 28315 TouchList: false 28316}; 28317for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { 28318 var NAME = collections[i]; 28319 var explicit = DOMIterables[NAME]; 28320 var Collection = global[NAME]; 28321 var proto = Collection && Collection.prototype; 28322 var key; 28323 if (proto) { 28324 if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); 28325 if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); 28326 Iterators[NAME] = ArrayValues; 28327 if (explicit) for (key in $iterators) { 28328 if (!proto[key]) redefine(proto, key, $iterators[key], true); 28329 } 28330 } 28331} 28332 28333/***/ }), 28334/* 95 */ 28335/***/ (function(module, exports, __w_pdfjs_require__) { 28336 28337"use strict"; 28338 28339 28340var each = __w_pdfjs_require__(39)(0); 28341var redefine = __w_pdfjs_require__(13); 28342var meta = __w_pdfjs_require__(40); 28343var assign = __w_pdfjs_require__(96); 28344var weak = __w_pdfjs_require__(98); 28345var isObject = __w_pdfjs_require__(4); 28346var fails = __w_pdfjs_require__(9); 28347var validate = __w_pdfjs_require__(61); 28348var WEAK_MAP = 'WeakMap'; 28349var getWeak = meta.getWeak; 28350var isExtensible = Object.isExtensible; 28351var uncaughtFrozenStore = weak.ufstore; 28352var tmp = {}; 28353var InternalMap; 28354var wrapper = function wrapper(get) { 28355 return function WeakMap() { 28356 return get(this, arguments.length > 0 ? arguments[0] : undefined); 28357 }; 28358}; 28359var methods = { 28360 get: function get(key) { 28361 if (isObject(key)) { 28362 var data = getWeak(key); 28363 if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); 28364 return data ? data[this._i] : undefined; 28365 } 28366 }, 28367 set: function set(key, value) { 28368 return weak.def(validate(this, WEAK_MAP), key, value); 28369 } 28370}; 28371var $WeakMap = module.exports = __w_pdfjs_require__(100)(WEAK_MAP, wrapper, methods, weak, true, true); 28372if (fails(function () { 28373 return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; 28374})) { 28375 InternalMap = weak.getConstructor(wrapper, WEAK_MAP); 28376 assign(InternalMap.prototype, methods); 28377 meta.NEED = true; 28378 each(['delete', 'has', 'get', 'set'], function (key) { 28379 var proto = $WeakMap.prototype; 28380 var method = proto[key]; 28381 redefine(proto, key, function (a, b) { 28382 if (isObject(a) && !isExtensible(a)) { 28383 if (!this._f) this._f = new InternalMap(); 28384 var result = this._f[key](a, b); 28385 return key == 'set' ? this : result; 28386 } 28387 return method.call(this, a, b); 28388 }); 28389 }); 28390} 28391 28392/***/ }), 28393/* 96 */ 28394/***/ (function(module, exports, __w_pdfjs_require__) { 28395 28396"use strict"; 28397 28398 28399var getKeys = __w_pdfjs_require__(38); 28400var gOPS = __w_pdfjs_require__(97); 28401var pIE = __w_pdfjs_require__(60); 28402var toObject = __w_pdfjs_require__(16); 28403var IObject = __w_pdfjs_require__(33); 28404var $assign = Object.assign; 28405module.exports = !$assign || __w_pdfjs_require__(9)(function () { 28406 var A = {}; 28407 var B = {}; 28408 var S = Symbol(); 28409 var K = 'abcdefghijklmnopqrst'; 28410 A[S] = 7; 28411 K.split('').forEach(function (k) { 28412 B[k] = k; 28413 }); 28414 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; 28415}) ? function assign(target, source) { 28416 var T = toObject(target); 28417 var aLen = arguments.length; 28418 var index = 1; 28419 var getSymbols = gOPS.f; 28420 var isEnum = pIE.f; 28421 while (aLen > index) { 28422 var S = IObject(arguments[index++]); 28423 var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); 28424 var length = keys.length; 28425 var j = 0; 28426 var key; 28427 while (length > j) {
vendor: 4,407 bytes, lines 28428-28575
28428 if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; 28429 } 28430 } 28431 return T; 28432} : $assign; 28433 28434/***/ }), 28435/* 97 */ 28436/***/ (function(module, exports, __w_pdfjs_require__) { 28437 28438"use strict"; 28439 28440 28441exports.f = Object.getOwnPropertySymbols; 28442 28443/***/ }), 28444/* 98 */ 28445/***/ (function(module, exports, __w_pdfjs_require__) { 28446 28447"use strict"; 28448 28449 28450var redefineAll = __w_pdfjs_require__(24); 28451var getWeak = __w_pdfjs_require__(40).getWeak; 28452var anObject = __w_pdfjs_require__(10); 28453var isObject = __w_pdfjs_require__(4); 28454var anInstance = __w_pdfjs_require__(25); 28455var forOf = __w_pdfjs_require__(41); 28456var createArrayMethod = __w_pdfjs_require__(39); 28457var $has = __w_pdfjs_require__(7); 28458var validate = __w_pdfjs_require__(61); 28459var arrayFind = createArrayMethod(5); 28460var arrayFindIndex = createArrayMethod(6); 28461var id = 0; 28462var uncaughtFrozenStore = function uncaughtFrozenStore(that) { 28463 return that._l || (that._l = new UncaughtFrozenStore()); 28464}; 28465var UncaughtFrozenStore = function UncaughtFrozenStore() { 28466 this.a = []; 28467}; 28468var findUncaughtFrozen = function findUncaughtFrozen(store, key) { 28469 return arrayFind(store.a, function (it) { 28470 return it[0] === key; 28471 }); 28472}; 28473UncaughtFrozenStore.prototype = { 28474 get: function get(key) { 28475 var entry = findUncaughtFrozen(this, key); 28476 if (entry) return entry[1]; 28477 }, 28478 has: function has(key) { 28479 return !!findUncaughtFrozen(this, key); 28480 }, 28481 set: function set(key, value) { 28482 var entry = findUncaughtFrozen(this, key); 28483 if (entry) entry[1] = value;else this.a.push([key, value]); 28484 }, 28485 'delete': function _delete(key) { 28486 var index = arrayFindIndex(this.a, function (it) { 28487 return it[0] === key; 28488 }); 28489 if (~index) this.a.splice(index, 1); 28490 return !!~index; 28491 } 28492}; 28493module.exports = { 28494 getConstructor: function getConstructor(wrapper, NAME, IS_MAP, ADDER) { 28495 var C = wrapper(function (that, iterable) { 28496 anInstance(that, C, NAME, '_i'); 28497 that._t = NAME; 28498 that._i = id++; 28499 that._l = undefined; 28500 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); 28501 }); 28502 redefineAll(C.prototype, { 28503 'delete': function _delete(key) { 28504 if (!isObject(key)) return false; 28505 var data = getWeak(key); 28506 if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); 28507 return data && $has(data, this._i) && delete data[this._i]; 28508 }, 28509 has: function has(key) { 28510 if (!isObject(key)) return false; 28511 var data = getWeak(key); 28512 if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); 28513 return data && $has(data, this._i); 28514 } 28515 }); 28516 return C; 28517 }, 28518 def: function def(that, key, value) { 28519 var data = getWeak(anObject(key), true); 28520 if (data === true) uncaughtFrozenStore(that).set(key, value);else data[that._i] = value; 28521 return that; 28522 }, 28523 ufstore: uncaughtFrozenStore 28524}; 28525 28526/***/ }), 28527/* 99 */ 28528/***/ (function(module, exports, __w_pdfjs_require__) { 28529 28530"use strict"; 28531 28532 28533var anObject = __w_pdfjs_require__(10); 28534module.exports = function (iterator, fn, value, entries) { 28535 try { 28536 return entries ? fn(anObject(value)[0], value[1]) : fn(value); 28537 } catch (e) { 28538 var ret = iterator['return']; 28539 if (ret !== undefined) anObject(ret.call(iterator)); 28540 throw e; 28541 } 28542}; 28543 28544/***/ }), 28545/* 100 */ 28546/***/ (function(module, exports, __w_pdfjs_require__) { 28547 28548"use strict"; 28549 28550 28551var global = __w_pdfjs_require__(3); 28552var $export = __w_pdfjs_require__(18); 28553var redefine = __w_pdfjs_require__(13); 28554var redefineAll = __w_pdfjs_require__(24); 28555var meta = __w_pdfjs_require__(40); 28556var forOf = __w_pdfjs_require__(41); 28557var anInstance = __w_pdfjs_require__(25); 28558var isObject = __w_pdfjs_require__(4); 28559var fails = __w_pdfjs_require__(9); 28560var $iterDetect = __w_pdfjs_require__(58); 28561var setToStringTag = __w_pdfjs_require__(28); 28562var inheritIfRequired = __w_pdfjs_require__(101); 28563module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { 28564 var Base = global[NAME]; 28565 var C = Base; 28566 var ADDER = IS_MAP ? 'set' : 'add'; 28567 var proto = C && C.prototype; 28568 var O = {}; 28569 var fixMethod = function fixMethod(KEY) { 28570 var fn = proto[KEY]; 28571 redefine(proto, KEY, KEY == 'delete' ? function (a) { 28572 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); 28573 } : KEY == 'has' ? function has(a) { 28574 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); 28575 } : KEY == 'get' ? function get(a) {
vendor: 4,737 bytes, lines 28576-28761
28576 return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); 28577 } : KEY == 'add' ? function add(a) { 28578 fn.call(this, a === 0 ? 0 : a); 28579 return this; 28580 } : function set(a, b) { 28581 fn.call(this, a === 0 ? 0 : a, b); 28582 return this; 28583 }); 28584 }; 28585 if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { 28586 new C().entries().next(); 28587 }))) { 28588 C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); 28589 redefineAll(C.prototype, methods); 28590 meta.NEED = true; 28591 } else { 28592 var instance = new C(); 28593 var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; 28594 var THROWS_ON_PRIMITIVES = fails(function () { 28595 instance.has(1); 28596 }); 28597 var ACCEPT_ITERABLES = $iterDetect(function (iter) { 28598 new C(iter); 28599 }); 28600 var BUGGY_ZERO = !IS_WEAK && fails(function () { 28601 var $instance = new C(); 28602 var index = 5; 28603 while (index--) { 28604 $instance[ADDER](index, index); 28605 }return !$instance.has(-0); 28606 }); 28607 if (!ACCEPT_ITERABLES) { 28608 C = wrapper(function (target, iterable) { 28609 anInstance(target, C, NAME); 28610 var that = inheritIfRequired(new Base(), target, C); 28611 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); 28612 return that; 28613 }); 28614 C.prototype = proto; 28615 proto.constructor = C; 28616 } 28617 if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { 28618 fixMethod('delete'); 28619 fixMethod('has'); 28620 IS_MAP && fixMethod('get'); 28621 } 28622 if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); 28623 if (IS_WEAK && proto.clear) delete proto.clear; 28624 } 28625 setToStringTag(C, NAME); 28626 O[NAME] = C; 28627 $export($export.G + $export.W + $export.F * (C != Base), O); 28628 if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); 28629 return C; 28630}; 28631 28632/***/ }), 28633/* 101 */ 28634/***/ (function(module, exports, __w_pdfjs_require__) { 28635 28636"use strict"; 28637 28638 28639var isObject = __w_pdfjs_require__(4); 28640var setPrototypeOf = __w_pdfjs_require__(102).set; 28641module.exports = function (that, target, C) { 28642 var S = target.constructor; 28643 var P; 28644 if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { 28645 setPrototypeOf(that, P); 28646 } 28647 return that; 28648}; 28649 28650/***/ }), 28651/* 102 */ 28652/***/ (function(module, exports, __w_pdfjs_require__) { 28653 28654"use strict"; 28655 28656 28657var isObject = __w_pdfjs_require__(4); 28658var anObject = __w_pdfjs_require__(10); 28659var check = function check(O, proto) { 28660 anObject(O); 28661 if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); 28662}; 28663module.exports = { 28664 set: Object.setPrototypeOf || ('__proto__' in {} ? function (test, buggy, set) { 28665 try { 28666 set = __w_pdfjs_require__(15)(Function.call, __w_pdfjs_require__(59).f(Object.prototype, '__proto__').set, 2); 28667 set(test, []); 28668 buggy = !(test instanceof Array); 28669 } catch (e) { 28670 buggy = true; 28671 } 28672 return function setPrototypeOf(O, proto) { 28673 check(O, proto); 28674 if (buggy) O.__proto__ = proto;else set(O, proto); 28675 return O; 28676 }; 28677 }({}, false) : undefined), 28678 check: check 28679}; 28680 28681/***/ }), 28682/* 103 */ 28683/***/ (function(module, exports, __w_pdfjs_require__) { 28684 28685"use strict"; 28686 28687 28688__w_pdfjs_require__(104)('WeakMap'); 28689 28690/***/ }), 28691/* 104 */ 28692/***/ (function(module, exports, __w_pdfjs_require__) { 28693 28694"use strict"; 28695 28696 28697var $export = __w_pdfjs_require__(18); 28698module.exports = function (COLLECTION) { 28699 $export($export.S, COLLECTION, { 28700 of: function of() { 28701 var length = arguments.length; 28702 var A = Array(length); 28703 while (length--) { 28704 A[length] = arguments[length]; 28705 }return new this(A); 28706 } 28707 }); 28708}; 28709 28710/***/ }), 28711/* 105 */ 28712/***/ (function(module, exports, __w_pdfjs_require__) { 28713 28714"use strict"; 28715 28716 28717__w_pdfjs_require__(106)('WeakMap'); 28718 28719/***/ }), 28720/* 106 */ 28721/***/ (function(module, exports, __w_pdfjs_require__) { 28722 28723"use strict"; 28724 28725 28726var $export = __w_pdfjs_require__(18); 28727var aFunction = __w_pdfjs_require__(32); 28728var ctx = __w_pdfjs_require__(15); 28729var forOf = __w_pdfjs_require__(41); 28730module.exports = function (COLLECTION) { 28731 $export($export.S, COLLECTION, { 28732 from: function from(source) { 28733 var mapFn = arguments[1]; 28734 var mapping, A, n, cb; 28735 aFunction(this); 28736 mapping = mapFn !== undefined; 28737 if (mapping) aFunction(mapFn); 28738 if (source == undefined) return new this(); 28739 A = []; 28740 if (mapping) { 28741 n = 0; 28742 cb = ctx(mapFn, arguments[2], 2); 28743 forOf(source, false, function (nextItem) { 28744 A.push(cb(nextItem, n++)); 28745 }); 28746 } else { 28747 forOf(source, false, A.push, A); 28748 } 28749 return new this(A); 28750 } 28751 }); 28752}; 28753 28754/***/ }), 28755/* 107 */ 28756/***/ (function(module, exports, __w_pdfjs_require__) { 28757 28758"use strict"; 28759 28760 28761var isReadableStreamSupported = false;
28762if (typeof ReadableStream !== 'undefined') { 28763 try { 28764 new ReadableStream({ 28765 start: function start(controller) { 28766 controller.close(); 28767 } 28768 }); 28769 isReadableStreamSupported = true; 28770 } catch (e) {} 28771} 28772if (isReadableStreamSupported) { 28773 exports.ReadableStream = ReadableStream; 28774} else { 28775 exports.ReadableStream = __w_pdfjs_require__(108).ReadableStream; 28776} 28777 28778/***/ }), 28779/* 108 */ 28780/***/ (function(module, exports, __w_pdfjs_require__) { 28781 28782"use strict"; 28783 28784 28785var _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; }; 28786 28787(function (e, a) { 28788 for (var i in a) { 28789 e[i] = a[i]; 28790 } 28791})(exports, function (modules) { 28792 var installedModules = {}; 28793 function __w_pdfjs_require__(moduleId) { 28794 if (installedModules[moduleId]) return installedModules[moduleId].exports; 28795 var module = installedModules[moduleId] = { 28796 i: moduleId, 28797 l: false, 28798 exports: {} 28799 }; 28800 modules[moduleId].call(module.exports, module, module.exports, __w_pdfjs_require__); 28801 module.l = true; 28802 return module.exports; 28803 } 28804 __w_pdfjs_require__.m = modules; 28805 __w_pdfjs_require__.c = installedModules; 28806 __w_pdfjs_require__.i = function (value) { 28807 return value; 28808 }; 28809 __w_pdfjs_require__.d = function (exports, name, getter) { 28810 if (!__w_pdfjs_require__.o(exports, name)) { 28811 Object.defineProperty(exports, name, { 28812 configurable: false, 28813 enumerable: true, 28814 get: getter 28815 }); 28816 } 28817 }; 28818 __w_pdfjs_require__.n = function (module) { 28819 var getter = module && module.__esModule ? function getDefault() { 28820 return module['default']; 28821 } : function getModuleExports() { 28822 return module; 28823 }; 28824 __w_pdfjs_require__.d(getter, 'a', getter); 28825 return getter; 28826 }; 28827 __w_pdfjs_require__.o = function (object, property) { 28828 return Object.prototype.hasOwnProperty.call(object, property); 28829 }; 28830 __w_pdfjs_require__.p = ""; 28831 return __w_pdfjs_require__(__w_pdfjs_require__.s = 7); 28832}([function (module, exports, __w_pdfjs_require__) { 28833 "use strict"; 28834 28835 var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { 28836 return typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); 28837 } : function (obj) { 28838 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); 28839 }; 28840 var _require = __w_pdfjs_require__(1), 28841 assert = _require.assert; 28842 function IsPropertyKey(argument) { 28843 return typeof argument === 'string' || (typeof argument === 'undefined' ? 'undefined' : _typeof(argument)) === 'symbol'; 28844 } 28845 exports.typeIsObject = function (x) { 28846 return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x !== null || typeof x === 'function'; 28847 }; 28848 exports.createDataProperty = function (o, p, v) { 28849 assert(exports.typeIsObject(o)); 28850 Object.defineProperty(o, p, { 28851 value: v, 28852 writable: true, 28853 enumerable: true, 28854 configurable: true 28855 }); 28856 }; 28857 exports.createArrayFromList = function (elements) { 28858 return elements.slice(); 28859 }; 28860 exports.ArrayBufferCopy = function (dest, destOffset, src, srcOffset, n) { 28861 new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset); 28862 }; 28863 exports.CreateIterResultObject = function (value, done) { 28864 assert(typeof done === 'boolean'); 28865 var obj = {}; 28866 Object.defineProperty(obj, 'value', { 28867 value: value, 28868 enumerable: true, 28869 writable: true, 28870 configurable: true 28871 }); 28872 Object.defineProperty(obj, 'done', { 28873 value: done, 28874 enumerable: true, 28875 writable: true, 28876 configurable: true 28877 }); 28878 return obj; 28879 }; 28880 exports.IsFiniteNonNegativeNumber = function (v) { 28881 if (Number.isNaN(v)) { 28882 return false; 28883 } 28884 if (v === Infinity) { 28885 return false; 28886 } 28887 if (v < 0) { 28888 return false; 28889 } 28890 return true; 28891 }; 28892 function Call(F, V, args) { 28893 if (typeof F !== 'function') { 28894 throw new TypeError('Argument is not a function'); 28895 } 28896 return Function.prototype.apply.call(F, V, args); 28897 } 28898 exports.InvokeOrNoop = function (O, P, args) { 28899 assert(O !== undefined); 28900 assert(IsPropertyKey(P)); 28901 assert(Array.isArray(args)); 28902 var method = O[P]; 28903 if (method === undefined) { 28904 return undefined; 28905 } 28906 return Call(method, O, args); 28907 }; 28908 exports.PromiseInvokeOrNoop = function (O, P, args) { 28909 assert(O !== undefined); 28910 assert(IsPropertyKey(P)); 28911 assert(Array.isArray(args)); 28912 try { 28913 return Promise.resolve(exports.InvokeOrNoop(O, P, args)); 28914 } catch (returnValueE) { 28915 return Promise.reject(returnValueE); 28916 } 28917 }; 28918 exports.PromiseInvokeOrPerformFallback = function (O, P, args, F, argsF) { 28919 assert(O !== undefined); 28920 assert(IsPropertyKey(P)); 28921 assert(Array.isArray(args)); 28922 assert(Array.isArray(argsF)); 28923 var method = void 0; 28924 try { 28925 method = O[P]; 28926 } catch (methodE) { 28927 return Promise.reject(methodE); 28928 } 28929 if (method === undefined) { 28930 return F.apply(null, argsF); 28931 } 28932 try { 28933 return Promise.resolve(Call(method, O, args)); 28934 } catch (e) { 28935 return Promise.reject(e); 28936 } 28937 }; 28938 exports.TransferArrayBuffer = function (O) { 28939 return O.slice(); 28940 }; 28941 exports.ValidateAndNormalizeHighWaterMark = function (highWaterMark) { 28942 highWaterMark = Number(highWaterMark); 28943 if (Number.isNaN(highWaterMark) || highWaterMark < 0) { 28944 throw new RangeError('highWaterMark property of a queuing strategy must be non-negative and non-NaN'); 28945 } 28946 return highWaterMark; 28947 }; 28948 exports.ValidateAndNormalizeQueuingStrategy = function (size, highWaterMark) { 28949 if (size !== undefined && typeof size !== 'function') { 28950 throw new TypeError('size property of a queuing strategy must be a function'); 28951 } 28952 highWaterMark = exports.ValidateAndNormalizeHighWaterMark(highWaterMark); 28953 return { 28954 size: size, 28955 highWaterMark: highWaterMark 28956 }; 28957 }; 28958}, function (module, exports, __w_pdfjs_require__) { 28959 "use strict"; 28960 28961 function rethrowAssertionErrorRejection(e) { 28962 if (e && e.constructor === AssertionError) { 28963 setTimeout(function () { 28964 throw e; 28965 }, 0); 28966 } 28967 } 28968 function AssertionError(message) { 28969 this.name = 'AssertionError'; 28970 this.message = message || ''; 28971 this.stack = new Error().stack; 28972 } 28973 AssertionError.prototype = Object.create(Error.prototype); 28974 AssertionError.prototype.constructor = AssertionError; 28975 function assert(value, message) { 28976 if (!value) { 28977 throw new AssertionError(message); 28978 } 28979 } 28980 module.exports = { 28981 rethrowAssertionErrorRejection: rethrowAssertionErrorRejection, 28982 AssertionError: AssertionError, 28983 assert: assert 28984 }; 28985}, function (module, exports, __w_pdfjs_require__) { 28986 "use strict"; 28987 28988 var _createClass = function () { 28989 function defineProperties(target, props) { 28990 for (var i = 0; i < props.length; i++) { 28991 var descriptor = props[i]; 28992 descriptor.enumerable = descriptor.enumerable || false; 28993 descriptor.configurable = true; 28994 if ("value" in descriptor) descriptor.writable = true; 28995 Object.defineProperty(target, descriptor.key, descriptor); 28996 } 28997 } 28998 return function (Constructor, protoProps, staticProps) { 28999 if (protoProps) defineProperties(Constructor.prototype, protoProps); 29000 if (staticProps) defineProperties(Constructor, staticProps); 29001 return Constructor; 29002 }; 29003 }(); 29004 function _classCallCheck(instance, Constructor) { 29005 if (!(instance instanceof Constructor)) { 29006 throw new TypeError("Cannot call a class as a function"); 29007 } 29008 } 29009 var _require = __w_pdfjs_require__(0), 29010 InvokeOrNoop = _require.InvokeOrNoop, 29011 PromiseInvokeOrNoop = _require.PromiseInvokeOrNoop, 29012 ValidateAndNormalizeQueuingStrategy = _require.ValidateAndNormalizeQueuingStrategy, 29013 typeIsObject = _require.typeIsObject; 29014 var _require2 = __w_pdfjs_require__(1), 29015 assert = _require2.assert, 29016 rethrowAssertionErrorRejection = _require2.rethrowAssertionErrorRejection; 29017 var _require3 = __w_pdfjs_require__(3), 29018 DequeueValue = _require3.DequeueValue, 29019 EnqueueValueWithSize = _require3.EnqueueValueWithSize, 29020 PeekQueueValue = _require3.PeekQueueValue, 29021 ResetQueue = _require3.ResetQueue; 29022 var WritableStream = function () { 29023 function WritableStream() { 29024 var underlyingSink = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 29025 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 29026 size = _ref.size, 29027 _ref$highWaterMark = _ref.highWaterMark, 29028 highWaterMark = _ref$highWaterMark === undefined ? 1 : _ref$highWaterMark; 29029 _classCallCheck(this, WritableStream); 29030 this._state = 'writable'; 29031 this._storedError = undefined; 29032 this._writer = undefined; 29033 this._writableStreamController = undefined; 29034 this._writeRequests = []; 29035 this._inFlightWriteRequest = undefined; 29036 this._closeRequest = undefined; 29037 this._inFlightCloseRequest = undefined; 29038 this._pendingAbortRequest = undefined; 29039 this._backpressure = false;
29040 var type = underlyingSink.type; 29041 if (type !== undefined) { 29042 throw new RangeError('Invalid type is specified'); 29043 } 29044 this._writableStreamController = new WritableStreamDefaultController(this, underlyingSink, size, highWaterMark); 29045 this._writableStreamController.__startSteps(); 29046 } 29047 _createClass(WritableStream, [{ 29048 key: 'abort', 29049 value: function abort(reason) { 29050 if (IsWritableStream(this) === false) { 29051 return Promise.reject(streamBrandCheckException('abort')); 29052 } 29053 if (IsWritableStreamLocked(this) === true) { 29054 return Promise.reject(new TypeError('Cannot abort a stream that already has a writer')); 29055 } 29056 return WritableStreamAbort(this, reason); 29057 } 29058 }, { 29059 key: 'getWriter', 29060 value: function getWriter() { 29061 if (IsWritableStream(this) === false) { 29062 throw streamBrandCheckException('getWriter'); 29063 } 29064 return AcquireWritableStreamDefaultWriter(this); 29065 } 29066 }, { 29067 key: 'locked', 29068 get: function get() { 29069 if (IsWritableStream(this) === false) { 29070 throw streamBrandCheckException('locked'); 29071 } 29072 return IsWritableStreamLocked(this); 29073 } 29074 }]); 29075 return WritableStream; 29076 }(); 29077 module.exports = { 29078 AcquireWritableStreamDefaultWriter: AcquireWritableStreamDefaultWriter, 29079 IsWritableStream: IsWritableStream, 29080 IsWritableStreamLocked: IsWritableStreamLocked, 29081 WritableStream: WritableStream, 29082 WritableStreamAbort: WritableStreamAbort, 29083 WritableStreamDefaultControllerError: WritableStreamDefaultControllerError, 29084 WritableStreamDefaultWriterCloseWithErrorPropagation: WritableStreamDefaultWriterCloseWithErrorPropagation, 29085 WritableStreamDefaultWriterRelease: WritableStreamDefaultWriterRelease, 29086 WritableStreamDefaultWriterWrite: WritableStreamDefaultWriterWrite, 29087 WritableStreamCloseQueuedOrInFlight: WritableStreamCloseQueuedOrInFlight 29088 }; 29089 function AcquireWritableStreamDefaultWriter(stream) { 29090 return new WritableStreamDefaultWriter(stream); 29091 } 29092 function IsWritableStream(x) { 29093 if (!typeIsObject(x)) { 29094 return false; 29095 } 29096 if (!Object.prototype.hasOwnProperty.call(x, '_writableStreamController')) { 29097 return false; 29098 } 29099 return true; 29100 } 29101 function IsWritableStreamLocked(stream) { 29102 assert(IsWritableStream(stream) === true, 'IsWritableStreamLocked should only be used on known writable streams'); 29103 if (stream._writer === undefined) { 29104 return false; 29105 } 29106 return true; 29107 } 29108 function WritableStreamAbort(stream, reason) { 29109 var state = stream._state; 29110 if (state === 'closed') { 29111 return Promise.resolve(undefined); 29112 } 29113 if (state === 'errored') { 29114 return Promise.reject(stream._storedError); 29115 } 29116 var error = new TypeError('Requested to abort'); 29117 if (stream._pendingAbortRequest !== undefined) { 29118 return Promise.reject(error); 29119 } 29120 assert(state === 'writable' || state === 'erroring', 'state must be writable or erroring'); 29121 var wasAlreadyErroring = false; 29122 if (state === 'erroring') { 29123 wasAlreadyErroring = true; 29124 reason = undefined; 29125 } 29126 var promise = new Promise(function (resolve, reject) { 29127 stream._pendingAbortRequest = { 29128 _resolve: resolve, 29129 _reject: reject, 29130 _reason: reason, 29131 _wasAlreadyErroring: wasAlreadyErroring 29132 }; 29133 }); 29134 if (wasAlreadyErroring === false) { 29135 WritableStreamStartErroring(stream, error); 29136 } 29137 return promise; 29138 } 29139 function WritableStreamAddWriteRequest(stream) { 29140 assert(IsWritableStreamLocked(stream) === true); 29141 assert(stream._state === 'writable'); 29142 var promise = new Promise(function (resolve, reject) { 29143 var writeRequest = { 29144 _resolve: resolve, 29145 _reject: reject 29146 }; 29147 stream._writeRequests.push(writeRequest); 29148 }); 29149 return promise; 29150 } 29151 function WritableStreamDealWithRejection(stream, error) { 29152 var state = stream._state; 29153 if (state === 'writable') { 29154 WritableStreamStartErroring(stream, error); 29155 return; 29156 } 29157 assert(state === 'erroring'); 29158 WritableStreamFinishErroring(stream); 29159 } 29160 function WritableStreamStartErroring(stream, reason) { 29161 assert(stream._storedError === undefined, 'stream._storedError === undefined'); 29162 assert(stream._state === 'writable', 'state must be writable'); 29163 var controller = stream._writableStreamController; 29164 assert(controller !== undefined, 'controller must not be undefined'); 29165 stream._state = 'erroring';
29166 stream._storedError = reason; 29167 var writer = stream._writer; 29168 if (writer !== undefined) { 29169 WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason); 29170 } 29171 if (WritableStreamHasOperationMarkedInFlight(stream) === false && controller._started === true) { 29172 WritableStreamFinishErroring(stream); 29173 } 29174 } 29175 function WritableStreamFinishErroring(stream) { 29176 assert(stream._state === 'erroring', 'stream._state === erroring'); 29177 assert(WritableStreamHasOperationMarkedInFlight(stream) === false, 'WritableStreamHasOperationMarkedInFlight(stream) === false'); 29178 stream._state = 'errored'; 29179 stream._writableStreamController.__errorSteps(); 29180 var storedError = stream._storedError; 29181 for (var i = 0; i < stream._writeRequests.length; i++) { 29182 var writeRequest = stream._writeRequests[i]; 29183 writeRequest._reject(storedError); 29184 } 29185 stream._writeRequests = []; 29186 if (stream._pendingAbortRequest === undefined) { 29187 WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); 29188 return; 29189 } 29190 var abortRequest = stream._pendingAbortRequest; 29191 stream._pendingAbortRequest = undefined; 29192 if (abortRequest._wasAlreadyErroring === true) { 29193 abortRequest._reject(storedError); 29194 WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); 29195 return; 29196 } 29197 var promise = stream._writableStreamController.__abortSteps(abortRequest._reason); 29198 promise.then(function () { 29199 abortRequest._resolve(); 29200 WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); 29201 }, function (reason) { 29202 abortRequest._reject(reason); 29203 WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); 29204 }); 29205 } 29206 function WritableStreamFinishInFlightWrite(stream) { 29207 assert(stream._inFlightWriteRequest !== undefined); 29208 stream._inFlightWriteRequest._resolve(undefined); 29209 stream._inFlightWriteRequest = undefined; 29210 } 29211 function WritableStreamFinishInFlightWriteWithError(stream, error) { 29212 assert(stream._inFlightWriteRequest !== undefined); 29213 stream._inFlightWriteRequest._reject(error); 29214 stream._inFlightWriteRequest = undefined; 29215 assert(stream._state === 'writable' || stream._state === 'erroring'); 29216 WritableStreamDealWithRejection(stream, error); 29217 } 29218 function WritableStreamFinishInFlightClose(stream) { 29219 assert(stream._inFlightCloseRequest !== undefined); 29220 stream._inFlightCloseRequest._resolve(undefined); 29221 stream._inFlightCloseRequest = undefined; 29222 var state = stream._state; 29223 assert(state === 'writable' || state === 'erroring'); 29224 if (state === 'erroring') { 29225 stream._storedError = undefined; 29226 if (stream._pendingAbortRequest !== undefined) { 29227 stream._pendingAbortRequest._resolve(); 29228 stream._pendingAbortRequest = undefined; 29229 } 29230 } 29231 stream._state = 'closed'; 29232 var writer = stream._writer; 29233 if (writer !== undefined) { 29234 defaultWriterClosedPromiseResolve(writer); 29235 } 29236 assert(stream._pendingAbortRequest === undefined, 'stream._pendingAbortRequest === undefined'); 29237 assert(stream._storedError === undefined, 'stream._storedError === undefined'); 29238 } 29239 function WritableStreamFinishInFlightCloseWithError(stream, error) { 29240 assert(stream._inFlightCloseRequest !== undefined); 29241 stream._inFlightCloseRequest._reject(error); 29242 stream._inFlightCloseRequest = undefined; 29243 assert(stream._state === 'writable' || stream._state === 'erroring'); 29244 if (stream._pendingAbortRequest !== undefined) { 29245 stream._pendingAbortRequest._reject(error); 29246 stream._pendingAbortRequest = undefined; 29247 } 29248 WritableStreamDealWithRejection(stream, error); 29249 } 29250 function WritableStreamCloseQueuedOrInFlight(stream) { 29251 if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) { 29252 return false; 29253 } 29254 return true; 29255 } 29256 function WritableStreamHasOperationMarkedInFlight(stream) { 29257 if (stream._inFlightWriteRequest === undefined && stream._inFlightCloseRequest === undefined) { 29258 return false; 29259 } 29260 return true; 29261 } 29262 function WritableStreamMarkCloseRequestInFlight(stream) { 29263 assert(stream._inFlightCloseRequest === undefined); 29264 assert(stream._closeRequest !== undefined); 29265 stream._inFlightCloseRequest = stream._closeRequest; 29266 stream._closeRequest = undefined; 29267 } 29268 function WritableStreamMarkFirstWriteRequestInFlight(stream) { 29269 assert(stream._inFlightWriteRequest === undefined, 'there must be no pending write request'); 29270 assert(stream._writeRequests.length !== 0, 'writeRequests must not be empty'); 29271 stream._inFlightWriteRequest = stream._writeRequests.shift(); 29272 } 29273 function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) { 29274 assert(stream._state === 'errored', '_stream_.[[state]] is `"errored"`'); 29275 if (stream._closeRequest !== undefined) { 29276 assert(stream._inFlightCloseRequest === undefined); 29277 stream._closeRequest._reject(stream._storedError); 29278 stream._closeRequest = undefined; 29279 } 29280 var writer = stream._writer; 29281 if (writer !== undefined) { 29282 defaultWriterClosedPromiseReject(writer, stream._storedError); 29283 writer._closedPromise.catch(function () {}); 29284 } 29285 } 29286 function WritableStreamUpdateBackpressure(stream, backpressure) { 29287 assert(stream._state === 'writable');
29288 assert(WritableStreamCloseQueuedOrInFlight(stream) === false); 29289 var writer = stream._writer; 29290 if (writer !== undefined && backpressure !== stream._backpressure) { 29291 if (backpressure === true) { 29292 defaultWriterReadyPromiseReset(writer); 29293 } else { 29294 assert(backpressure === false); 29295 defaultWriterReadyPromiseResolve(writer); 29296 } 29297 } 29298 stream._backpressure = backpressure; 29299 } 29300 var WritableStreamDefaultWriter = function () { 29301 function WritableStreamDefaultWriter(stream) { 29302 _classCallCheck(this, WritableStreamDefaultWriter); 29303 if (IsWritableStream(stream) === false) { 29304 throw new TypeError('WritableStreamDefaultWriter can only be constructed with a WritableStream instance'); 29305 } 29306 if (IsWritableStreamLocked(stream) === true) { 29307 throw new TypeError('This stream has already been locked for exclusive writing by another writer'); 29308 } 29309 this._ownerWritableStream = stream; 29310 stream._writer = this; 29311 var state = stream._state; 29312 if (state === 'writable') { 29313 if (WritableStreamCloseQueuedOrInFlight(stream) === false && stream._backpressure === true) { 29314 defaultWriterReadyPromiseInitialize(this); 29315 } else { 29316 defaultWriterReadyPromiseInitializeAsResolved(this); 29317 } 29318 defaultWriterClosedPromiseInitialize(this); 29319 } else if (state === 'erroring') { 29320 defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError); 29321 this._readyPromise.catch(function () {}); 29322 defaultWriterClosedPromiseInitialize(this); 29323 } else if (state === 'closed') { 29324 defaultWriterReadyPromiseInitializeAsResolved(this); 29325 defaultWriterClosedPromiseInitializeAsResolved(this); 29326 } else { 29327 assert(state === 'errored', 'state must be errored'); 29328 var storedError = stream._storedError; 29329 defaultWriterReadyPromiseInitializeAsRejected(this, storedError); 29330 this._readyPromise.catch(function () {}); 29331 defaultWriterClosedPromiseInitializeAsRejected(this, storedError); 29332 this._closedPromise.catch(function () {}); 29333 } 29334 } 29335 _createClass(WritableStreamDefaultWriter, [{ 29336 key: 'abort', 29337 value: function abort(reason) { 29338 if (IsWritableStreamDefaultWriter(this) === false) { 29339 return Promise.reject(defaultWriterBrandCheckException('abort')); 29340 } 29341 if (this._ownerWritableStream === undefined) { 29342 return Promise.reject(defaultWriterLockException('abort')); 29343 } 29344 return WritableStreamDefaultWriterAbort(this, reason); 29345 } 29346 }, { 29347 key: 'close', 29348 value: function close() { 29349 if (IsWritableStreamDefaultWriter(this) === false) { 29350 return Promise.reject(defaultWriterBrandCheckException('close')); 29351 } 29352 var stream = this._ownerWritableStream; 29353 if (stream === undefined) { 29354 return Promise.reject(defaultWriterLockException('close')); 29355 } 29356 if (WritableStreamCloseQueuedOrInFlight(stream) === true) { 29357 return Promise.reject(new TypeError('cannot close an already-closing stream')); 29358 } 29359 return WritableStreamDefaultWriterClose(this); 29360 } 29361 }, { 29362 key: 'releaseLock', 29363 value: function releaseLock() { 29364 if (IsWritableStreamDefaultWriter(this) === false) { 29365 throw defaultWriterBrandCheckException('releaseLock'); 29366 } 29367 var stream = this._ownerWritableStream; 29368 if (stream === undefined) { 29369 return; 29370 } 29371 assert(stream._writer !== undefined); 29372 WritableStreamDefaultWriterRelease(this); 29373 } 29374 }, { 29375 key: 'write', 29376 value: function write(chunk) { 29377 if (IsWritableStreamDefaultWriter(this) === false) { 29378 return Promise.reject(defaultWriterBrandCheckException('write')); 29379 } 29380 if (this._ownerWritableStream === undefined) { 29381 return Promise.reject(defaultWriterLockException('write to')); 29382 } 29383 return WritableStreamDefaultWriterWrite(this, chunk); 29384 } 29385 }, { 29386 key: 'closed', 29387 get: function get() { 29388 if (IsWritableStreamDefaultWriter(this) === false) { 29389 return Promise.reject(defaultWriterBrandCheckException('closed')); 29390 } 29391 return this._closedPromise; 29392 } 29393 }, {
29394 key: 'desiredSize', 29395 get: function get() { 29396 if (IsWritableStreamDefaultWriter(this) === false) { 29397 throw defaultWriterBrandCheckException('desiredSize'); 29398 } 29399 if (this._ownerWritableStream === undefined) { 29400 throw defaultWriterLockException('desiredSize'); 29401 } 29402 return WritableStreamDefaultWriterGetDesiredSize(this); 29403 } 29404 }, { 29405 key: 'ready', 29406 get: function get() { 29407 if (IsWritableStreamDefaultWriter(this) === false) { 29408 return Promise.reject(defaultWriterBrandCheckException('ready')); 29409 } 29410 return this._readyPromise; 29411 } 29412 }]); 29413 return WritableStreamDefaultWriter; 29414 }(); 29415 function IsWritableStreamDefaultWriter(x) { 29416 if (!typeIsObject(x)) { 29417 return false; 29418 } 29419 if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) { 29420 return false; 29421 } 29422 return true; 29423 } 29424 function WritableStreamDefaultWriterAbort(writer, reason) { 29425 var stream = writer._ownerWritableStream; 29426 assert(stream !== undefined); 29427 return WritableStreamAbort(stream, reason); 29428 } 29429 function WritableStreamDefaultWriterClose(writer) { 29430 var stream = writer._ownerWritableStream; 29431 assert(stream !== undefined); 29432 var state = stream._state; 29433 if (state === 'closed' || state === 'errored') { 29434 return Promise.reject(new TypeError('The stream (in ' + state + ' state) is not in the writable state and cannot be closed')); 29435 } 29436 assert(state === 'writable' || state === 'erroring'); 29437 assert(WritableStreamCloseQueuedOrInFlight(stream) === false); 29438 var promise = new Promise(function (resolve, reject) { 29439 var closeRequest = { 29440 _resolve: resolve, 29441 _reject: reject 29442 }; 29443 stream._closeRequest = closeRequest; 29444 }); 29445 if (stream._backpressure === true && state === 'writable') { 29446 defaultWriterReadyPromiseResolve(writer); 29447 } 29448 WritableStreamDefaultControllerClose(stream._writableStreamController); 29449 return promise; 29450 } 29451 function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) { 29452 var stream = writer._ownerWritableStream; 29453 assert(stream !== undefined); 29454 var state = stream._state; 29455 if (WritableStreamCloseQueuedOrInFlight(stream) === true || state === 'closed') { 29456 return Promise.resolve(); 29457 } 29458 if (state === 'errored') { 29459 return Promise.reject(stream._storedError); 29460 } 29461 assert(state === 'writable' || state === 'erroring'); 29462 return WritableStreamDefaultWriterClose(writer); 29463 } 29464 function WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) { 29465 if (writer._closedPromiseState === 'pending') { 29466 defaultWriterClosedPromiseReject(writer, error); 29467 } else { 29468 defaultWriterClosedPromiseResetToRejected(writer, error); 29469 } 29470 writer._closedPromise.catch(function () {}); 29471 } 29472 function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) { 29473 if (writer._readyPromiseState === 'pending') { 29474 defaultWriterReadyPromiseReject(writer, error); 29475 } else { 29476 defaultWriterReadyPromiseResetToRejected(writer, error); 29477 } 29478 writer._readyPromise.catch(function () {}); 29479 } 29480 function WritableStreamDefaultWriterGetDesiredSize(writer) { 29481 var stream = writer._ownerWritableStream; 29482 var state = stream._state; 29483 if (state === 'errored' || state === 'erroring') { 29484 return null; 29485 } 29486 if (state === 'closed') { 29487 return 0; 29488 } 29489 return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController); 29490 } 29491 function WritableStreamDefaultWriterRelease(writer) { 29492 var stream = writer._ownerWritableStream; 29493 assert(stream !== undefined); 29494 assert(stream._writer === writer); 29495 var releasedError = new TypeError('Writer was released and can no longer be used to monitor the stream\'s closedness'); 29496 WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError); 29497 WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError); 29498 stream._writer = undefined; 29499 writer._ownerWritableStream = undefined; 29500 } 29501 function WritableStreamDefaultWriterWrite(writer, chunk) { 29502 var stream = writer._ownerWritableStream; 29503 assert(stream !== undefined); 29504 var controller = stream._writableStreamController; 29505 var chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk); 29506 if (stream !== writer._ownerWritableStream) { 29507 return Promise.reject(defaultWriterLockException('write to')); 29508 } 29509 var state = stream._state; 29510 if (state === 'errored') { 29511 return Promise.reject(stream._storedError); 29512 }
29513 if (WritableStreamCloseQueuedOrInFlight(stream) === true || state === 'closed') { 29514 return Promise.reject(new TypeError('The stream is closing or closed and cannot be written to')); 29515 } 29516 if (state === 'erroring') { 29517 return Promise.reject(stream._storedError); 29518 } 29519 assert(state === 'writable'); 29520 var promise = WritableStreamAddWriteRequest(stream); 29521 WritableStreamDefaultControllerWrite(controller, chunk, chunkSize); 29522 return promise; 29523 } 29524 var WritableStreamDefaultController = function () { 29525 function WritableStreamDefaultController(stream, underlyingSink, size, highWaterMark) { 29526 _classCallCheck(this, WritableStreamDefaultController); 29527 if (IsWritableStream(stream) === false) { 29528 throw new TypeError('WritableStreamDefaultController can only be constructed with a WritableStream instance'); 29529 } 29530 if (stream._writableStreamController !== undefined) { 29531 throw new TypeError('WritableStreamDefaultController instances can only be created by the WritableStream constructor'); 29532 } 29533 this._controlledWritableStream = stream; 29534 this._underlyingSink = underlyingSink; 29535 this._queue = undefined; 29536 this._queueTotalSize = undefined; 29537 ResetQueue(this); 29538 this._started = false; 29539 var normalizedStrategy = ValidateAndNormalizeQueuingStrategy(size, highWaterMark); 29540 this._strategySize = normalizedStrategy.size; 29541 this._strategyHWM = normalizedStrategy.highWaterMark; 29542 var backpressure = WritableStreamDefaultControllerGetBackpressure(this); 29543 WritableStreamUpdateBackpressure(stream, backpressure); 29544 } 29545 _createClass(WritableStreamDefaultController, [{ 29546 key: 'error', 29547 value: function error(e) { 29548 if (IsWritableStreamDefaultController(this) === false) { 29549 throw new TypeError('WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController'); 29550 } 29551 var state = this._controlledWritableStream._state; 29552 if (state !== 'writable') { 29553 return; 29554 } 29555 WritableStreamDefaultControllerError(this, e); 29556 } 29557 }, { 29558 key: '__abortSteps', 29559 value: function __abortSteps(reason) { 29560 return PromiseInvokeOrNoop(this._underlyingSink, 'abort', [reason]); 29561 } 29562 }, { 29563 key: '__errorSteps', 29564 value: function __errorSteps() { 29565 ResetQueue(this); 29566 } 29567 }, { 29568 key: '__startSteps', 29569 value: function __startSteps() { 29570 var _this = this; 29571 var startResult = InvokeOrNoop(this._underlyingSink, 'start', [this]); 29572 var stream = this._controlledWritableStream; 29573 Promise.resolve(startResult).then(function () { 29574 assert(stream._state === 'writable' || stream._state === 'erroring'); 29575 _this._started = true; 29576 WritableStreamDefaultControllerAdvanceQueueIfNeeded(_this); 29577 }, function (r) { 29578 assert(stream._state === 'writable' || stream._state === 'erroring'); 29579 _this._started = true; 29580 WritableStreamDealWithRejection(stream, r); 29581 }).catch(rethrowAssertionErrorRejection); 29582 } 29583 }]); 29584 return WritableStreamDefaultController; 29585 }(); 29586 function WritableStreamDefaultControllerClose(controller) { 29587 EnqueueValueWithSize(controller, 'close', 0); 29588 WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); 29589 } 29590 function WritableStreamDefaultControllerGetChunkSize(controller, chunk) { 29591 var strategySize = controller._strategySize; 29592 if (strategySize === undefined) { 29593 return 1; 29594 } 29595 try { 29596 return strategySize(chunk); 29597 } catch (chunkSizeE) { 29598 WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE); 29599 return 1; 29600 } 29601 } 29602 function WritableStreamDefaultControllerGetDesiredSize(controller) { 29603 return controller._strategyHWM - controller._queueTotalSize; 29604 } 29605 function WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) { 29606 var writeRecord = { chunk: chunk }; 29607 try { 29608 EnqueueValueWithSize(controller, writeRecord, chunkSize); 29609 } catch (enqueueE) { 29610 WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE); 29611 return; 29612 } 29613 var stream = controller._controlledWritableStream;
29614 if (WritableStreamCloseQueuedOrInFlight(stream) === false && stream._state === 'writable') { 29615 var backpressure = WritableStreamDefaultControllerGetBackpressure(controller); 29616 WritableStreamUpdateBackpressure(stream, backpressure); 29617 } 29618 WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); 29619 } 29620 function IsWritableStreamDefaultController(x) { 29621 if (!typeIsObject(x)) { 29622 return false; 29623 } 29624 if (!Object.prototype.hasOwnProperty.call(x, '_underlyingSink')) { 29625 return false; 29626 } 29627 return true; 29628 } 29629 function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) { 29630 var stream = controller._controlledWritableStream; 29631 if (controller._started === false) { 29632 return; 29633 } 29634 if (stream._inFlightWriteRequest !== undefined) { 29635 return; 29636 } 29637 var state = stream._state; 29638 if (state === 'closed' || state === 'errored') { 29639 return; 29640 } 29641 if (state === 'erroring') { 29642 WritableStreamFinishErroring(stream); 29643 return; 29644 } 29645 if (controller._queue.length === 0) { 29646 return; 29647 } 29648 var writeRecord = PeekQueueValue(controller); 29649 if (writeRecord === 'close') { 29650 WritableStreamDefaultControllerProcessClose(controller); 29651 } else { 29652 WritableStreamDefaultControllerProcessWrite(controller, writeRecord.chunk); 29653 } 29654 } 29655 function WritableStreamDefaultControllerErrorIfNeeded(controller, error) { 29656 if (controller._controlledWritableStream._state === 'writable') { 29657 WritableStreamDefaultControllerError(controller, error); 29658 } 29659 } 29660 function WritableStreamDefaultControllerProcessClose(controller) { 29661 var stream = controller._controlledWritableStream; 29662 WritableStreamMarkCloseRequestInFlight(stream); 29663 DequeueValue(controller); 29664 assert(controller._queue.length === 0, 'queue must be empty once the final write record is dequeued'); 29665 var sinkClosePromise = PromiseInvokeOrNoop(controller._underlyingSink, 'close', []); 29666 sinkClosePromise.then(function () { 29667 WritableStreamFinishInFlightClose(stream); 29668 }, function (reason) { 29669 WritableStreamFinishInFlightCloseWithError(stream, reason); 29670 }).catch(rethrowAssertionErrorRejection); 29671 } 29672 function WritableStreamDefaultControllerProcessWrite(controller, chunk) { 29673 var stream = controller._controlledWritableStream; 29674 WritableStreamMarkFirstWriteRequestInFlight(stream); 29675 var sinkWritePromise = PromiseInvokeOrNoop(controller._underlyingSink, 'write', [chunk, controller]); 29676 sinkWritePromise.then(function () { 29677 WritableStreamFinishInFlightWrite(stream); 29678 var state = stream._state; 29679 assert(state === 'writable' || state === 'erroring'); 29680 DequeueValue(controller); 29681 if (WritableStreamCloseQueuedOrInFlight(stream) === false && state === 'writable') { 29682 var backpressure = WritableStreamDefaultControllerGetBackpressure(controller); 29683 WritableStreamUpdateBackpressure(stream, backpressure); 29684 } 29685 WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); 29686 }, function (reason) { 29687 WritableStreamFinishInFlightWriteWithError(stream, reason); 29688 }).catch(rethrowAssertionErrorRejection); 29689 } 29690 function WritableStreamDefaultControllerGetBackpressure(controller) { 29691 var desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller); 29692 return desiredSize <= 0; 29693 } 29694 function WritableStreamDefaultControllerError(controller, error) { 29695 var stream = controller._controlledWritableStream; 29696 assert(stream._state === 'writable'); 29697 WritableStreamStartErroring(stream, error); 29698 } 29699 function streamBrandCheckException(name) { 29700 return new TypeError('WritableStream.prototype.' + name + ' can only be used on a WritableStream'); 29701 } 29702 function defaultWriterBrandCheckException(name) { 29703 return new TypeError('WritableStreamDefaultWriter.prototype.' + name + ' can only be used on a WritableStreamDefaultWriter'); 29704 } 29705 function defaultWriterLockException(name) { 29706 return new TypeError('Cannot ' + name + ' a stream using a released writer'); 29707 } 29708 function defaultWriterClosedPromiseInitialize(writer) { 29709 writer._closedPromise = new Promise(function (resolve, reject) { 29710 writer._closedPromise_resolve = resolve; 29711 writer._closedPromise_reject = reject;
vendor: 9,900 bytes, lines 29712-29905
29712 writer._closedPromiseState = 'pending'; 29713 }); 29714 } 29715 function defaultWriterClosedPromiseInitializeAsRejected(writer, reason) { 29716 writer._closedPromise = Promise.reject(reason); 29717 writer._closedPromise_resolve = undefined; 29718 writer._closedPromise_reject = undefined; 29719 writer._closedPromiseState = 'rejected'; 29720 } 29721 function defaultWriterClosedPromiseInitializeAsResolved(writer) { 29722 writer._closedPromise = Promise.resolve(undefined); 29723 writer._closedPromise_resolve = undefined; 29724 writer._closedPromise_reject = undefined; 29725 writer._closedPromiseState = 'resolved'; 29726 } 29727 function defaultWriterClosedPromiseReject(writer, reason) { 29728 assert(writer._closedPromise_resolve !== undefined, 'writer._closedPromise_resolve !== undefined'); 29729 assert(writer._closedPromise_reject !== undefined, 'writer._closedPromise_reject !== undefined'); 29730 assert(writer._closedPromiseState === 'pending', 'writer._closedPromiseState is pending'); 29731 writer._closedPromise_reject(reason); 29732 writer._closedPromise_resolve = undefined; 29733 writer._closedPromise_reject = undefined; 29734 writer._closedPromiseState = 'rejected'; 29735 } 29736 function defaultWriterClosedPromiseResetToRejected(writer, reason) { 29737 assert(writer._closedPromise_resolve === undefined, 'writer._closedPromise_resolve === undefined'); 29738 assert(writer._closedPromise_reject === undefined, 'writer._closedPromise_reject === undefined'); 29739 assert(writer._closedPromiseState !== 'pending', 'writer._closedPromiseState is not pending'); 29740 writer._closedPromise = Promise.reject(reason); 29741 writer._closedPromiseState = 'rejected'; 29742 } 29743 function defaultWriterClosedPromiseResolve(writer) { 29744 assert(writer._closedPromise_resolve !== undefined, 'writer._closedPromise_resolve !== undefined'); 29745 assert(writer._closedPromise_reject !== undefined, 'writer._closedPromise_reject !== undefined'); 29746 assert(writer._closedPromiseState === 'pending', 'writer._closedPromiseState is pending'); 29747 writer._closedPromise_resolve(undefined); 29748 writer._closedPromise_resolve = undefined; 29749 writer._closedPromise_reject = undefined; 29750 writer._closedPromiseState = 'resolved'; 29751 } 29752 function defaultWriterReadyPromiseInitialize(writer) { 29753 writer._readyPromise = new Promise(function (resolve, reject) { 29754 writer._readyPromise_resolve = resolve; 29755 writer._readyPromise_reject = reject; 29756 }); 29757 writer._readyPromiseState = 'pending'; 29758 } 29759 function defaultWriterReadyPromiseInitializeAsRejected(writer, reason) { 29760 writer._readyPromise = Promise.reject(reason); 29761 writer._readyPromise_resolve = undefined; 29762 writer._readyPromise_reject = undefined; 29763 writer._readyPromiseState = 'rejected'; 29764 } 29765 function defaultWriterReadyPromiseInitializeAsResolved(writer) { 29766 writer._readyPromise = Promise.resolve(undefined); 29767 writer._readyPromise_resolve = undefined; 29768 writer._readyPromise_reject = undefined; 29769 writer._readyPromiseState = 'fulfilled'; 29770 } 29771 function defaultWriterReadyPromiseReject(writer, reason) { 29772 assert(writer._readyPromise_resolve !== undefined, 'writer._readyPromise_resolve !== undefined'); 29773 assert(writer._readyPromise_reject !== undefined, 'writer._readyPromise_reject !== undefined'); 29774 writer._readyPromise_reject(reason); 29775 writer._readyPromise_resolve = undefined; 29776 writer._readyPromise_reject = undefined; 29777 writer._readyPromiseState = 'rejected'; 29778 } 29779 function defaultWriterReadyPromiseReset(writer) { 29780 assert(writer._readyPromise_resolve === undefined, 'writer._readyPromise_resolve === undefined'); 29781 assert(writer._readyPromise_reject === undefined, 'writer._readyPromise_reject === undefined'); 29782 writer._readyPromise = new Promise(function (resolve, reject) { 29783 writer._readyPromise_resolve = resolve; 29784 writer._readyPromise_reject = reject; 29785 }); 29786 writer._readyPromiseState = 'pending'; 29787 } 29788 function defaultWriterReadyPromiseResetToRejected(writer, reason) { 29789 assert(writer._readyPromise_resolve === undefined, 'writer._readyPromise_resolve === undefined'); 29790 assert(writer._readyPromise_reject === undefined, 'writer._readyPromise_reject === undefined'); 29791 writer._readyPromise = Promise.reject(reason); 29792 writer._readyPromiseState = 'rejected'; 29793 } 29794 function defaultWriterReadyPromiseResolve(writer) { 29795 assert(writer._readyPromise_resolve !== undefined, 'writer._readyPromise_resolve !== undefined'); 29796 assert(writer._readyPromise_reject !== undefined, 'writer._readyPromise_reject !== undefined'); 29797 writer._readyPromise_resolve(undefined); 29798 writer._readyPromise_resolve = undefined; 29799 writer._readyPromise_reject = undefined; 29800 writer._readyPromiseState = 'fulfilled'; 29801 } 29802}, function (module, exports, __w_pdfjs_require__) { 29803 "use strict"; 29804 29805 var _require = __w_pdfjs_require__(0), 29806 IsFiniteNonNegativeNumber = _require.IsFiniteNonNegativeNumber; 29807 var _require2 = __w_pdfjs_require__(1), 29808 assert = _require2.assert; 29809 exports.DequeueValue = function (container) { 29810 assert('_queue' in container && '_queueTotalSize' in container, 'Spec-level failure: DequeueValue should only be used on containers with [[queue]] and [[queueTotalSize]].'); 29811 assert(container._queue.length > 0, 'Spec-level failure: should never dequeue from an empty queue.'); 29812 var pair = container._queue.shift(); 29813 container._queueTotalSize -= pair.size; 29814 if (container._queueTotalSize < 0) { 29815 container._queueTotalSize = 0; 29816 } 29817 return pair.value; 29818 }; 29819 exports.EnqueueValueWithSize = function (container, value, size) { 29820 assert('_queue' in container && '_queueTotalSize' in container, 'Spec-level failure: EnqueueValueWithSize should only be used on containers with [[queue]] and ' + '[[queueTotalSize]].'); 29821 size = Number(size); 29822 if (!IsFiniteNonNegativeNumber(size)) { 29823 throw new RangeError('Size must be a finite, non-NaN, non-negative number.'); 29824 } 29825 container._queue.push({ 29826 value: value, 29827 size: size 29828 }); 29829 container._queueTotalSize += size; 29830 }; 29831 exports.PeekQueueValue = function (container) { 29832 assert('_queue' in container && '_queueTotalSize' in container, 'Spec-level failure: PeekQueueValue should only be used on containers with [[queue]] and [[queueTotalSize]].'); 29833 assert(container._queue.length > 0, 'Spec-level failure: should never peek at an empty queue.'); 29834 var pair = container._queue[0]; 29835 return pair.value; 29836 }; 29837 exports.ResetQueue = function (container) { 29838 assert('_queue' in container && '_queueTotalSize' in container, 'Spec-level failure: ResetQueue should only be used on containers with [[queue]] and [[queueTotalSize]].'); 29839 container._queue = []; 29840 container._queueTotalSize = 0; 29841 }; 29842}, function (module, exports, __w_pdfjs_require__) { 29843 "use strict"; 29844 29845 var _createClass = function () { 29846 function defineProperties(target, props) { 29847 for (var i = 0; i < props.length; i++) { 29848 var descriptor = props[i]; 29849 descriptor.enumerable = descriptor.enumerable || false; 29850 descriptor.configurable = true; 29851 if ("value" in descriptor) descriptor.writable = true; 29852 Object.defineProperty(target, descriptor.key, descriptor); 29853 } 29854 } 29855 return function (Constructor, protoProps, staticProps) { 29856 if (protoProps) defineProperties(Constructor.prototype, protoProps); 29857 if (staticProps) defineProperties(Constructor, staticProps); 29858 return Constructor; 29859 }; 29860 }(); 29861 function _classCallCheck(instance, Constructor) { 29862 if (!(instance instanceof Constructor)) { 29863 throw new TypeError("Cannot call a class as a function"); 29864 } 29865 } 29866 var _require = __w_pdfjs_require__(0), 29867 ArrayBufferCopy = _require.ArrayBufferCopy, 29868 CreateIterResultObject = _require.CreateIterResultObject, 29869 IsFiniteNonNegativeNumber = _require.IsFiniteNonNegativeNumber, 29870 InvokeOrNoop = _require.InvokeOrNoop, 29871 PromiseInvokeOrNoop = _require.PromiseInvokeOrNoop, 29872 TransferArrayBuffer = _require.TransferArrayBuffer, 29873 ValidateAndNormalizeQueuingStrategy = _require.ValidateAndNormalizeQueuingStrategy, 29874 ValidateAndNormalizeHighWaterMark = _require.ValidateAndNormalizeHighWaterMark; 29875 var _require2 = __w_pdfjs_require__(0), 29876 createArrayFromList = _require2.createArrayFromList, 29877 createDataProperty = _require2.createDataProperty, 29878 typeIsObject = _require2.typeIsObject; 29879 var _require3 = __w_pdfjs_require__(1), 29880 assert = _require3.assert, 29881 rethrowAssertionErrorRejection = _require3.rethrowAssertionErrorRejection; 29882 var _require4 = __w_pdfjs_require__(3), 29883 DequeueValue = _require4.DequeueValue, 29884 EnqueueValueWithSize = _require4.EnqueueValueWithSize, 29885 ResetQueue = _require4.ResetQueue; 29886 var _require5 = __w_pdfjs_require__(2), 29887 AcquireWritableStreamDefaultWriter = _require5.AcquireWritableStreamDefaultWriter, 29888 IsWritableStream = _require5.IsWritableStream, 29889 IsWritableStreamLocked = _require5.IsWritableStreamLocked, 29890 WritableStreamAbort = _require5.WritableStreamAbort, 29891 WritableStreamDefaultWriterCloseWithErrorPropagation = _require5.WritableStreamDefaultWriterCloseWithErrorPropagation, 29892 WritableStreamDefaultWriterRelease = _require5.WritableStreamDefaultWriterRelease, 29893 WritableStreamDefaultWriterWrite = _require5.WritableStreamDefaultWriterWrite, 29894 WritableStreamCloseQueuedOrInFlight = _require5.WritableStreamCloseQueuedOrInFlight; 29895 var ReadableStream = function () { 29896 function ReadableStream() { 29897 var underlyingSource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 29898 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 29899 size = _ref.size, 29900 highWaterMark = _ref.highWaterMark; 29901 _classCallCheck(this, ReadableStream); 29902 this._state = 'readable'; 29903 this._reader = undefined; 29904 this._storedError = undefined; 29905 this._disturbed = false;
29906 this._readableStreamController = undefined; 29907 var type = underlyingSource.type; 29908 var typeString = String(type); 29909 if (typeString === 'bytes') { 29910 if (highWaterMark === undefined) { 29911 highWaterMark = 0; 29912 } 29913 this._readableStreamController = new ReadableByteStreamController(this, underlyingSource, highWaterMark); 29914 } else if (type === undefined) { 29915 if (highWaterMark === undefined) { 29916 highWaterMark = 1; 29917 } 29918 this._readableStreamController = new ReadableStreamDefaultController(this, underlyingSource, size, highWaterMark); 29919 } else { 29920 throw new RangeError('Invalid type is specified'); 29921 } 29922 } 29923 _createClass(ReadableStream, [{ 29924 key: 'cancel', 29925 value: function cancel(reason) { 29926 if (IsReadableStream(this) === false) { 29927 return Promise.reject(streamBrandCheckException('cancel')); 29928 } 29929 if (IsReadableStreamLocked(this) === true) { 29930 return Promise.reject(new TypeError('Cannot cancel a stream that already has a reader')); 29931 } 29932 return ReadableStreamCancel(this, reason); 29933 } 29934 }, { 29935 key: 'getReader', 29936 value: function getReader() { 29937 var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, 29938 mode = _ref2.mode; 29939 if (IsReadableStream(this) === false) { 29940 throw streamBrandCheckException('getReader'); 29941 } 29942 if (mode === undefined) { 29943 return AcquireReadableStreamDefaultReader(this); 29944 } 29945 mode = String(mode); 29946 if (mode === 'byob') { 29947 return AcquireReadableStreamBYOBReader(this); 29948 } 29949 throw new RangeError('Invalid mode is specified'); 29950 } 29951 }, { 29952 key: 'pipeThrough', 29953 value: function pipeThrough(_ref3, options) { 29954 var writable = _ref3.writable, 29955 readable = _ref3.readable; 29956 var promise = this.pipeTo(writable, options); 29957 ifIsObjectAndHasAPromiseIsHandledInternalSlotSetPromiseIsHandledToTrue(promise); 29958 return readable; 29959 } 29960 }, { 29961 key: 'pipeTo', 29962 value: function pipeTo(dest) { 29963 var _this = this; 29964 var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 29965 preventClose = _ref4.preventClose, 29966 preventAbort = _ref4.preventAbort, 29967 preventCancel = _ref4.preventCancel; 29968 if (IsReadableStream(this) === false) { 29969 return Promise.reject(streamBrandCheckException('pipeTo')); 29970 } 29971 if (IsWritableStream(dest) === false) { 29972 return Promise.reject(new TypeError('ReadableStream.prototype.pipeTo\'s first argument must be a WritableStream')); 29973 } 29974 preventClose = Boolean(preventClose); 29975 preventAbort = Boolean(preventAbort); 29976 preventCancel = Boolean(preventCancel); 29977 if (IsReadableStreamLocked(this) === true) { 29978 return Promise.reject(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream')); 29979 } 29980 if (IsWritableStreamLocked(dest) === true) { 29981 return Promise.reject(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream')); 29982 } 29983 var reader = AcquireReadableStreamDefaultReader(this); 29984 var writer = AcquireWritableStreamDefaultWriter(dest); 29985 var shuttingDown = false; 29986 var currentWrite = Promise.resolve(); 29987 return new Promise(function (resolve, reject) { 29988 function pipeLoop() { 29989 currentWrite = Promise.resolve(); 29990 if (shuttingDown === true) { 29991 return Promise.resolve(); 29992 } 29993 return writer._readyPromise.then(function () { 29994 return ReadableStreamDefaultReaderRead(reader).then(function (_ref5) { 29995 var value = _ref5.value, 29996 done = _ref5.done; 29997 if (done === true) { 29998 return; 29999 } 30000 currentWrite = WritableStreamDefaultWriterWrite(writer, value).catch(function () {}); 30001 }); 30002 }).then(pipeLoop); 30003 } 30004 isOrBecomesErrored(_this, reader._closedPromise, function (storedError) { 30005 if (preventAbort === false) { 30006 shutdownWithAction(function () { 30007 return WritableStreamAbort(dest, storedError); 30008 }, true, storedError); 30009 } else { 30010 shutdown(true, storedError); 30011 } 30012 }); 30013 isOrBecomesErrored(dest, writer._closedPromise, function (storedError) { 30014 if (preventCancel === false) { 30015 shutdownWithAction(function () { 30016 return ReadableStreamCancel(_this, storedError); 30017 }, true, storedError); 30018 } else { 30019 shutdown(true, storedError); 30020 } 30021 }); 30022 isOrBecomesClosed(_this, reader._closedPromise, function () { 30023 if (preventClose === false) { 30024 shutdownWithAction(function () { 30025 return WritableStreamDefaultWriterCloseWithErrorPropagation(writer); 30026 }); 30027 } else { 30028 shutdown(); 30029 } 30030 }); 30031 if (WritableStreamCloseQueuedOrInFlight(dest) === true || dest._state === 'closed') { 30032 var destClosed = new TypeError('the destination writable stream closed before all data could be piped to it'); 30033 if (preventCancel === false) { 30034 shutdownWithAction(function () { 30035 return ReadableStreamCancel(_this, destClosed); 30036 }, true, destClosed); 30037 } else { 30038 shutdown(true, destClosed); 30039 } 30040 } 30041 pipeLoop().catch(function (err) { 30042 currentWrite = Promise.resolve(); 30043 rethrowAssertionErrorRejection(err); 30044 }); 30045 function waitForWritesToFinish() { 30046 var oldCurrentWrite = currentWrite; 30047 return currentWrite.then(function () { 30048 return oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined; 30049 }); 30050 } 30051 function isOrBecomesErrored(stream, promise, action) { 30052 if (stream._state === 'errored') { 30053 action(stream._storedError); 30054 } else { 30055 promise.catch(action).catch(rethrowAssertionErrorRejection); 30056 } 30057 } 30058 function isOrBecomesClosed(stream, promise, action) { 30059 if (stream._state === 'closed') { 30060 action(); 30061 } else { 30062 promise.then(action).catch(rethrowAssertionErrorRejection); 30063 } 30064 } 30065 function shutdownWithAction(action, originalIsError, originalError) { 30066 if (shuttingDown === true) { 30067 return; 30068 } 30069 shuttingDown = true; 30070 if (dest._state === 'writable' && WritableStreamCloseQueuedOrInFlight(dest) === false) { 30071 waitForWritesToFinish().then(doTheRest); 30072 } else { 30073 doTheRest(); 30074 } 30075 function doTheRest() { 30076 action().then(function () { 30077 return finalize(originalIsError, originalError); 30078 }, function (newError) { 30079 return finalize(true, newError); 30080 }).catch(rethrowAssertionErrorRejection); 30081 } 30082 } 30083 function shutdown(isError, error) { 30084 if (shuttingDown === true) { 30085 return; 30086 } 30087 shuttingDown = true; 30088 if (dest._state === 'writable' && WritableStreamCloseQueuedOrInFlight(dest) === false) { 30089 waitForWritesToFinish().then(function () { 30090 return finalize(isError, error); 30091 }).catch(rethrowAssertionErrorRejection); 30092 } else { 30093 finalize(isError, error); 30094 } 30095 } 30096 function finalize(isError, error) { 30097 WritableStreamDefaultWriterRelease(writer); 30098 ReadableStreamReaderGenericRelease(reader); 30099 if (isError) { 30100 reject(error); 30101 } else { 30102 resolve(undefined); 30103 } 30104 } 30105 }); 30106 } 30107 }, {
30108 key: 'tee', 30109 value: function tee() { 30110 if (IsReadableStream(this) === false) { 30111 throw streamBrandCheckException('tee'); 30112 } 30113 var branches = ReadableStreamTee(this, false); 30114 return createArrayFromList(branches); 30115 } 30116 }, { 30117 key: 'locked', 30118 get: function get() { 30119 if (IsReadableStream(this) === false) { 30120 throw streamBrandCheckException('locked'); 30121 } 30122 return IsReadableStreamLocked(this); 30123 } 30124 }]); 30125 return ReadableStream; 30126 }(); 30127 module.exports = { 30128 ReadableStream: ReadableStream, 30129 IsReadableStreamDisturbed: IsReadableStreamDisturbed, 30130 ReadableStreamDefaultControllerClose: ReadableStreamDefaultControllerClose, 30131 ReadableStreamDefaultControllerEnqueue: ReadableStreamDefaultControllerEnqueue, 30132 ReadableStreamDefaultControllerError: ReadableStreamDefaultControllerError, 30133 ReadableStreamDefaultControllerGetDesiredSize: ReadableStreamDefaultControllerGetDesiredSize 30134 }; 30135 function AcquireReadableStreamBYOBReader(stream) { 30136 return new ReadableStreamBYOBReader(stream); 30137 } 30138 function AcquireReadableStreamDefaultReader(stream) { 30139 return new ReadableStreamDefaultReader(stream); 30140 } 30141 function IsReadableStream(x) { 30142 if (!typeIsObject(x)) { 30143 return false; 30144 } 30145 if (!Object.prototype.hasOwnProperty.call(x, '_readableStreamController')) { 30146 return false; 30147 } 30148 return true; 30149 } 30150 function IsReadableStreamDisturbed(stream) { 30151 assert(IsReadableStream(stream) === true, 'IsReadableStreamDisturbed should only be used on known readable streams'); 30152 return stream._disturbed; 30153 } 30154 function IsReadableStreamLocked(stream) { 30155 assert(IsReadableStream(stream) === true, 'IsReadableStreamLocked should only be used on known readable streams'); 30156 if (stream._reader === undefined) { 30157 return false; 30158 } 30159 return true; 30160 } 30161 function ReadableStreamTee(stream, cloneForBranch2) { 30162 assert(IsReadableStream(stream) === true); 30163 assert(typeof cloneForBranch2 === 'boolean'); 30164 var reader = AcquireReadableStreamDefaultReader(stream); 30165 var teeState = { 30166 closedOrErrored: false, 30167 canceled1: false, 30168 canceled2: false, 30169 reason1: undefined, 30170 reason2: undefined 30171 }; 30172 teeState.promise = new Promise(function (resolve) { 30173 teeState._resolve = resolve; 30174 }); 30175 var pull = create_ReadableStreamTeePullFunction(); 30176 pull._reader = reader; 30177 pull._teeState = teeState; 30178 pull._cloneForBranch2 = cloneForBranch2; 30179 var cancel1 = create_ReadableStreamTeeBranch1CancelFunction(); 30180 cancel1._stream = stream; 30181 cancel1._teeState = teeState; 30182 var cancel2 = create_ReadableStreamTeeBranch2CancelFunction(); 30183 cancel2._stream = stream; 30184 cancel2._teeState = teeState; 30185 var underlyingSource1 = Object.create(Object.prototype);
30186 createDataProperty(underlyingSource1, 'pull', pull); 30187 createDataProperty(underlyingSource1, 'cancel', cancel1); 30188 var branch1Stream = new ReadableStream(underlyingSource1); 30189 var underlyingSource2 = Object.create(Object.prototype); 30190 createDataProperty(underlyingSource2, 'pull', pull); 30191 createDataProperty(underlyingSource2, 'cancel', cancel2); 30192 var branch2Stream = new ReadableStream(underlyingSource2); 30193 pull._branch1 = branch1Stream._readableStreamController; 30194 pull._branch2 = branch2Stream._readableStreamController; 30195 reader._closedPromise.catch(function (r) { 30196 if (teeState.closedOrErrored === true) { 30197 return; 30198 } 30199 ReadableStreamDefaultControllerError(pull._branch1, r); 30200 ReadableStreamDefaultControllerError(pull._branch2, r); 30201 teeState.closedOrErrored = true; 30202 }); 30203 return [branch1Stream, branch2Stream]; 30204 } 30205 function create_ReadableStreamTeePullFunction() { 30206 function f() { 30207 var reader = f._reader, 30208 branch1 = f._branch1, 30209 branch2 = f._branch2, 30210 teeState = f._teeState; 30211 return ReadableStreamDefaultReaderRead(reader).then(function (result) { 30212 assert(typeIsObject(result)); 30213 var value = result.value; 30214 var done = result.done; 30215 assert(typeof done === 'boolean'); 30216 if (done === true && teeState.closedOrErrored === false) { 30217 if (teeState.canceled1 === false) { 30218 ReadableStreamDefaultControllerClose(branch1); 30219 } 30220 if (teeState.canceled2 === false) { 30221 ReadableStreamDefaultControllerClose(branch2); 30222 } 30223 teeState.closedOrErrored = true; 30224 } 30225 if (teeState.closedOrErrored === true) { 30226 return; 30227 } 30228 var value1 = value; 30229 var value2 = value; 30230 if (teeState.canceled1 === false) { 30231 ReadableStreamDefaultControllerEnqueue(branch1, value1); 30232 } 30233 if (teeState.canceled2 === false) { 30234 ReadableStreamDefaultControllerEnqueue(branch2, value2); 30235 } 30236 }); 30237 } 30238 return f; 30239 } 30240 function create_ReadableStreamTeeBranch1CancelFunction() { 30241 function f(reason) { 30242 var stream = f._stream, 30243 teeState = f._teeState; 30244 teeState.canceled1 = true; 30245 teeState.reason1 = reason; 30246 if (teeState.canceled2 === true) { 30247 var compositeReason = createArrayFromList([teeState.reason1, teeState.reason2]); 30248 var cancelResult = ReadableStreamCancel(stream, compositeReason); 30249 teeState._resolve(cancelResult); 30250 } 30251 return teeState.promise; 30252 } 30253 return f; 30254 } 30255 function create_ReadableStreamTeeBranch2CancelFunction() { 30256 function f(reason) { 30257 var stream = f._stream, 30258 teeState = f._teeState; 30259 teeState.canceled2 = true; 30260 teeState.reason2 = reason; 30261 if (teeState.canceled1 === true) { 30262 var compositeReason = createArrayFromList([teeState.reason1, teeState.reason2]); 30263 var cancelResult = ReadableStreamCancel(stream, compositeReason); 30264 teeState._resolve(cancelResult); 30265 } 30266 return teeState.promise; 30267 } 30268 return f; 30269 } 30270 function ReadableStreamAddReadIntoRequest(stream) { 30271 assert(IsReadableStreamBYOBReader(stream._reader) === true); 30272 assert(stream._state === 'readable' || stream._state === 'closed'); 30273 var promise = new Promise(function (resolve, reject) { 30274 var readIntoRequest = { 30275 _resolve: resolve, 30276 _reject: reject 30277 }; 30278 stream._reader._readIntoRequests.push(readIntoRequest); 30279 }); 30280 return promise; 30281 } 30282 function ReadableStreamAddReadRequest(stream) { 30283 assert(IsReadableStreamDefaultReader(stream._reader) === true); 30284 assert(stream._state === 'readable'); 30285 var promise = new Promise(function (resolve, reject) { 30286 var readRequest = { 30287 _resolve: resolve, 30288 _reject: reject 30289 }; 30290 stream._reader._readRequests.push(readRequest); 30291 }); 30292 return promise; 30293 } 30294 function ReadableStreamCancel(stream, reason) { 30295 stream._disturbed = true; 30296 if (stream._state === 'closed') { 30297 return Promise.resolve(undefined); 30298 } 30299 if (stream._state === 'errored') { 30300 return Promise.reject(stream._storedError); 30301 } 30302 ReadableStreamClose(stream); 30303 var sourceCancelPromise = stream._readableStreamController.__cancelSteps(reason); 30304 return sourceCancelPromise.then(function () { 30305 return undefined; 30306 }); 30307 } 30308 function ReadableStreamClose(stream) { 30309 assert(stream._state === 'readable'); 30310 stream._state = 'closed'; 30311 var reader = stream._reader; 30312 if (reader === undefined) { 30313 return undefined; 30314 } 30315 if (IsReadableStreamDefaultReader(reader) === true) { 30316 for (var i = 0; i < reader._readRequests.length; i++) { 30317 var _resolve = reader._readRequests[i]._resolve; 30318 _resolve(CreateIterResultObject(undefined, true)); 30319 } 30320 reader._readRequests = []; 30321 } 30322 defaultReaderClosedPromiseResolve(reader); 30323 return undefined; 30324 } 30325 function ReadableStreamError(stream, e) {
30326 assert(IsReadableStream(stream) === true, 'stream must be ReadableStream'); 30327 assert(stream._state === 'readable', 'state must be readable'); 30328 stream._state = 'errored'; 30329 stream._storedError = e; 30330 var reader = stream._reader; 30331 if (reader === undefined) { 30332 return undefined; 30333 } 30334 if (IsReadableStreamDefaultReader(reader) === true) { 30335 for (var i = 0; i < reader._readRequests.length; i++) { 30336 var readRequest = reader._readRequests[i]; 30337 readRequest._reject(e); 30338 } 30339 reader._readRequests = []; 30340 } else { 30341 assert(IsReadableStreamBYOBReader(reader), 'reader must be ReadableStreamBYOBReader'); 30342 for (var _i = 0; _i < reader._readIntoRequests.length; _i++) { 30343 var readIntoRequest = reader._readIntoRequests[_i]; 30344 readIntoRequest._reject(e); 30345 } 30346 reader._readIntoRequests = []; 30347 } 30348 defaultReaderClosedPromiseReject(reader, e); 30349 reader._closedPromise.catch(function () {}); 30350 } 30351 function ReadableStreamFulfillReadIntoRequest(stream, chunk, done) { 30352 var reader = stream._reader; 30353 assert(reader._readIntoRequests.length > 0); 30354 var readIntoRequest = reader._readIntoRequests.shift(); 30355 readIntoRequest._resolve(CreateIterResultObject(chunk, done)); 30356 } 30357 function ReadableStreamFulfillReadRequest(stream, chunk, done) { 30358 var reader = stream._reader; 30359 assert(reader._readRequests.length > 0); 30360 var readRequest = reader._readRequests.shift(); 30361 readRequest._resolve(CreateIterResultObject(chunk, done)); 30362 } 30363 function ReadableStreamGetNumReadIntoRequests(stream) { 30364 return stream._reader._readIntoRequests.length; 30365 } 30366 function ReadableStreamGetNumReadRequests(stream) { 30367 return stream._reader._readRequests.length; 30368 } 30369 function ReadableStreamHasBYOBReader(stream) { 30370 var reader = stream._reader; 30371 if (reader === undefined) { 30372 return false; 30373 } 30374 if (IsReadableStreamBYOBReader(reader) === false) { 30375 return false; 30376 } 30377 return true; 30378 } 30379 function ReadableStreamHasDefaultReader(stream) { 30380 var reader = stream._reader; 30381 if (reader === undefined) { 30382 return false; 30383 } 30384 if (IsReadableStreamDefaultReader(reader) === false) { 30385 return false; 30386 } 30387 return true; 30388 } 30389 var ReadableStreamDefaultReader = function () { 30390 function ReadableStreamDefaultReader(stream) { 30391 _classCallCheck(this, ReadableStreamDefaultReader); 30392 if (IsReadableStream(stream) === false) { 30393 throw new TypeError('ReadableStreamDefaultReader can only be constructed with a ReadableStream instance'); 30394 } 30395 if (IsReadableStreamLocked(stream) === true) { 30396 throw new TypeError('This stream has already been locked for exclusive reading by another reader'); 30397 } 30398 ReadableStreamReaderGenericInitialize(this, stream); 30399 this._readRequests = []; 30400 } 30401 _createClass(ReadableStreamDefaultReader, [{ 30402 key: 'cancel', 30403 value: function cancel(reason) { 30404 if (IsReadableStreamDefaultReader(this) === false) { 30405 return Promise.reject(defaultReaderBrandCheckException('cancel')); 30406 } 30407 if (this._ownerReadableStream === undefined) { 30408 return Promise.reject(readerLockException('cancel')); 30409 } 30410 return ReadableStreamReaderGenericCancel(this, reason); 30411 } 30412 }, { 30413 key: 'read', 30414 value: function read() { 30415 if (IsReadableStreamDefaultReader(this) === false) { 30416 return Promise.reject(defaultReaderBrandCheckException('read')); 30417 } 30418 if (this._ownerReadableStream === undefined) { 30419 return Promise.reject(readerLockException('read from')); 30420 } 30421 return ReadableStreamDefaultReaderRead(this); 30422 } 30423 }, { 30424 key: 'releaseLock', 30425 value: function releaseLock() { 30426 if (IsReadableStreamDefaultReader(this) === false) { 30427 throw defaultReaderBrandCheckException('releaseLock'); 30428 } 30429 if (this._ownerReadableStream === undefined) { 30430 return; 30431 } 30432 if (this._readRequests.length > 0) { 30433 throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled'); 30434 } 30435 ReadableStreamReaderGenericRelease(this); 30436 } 30437 }, {
30438 key: 'closed', 30439 get: function get() { 30440 if (IsReadableStreamDefaultReader(this) === false) { 30441 return Promise.reject(defaultReaderBrandCheckException('closed')); 30442 } 30443 return this._closedPromise; 30444 } 30445 }]); 30446 return ReadableStreamDefaultReader; 30447 }(); 30448 var ReadableStreamBYOBReader = function () { 30449 function ReadableStreamBYOBReader(stream) { 30450 _classCallCheck(this, ReadableStreamBYOBReader); 30451 if (!IsReadableStream(stream)) { 30452 throw new TypeError('ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a ' + 'byte source'); 30453 } 30454 if (IsReadableByteStreamController(stream._readableStreamController) === false) { 30455 throw new TypeError('Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte ' + 'source'); 30456 } 30457 if (IsReadableStreamLocked(stream)) { 30458 throw new TypeError('This stream has already been locked for exclusive reading by another reader'); 30459 } 30460 ReadableStreamReaderGenericInitialize(this, stream); 30461 this._readIntoRequests = []; 30462 } 30463 _createClass(ReadableStreamBYOBReader, [{ 30464 key: 'cancel', 30465 value: function cancel(reason) { 30466 if (!IsReadableStreamBYOBReader(this)) { 30467 return Promise.reject(byobReaderBrandCheckException('cancel')); 30468 } 30469 if (this._ownerReadableStream === undefined) { 30470 return Promise.reject(readerLockException('cancel')); 30471 } 30472 return ReadableStreamReaderGenericCancel(this, reason); 30473 } 30474 }, { 30475 key: 'read', 30476 value: function read(view) { 30477 if (!IsReadableStreamBYOBReader(this)) { 30478 return Promise.reject(byobReaderBrandCheckException('read')); 30479 } 30480 if (this._ownerReadableStream === undefined) { 30481 return Promise.reject(readerLockException('read from')); 30482 } 30483 if (!ArrayBuffer.isView(view)) { 30484 return Promise.reject(new TypeError('view must be an array buffer view')); 30485 } 30486 if (view.byteLength === 0) { 30487 return Promise.reject(new TypeError('view must have non-zero byteLength')); 30488 } 30489 return ReadableStreamBYOBReaderRead(this, view); 30490 } 30491 }, { 30492 key: 'releaseLock', 30493 value: function releaseLock() { 30494 if (!IsReadableStreamBYOBReader(this)) { 30495 throw byobReaderBrandCheckException('releaseLock'); 30496 } 30497 if (this._ownerReadableStream === undefined) { 30498 return; 30499 } 30500 if (this._readIntoRequests.length > 0) { 30501 throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled'); 30502 } 30503 ReadableStreamReaderGenericRelease(this); 30504 } 30505 }, { 30506 key: 'closed', 30507 get: function get() { 30508 if (!IsReadableStreamBYOBReader(this)) { 30509 return Promise.reject(byobReaderBrandCheckException('closed')); 30510 } 30511 return this._closedPromise; 30512 } 30513 }]); 30514 return ReadableStreamBYOBReader; 30515 }(); 30516 function IsReadableStreamBYOBReader(x) { 30517 if (!typeIsObject(x)) { 30518 return false; 30519 } 30520 if (!Object.prototype.hasOwnProperty.call(x, '_readIntoRequests')) { 30521 return false; 30522 } 30523 return true; 30524 } 30525 function IsReadableStreamDefaultReader(x) { 30526 if (!typeIsObject(x)) { 30527 return false; 30528 } 30529 if (!Object.prototype.hasOwnProperty.call(x, '_readRequests')) { 30530 return false; 30531 } 30532 return true; 30533 } 30534 function ReadableStreamReaderGenericInitialize(reader, stream) { 30535 reader._ownerReadableStream = stream; 30536 stream._reader = reader; 30537 if (stream._state === 'readable') { 30538 defaultReaderClosedPromiseInitialize(reader); 30539 } else if (stream._state === 'closed') { 30540 defaultReaderClosedPromiseInitializeAsResolved(reader); 30541 } else { 30542 assert(stream._state === 'errored', 'state must be errored'); 30543 defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError); 30544 reader._closedPromise.catch(function () {}); 30545 } 30546 } 30547 function ReadableStreamReaderGenericCancel(reader, reason) { 30548 var stream = reader._ownerReadableStream; 30549 assert(stream !== undefined); 30550 return ReadableStreamCancel(stream, reason); 30551 } 30552 function ReadableStreamReaderGenericRelease(reader) { 30553 assert(reader._ownerReadableStream !== undefined); 30554 assert(reader._ownerReadableStream._reader === reader); 30555 if (reader._ownerReadableStream._state === 'readable') { 30556 defaultReaderClosedPromiseReject(reader, new TypeError('Reader was released and can no longer be used to monitor the stream\'s closedness')); 30557 } else { 30558 defaultReaderClosedPromiseResetToRejected(reader, new TypeError('Reader was released and can no longer be used to monitor the stream\'s closedness')); 30559 } 30560 reader._closedPromise.catch(function () {}); 30561 reader._ownerReadableStream._reader = undefined; 30562 reader._ownerReadableStream = undefined; 30563 } 30564 function ReadableStreamBYOBReaderRead(reader, view) { 30565 var stream = reader._ownerReadableStream; 30566 assert(stream !== undefined); 30567 stream._disturbed = true; 30568 if (stream._state === 'errored') { 30569 return Promise.reject(stream._storedError); 30570 } 30571 return ReadableByteStreamControllerPullInto(stream._readableStreamController, view); 30572 } 30573 function ReadableStreamDefaultReaderRead(reader) { 30574 var stream = reader._ownerReadableStream; 30575 assert(stream !== undefined); 30576 stream._disturbed = true; 30577 if (stream._state === 'closed') { 30578 return Promise.resolve(CreateIterResultObject(undefined, true)); 30579 } 30580 if (stream._state === 'errored') { 30581 return Promise.reject(stream._storedError); 30582 } 30583 assert(stream._state === 'readable'); 30584 return stream._readableStreamController.__pullSteps(); 30585 } 30586 var ReadableStreamDefaultController = function () { 30587 function ReadableStreamDefaultController(stream, underlyingSource, size, highWaterMark) { 30588 _classCallCheck(this, ReadableStreamDefaultController);
30589 if (IsReadableStream(stream) === false) { 30590 throw new TypeError('ReadableStreamDefaultController can only be constructed with a ReadableStream instance'); 30591 } 30592 if (stream._readableStreamController !== undefined) { 30593 throw new TypeError('ReadableStreamDefaultController instances can only be created by the ReadableStream constructor'); 30594 } 30595 this._controlledReadableStream = stream; 30596 this._underlyingSource = underlyingSource; 30597 this._queue = undefined; 30598 this._queueTotalSize = undefined; 30599 ResetQueue(this); 30600 this._started = false; 30601 this._closeRequested = false; 30602 this._pullAgain = false; 30603 this._pulling = false; 30604 var normalizedStrategy = ValidateAndNormalizeQueuingStrategy(size, highWaterMark); 30605 this._strategySize = normalizedStrategy.size; 30606 this._strategyHWM = normalizedStrategy.highWaterMark; 30607 var controller = this; 30608 var startResult = InvokeOrNoop(underlyingSource, 'start', [this]); 30609 Promise.resolve(startResult).then(function () { 30610 controller._started = true; 30611 assert(controller._pulling === false); 30612 assert(controller._pullAgain === false); 30613 ReadableStreamDefaultControllerCallPullIfNeeded(controller); 30614 }, function (r) { 30615 ReadableStreamDefaultControllerErrorIfNeeded(controller, r); 30616 }).catch(rethrowAssertionErrorRejection); 30617 } 30618 _createClass(ReadableStreamDefaultController, [{ 30619 key: 'close', 30620 value: function close() { 30621 if (IsReadableStreamDefaultController(this) === false) { 30622 throw defaultControllerBrandCheckException('close'); 30623 } 30624 if (this._closeRequested === true) { 30625 throw new TypeError('The stream has already been closed; do not close it again!'); 30626 } 30627 var state = this._controlledReadableStream._state; 30628 if (state !== 'readable') { 30629 throw new TypeError('The stream (in ' + state + ' state) is not in the readable state and cannot be closed'); 30630 } 30631 ReadableStreamDefaultControllerClose(this); 30632 } 30633 }, { 30634 key: 'enqueue', 30635 value: function enqueue(chunk) { 30636 if (IsReadableStreamDefaultController(this) === false) { 30637 throw defaultControllerBrandCheckException('enqueue'); 30638 } 30639 if (this._closeRequested === true) { 30640 throw new TypeError('stream is closed or draining'); 30641 } 30642 var state = this._controlledReadableStream._state; 30643 if (state !== 'readable') { 30644 throw new TypeError('The stream (in ' + state + ' state) is not in the readable state and cannot be enqueued to'); 30645 } 30646 return ReadableStreamDefaultControllerEnqueue(this, chunk); 30647 } 30648 }, { 30649 key: 'error', 30650 value: function error(e) { 30651 if (IsReadableStreamDefaultController(this) === false) { 30652 throw defaultControllerBrandCheckException('error'); 30653 } 30654 var stream = this._controlledReadableStream; 30655 if (stream._state !== 'readable') { 30656 throw new TypeError('The stream is ' + stream._state + ' and so cannot be errored'); 30657 } 30658 ReadableStreamDefaultControllerError(this, e); 30659 } 30660 }, { 30661 key: '__cancelSteps', 30662 value: function __cancelSteps(reason) { 30663 ResetQueue(this); 30664 return PromiseInvokeOrNoop(this._underlyingSource, 'cancel', [reason]); 30665 } 30666 }, { 30667 key: '__pullSteps', 30668 value: function __pullSteps() { 30669 var stream = this._controlledReadableStream; 30670 if (this._queue.length > 0) { 30671 var chunk = DequeueValue(this); 30672 if (this._closeRequested === true && this._queue.length === 0) { 30673 ReadableStreamClose(stream); 30674 } else { 30675 ReadableStreamDefaultControllerCallPullIfNeeded(this); 30676 } 30677 return Promise.resolve(CreateIterResultObject(chunk, false)); 30678 } 30679 var pendingPromise = ReadableStreamAddReadRequest(stream); 30680 ReadableStreamDefaultControllerCallPullIfNeeded(this); 30681 return pendingPromise; 30682 } 30683 }, { 30684 key: 'desiredSize', 30685 get: function get() { 30686 if (IsReadableStreamDefaultController(this) === false) { 30687 throw defaultControllerBrandCheckException('desiredSize'); 30688 } 30689 return ReadableStreamDefaultControllerGetDesiredSize(this); 30690 } 30691 }]); 30692 return ReadableStreamDefaultController; 30693 }(); 30694 function IsReadableStreamDefaultController(x) { 30695 if (!typeIsObject(x)) { 30696 return false;
30697 } 30698 if (!Object.prototype.hasOwnProperty.call(x, '_underlyingSource')) { 30699 return false; 30700 } 30701 return true; 30702 } 30703 function ReadableStreamDefaultControllerCallPullIfNeeded(controller) { 30704 var shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller); 30705 if (shouldPull === false) { 30706 return undefined; 30707 } 30708 if (controller._pulling === true) { 30709 controller._pullAgain = true; 30710 return undefined; 30711 } 30712 assert(controller._pullAgain === false); 30713 controller._pulling = true; 30714 var pullPromise = PromiseInvokeOrNoop(controller._underlyingSource, 'pull', [controller]); 30715 pullPromise.then(function () { 30716 controller._pulling = false; 30717 if (controller._pullAgain === true) { 30718 controller._pullAgain = false; 30719 return ReadableStreamDefaultControllerCallPullIfNeeded(controller); 30720 } 30721 return undefined; 30722 }, function (e) { 30723 ReadableStreamDefaultControllerErrorIfNeeded(controller, e); 30724 }).catch(rethrowAssertionErrorRejection); 30725 return undefined; 30726 } 30727 function ReadableStreamDefaultControllerShouldCallPull(controller) { 30728 var stream = controller._controlledReadableStream; 30729 if (stream._state === 'closed' || stream._state === 'errored') { 30730 return false; 30731 } 30732 if (controller._closeRequested === true) { 30733 return false; 30734 } 30735 if (controller._started === false) { 30736 return false; 30737 } 30738 if (IsReadableStreamLocked(stream) === true && ReadableStreamGetNumReadRequests(stream) > 0) { 30739 return true; 30740 } 30741 var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller); 30742 if (desiredSize > 0) { 30743 return true; 30744 } 30745 return false; 30746 } 30747 function ReadableStreamDefaultControllerClose(controller) { 30748 var stream = controller._controlledReadableStream; 30749 assert(controller._closeRequested === false); 30750 assert(stream._state === 'readable'); 30751 controller._closeRequested = true; 30752 if (controller._queue.length === 0) { 30753 ReadableStreamClose(stream); 30754 } 30755 } 30756 function ReadableStreamDefaultControllerEnqueue(controller, chunk) { 30757 var stream = controller._controlledReadableStream; 30758 assert(controller._closeRequested === false); 30759 assert(stream._state === 'readable'); 30760 if (IsReadableStreamLocked(stream) === true && ReadableStreamGetNumReadRequests(stream) > 0) { 30761 ReadableStreamFulfillReadRequest(stream, chunk, false); 30762 } else { 30763 var chunkSize = 1; 30764 if (controller._strategySize !== undefined) { 30765 var strategySize = controller._strategySize; 30766 try { 30767 chunkSize = strategySize(chunk); 30768 } catch (chunkSizeE) { 30769 ReadableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE); 30770 throw chunkSizeE; 30771 } 30772 } 30773 try { 30774 EnqueueValueWithSize(controller, chunk, chunkSize); 30775 } catch (enqueueE) { 30776 ReadableStreamDefaultControllerErrorIfNeeded(controller, enqueueE); 30777 throw enqueueE; 30778 } 30779 } 30780 ReadableStreamDefaultControllerCallPullIfNeeded(controller); 30781 return undefined; 30782 } 30783 function ReadableStreamDefaultControllerError(controller, e) { 30784 var stream = controller._controlledReadableStream; 30785 assert(stream._state === 'readable'); 30786 ResetQueue(controller); 30787 ReadableStreamError(stream, e); 30788 } 30789 function ReadableStreamDefaultControllerErrorIfNeeded(controller, e) { 30790 if (controller._controlledReadableStream._state === 'readable') { 30791 ReadableStreamDefaultControllerError(controller, e); 30792 } 30793 } 30794 function ReadableStreamDefaultControllerGetDesiredSize(controller) { 30795 var stream = controller._controlledReadableStream; 30796 var state = stream._state; 30797 if (state === 'errored') { 30798 return null; 30799 } 30800 if (state === 'closed') { 30801 return 0; 30802 } 30803 return controller._strategyHWM - controller._queueTotalSize; 30804 } 30805 var ReadableStreamBYOBRequest = function () { 30806 function ReadableStreamBYOBRequest(controller, view) { 30807 _classCallCheck(this, ReadableStreamBYOBRequest); 30808 this._associatedReadableByteStreamController = controller; 30809 this._view = view; 30810 } 30811 _createClass(ReadableStreamBYOBRequest, [{ 30812 key: 'respond', 30813 value: function respond(bytesWritten) { 30814 if (IsReadableStreamBYOBRequest(this) === false) { 30815 throw byobRequestBrandCheckException('respond'); 30816 } 30817 if (this._associatedReadableByteStreamController === undefined) { 30818 throw new TypeError('This BYOB request has been invalidated'); 30819 } 30820 ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten); 30821 } 30822 }, {
30823 key: 'respondWithNewView', 30824 value: function respondWithNewView(view) { 30825 if (IsReadableStreamBYOBRequest(this) === false) { 30826 throw byobRequestBrandCheckException('respond'); 30827 } 30828 if (this._associatedReadableByteStreamController === undefined) { 30829 throw new TypeError('This BYOB request has been invalidated'); 30830 } 30831 if (!ArrayBuffer.isView(view)) { 30832 throw new TypeError('You can only respond with array buffer views'); 30833 } 30834 ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view); 30835 } 30836 }, { 30837 key: 'view', 30838 get: function get() { 30839 return this._view; 30840 } 30841 }]); 30842 return ReadableStreamBYOBRequest; 30843 }(); 30844 var ReadableByteStreamController = function () { 30845 function ReadableByteStreamController(stream, underlyingByteSource, highWaterMark) { 30846 _classCallCheck(this, ReadableByteStreamController); 30847 if (IsReadableStream(stream) === false) { 30848 throw new TypeError('ReadableByteStreamController can only be constructed with a ReadableStream instance given ' + 'a byte source'); 30849 } 30850 if (stream._readableStreamController !== undefined) { 30851 throw new TypeError('ReadableByteStreamController instances can only be created by the ReadableStream constructor given a byte ' + 'source'); 30852 } 30853 this._controlledReadableStream = stream; 30854 this._underlyingByteSource = underlyingByteSource; 30855 this._pullAgain = false; 30856 this._pulling = false; 30857 ReadableByteStreamControllerClearPendingPullIntos(this); 30858 this._queue = this._queueTotalSize = undefined; 30859 ResetQueue(this); 30860 this._closeRequested = false; 30861 this._started = false; 30862 this._strategyHWM = ValidateAndNormalizeHighWaterMark(highWaterMark); 30863 var autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize; 30864 if (autoAllocateChunkSize !== undefined) { 30865 if (Number.isInteger(autoAllocateChunkSize) === false || autoAllocateChunkSize <= 0) { 30866 throw new RangeError('autoAllocateChunkSize must be a positive integer'); 30867 } 30868 } 30869 this._autoAllocateChunkSize = autoAllocateChunkSize; 30870 this._pendingPullIntos = []; 30871 var controller = this; 30872 var startResult = InvokeOrNoop(underlyingByteSource, 'start', [this]); 30873 Promise.resolve(startResult).then(function () { 30874 controller._started = true; 30875 assert(controller._pulling === false); 30876 assert(controller._pullAgain === false); 30877 ReadableByteStreamControllerCallPullIfNeeded(controller); 30878 }, function (r) { 30879 if (stream._state === 'readable') { 30880 ReadableByteStreamControllerError(controller, r); 30881 } 30882 }).catch(rethrowAssertionErrorRejection); 30883 } 30884 _createClass(ReadableByteStreamController, [{ 30885 key: 'close', 30886 value: function close() { 30887 if (IsReadableByteStreamController(this) === false) { 30888 throw byteStreamControllerBrandCheckException('close'); 30889 } 30890 if (this._closeRequested === true) { 30891 throw new TypeError('The stream has already been closed; do not close it again!'); 30892 } 30893 var state = this._controlledReadableStream._state; 30894 if (state !== 'readable') { 30895 throw new TypeError('The stream (in ' + state + ' state) is not in the readable state and cannot be closed'); 30896 } 30897 ReadableByteStreamControllerClose(this); 30898 } 30899 }, { 30900 key: 'enqueue', 30901 value: function enqueue(chunk) { 30902 if (IsReadableByteStreamController(this) === false) { 30903 throw byteStreamControllerBrandCheckException('enqueue'); 30904 } 30905 if (this._closeRequested === true) { 30906 throw new TypeError('stream is closed or draining'); 30907 } 30908 var state = this._controlledReadableStream._state; 30909 if (state !== 'readable') { 30910 throw new TypeError('The stream (in ' + state + ' state) is not in the readable state and cannot be enqueued to'); 30911 } 30912 if (!ArrayBuffer.isView(chunk)) { 30913 throw new TypeError('You can only enqueue array buffer views when using a ReadableByteStreamController'); 30914 } 30915 ReadableByteStreamControllerEnqueue(this, chunk); 30916 } 30917 }, {
30918 key: 'error', 30919 value: function error(e) { 30920 if (IsReadableByteStreamController(this) === false) { 30921 throw byteStreamControllerBrandCheckException('error'); 30922 } 30923 var stream = this._controlledReadableStream; 30924 if (stream._state !== 'readable') { 30925 throw new TypeError('The stream is ' + stream._state + ' and so cannot be errored'); 30926 } 30927 ReadableByteStreamControllerError(this, e); 30928 } 30929 }, { 30930 key: '__cancelSteps', 30931 value: function __cancelSteps(reason) { 30932 if (this._pendingPullIntos.length > 0) { 30933 var firstDescriptor = this._pendingPullIntos[0]; 30934 firstDescriptor.bytesFilled = 0; 30935 } 30936 ResetQueue(this); 30937 return PromiseInvokeOrNoop(this._underlyingByteSource, 'cancel', [reason]); 30938 } 30939 }, { 30940 key: '__pullSteps', 30941 value: function __pullSteps() { 30942 var stream = this._controlledReadableStream; 30943 assert(ReadableStreamHasDefaultReader(stream) === true); 30944 if (this._queueTotalSize > 0) { 30945 assert(ReadableStreamGetNumReadRequests(stream) === 0); 30946 var entry = this._queue.shift(); 30947 this._queueTotalSize -= entry.byteLength; 30948 ReadableByteStreamControllerHandleQueueDrain(this); 30949 var view = void 0; 30950 try { 30951 view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength); 30952 } catch (viewE) { 30953 return Promise.reject(viewE); 30954 } 30955 return Promise.resolve(CreateIterResultObject(view, false)); 30956 } 30957 var autoAllocateChunkSize = this._autoAllocateChunkSize; 30958 if (autoAllocateChunkSize !== undefined) { 30959 var buffer = void 0; 30960 try { 30961 buffer = new ArrayBuffer(autoAllocateChunkSize); 30962 } catch (bufferE) { 30963 return Promise.reject(bufferE); 30964 } 30965 var pullIntoDescriptor = { 30966 buffer: buffer, 30967 byteOffset: 0, 30968 byteLength: autoAllocateChunkSize, 30969 bytesFilled: 0, 30970 elementSize: 1, 30971 ctor: Uint8Array, 30972 readerType: 'default' 30973 }; 30974 this._pendingPullIntos.push(pullIntoDescriptor); 30975 } 30976 var promise = ReadableStreamAddReadRequest(stream); 30977 ReadableByteStreamControllerCallPullIfNeeded(this); 30978 return promise; 30979 } 30980 }, { 30981 key: 'byobRequest', 30982 get: function get() { 30983 if (IsReadableByteStreamController(this) === false) { 30984 throw byteStreamControllerBrandCheckException('byobRequest'); 30985 } 30986 if (this._byobRequest === undefined && this._pendingPullIntos.length > 0) { 30987 var firstDescriptor = this._pendingPullIntos[0]; 30988 var view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled); 30989 this._byobRequest = new ReadableStreamBYOBRequest(this, view); 30990 } 30991 return this._byobRequest; 30992 } 30993 }, { 30994 key: 'desiredSize', 30995 get: function get() { 30996 if (IsReadableByteStreamController(this) === false) { 30997 throw byteStreamControllerBrandCheckException('desiredSize'); 30998 } 30999 return ReadableByteStreamControllerGetDesiredSize(this); 31000 } 31001 }]); 31002 return ReadableByteStreamController; 31003 }(); 31004 function IsReadableByteStreamController(x) { 31005 if (!typeIsObject(x)) { 31006 return false; 31007 } 31008 if (!Object.prototype.hasOwnProperty.call(x, '_underlyingByteSource')) { 31009 return false; 31010 } 31011 return true; 31012 } 31013 function IsReadableStreamBYOBRequest(x) { 31014 if (!typeIsObject(x)) { 31015 return false; 31016 } 31017 if (!Object.prototype.hasOwnProperty.call(x, '_associatedReadableByteStreamController')) { 31018 return false; 31019 } 31020 return true; 31021 } 31022 function ReadableByteStreamControllerCallPullIfNeeded(controller) { 31023 var shouldPull = ReadableByteStreamControllerShouldCallPull(controller); 31024 if (shouldPull === false) { 31025 return undefined; 31026 } 31027 if (controller._pulling === true) { 31028 controller._pullAgain = true; 31029 return undefined; 31030 } 31031 assert(controller._pullAgain === false); 31032 controller._pulling = true; 31033 var pullPromise = PromiseInvokeOrNoop(controller._underlyingByteSource, 'pull', [controller]); 31034 pullPromise.then(function () { 31035 controller._pulling = false;
31036 if (controller._pullAgain === true) { 31037 controller._pullAgain = false; 31038 ReadableByteStreamControllerCallPullIfNeeded(controller); 31039 } 31040 }, function (e) { 31041 if (controller._controlledReadableStream._state === 'readable') { 31042 ReadableByteStreamControllerError(controller, e); 31043 } 31044 }).catch(rethrowAssertionErrorRejection); 31045 return undefined; 31046 } 31047 function ReadableByteStreamControllerClearPendingPullIntos(controller) { 31048 ReadableByteStreamControllerInvalidateBYOBRequest(controller); 31049 controller._pendingPullIntos = []; 31050 } 31051 function ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) { 31052 assert(stream._state !== 'errored', 'state must not be errored'); 31053 var done = false; 31054 if (stream._state === 'closed') { 31055 assert(pullIntoDescriptor.bytesFilled === 0); 31056 done = true; 31057 } 31058 var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); 31059 if (pullIntoDescriptor.readerType === 'default') { 31060 ReadableStreamFulfillReadRequest(stream, filledView, done); 31061 } else { 31062 assert(pullIntoDescriptor.readerType === 'byob'); 31063 ReadableStreamFulfillReadIntoRequest(stream, filledView, done); 31064 } 31065 } 31066 function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) { 31067 var bytesFilled = pullIntoDescriptor.bytesFilled; 31068 var elementSize = pullIntoDescriptor.elementSize; 31069 assert(bytesFilled <= pullIntoDescriptor.byteLength); 31070 assert(bytesFilled % elementSize === 0); 31071 return new pullIntoDescriptor.ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize); 31072 } 31073 function ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) { 31074 controller._queue.push({ 31075 buffer: buffer, 31076 byteOffset: byteOffset, 31077 byteLength: byteLength 31078 }); 31079 controller._queueTotalSize += byteLength; 31080 } 31081 function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) { 31082 var elementSize = pullIntoDescriptor.elementSize; 31083 var currentAlignedBytes = pullIntoDescriptor.bytesFilled - pullIntoDescriptor.bytesFilled % elementSize; 31084 var maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled); 31085 var maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy; 31086 var maxAlignedBytes = maxBytesFilled - maxBytesFilled % elementSize; 31087 var totalBytesToCopyRemaining = maxBytesToCopy; 31088 var ready = false; 31089 if (maxAlignedBytes > currentAlignedBytes) { 31090 totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled; 31091 ready = true; 31092 } 31093 var queue = controller._queue; 31094 while (totalBytesToCopyRemaining > 0) { 31095 var headOfQueue = queue[0]; 31096 var bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength); 31097 var destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; 31098 ArrayBufferCopy(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy); 31099 if (headOfQueue.byteLength === bytesToCopy) { 31100 queue.shift(); 31101 } else { 31102 headOfQueue.byteOffset += bytesToCopy; 31103 headOfQueue.byteLength -= bytesToCopy; 31104 } 31105 controller._queueTotalSize -= bytesToCopy; 31106 ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor); 31107 totalBytesToCopyRemaining -= bytesToCopy; 31108 } 31109 if (ready === false) { 31110 assert(controller._queueTotalSize === 0, 'queue must be empty'); 31111 assert(pullIntoDescriptor.bytesFilled > 0); 31112 assert(pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize); 31113 } 31114 return ready; 31115 } 31116 function ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) { 31117 assert(controller._pendingPullIntos.length === 0 || controller._pendingPullIntos[0] === pullIntoDescriptor); 31118 ReadableByteStreamControllerInvalidateBYOBRequest(controller); 31119 pullIntoDescriptor.bytesFilled += size; 31120 } 31121 function ReadableByteStreamControllerHandleQueueDrain(controller) { 31122 assert(controller._controlledReadableStream._state === 'readable'); 31123 if (controller._queueTotalSize === 0 && controller._closeRequested === true) { 31124 ReadableStreamClose(controller._controlledReadableStream); 31125 } else { 31126 ReadableByteStreamControllerCallPullIfNeeded(controller); 31127 } 31128 } 31129 function ReadableByteStreamControllerInvalidateBYOBRequest(controller) { 31130 if (controller._byobRequest === undefined) { 31131 return; 31132 } 31133 controller._byobRequest._associatedReadableByteStreamController = undefined; 31134 controller._byobRequest._view = undefined; 31135 controller._byobRequest = undefined; 31136 } 31137 function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) { 31138 assert(controller._closeRequested === false); 31139 while (controller._pendingPullIntos.length > 0) { 31140 if (controller._queueTotalSize === 0) { 31141 return; 31142 } 31143 var pullIntoDescriptor = controller._pendingPullIntos[0]; 31144 if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) === true) { 31145 ReadableByteStreamControllerShiftPendingPullInto(controller); 31146 ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableStream, pullIntoDescriptor); 31147 } 31148 } 31149 } 31150 function ReadableByteStreamControllerPullInto(controller, view) { 31151 var stream = controller._controlledReadableStream; 31152 var elementSize = 1; 31153 if (view.constructor !== DataView) { 31154 elementSize = view.constructor.BYTES_PER_ELEMENT; 31155 } 31156 var ctor = view.constructor; 31157 var pullIntoDescriptor = { 31158 buffer: view.buffer, 31159 byteOffset: view.byteOffset, 31160 byteLength: view.byteLength, 31161 bytesFilled: 0, 31162 elementSize: elementSize, 31163 ctor: ctor, 31164 readerType: 'byob' 31165 }; 31166 if (controller._pendingPullIntos.length > 0) { 31167 pullIntoDescriptor.buffer = TransferArrayBuffer(pullIntoDescriptor.buffer); 31168 controller._pendingPullIntos.push(pullIntoDescriptor); 31169 return ReadableStreamAddReadIntoRequest(stream); 31170 } 31171 if (stream._state === 'closed') { 31172 var emptyView = new view.constructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0); 31173 return Promise.resolve(CreateIterResultObject(emptyView, true)); 31174 } 31175 if (controller._queueTotalSize > 0) { 31176 if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) === true) { 31177 var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); 31178 ReadableByteStreamControllerHandleQueueDrain(controller); 31179 return Promise.resolve(CreateIterResultObject(filledView, false)); 31180 } 31181 if (controller._closeRequested === true) { 31182 var e = new TypeError('Insufficient bytes to fill elements in the given buffer'); 31183 ReadableByteStreamControllerError(controller, e); 31184 return Promise.reject(e); 31185 } 31186 } 31187 pullIntoDescriptor.buffer = TransferArrayBuffer(pullIntoDescriptor.buffer); 31188 controller._pendingPullIntos.push(pullIntoDescriptor); 31189 var promise = ReadableStreamAddReadIntoRequest(stream); 31190 ReadableByteStreamControllerCallPullIfNeeded(controller); 31191 return promise; 31192 } 31193 function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) { 31194 firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer); 31195 assert(firstDescriptor.bytesFilled === 0, 'bytesFilled must be 0'); 31196 var stream = controller._controlledReadableStream;
31197 if (ReadableStreamHasBYOBReader(stream) === true) { 31198 while (ReadableStreamGetNumReadIntoRequests(stream) > 0) { 31199 var pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller); 31200 ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor); 31201 } 31202 } 31203 } 31204 function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) { 31205 if (pullIntoDescriptor.bytesFilled + bytesWritten > pullIntoDescriptor.byteLength) { 31206 throw new RangeError('bytesWritten out of range'); 31207 } 31208 ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor); 31209 if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize) { 31210 return; 31211 } 31212 ReadableByteStreamControllerShiftPendingPullInto(controller); 31213 var remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize; 31214 if (remainderSize > 0) { 31215 var end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; 31216 var remainder = pullIntoDescriptor.buffer.slice(end - remainderSize, end); 31217 ReadableByteStreamControllerEnqueueChunkToQueue(controller, remainder, 0, remainder.byteLength); 31218 } 31219 pullIntoDescriptor.buffer = TransferArrayBuffer(pullIntoDescriptor.buffer); 31220 pullIntoDescriptor.bytesFilled -= remainderSize; 31221 ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableStream, pullIntoDescriptor); 31222 ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); 31223 } 31224 function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) { 31225 var firstDescriptor = controller._pendingPullIntos[0]; 31226 var stream = controller._controlledReadableStream; 31227 if (stream._state === 'closed') { 31228 if (bytesWritten !== 0) { 31229 throw new TypeError('bytesWritten must be 0 when calling respond() on a closed stream'); 31230 } 31231 ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor); 31232 } else { 31233 assert(stream._state === 'readable'); 31234 ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor); 31235 } 31236 } 31237 function ReadableByteStreamControllerShiftPendingPullInto(controller) { 31238 var descriptor = controller._pendingPullIntos.shift(); 31239 ReadableByteStreamControllerInvalidateBYOBRequest(controller); 31240 return descriptor; 31241 } 31242 function ReadableByteStreamControllerShouldCallPull(controller) { 31243 var stream = controller._controlledReadableStream; 31244 if (stream._state !== 'readable') { 31245 return false; 31246 } 31247 if (controller._closeRequested === true) { 31248 return false; 31249 } 31250 if (controller._started === false) { 31251 return false; 31252 } 31253 if (ReadableStreamHasDefaultReader(stream) === true && ReadableStreamGetNumReadRequests(stream) > 0) { 31254 return true; 31255 } 31256 if (ReadableStreamHasBYOBReader(stream) === true && ReadableStreamGetNumReadIntoRequests(stream) > 0) { 31257 return true; 31258 } 31259 if (ReadableByteStreamControllerGetDesiredSize(controller) > 0) { 31260 return true; 31261 } 31262 return false; 31263 } 31264 function ReadableByteStreamControllerClose(controller) { 31265 var stream = controller._controlledReadableStream; 31266 assert(controller._closeRequested === false); 31267 assert(stream._state === 'readable'); 31268 if (controller._queueTotalSize > 0) { 31269 controller._closeRequested = true; 31270 return; 31271 } 31272 if (controller._pendingPullIntos.length > 0) { 31273 var firstPendingPullInto = controller._pendingPullIntos[0]; 31274 if (firstPendingPullInto.bytesFilled > 0) { 31275 var e = new TypeError('Insufficient bytes to fill elements in the given buffer'); 31276 ReadableByteStreamControllerError(controller, e); 31277 throw e; 31278 } 31279 } 31280 ReadableStreamClose(stream); 31281 } 31282 function ReadableByteStreamControllerEnqueue(controller, chunk) { 31283 var stream = controller._controlledReadableStream; 31284 assert(controller._closeRequested === false); 31285 assert(stream._state === 'readable'); 31286 var buffer = chunk.buffer; 31287 var byteOffset = chunk.byteOffset; 31288 var byteLength = chunk.byteLength; 31289 var transferredBuffer = TransferArrayBuffer(buffer);
31290 if (ReadableStreamHasDefaultReader(stream) === true) { 31291 if (ReadableStreamGetNumReadRequests(stream) === 0) { 31292 ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); 31293 } else { 31294 assert(controller._queue.length === 0); 31295 var transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength); 31296 ReadableStreamFulfillReadRequest(stream, transferredView, false); 31297 } 31298 } else if (ReadableStreamHasBYOBReader(stream) === true) { 31299 ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); 31300 ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); 31301 } else { 31302 assert(IsReadableStreamLocked(stream) === false, 'stream must not be locked'); 31303 ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); 31304 } 31305 } 31306 function ReadableByteStreamControllerError(controller, e) { 31307 var stream = controller._controlledReadableStream; 31308 assert(stream._state === 'readable'); 31309 ReadableByteStreamControllerClearPendingPullIntos(controller); 31310 ResetQueue(controller); 31311 ReadableStreamError(stream, e); 31312 } 31313 function ReadableByteStreamControllerGetDesiredSize(controller) { 31314 var stream = controller._controlledReadableStream; 31315 var state = stream._state; 31316 if (state === 'errored') { 31317 return null; 31318 } 31319 if (state === 'closed') { 31320 return 0; 31321 } 31322 return controller._strategyHWM - controller._queueTotalSize; 31323 } 31324 function ReadableByteStreamControllerRespond(controller, bytesWritten) { 31325 bytesWritten = Number(bytesWritten); 31326 if (IsFiniteNonNegativeNumber(bytesWritten) === false) { 31327 throw new RangeError('bytesWritten must be a finite'); 31328 } 31329 assert(controller._pendingPullIntos.length > 0); 31330 ReadableByteStreamControllerRespondInternal(controller, bytesWritten); 31331 } 31332 function ReadableByteStreamControllerRespondWithNewView(controller, view) { 31333 assert(controller._pendingPullIntos.length > 0); 31334 var firstDescriptor = controller._pendingPullIntos[0]; 31335 if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) { 31336 throw new RangeError('The region specified by view does not match byobRequest'); 31337 } 31338 if (firstDescriptor.byteLength !== view.byteLength) { 31339 throw new RangeError('The buffer of view has different capacity than byobRequest'); 31340 } 31341 firstDescriptor.buffer = view.buffer; 31342 ReadableByteStreamControllerRespondInternal(controller, view.byteLength); 31343 } 31344 function streamBrandCheckException(name) { 31345 return new TypeError('ReadableStream.prototype.' + name + ' can only be used on a ReadableStream'); 31346 } 31347 function readerLockException(name) { 31348 return new TypeError('Cannot ' + name + ' a stream using a released reader'); 31349 } 31350 function defaultReaderBrandCheckException(name) { 31351 return new TypeError('ReadableStreamDefaultReader.prototype.' + name + ' can only be used on a ReadableStreamDefaultReader'); 31352 } 31353 function defaultReaderClosedPromiseInitialize(reader) { 31354 reader._closedPromise = new Promise(function (resolve, reject) { 31355 reader._closedPromise_resolve = resolve; 31356 reader._closedPromise_reject = reject; 31357 }); 31358 } 31359 function defaultReaderClosedPromiseInitializeAsRejected(reader, reason) { 31360 reader._closedPromise = Promise.reject(reason); 31361 reader._closedPromise_resolve = undefined; 31362 reader._closedPromise_reject = undefined; 31363 } 31364 function defaultReaderClosedPromiseInitializeAsResolved(reader) { 31365 reader._closedPromise = Promise.resolve(undefined); 31366 reader._closedPromise_resolve = undefined; 31367 reader._closedPromise_reject = undefined; 31368 } 31369 function defaultReaderClosedPromiseReject(reader, reason) { 31370 assert(reader._closedPromise_resolve !== undefined); 31371 assert(reader._closedPromise_reject !== undefined); 31372 reader._closedPromise_reject(reason); 31373 reader._closedPromise_resolve = undefined; 31374 reader._closedPromise_reject = undefined; 31375 } 31376 function defaultReaderClosedPromiseResetToRejected(reader, reason) { 31377 assert(reader._closedPromise_resolve === undefined); 31378 assert(reader._closedPromise_reject === undefined); 31379 reader._closedPromise = Promise.reject(reason); 31380 } 31381 function defaultReaderClosedPromiseResolve(reader) { 31382 assert(reader._closedPromise_resolve !== undefined); 31383 assert(reader._closedPromise_reject !== undefined); 31384 reader._closedPromise_resolve(undefined); 31385 reader._closedPromise_resolve = undefined; 31386 reader._closedPromise_reject = undefined; 31387 } 31388 function byobReaderBrandCheckException(name) { 31389 return new TypeError('ReadableStreamBYOBReader.prototype.' + name + ' can only be used on a ReadableStreamBYOBReader'); 31390 } 31391 function defaultControllerBrandCheckException(name) { 31392 return new TypeError('ReadableStreamDefaultController.prototype.' + name + ' can only be used on a ReadableStreamDefaultController'); 31393 } 31394 function byobRequestBrandCheckException(name) { 31395 return new TypeError('ReadableStreamBYOBRequest.prototype.' + name + ' can only be used on a ReadableStreamBYOBRequest'); 31396 } 31397 function byteStreamControllerBrandCheckException(name) { 31398 return new TypeError('ReadableByteStreamController.prototype.' + name + ' can only be used on a ReadableByteStreamController'); 31399 } 31400 function ifIsObjectAndHasAPromiseIsHandledInternalSlotSetPromiseIsHandledToTrue(promise) { 31401 try { 31402 Promise.prototype.then.call(promise, undefined, function () {}); 31403 } catch (e) {} 31404 } 31405}, function (module, exports, __w_pdfjs_require__) { 31406 "use strict"; 31407 31408 var transformStream = __w_pdfjs_require__(6); 31409 var readableStream = __w_pdfjs_require__(4); 31410 var writableStream = __w_pdfjs_require__(2); 31411 exports.TransformStream = transformStream.TransformStream; 31412 exports.ReadableStream = readableStream.ReadableStream; 31413 exports.IsReadableStreamDisturbed = readableStream.IsReadableStreamDisturbed; 31414 exports.ReadableStreamDefaultControllerClose = readableStream.ReadableStreamDefaultControllerClose; 31415 exports.ReadableStreamDefaultControllerEnqueue = readableStream.ReadableStreamDefaultControllerEnqueue; 31416 exports.ReadableStreamDefaultControllerError = readableStream.ReadableStreamDefaultControllerError; 31417 exports.ReadableStreamDefaultControllerGetDesiredSize = readableStream.ReadableStreamDefaultControllerGetDesiredSize; 31418 exports.AcquireWritableStreamDefaultWriter = writableStream.AcquireWritableStreamDefaultWriter; 31419 exports.IsWritableStream = writableStream.IsWritableStream; 31420 exports.IsWritableStreamLocked = writableStream.IsWritableStreamLocked; 31421 exports.WritableStream = writableStream.WritableStream; 31422 exports.WritableStreamAbort = writableStream.WritableStreamAbort; 31423 exports.WritableStreamDefaultControllerError = writableStream.WritableStreamDefaultControllerError; 31424 exports.WritableStreamDefaultWriterCloseWithErrorPropagation = writableStream.WritableStreamDefaultWriterCloseWithErrorPropagation; 31425 exports.WritableStreamDefaultWriterRelease = writableStream.WritableStreamDefaultWriterRelease; 31426 exports.WritableStreamDefaultWriterWrite = writableStream.WritableStreamDefaultWriterWrite; 31427}, function (module, exports, __w_pdfjs_require__) { 31428 "use strict"; 31429 31430 var _createClass = function () { 31431 function defineProperties(target, props) { 31432 for (var i = 0; i < props.length; i++) { 31433 var descriptor = props[i]; 31434 descriptor.enumerable = descriptor.enumerable || false; 31435 descriptor.configurable = true; 31436 if ("value" in descriptor) descriptor.writable = true; 31437 Object.defineProperty(target, descriptor.key, descriptor); 31438 } 31439 } 31440 return function (Constructor, protoProps, staticProps) { 31441 if (protoProps) defineProperties(Constructor.prototype, protoProps); 31442 if (staticProps) defineProperties(Constructor, staticProps); 31443 return Constructor; 31444 }; 31445 }(); 31446 function _classCallCheck(instance, Constructor) { 31447 if (!(instance instanceof Constructor)) { 31448 throw new TypeError("Cannot call a class as a function"); 31449 } 31450 } 31451 var _require = __w_pdfjs_require__(1), 31452 assert = _require.assert; 31453 var _require2 = __w_pdfjs_require__(0), 31454 InvokeOrNoop = _require2.InvokeOrNoop, 31455 PromiseInvokeOrPerformFallback = _require2.PromiseInvokeOrPerformFallback, 31456 PromiseInvokeOrNoop = _require2.PromiseInvokeOrNoop, 31457 typeIsObject = _require2.typeIsObject; 31458 var _require3 = __w_pdfjs_require__(4), 31459 ReadableStream = _require3.ReadableStream, 31460 ReadableStreamDefaultControllerClose = _require3.ReadableStreamDefaultControllerClose, 31461 ReadableStreamDefaultControllerEnqueue = _require3.ReadableStreamDefaultControllerEnqueue, 31462 ReadableStreamDefaultControllerError = _require3.ReadableStreamDefaultControllerError, 31463 ReadableStreamDefaultControllerGetDesiredSize = _require3.ReadableStreamDefaultControllerGetDesiredSize; 31464 var _require4 = __w_pdfjs_require__(2), 31465 WritableStream = _require4.WritableStream, 31466 WritableStreamDefaultControllerError = _require4.WritableStreamDefaultControllerError; 31467 function TransformStreamCloseReadable(transformStream) { 31468 if (transformStream._errored === true) { 31469 throw new TypeError('TransformStream is already errored'); 31470 } 31471 if (transformStream._readableClosed === true) { 31472 throw new TypeError('Readable side is already closed'); 31473 } 31474 TransformStreamCloseReadableInternal(transformStream); 31475 } 31476 function TransformStreamEnqueueToReadable(transformStream, chunk) { 31477 if (transformStream._errored === true) { 31478 throw new TypeError('TransformStream is already errored'); 31479 } 31480 if (transformStream._readableClosed === true) { 31481 throw new TypeError('Readable side is already closed'); 31482 } 31483 var controller = transformStream._readableController; 31484 try { 31485 ReadableStreamDefaultControllerEnqueue(controller, chunk); 31486 } catch (e) { 31487 transformStream._readableClosed = true; 31488 TransformStreamErrorIfNeeded(transformStream, e); 31489 throw transformStream._storedError; 31490 } 31491 var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller); 31492 var maybeBackpressure = desiredSize <= 0; 31493 if (maybeBackpressure === true && transformStream._backpressure === false) { 31494 TransformStreamSetBackpressure(transformStream, true); 31495 } 31496 } 31497 function TransformStreamError(transformStream, e) { 31498 if (transformStream._errored === true) { 31499 throw new TypeError('TransformStream is already errored'); 31500 } 31501 TransformStreamErrorInternal(transformStream, e); 31502 } 31503 function TransformStreamCloseReadableInternal(transformStream) { 31504 assert(transformStream._errored === false); 31505 assert(transformStream._readableClosed === false); 31506 try { 31507 ReadableStreamDefaultControllerClose(transformStream._readableController); 31508 } catch (e) { 31509 assert(false); 31510 } 31511 transformStream._readableClosed = true; 31512 } 31513 function TransformStreamErrorIfNeeded(transformStream, e) { 31514 if (transformStream._errored === false) { 31515 TransformStreamErrorInternal(transformStream, e); 31516 } 31517 } 31518 function TransformStreamErrorInternal(transformStream, e) { 31519 assert(transformStream._errored === false); 31520 transformStream._errored = true; 31521 transformStream._storedError = e; 31522 if (transformStream._writableDone === false) { 31523 WritableStreamDefaultControllerError(transformStream._writableController, e); 31524 } 31525 if (transformStream._readableClosed === false) { 31526 ReadableStreamDefaultControllerError(transformStream._readableController, e); 31527 } 31528 } 31529 function TransformStreamReadableReadyPromise(transformStream) { 31530 assert(transformStream._backpressureChangePromise !== undefined, '_backpressureChangePromise should have been initialized'); 31531 if (transformStream._backpressure === false) { 31532 return Promise.resolve(); 31533 } 31534 assert(transformStream._backpressure === true, '_backpressure should have been initialized'); 31535 return transformStream._backpressureChangePromise; 31536 } 31537 function TransformStreamSetBackpressure(transformStream, backpressure) { 31538 assert(transformStream._backpressure !== backpressure, 'TransformStreamSetBackpressure() should be called only when backpressure is changed'); 31539 if (transformStream._backpressureChangePromise !== undefined) { 31540 transformStream._backpressureChangePromise_resolve(backpressure); 31541 } 31542 transformStream._backpressureChangePromise = new Promise(function (resolve) { 31543 transformStream._backpressureChangePromise_resolve = resolve; 31544 }); 31545 transformStream._backpressureChangePromise.then(function (resolution) { 31546 assert(resolution !== backpressure, '_backpressureChangePromise should be fulfilled only when backpressure is changed'); 31547 }); 31548 transformStream._backpressure = backpressure; 31549 } 31550 function TransformStreamDefaultTransform(chunk, transformStreamController) { 31551 var transformStream = transformStreamController._controlledTransformStream; 31552 TransformStreamEnqueueToReadable(transformStream, chunk); 31553 return Promise.resolve(); 31554 } 31555 function TransformStreamTransform(transformStream, chunk) { 31556 assert(transformStream._errored === false); 31557 assert(transformStream._transforming === false); 31558 assert(transformStream._backpressure === false); 31559 transformStream._transforming = true; 31560 var transformer = transformStream._transformer; 31561 var controller = transformStream._transformStreamController; 31562 var transformPromise = PromiseInvokeOrPerformFallback(transformer, 'transform', [chunk, controller], TransformStreamDefaultTransform, [chunk, controller]); 31563 return transformPromise.then(function () { 31564 transformStream._transforming = false;
31565 return TransformStreamReadableReadyPromise(transformStream); 31566 }, function (e) { 31567 TransformStreamErrorIfNeeded(transformStream, e); 31568 return Promise.reject(e); 31569 }); 31570 } 31571 function IsTransformStreamDefaultController(x) { 31572 if (!typeIsObject(x)) { 31573 return false; 31574 } 31575 if (!Object.prototype.hasOwnProperty.call(x, '_controlledTransformStream')) { 31576 return false; 31577 } 31578 return true; 31579 } 31580 function IsTransformStream(x) { 31581 if (!typeIsObject(x)) { 31582 return false; 31583 } 31584 if (!Object.prototype.hasOwnProperty.call(x, '_transformStreamController')) { 31585 return false; 31586 } 31587 return true; 31588 } 31589 var TransformStreamSink = function () { 31590 function TransformStreamSink(transformStream, startPromise) { 31591 _classCallCheck(this, TransformStreamSink); 31592 this._transformStream = transformStream; 31593 this._startPromise = startPromise; 31594 } 31595 _createClass(TransformStreamSink, [{ 31596 key: 'start', 31597 value: function start(c) { 31598 var transformStream = this._transformStream; 31599 transformStream._writableController = c; 31600 return this._startPromise.then(function () { 31601 return TransformStreamReadableReadyPromise(transformStream); 31602 }); 31603 } 31604 }, { 31605 key: 'write', 31606 value: function write(chunk) { 31607 var transformStream = this._transformStream; 31608 return TransformStreamTransform(transformStream, chunk); 31609 } 31610 }, { 31611 key: 'abort', 31612 value: function abort() { 31613 var transformStream = this._transformStream; 31614 transformStream._writableDone = true; 31615 TransformStreamErrorInternal(transformStream, new TypeError('Writable side aborted')); 31616 } 31617 }, { 31618 key: 'close', 31619 value: function close() { 31620 var transformStream = this._transformStream; 31621 assert(transformStream._transforming === false); 31622 transformStream._writableDone = true; 31623 var flushPromise = PromiseInvokeOrNoop(transformStream._transformer, 'flush', [transformStream._transformStreamController]); 31624 return flushPromise.then(function () { 31625 if (transformStream._errored === true) { 31626 return Promise.reject(transformStream._storedError); 31627 } 31628 if (transformStream._readableClosed === false) { 31629 TransformStreamCloseReadableInternal(transformStream); 31630 } 31631 return Promise.resolve(); 31632 }).catch(function (r) { 31633 TransformStreamErrorIfNeeded(transformStream, r); 31634 return Promise.reject(transformStream._storedError); 31635 }); 31636 } 31637 }]); 31638 return TransformStreamSink; 31639 }(); 31640 var TransformStreamSource = function () { 31641 function TransformStreamSource(transformStream, startPromise) { 31642 _classCallCheck(this, TransformStreamSource); 31643 this._transformStream = transformStream; 31644 this._startPromise = startPromise; 31645 } 31646 _createClass(TransformStreamSource, [{ 31647 key: 'start', 31648 value: function start(c) { 31649 var transformStream = this._transformStream; 31650 transformStream._readableController = c; 31651 return this._startPromise.then(function () { 31652 assert(transformStream._backpressureChangePromise !== undefined, '_backpressureChangePromise should have been initialized'); 31653 if (transformStream._backpressure === true) { 31654 return Promise.resolve(); 31655 } 31656 assert(transformStream._backpressure === false, '_backpressure should have been initialized'); 31657 return transformStream._backpressureChangePromise; 31658 }); 31659 } 31660 }, { 31661 key: 'pull', 31662 value: function pull() { 31663 var transformStream = this._transformStream; 31664 assert(transformStream._backpressure === true, 'pull() should be never called while _backpressure is false'); 31665 assert(transformStream._backpressureChangePromise !== undefined, '_backpressureChangePromise should have been initialized'); 31666 TransformStreamSetBackpressure(transformStream, false); 31667 return transformStream._backpressureChangePromise; 31668 } 31669 }, { 31670 key: 'cancel', 31671 value: function cancel() { 31672 var transformStream = this._transformStream; 31673 transformStream._readableClosed = true; 31674 TransformStreamErrorInternal(transformStream, new TypeError('Readable side canceled')); 31675 } 31676 }]); 31677 return TransformStreamSource; 31678 }(); 31679 var TransformStreamDefaultController = function () { 31680 function TransformStreamDefaultController(transformStream) { 31681 _classCallCheck(this, TransformStreamDefaultController); 31682 if (IsTransformStream(transformStream) === false) { 31683 throw new TypeError('TransformStreamDefaultController can only be ' + 'constructed with a TransformStream instance'); 31684 } 31685 if (transformStream._transformStreamController !== undefined) { 31686 throw new TypeError('TransformStreamDefaultController instances can ' + 'only be created by the TransformStream constructor'); 31687 } 31688 this._controlledTransformStream = transformStream; 31689 } 31690 _createClass(TransformStreamDefaultController, [{ 31691 key: 'enqueue', 31692 value: function enqueue(chunk) { 31693 if (IsTransformStreamDefaultController(this) === false) { 31694 throw defaultControllerBrandCheckException('enqueue'); 31695 } 31696 TransformStreamEnqueueToReadable(this._controlledTransformStream, chunk); 31697 } 31698 }, {
31699 key: 'close', 31700 value: function close() { 31701 if (IsTransformStreamDefaultController(this) === false) { 31702 throw defaultControllerBrandCheckException('close'); 31703 } 31704 TransformStreamCloseReadable(this._controlledTransformStream); 31705 } 31706 }, { 31707 key: 'error', 31708 value: function error(reason) { 31709 if (IsTransformStreamDefaultController(this) === false) { 31710 throw defaultControllerBrandCheckException('error'); 31711 } 31712 TransformStreamError(this._controlledTransformStream, reason); 31713 } 31714 }, { 31715 key: 'desiredSize', 31716 get: function get() { 31717 if (IsTransformStreamDefaultController(this) === false) { 31718 throw defaultControllerBrandCheckException('desiredSize'); 31719 } 31720 var transformStream = this._controlledTransformStream; 31721 var readableController = transformStream._readableController; 31722 return ReadableStreamDefaultControllerGetDesiredSize(readableController); 31723 } 31724 }]); 31725 return TransformStreamDefaultController; 31726 }(); 31727 var TransformStream = function () { 31728 function TransformStream() { 31729 var transformer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 31730 _classCallCheck(this, TransformStream); 31731 this._transformer = transformer; 31732 var readableStrategy = transformer.readableStrategy, 31733 writableStrategy = transformer.writableStrategy; 31734 this._transforming = false; 31735 this._errored = false; 31736 this._storedError = undefined; 31737 this._writableController = undefined; 31738 this._readableController = undefined; 31739 this._transformStreamController = undefined; 31740 this._writableDone = false; 31741 this._readableClosed = false; 31742 this._backpressure = undefined; 31743 this._backpressureChangePromise = undefined; 31744 this._backpressureChangePromise_resolve = undefined; 31745 this._transformStreamController = new TransformStreamDefaultController(this); 31746 var startPromise_resolve = void 0; 31747 var startPromise = new Promise(function (resolve) { 31748 startPromise_resolve = resolve; 31749 }); 31750 var source = new TransformStreamSource(this, startPromise); 31751 this._readable = new ReadableStream(source, readableStrategy); 31752 var sink = new TransformStreamSink(this, startPromise); 31753 this._writable = new WritableStream(sink, writableStrategy); 31754 assert(this._writableController !== undefined); 31755 assert(this._readableController !== undefined); 31756 var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(this._readableController); 31757 TransformStreamSetBackpressure(this, desiredSize <= 0); 31758 var transformStream = this; 31759 var startResult = InvokeOrNoop(transformer, 'start', [transformStream._transformStreamController]); 31760 startPromise_resolve(startResult); 31761 startPromise.catch(function (e) { 31762 if (transformStream._errored === false) { 31763 transformStream._errored = true; 31764 transformStream._storedError = e; 31765 } 31766 }); 31767 } 31768 _createClass(TransformStream, [{ 31769 key: 'readable', 31770 get: function get() { 31771 if (IsTransformStream(this) === false) { 31772 throw streamBrandCheckException('readable'); 31773 } 31774 return this._readable; 31775 } 31776 }, { 31777 key: 'writable', 31778 get: function get() { 31779 if (IsTransformStream(this) === false) { 31780 throw streamBrandCheckException('writable'); 31781 } 31782 return this._writable; 31783 } 31784 }]); 31785 return TransformStream; 31786 }(); 31787 module.exports = { TransformStream: TransformStream }; 31788 function defaultControllerBrandCheckException(name) { 31789 return new TypeError('TransformStreamDefaultController.prototype.' + name + ' can only be used on a TransformStreamDefaultController'); 31790 } 31791 function streamBrandCheckException(name) { 31792 return new TypeError('TransformStream.prototype.' + name + ' can only be used on a TransformStream'); 31793 } 31794}, function (module, exports, __w_pdfjs_require__) { 31795 module.exports = __w_pdfjs_require__(5); 31796}])); 31797 31798/***/ }), 31799/* 109 */ 31800/***/ (function(module, exports, __w_pdfjs_require__) { 31801 31802"use strict"; 31803 31804 31805Object.defineProperty(exports, "__esModule", { 31806 value: true 31807}); 31808exports.NetworkPdfManager = exports.LocalPdfManager = undefined; 31809 31810var _util = __w_pdfjs_require__(0); 31811 31812var _chunked_stream = __w_pdfjs_require__(62); 31813 31814var _document = __w_pdfjs_require__(110); 31815 31816var _stream = __w_pdfjs_require__(5); 31817 31818var BasePdfManager = function BasePdfManagerClosure() { 31819 function BasePdfManager() { 31820 throw new Error('Cannot initialize BaseManagerManager'); 31821 } 31822 BasePdfManager.prototype = { 31823 get docId() { 31824 return this._docId; 31825 }, 31826 get password() { 31827 return this._password; 31828 }, 31829 get docBaseUrl() { 31830 var docBaseUrl = null; 31831 if (this._docBaseUrl) { 31832 var absoluteUrl = (0, _util.createValidAbsoluteUrl)(this._docBaseUrl); 31833 if (absoluteUrl) { 31834 docBaseUrl = absoluteUrl.href; 31835 } else { 31836 (0, _util.warn)('Invalid absolute docBaseUrl: "' + this._docBaseUrl + '".'); 31837 } 31838 } 31839 return (0, _util.shadow)(this, 'docBaseUrl', docBaseUrl); 31840 }, 31841 onLoadedStream: function BasePdfManager_onLoadedStream() { 31842 throw new _util.NotImplementedException(); 31843 }, 31844 ensureDoc: function BasePdfManager_ensureDoc(prop, args) { 31845 return this.ensure(this.pdfDocument, prop, args); 31846 }, 31847 ensureXRef: function BasePdfManager_ensureXRef(prop, args) { 31848 return this.ensure(this.pdfDocument.xref, prop, args); 31849 }, 31850 ensureCatalog: function BasePdfManager_ensureCatalog(prop, args) { 31851 return this.ensure(this.pdfDocument.catalog, prop, args); 31852 }, 31853 getPage: function BasePdfManager_getPage(pageIndex) { 31854 return this.pdfDocument.getPage(pageIndex); 31855 }, 31856 cleanup: function BasePdfManager_cleanup() { 31857 return this.pdfDocument.cleanup(); 31858 }, 31859 ensure: function BasePdfManager_ensure(obj, prop, args) { 31860 return new _util.NotImplementedException(); 31861 }, 31862 requestRange: function BasePdfManager_requestRange(begin, end) { 31863 return new _util.NotImplementedException(); 31864 }, 31865 requestLoadedStream: function BasePdfManager_requestLoadedStream() { 31866 return new _util.NotImplementedException(); 31867 }, 31868 sendProgressiveData: function BasePdfManager_sendProgressiveData(chunk) { 31869 return new _util.NotImplementedException(); 31870 }, 31871 updatePassword: function BasePdfManager_updatePassword(password) { 31872 this._password = password; 31873 }, 31874 terminate: function BasePdfManager_terminate() { 31875 return new _util.NotImplementedException(); 31876 } 31877 }; 31878 return BasePdfManager; 31879}(); 31880var LocalPdfManager = function LocalPdfManagerClosure() { 31881 function LocalPdfManager(docId, data, password, evaluatorOptions, docBaseUrl) { 31882 this._docId = docId; 31883 this._password = password; 31884 this._docBaseUrl = docBaseUrl; 31885 this.evaluatorOptions = evaluatorOptions; 31886 var stream = new _stream.Stream(data); 31887 this.pdfDocument = new _document.PDFDocument(this, stream); 31888 this._loadedStreamCapability = (0, _util.createPromiseCapability)(); 31889 this._loadedStreamCapability.resolve(stream); 31890 } 31891 _util.Util.inherit(LocalPdfManager, BasePdfManager, { 31892 ensure: function LocalPdfManager_ensure(obj, prop, args) { 31893 return new Promise(function (resolve, reject) { 31894 try { 31895 var value = obj[prop]; 31896 var result; 31897 if (typeof value === 'function') {
31898 result = value.apply(obj, args); 31899 } else { 31900 result = value; 31901 } 31902 resolve(result); 31903 } catch (e) { 31904 reject(e); 31905 } 31906 }); 31907 }, 31908 requestRange: function LocalPdfManager_requestRange(begin, end) { 31909 return Promise.resolve(); 31910 }, 31911 requestLoadedStream: function LocalPdfManager_requestLoadedStream() {}, 31912 onLoadedStream: function LocalPdfManager_onLoadedStream() { 31913 return this._loadedStreamCapability.promise; 31914 }, 31915 terminate: function LocalPdfManager_terminate() {} 31916 }); 31917 return LocalPdfManager; 31918}(); 31919var NetworkPdfManager = function NetworkPdfManagerClosure() { 31920 function NetworkPdfManager(docId, pdfNetworkStream, args, evaluatorOptions, docBaseUrl) { 31921 this._docId = docId; 31922 this._password = args.password; 31923 this._docBaseUrl = docBaseUrl; 31924 this.msgHandler = args.msgHandler; 31925 this.evaluatorOptions = evaluatorOptions; 31926 var params = { 31927 msgHandler: args.msgHandler, 31928 url: args.url, 31929 length: args.length, 31930 disableAutoFetch: args.disableAutoFetch, 31931 rangeChunkSize: args.rangeChunkSize 31932 }; 31933 this.streamManager = new _chunked_stream.ChunkedStreamManager(pdfNetworkStream, params); 31934 this.pdfDocument = new _document.PDFDocument(this, this.streamManager.getStream()); 31935 } 31936 _util.Util.inherit(NetworkPdfManager, BasePdfManager, { 31937 ensure: function NetworkPdfManager_ensure(obj, prop, args) { 31938 var pdfManager = this; 31939 return new Promise(function (resolve, reject) { 31940 function ensureHelper() { 31941 try { 31942 var result; 31943 var value = obj[prop]; 31944 if (typeof value === 'function') { 31945 result = value.apply(obj, args); 31946 } else { 31947 result = value; 31948 } 31949 resolve(result); 31950 } catch (e) { 31951 if (!(e instanceof _util.MissingDataException)) { 31952 reject(e); 31953 return; 31954 } 31955 pdfManager.streamManager.requestRange(e.begin, e.end).then(ensureHelper, reject); 31956 } 31957 } 31958 ensureHelper(); 31959 }); 31960 }, 31961 requestRange: function NetworkPdfManager_requestRange(begin, end) { 31962 return this.streamManager.requestRange(begin, end); 31963 }, 31964 requestLoadedStream: function NetworkPdfManager_requestLoadedStream() { 31965 this.streamManager.requestAllChunks(); 31966 }, 31967 sendProgressiveData: function NetworkPdfManager_sendProgressiveData(chunk) { 31968 this.streamManager.onReceiveData({ chunk: chunk }); 31969 }, 31970 onLoadedStream: function NetworkPdfManager_onLoadedStream() { 31971 return this.streamManager.onLoadedStream(); 31972 }, 31973 terminate: function NetworkPdfManager_terminate() { 31974 this.streamManager.abort(); 31975 } 31976 }); 31977 return NetworkPdfManager; 31978}(); 31979exports.LocalPdfManager = LocalPdfManager; 31980exports.NetworkPdfManager = NetworkPdfManager; 31981 31982/***/ }), 31983/* 110 */ 31984/***/ (function(module, exports, __w_pdfjs_require__) { 31985 31986"use strict"; 31987 31988 31989Object.defineProperty(exports, "__esModule", { 31990 value: true 31991}); 31992exports.PDFDocument = exports.Page = undefined; 31993 31994var _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"); } }; }(); 31995 31996var _obj = __w_pdfjs_require__(63); 31997 31998var _primitives = __w_pdfjs_require__(2); 31999 32000var _util = __w_pdfjs_require__(0); 32001 32002var _stream = __w_pdfjs_require__(5); 32003 32004var _evaluator = __w_pdfjs_require__(67); 32005 32006var _annotation = __w_pdfjs_require__(124); 32007 32008var _crypto = __w_pdfjs_require__(66); 32009 32010var _parser = __w_pdfjs_require__(29); 32011 32012var _function = __w_pdfjs_require__(71); 32013 32014var Page = function PageClosure() { 32015 var DEFAULT_USER_UNIT = 1.0; 32016 var LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; 32017 function isAnnotationRenderable(annotation, intent) { 32018 return intent === 'display' && annotation.viewable || intent === 'print' && annotation.printable; 32019 } 32020 function Page(_ref) { 32021 var pdfManager = _ref.pdfManager, 32022 xref = _ref.xref, 32023 pageIndex = _ref.pageIndex, 32024 pageDict = _ref.pageDict, 32025 ref = _ref.ref, 32026 fontCache = _ref.fontCache, 32027 builtInCMapCache = _ref.builtInCMapCache, 32028 pdfFunctionFactory = _ref.pdfFunctionFactory; 32029 32030 this.pdfManager = pdfManager; 32031 this.pageIndex = pageIndex; 32032 this.pageDict = pageDict; 32033 this.xref = xref; 32034 this.ref = ref; 32035 this.fontCache = fontCache; 32036 this.builtInCMapCache = builtInCMapCache; 32037 this.pdfFunctionFactory = pdfFunctionFactory; 32038 this.evaluatorOptions = pdfManager.evaluatorOptions; 32039 this.resourcesPromise = null; 32040 var uniquePrefix = 'p' + this.pageIndex + '_'; 32041 var idCounters = { obj: 0 }; 32042 this.idFactory = { 32043 createObjId: function createObjId() { 32044 return uniquePrefix + ++idCounters.obj; 32045 } 32046 }; 32047 } 32048 Page.prototype = { 32049 getPageProp: function Page_getPageProp(key) { 32050 return this.pageDict.get(key); 32051 }, 32052 getInheritedPageProp: function Page_getInheritedPageProp(key, getArray) { 32053 var dict = this.pageDict, 32054 valueArray = null, 32055 loopCount = 0; 32056 var MAX_LOOP_COUNT = 100; 32057 getArray = getArray || false; 32058 while (dict) { 32059 var value = getArray ? dict.getArray(key) : dict.get(key); 32060 if (value !== undefined) { 32061 if (!valueArray) { 32062 valueArray = []; 32063 } 32064 valueArray.push(value); 32065 } 32066 if (++loopCount > MAX_LOOP_COUNT) { 32067 (0, _util.warn)('getInheritedPageProp: maximum loop count exceeded for ' + key); 32068 return valueArray ? valueArray[0] : undefined; 32069 } 32070 dict = dict.get('Parent'); 32071 } 32072 if (!valueArray) { 32073 return undefined; 32074 } 32075 if (valueArray.length === 1 || !(0, _primitives.isDict)(valueArray[0])) { 32076 return valueArray[0]; 32077 } 32078 return _primitives.Dict.merge(this.xref, valueArray); 32079 }, 32080 get content() { 32081 return this.getPageProp('Contents'); 32082 }, 32083 get resources() { 32084 return (0, _util.shadow)(this, 'resources', this.getInheritedPageProp('Resources') || _primitives.Dict.empty); 32085 }, 32086 get mediaBox() { 32087 var mediaBox = this.getInheritedPageProp('MediaBox', true); 32088 if (!Array.isArray(mediaBox) || mediaBox.length !== 4) { 32089 return (0, _util.shadow)(this, 'mediaBox', LETTER_SIZE_MEDIABOX); 32090 } 32091 return (0, _util.shadow)(this, 'mediaBox', mediaBox); 32092 }, 32093 get cropBox() { 32094 var cropBox = this.getInheritedPageProp('CropBox', true); 32095 if (!Array.isArray(cropBox) || cropBox.length !== 4) { 32096 return (0, _util.shadow)(this, 'cropBox', this.mediaBox); 32097 } 32098 return (0, _util.shadow)(this, 'cropBox', cropBox); 32099 }, 32100 get userUnit() { 32101 var obj = this.getPageProp('UserUnit'); 32102 if (!(0, _util.isNum)(obj) || obj <= 0) { 32103 obj = DEFAULT_USER_UNIT; 32104 } 32105 return (0, _util.shadow)(this, 'userUnit', obj); 32106 }, 32107 get view() { 32108 var mediaBox = this.mediaBox, 32109 cropBox = this.cropBox; 32110 if (mediaBox === cropBox) { 32111 return (0, _util.shadow)(this, 'view', mediaBox); 32112 } 32113 var intersection = _util.Util.intersect(cropBox, mediaBox); 32114 return (0, _util.shadow)(this, 'view', intersection || mediaBox); 32115 }, 32116 get rotate() { 32117 var rotate = this.getInheritedPageProp('Rotate') || 0; 32118 if (rotate % 90 !== 0) { 32119 rotate = 0; 32120 } else if (rotate >= 360) { 32121 rotate = rotate % 360; 32122 } else if (rotate < 0) { 32123 rotate = (rotate % 360 + 360) % 360; 32124 } 32125 return (0, _util.shadow)(this, 'rotate', rotate); 32126 }, 32127 getContentStream: function Page_getContentStream() { 32128 var content = this.content; 32129 var stream; 32130 if (Array.isArray(content)) { 32131 var xref = this.xref; 32132 var i, 32133 n = content.length; 32134 var streams = []; 32135 for (i = 0; i < n; ++i) { 32136 streams.push(xref.fetchIfRef(content[i])); 32137 } 32138 stream = new _stream.StreamsSequenceStream(streams); 32139 } else if ((0, _primitives.isStream)(content)) { 32140 stream = content; 32141 } else { 32142 stream = new _stream.NullStream(); 32143 } 32144 return stream; 32145 }, 32146 loadResources: function Page_loadResources(keys) { 32147 var _this = this; 32148 32149 if (!this.resourcesPromise) { 32150 this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); 32151 } 32152 return this.resourcesPromise.then(function () { 32153 var objectLoader = new _obj.ObjectLoader(_this.resources, keys, _this.xref); 32154 return objectLoader.load(); 32155 }); 32156 }, 32157 getOperatorList: function getOperatorList(_ref2) { 32158 var _this2 = this; 32159 32160 var handler = _ref2.handler, 32161 task = _ref2.task, 32162 intent = _ref2.intent, 32163 renderInteractiveForms = _ref2.renderInteractiveForms; 32164 32165 var contentStreamPromise = this.pdfManager.ensure(this, 'getContentStream'); 32166 var resourcesPromise = this.loadResources(['ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font']); 32167 var partialEvaluator = new _evaluator.PartialEvaluator({ 32168 pdfManager: this.pdfManager, 32169 xref: this.xref, 32170 handler: handler, 32171 pageIndex: this.pageIndex, 32172 idFactory: this.idFactory, 32173 fontCache: this.fontCache, 32174 builtInCMapCache: this.builtInCMapCache, 32175 options: this.evaluatorOptions, 32176 pdfFunctionFactory: this.pdfFunctionFactory 32177 }); 32178 var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); 32179 var pageListPromise = dataPromises.then(function (_ref3) { 32180 var _ref4 = _slicedToArray(_ref3, 1), 32181 contentStream = _ref4[0]; 32182 32183 var opList = new _evaluator.OperatorList(intent, handler, _this2.pageIndex); 32184 handler.send('StartRenderPage', { 32185 transparency: partialEvaluator.hasBlendModes(_this2.resources), 32186 pageIndex: _this2.pageIndex, 32187 intent: intent 32188 }); 32189 return partialEvaluator.getOperatorList({ 32190 stream: contentStream, 32191 task: task, 32192 resources: _this2.resources, 32193 operatorList: opList 32194 }).then(function () { 32195 return opList; 32196 }); 32197 });
vendor: 4,795 bytes, lines 32198-32328
32198 var annotationsPromise = this.pdfManager.ensure(this, 'annotations'); 32199 return Promise.all([pageListPromise, annotationsPromise]).then(function (_ref5) { 32200 var _ref6 = _slicedToArray(_ref5, 2), 32201 pageOpList = _ref6[0], 32202 annotations = _ref6[1]; 32203 32204 if (annotations.length === 0) { 32205 pageOpList.flush(true); 32206 return pageOpList; 32207 } 32208 var i, 32209 ii, 32210 opListPromises = []; 32211 for (i = 0, ii = annotations.length; i < ii; i++) { 32212 if (isAnnotationRenderable(annotations[i], intent)) { 32213 opListPromises.push(annotations[i].getOperatorList(partialEvaluator, task, renderInteractiveForms)); 32214 } 32215 } 32216 return Promise.all(opListPromises).then(function (opLists) { 32217 pageOpList.addOp(_util.OPS.beginAnnotations, []); 32218 for (i = 0, ii = opLists.length; i < ii; i++) { 32219 pageOpList.addOpList(opLists[i]); 32220 } 32221 pageOpList.addOp(_util.OPS.endAnnotations, []); 32222 pageOpList.flush(true); 32223 return pageOpList; 32224 }); 32225 }); 32226 }, 32227 extractTextContent: function extractTextContent(_ref7) { 32228 var _this3 = this; 32229 32230 var handler = _ref7.handler, 32231 task = _ref7.task, 32232 normalizeWhitespace = _ref7.normalizeWhitespace, 32233 sink = _ref7.sink, 32234 combineTextItems = _ref7.combineTextItems; 32235 32236 var contentStreamPromise = this.pdfManager.ensure(this, 'getContentStream'); 32237 var resourcesPromise = this.loadResources(['ExtGState', 'XObject', 'Font']); 32238 var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); 32239 return dataPromises.then(function (_ref8) { 32240 var _ref9 = _slicedToArray(_ref8, 1), 32241 contentStream = _ref9[0]; 32242 32243 var partialEvaluator = new _evaluator.PartialEvaluator({ 32244 pdfManager: _this3.pdfManager, 32245 xref: _this3.xref, 32246 handler: handler, 32247 pageIndex: _this3.pageIndex, 32248 idFactory: _this3.idFactory, 32249 fontCache: _this3.fontCache, 32250 builtInCMapCache: _this3.builtInCMapCache, 32251 options: _this3.evaluatorOptions, 32252 pdfFunctionFactory: _this3.pdfFunctionFactory 32253 }); 32254 return partialEvaluator.getTextContent({ 32255 stream: contentStream, 32256 task: task, 32257 resources: _this3.resources, 32258 normalizeWhitespace: normalizeWhitespace, 32259 combineTextItems: combineTextItems, 32260 sink: sink 32261 }); 32262 }); 32263 }, 32264 32265 getAnnotationsData: function Page_getAnnotationsData(intent) { 32266 var annotations = this.annotations; 32267 var annotationsData = []; 32268 for (var i = 0, n = annotations.length; i < n; ++i) { 32269 if (!intent || isAnnotationRenderable(annotations[i], intent)) { 32270 annotationsData.push(annotations[i].data); 32271 } 32272 } 32273 return annotationsData; 32274 }, 32275 get annotations() { 32276 var annotations = []; 32277 var annotationRefs = this.getInheritedPageProp('Annots') || []; 32278 for (var i = 0, n = annotationRefs.length; i < n; ++i) { 32279 var annotationRef = annotationRefs[i]; 32280 var annotation = _annotation.AnnotationFactory.create(this.xref, annotationRef, this.pdfManager, this.idFactory); 32281 if (annotation) { 32282 annotations.push(annotation); 32283 } 32284 } 32285 return (0, _util.shadow)(this, 'annotations', annotations); 32286 } 32287 }; 32288 return Page; 32289}(); 32290var PDFDocument = function PDFDocumentClosure() { 32291 var FINGERPRINT_FIRST_BYTES = 1024; 32292 var EMPTY_FINGERPRINT = '\x00\x00\x00\x00\x00\x00\x00' + '\x00\x00\x00\x00\x00\x00\x00\x00\x00'; 32293 function PDFDocument(pdfManager, arg) { 32294 var stream; 32295 if ((0, _primitives.isStream)(arg)) { 32296 stream = arg; 32297 } else if ((0, _util.isArrayBuffer)(arg)) { 32298 stream = new _stream.Stream(arg); 32299 } else { 32300 throw new Error('PDFDocument: Unknown argument type'); 32301 } 32302 if (stream.length <= 0) { 32303 throw new Error('PDFDocument: stream must have data'); 32304 } 32305 this.pdfManager = pdfManager; 32306 this.stream = stream; 32307 this.xref = new _obj.XRef(stream, pdfManager); 32308 var evaluatorOptions = pdfManager.evaluatorOptions; 32309 this.pdfFunctionFactory = new _function.PDFFunctionFactory({ 32310 xref: this.xref, 32311 isEvalSupported: evaluatorOptions.isEvalSupported 32312 }); 32313 } 32314 function find(stream, needle, limit, backwards) { 32315 var pos = stream.pos; 32316 var end = stream.end; 32317 var strBuf = []; 32318 if (pos + limit > end) { 32319 limit = end - pos; 32320 } 32321 for (var n = 0; n < limit; ++n) { 32322 strBuf.push(String.fromCharCode(stream.getByte())); 32323 } 32324 var str = strBuf.join(''); 32325 stream.pos = pos; 32326 var index = backwards ? str.lastIndexOf(needle) : str.indexOf(needle); 32327 if (index === -1) { 32328 return false;
32329 } 32330 stream.pos += index; 32331 return true; 32332 } 32333 var DocumentInfoValidators = { 32334 get entries() { 32335 return (0, _util.shadow)(this, 'entries', { 32336 Title: _util.isString, 32337 Author: _util.isString, 32338 Subject: _util.isString, 32339 Keywords: _util.isString, 32340 Creator: _util.isString, 32341 Producer: _util.isString, 32342 CreationDate: _util.isString, 32343 ModDate: _util.isString, 32344 Trapped: _primitives.isName 32345 }); 32346 } 32347 }; 32348 PDFDocument.prototype = { 32349 parse: function PDFDocument_parse(recoveryMode) { 32350 this.setup(recoveryMode); 32351 var version = this.catalog.catDict.get('Version'); 32352 if ((0, _primitives.isName)(version)) { 32353 this.pdfFormatVersion = version.name; 32354 } 32355 try { 32356 this.acroForm = this.catalog.catDict.get('AcroForm'); 32357 if (this.acroForm) { 32358 this.xfa = this.acroForm.get('XFA'); 32359 var fields = this.acroForm.get('Fields'); 32360 if ((!fields || !Array.isArray(fields) || fields.length === 0) && !this.xfa) { 32361 this.acroForm = null; 32362 } 32363 } 32364 } catch (ex) { 32365 if (ex instanceof _util.MissingDataException) { 32366 throw ex; 32367 } 32368 (0, _util.info)('Something wrong with AcroForm entry'); 32369 this.acroForm = null; 32370 } 32371 }, 32372 get linearization() { 32373 var linearization = null; 32374 if (this.stream.length) { 32375 try { 32376 linearization = _parser.Linearization.create(this.stream); 32377 } catch (err) { 32378 if (err instanceof _util.MissingDataException) { 32379 throw err; 32380 } 32381 (0, _util.info)(err); 32382 } 32383 } 32384 return (0, _util.shadow)(this, 'linearization', linearization); 32385 }, 32386 get startXRef() { 32387 var stream = this.stream; 32388 var startXRef = 0; 32389 var linearization = this.linearization; 32390 if (linearization) { 32391 stream.reset(); 32392 if (find(stream, 'endobj', 1024)) { 32393 startXRef = stream.pos + 6; 32394 } 32395 } else { 32396 var step = 1024; 32397 var found = false, 32398 pos = stream.end; 32399 while (!found && pos > 0) { 32400 pos -= step - 'startxref'.length; 32401 if (pos < 0) { 32402 pos = 0; 32403 } 32404 stream.pos = pos; 32405 found = find(stream, 'startxref', step, true); 32406 } 32407 if (found) { 32408 stream.skip(9); 32409 var ch; 32410 do { 32411 ch = stream.getByte(); 32412 } while ((0, _util.isSpace)(ch)); 32413 var str = ''; 32414 while (ch >= 0x20 && ch <= 0x39) { 32415 str += String.fromCharCode(ch); 32416 ch = stream.getByte(); 32417 } 32418 startXRef = parseInt(str, 10); 32419 if (isNaN(startXRef)) { 32420 startXRef = 0; 32421 } 32422 } 32423 } 32424 return (0, _util.shadow)(this, 'startXRef', startXRef); 32425 }, 32426 get mainXRefEntriesOffset() { 32427 var mainXRefEntriesOffset = 0; 32428 var linearization = this.linearization; 32429 if (linearization) { 32430 mainXRefEntriesOffset = linearization.mainXRefEntriesOffset; 32431 } 32432 return (0, _util.shadow)(this, 'mainXRefEntriesOffset', mainXRefEntriesOffset); 32433 }, 32434 checkHeader: function PDFDocument_checkHeader() { 32435 var stream = this.stream; 32436 stream.reset(); 32437 if (find(stream, '%PDF-', 1024)) { 32438 stream.moveStart(); 32439 var MAX_VERSION_LENGTH = 12; 32440 var version = '', 32441 ch; 32442 while ((ch = stream.getByte()) > 0x20) { 32443 if (version.length >= MAX_VERSION_LENGTH) { 32444 break; 32445 } 32446 version += String.fromCharCode(ch); 32447 } 32448 if (!this.pdfFormatVersion) { 32449 this.pdfFormatVersion = version.substring(5); 32450 } 32451 return; 32452 } 32453 }, 32454 parseStartXRef: function PDFDocument_parseStartXRef() { 32455 var startXRef = this.startXRef; 32456 this.xref.setStartXRef(startXRef); 32457 }, 32458 setup: function PDFDocument_setup(recoveryMode) { 32459 var _this4 = this; 32460 32461 this.xref.parse(recoveryMode); 32462 var pageFactory = { 32463 createPage: function createPage(pageIndex, dict, ref, fontCache, builtInCMapCache) { 32464 return new Page({ 32465 pdfManager: _this4.pdfManager, 32466 xref: _this4.xref, 32467 pageIndex: pageIndex, 32468 pageDict: dict, 32469 ref: ref, 32470 fontCache: fontCache, 32471 builtInCMapCache: builtInCMapCache, 32472 pdfFunctionFactory: _this4.pdfFunctionFactory 32473 }); 32474 } 32475 }; 32476 this.catalog = new _obj.Catalog(this.pdfManager, this.xref, pageFactory); 32477 }, 32478 get numPages() { 32479 var linearization = this.linearization; 32480 var num = linearization ? linearization.numPages : this.catalog.numPages; 32481 return (0, _util.shadow)(this, 'numPages', num); 32482 }, 32483 get documentInfo() { 32484 var docInfo = { 32485 PDFFormatVersion: this.pdfFormatVersion, 32486 IsAcroFormPresent: !!this.acroForm, 32487 IsXFAPresent: !!this.xfa 32488 }; 32489 var infoDict;
32490 try { 32491 infoDict = this.xref.trailer.get('Info'); 32492 } catch (err) { 32493 if (err instanceof _util.MissingDataException) { 32494 throw err; 32495 } 32496 (0, _util.info)('The document information dictionary is invalid.'); 32497 } 32498 if (infoDict) { 32499 var validEntries = DocumentInfoValidators.entries; 32500 for (var key in validEntries) { 32501 if (infoDict.has(key)) { 32502 var value = infoDict.get(key); 32503 if (validEntries[key](value)) { 32504 docInfo[key] = typeof value !== 'string' ? value : (0, _util.stringToPDFString)(value); 32505 } else { 32506 (0, _util.info)('Bad value in document info for "' + key + '"'); 32507 } 32508 } 32509 } 32510 } 32511 return (0, _util.shadow)(this, 'documentInfo', docInfo); 32512 }, 32513 get fingerprint() { 32514 var xref = this.xref, 32515 hash, 32516 fileID = ''; 32517 var idArray = xref.trailer.get('ID'); 32518 if (Array.isArray(idArray) && idArray[0] && (0, _util.isString)(idArray[0]) && idArray[0] !== EMPTY_FINGERPRINT) { 32519 hash = (0, _util.stringToBytes)(idArray[0]); 32520 } else { 32521 if (this.stream.ensureRange) { 32522 this.stream.ensureRange(0, Math.min(FINGERPRINT_FIRST_BYTES, this.stream.end)); 32523 } 32524 hash = (0, _crypto.calculateMD5)(this.stream.bytes.subarray(0, FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES); 32525 } 32526 for (var i = 0, n = hash.length; i < n; i++) { 32527 var hex = hash[i].toString(16); 32528 fileID += hex.length === 1 ? '0' + hex : hex; 32529 } 32530 return (0, _util.shadow)(this, 'fingerprint', fileID); 32531 }, 32532 getPage: function PDFDocument_getPage(pageIndex) { 32533 return this.catalog.getPage(pageIndex); 32534 }, 32535 cleanup: function PDFDocument_cleanup() { 32536 return this.catalog.cleanup(); 32537 } 32538 }; 32539 return PDFDocument; 32540}(); 32541exports.Page = Page; 32542exports.PDFDocument = PDFDocument; 32543 32544/***/ }), 32545/* 111 */ 32546/***/ (function(module, exports, __w_pdfjs_require__) { 32547 32548"use strict"; 32549 32550 32551Object.defineProperty(exports, "__esModule", { 32552 value: true 32553}); 32554exports.Jbig2Image = undefined; 32555 32556var _util = __w_pdfjs_require__(0); 32557 32558var _arithmetic_decoder = __w_pdfjs_require__(64); 32559 32560var Jbig2Error = function Jbig2ErrorClosure() { 32561 function Jbig2Error(msg) { 32562 this.message = 'JBIG2 error: ' + msg; 32563 } 32564 Jbig2Error.prototype = new Error(); 32565 Jbig2Error.prototype.name = 'Jbig2Error'; 32566 Jbig2Error.constructor = Jbig2Error; 32567 return Jbig2Error; 32568}(); 32569var Jbig2Image = function Jbig2ImageClosure() { 32570 function ContextCache() {} 32571 ContextCache.prototype = { 32572 getContexts: function getContexts(id) { 32573 if (id in this) { 32574 return this[id]; 32575 } 32576 return this[id] = new Int8Array(1 << 16); 32577 } 32578 }; 32579 function DecodingContext(data, start, end) { 32580 this.data = data; 32581 this.start = start; 32582 this.end = end; 32583 } 32584 DecodingContext.prototype = { 32585 get decoder() { 32586 var decoder = new _arithmetic_decoder.ArithmeticDecoder(this.data, this.start, this.end); 32587 return (0, _util.shadow)(this, 'decoder', decoder); 32588 }, 32589 get contextCache() { 32590 var cache = new ContextCache(); 32591 return (0, _util.shadow)(this, 'contextCache', cache); 32592 } 32593 }; 32594 function decodeInteger(contextCache, procedure, decoder) { 32595 var contexts = contextCache.getContexts(procedure); 32596 var prev = 1; 32597 function readBits(length) { 32598 var v = 0; 32599 for (var i = 0; i < length; i++) { 32600 var bit = decoder.readBit(contexts, prev); 32601 prev = prev < 256 ? prev << 1 | bit : (prev << 1 | bit) & 511 | 256; 32602 v = v << 1 | bit; 32603 } 32604 return v >>> 0; 32605 } 32606 var sign = readBits(1); 32607 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); 32608 return sign === 0 ? value : value > 0 ? -value : null; 32609 } 32610 function decodeIAID(contextCache, decoder, codeLength) { 32611 var contexts = contextCache.getContexts('IAID'); 32612 var prev = 1; 32613 for (var i = 0; i < codeLength; i++) { 32614 var bit = decoder.readBit(contexts, prev); 32615 prev = prev << 1 | bit; 32616 } 32617 if (codeLength < 31) { 32618 return prev & (1 << codeLength) - 1; 32619 } 32620 return prev & 0x7FFFFFFF; 32621 } 32622 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']; 32623 var CodingTemplates = [[{ 32624 x: -1, 32625 y: -2 32626 }, { 32627 x: 0, 32628 y: -2 32629 }, { 32630 x: 1, 32631 y: -2 32632 }, { 32633 x: -2, 32634 y: -1 32635 }, { 32636 x: -1, 32637 y: -1 32638 }, { 32639 x: 0, 32640 y: -1 32641 }, { 32642 x: 1, 32643 y: -1 32644 }, { 32645 x: 2, 32646 y: -1 32647 }, { 32648 x: -4, 32649 y: 0 32650 }, { 32651 x: -3, 32652 y: 0 32653 }, { 32654 x: -2, 32655 y: 0 32656 }, { 32657 x: -1, 32658 y: 0 32659 }], [{ 32660 x: -1, 32661 y: -2 32662 }, { 32663 x: 0, 32664 y: -2 32665 }, { 32666 x: 1, 32667 y: -2 32668 }, { 32669 x: 2, 32670 y: -2 32671 }, { 32672 x: -2, 32673 y: -1 32674 }, { 32675 x: -1, 32676 y: -1 32677 }, { 32678 x: 0, 32679 y: -1 32680 }, { 32681 x: 1, 32682 y: -1 32683 }, { 32684 x: 2, 32685 y: -1 32686 }, { 32687 x: -3, 32688 y: 0 32689 }, { 32690 x: -2, 32691 y: 0 32692 }, { 32693 x: -1, 32694 y: 0 32695 }], [{ 32696 x: -1, 32697 y: -2 32698 }, { 32699 x: 0, 32700 y: -2 32701 }, { 32702 x: 1, 32703 y: -2 32704 }, { 32705 x: -2, 32706 y: -1 32707 }, { 32708 x: -1, 32709 y: -1 32710 }, { 32711 x: 0, 32712 y: -1 32713 }, { 32714 x: 1, 32715 y: -1 32716 }, { 32717 x: -2, 32718 y: 0 32719 }, { 32720 x: -1, 32721 y: 0 32722 }], [{ 32723 x: -3, 32724 y: -1 32725 }, { 32726 x: -2, 32727 y: -1 32728 }, { 32729 x: -1, 32730 y: -1 32731 }, { 32732 x: 0, 32733 y: -1 32734 }, { 32735 x: 1, 32736 y: -1 32737 }, { 32738 x: -4, 32739 y: 0 32740 }, { 32741 x: -3, 32742 y: 0 32743 }, { 32744 x: -2, 32745 y: 0 32746 }, { 32747 x: -1, 32748 y: 0 32749 }]]; 32750 var RefinementTemplates = [{ 32751 coding: [{ 32752 x: 0, 32753 y: -1 32754 }, {
vendor: 4,738 bytes, lines 32755-32924
32755 x: 1, 32756 y: -1 32757 }, { 32758 x: -1, 32759 y: 0 32760 }], 32761 reference: [{ 32762 x: 0, 32763 y: -1 32764 }, { 32765 x: 1, 32766 y: -1 32767 }, { 32768 x: -1, 32769 y: 0 32770 }, { 32771 x: 0, 32772 y: 0 32773 }, { 32774 x: 1, 32775 y: 0 32776 }, { 32777 x: -1, 32778 y: 1 32779 }, { 32780 x: 0, 32781 y: 1 32782 }, { 32783 x: 1, 32784 y: 1 32785 }] 32786 }, { 32787 coding: [{ 32788 x: -1, 32789 y: -1 32790 }, { 32791 x: 0, 32792 y: -1 32793 }, { 32794 x: 1, 32795 y: -1 32796 }, { 32797 x: -1, 32798 y: 0 32799 }], 32800 reference: [{ 32801 x: 0, 32802 y: -1 32803 }, { 32804 x: -1, 32805 y: 0 32806 }, { 32807 x: 0, 32808 y: 0 32809 }, { 32810 x: 1, 32811 y: 0 32812 }, { 32813 x: 0, 32814 y: 1 32815 }, { 32816 x: 1, 32817 y: 1 32818 }] 32819 }]; 32820 var ReusedContexts = [0x9B25, 0x0795, 0x00E5, 0x0195]; 32821 var RefinementReusedContexts = [0x0020, 0x0008]; 32822 function decodeBitmapTemplate0(width, height, decodingContext) { 32823 var decoder = decodingContext.decoder; 32824 var contexts = decodingContext.contextCache.getContexts('GB'); 32825 var contextLabel, 32826 i, 32827 j, 32828 pixel, 32829 row, 32830 row1, 32831 row2, 32832 bitmap = []; 32833 var OLD_PIXEL_MASK = 0x7BF7; 32834 for (i = 0; i < height; i++) { 32835 row = bitmap[i] = new Uint8Array(width); 32836 row1 = i < 1 ? row : bitmap[i - 1]; 32837 row2 = i < 2 ? row : bitmap[i - 2]; 32838 contextLabel = row2[0] << 13 | row2[1] << 12 | row2[2] << 11 | row1[0] << 7 | row1[1] << 6 | row1[2] << 5 | row1[3] << 4; 32839 for (j = 0; j < width; j++) { 32840 row[j] = pixel = decoder.readBit(contexts, contextLabel); 32841 contextLabel = (contextLabel & OLD_PIXEL_MASK) << 1 | (j + 3 < width ? row2[j + 3] << 11 : 0) | (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel; 32842 } 32843 } 32844 return bitmap; 32845 } 32846 function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at, decodingContext) { 32847 if (mmr) { 32848 throw new Jbig2Error('MMR encoding is not supported'); 32849 } 32850 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) { 32851 return decodeBitmapTemplate0(width, height, decodingContext); 32852 } 32853 var useskip = !!skip; 32854 var template = CodingTemplates[templateIndex].concat(at); 32855 template.sort(function (a, b) { 32856 return a.y - b.y || a.x - b.x; 32857 }); 32858 var templateLength = template.length; 32859 var templateX = new Int8Array(templateLength); 32860 var templateY = new Int8Array(templateLength); 32861 var changingTemplateEntries = []; 32862 var reuseMask = 0, 32863 minX = 0, 32864 maxX = 0, 32865 minY = 0; 32866 var c, k; 32867 for (k = 0; k < templateLength; k++) { 32868 templateX[k] = template[k].x; 32869 templateY[k] = template[k].y; 32870 minX = Math.min(minX, template[k].x); 32871 maxX = Math.max(maxX, template[k].x); 32872 minY = Math.min(minY, template[k].y); 32873 if (k < templateLength - 1 && template[k].y === template[k + 1].y && template[k].x === template[k + 1].x - 1) { 32874 reuseMask |= 1 << templateLength - 1 - k; 32875 } else { 32876 changingTemplateEntries.push(k); 32877 } 32878 } 32879 var changingEntriesLength = changingTemplateEntries.length; 32880 var changingTemplateX = new Int8Array(changingEntriesLength); 32881 var changingTemplateY = new Int8Array(changingEntriesLength); 32882 var changingTemplateBit = new Uint16Array(changingEntriesLength); 32883 for (c = 0; c < changingEntriesLength; c++) { 32884 k = changingTemplateEntries[c]; 32885 changingTemplateX[c] = template[k].x; 32886 changingTemplateY[c] = template[k].y; 32887 changingTemplateBit[c] = 1 << templateLength - 1 - k; 32888 } 32889 var sbb_left = -minX; 32890 var sbb_top = -minY; 32891 var sbb_right = width - maxX; 32892 var pseudoPixelContext = ReusedContexts[templateIndex]; 32893 var row = new Uint8Array(width); 32894 var bitmap = []; 32895 var decoder = decodingContext.decoder; 32896 var contexts = decodingContext.contextCache.getContexts('GB'); 32897 var ltp = 0, 32898 j, 32899 i0, 32900 j0, 32901 contextLabel = 0, 32902 bit, 32903 shift; 32904 for (var i = 0; i < height; i++) { 32905 if (prediction) { 32906 var sltp = decoder.readBit(contexts, pseudoPixelContext); 32907 ltp ^= sltp; 32908 if (ltp) { 32909 bitmap.push(row); 32910 continue; 32911 } 32912 } 32913 row = new Uint8Array(row); 32914 bitmap.push(row); 32915 for (j = 0; j < width; j++) { 32916 if (useskip && skip[i][j]) { 32917 row[j] = 0; 32918 continue; 32919 } 32920 if (j >= sbb_left && j < sbb_right && i >= sbb_top) { 32921 contextLabel = contextLabel << 1 & reuseMask; 32922 for (k = 0; k < changingEntriesLength; k++) { 32923 i0 = i + changingTemplateY[k]; 32924 j0 = j + changingTemplateX[k];
vendor: 5,546 bytes, lines 32925-33060
32925 bit = bitmap[i0][j0]; 32926 if (bit) { 32927 bit = changingTemplateBit[k]; 32928 contextLabel |= bit; 32929 } 32930 } 32931 } else { 32932 contextLabel = 0; 32933 shift = templateLength - 1; 32934 for (k = 0; k < templateLength; k++, shift--) { 32935 j0 = j + templateX[k]; 32936 if (j0 >= 0 && j0 < width) { 32937 i0 = i + templateY[k]; 32938 if (i0 >= 0) { 32939 bit = bitmap[i0][j0]; 32940 if (bit) { 32941 contextLabel |= bit << shift; 32942 } 32943 } 32944 } 32945 } 32946 } 32947 var pixel = decoder.readBit(contexts, contextLabel); 32948 row[j] = pixel; 32949 } 32950 } 32951 return bitmap; 32952 } 32953 function decodeRefinement(width, height, templateIndex, referenceBitmap, offsetX, offsetY, prediction, at, decodingContext) { 32954 var codingTemplate = RefinementTemplates[templateIndex].coding; 32955 if (templateIndex === 0) { 32956 codingTemplate = codingTemplate.concat([at[0]]); 32957 } 32958 var codingTemplateLength = codingTemplate.length; 32959 var codingTemplateX = new Int32Array(codingTemplateLength); 32960 var codingTemplateY = new Int32Array(codingTemplateLength); 32961 var k; 32962 for (k = 0; k < codingTemplateLength; k++) { 32963 codingTemplateX[k] = codingTemplate[k].x; 32964 codingTemplateY[k] = codingTemplate[k].y; 32965 } 32966 var referenceTemplate = RefinementTemplates[templateIndex].reference; 32967 if (templateIndex === 0) { 32968 referenceTemplate = referenceTemplate.concat([at[1]]); 32969 } 32970 var referenceTemplateLength = referenceTemplate.length; 32971 var referenceTemplateX = new Int32Array(referenceTemplateLength); 32972 var referenceTemplateY = new Int32Array(referenceTemplateLength); 32973 for (k = 0; k < referenceTemplateLength; k++) { 32974 referenceTemplateX[k] = referenceTemplate[k].x; 32975 referenceTemplateY[k] = referenceTemplate[k].y; 32976 } 32977 var referenceWidth = referenceBitmap[0].length; 32978 var referenceHeight = referenceBitmap.length; 32979 var pseudoPixelContext = RefinementReusedContexts[templateIndex]; 32980 var bitmap = []; 32981 var decoder = decodingContext.decoder; 32982 var contexts = decodingContext.contextCache.getContexts('GR'); 32983 var ltp = 0; 32984 for (var i = 0; i < height; i++) { 32985 if (prediction) { 32986 var sltp = decoder.readBit(contexts, pseudoPixelContext); 32987 ltp ^= sltp; 32988 if (ltp) { 32989 throw new Jbig2Error('prediction is not supported'); 32990 } 32991 } 32992 var row = new Uint8Array(width); 32993 bitmap.push(row); 32994 for (var j = 0; j < width; j++) { 32995 var i0, j0; 32996 var contextLabel = 0; 32997 for (k = 0; k < codingTemplateLength; k++) { 32998 i0 = i + codingTemplateY[k]; 32999 j0 = j + codingTemplateX[k]; 33000 if (i0 < 0 || j0 < 0 || j0 >= width) { 33001 contextLabel <<= 1; 33002 } else { 33003 contextLabel = contextLabel << 1 | bitmap[i0][j0]; 33004 } 33005 } 33006 for (k = 0; k < referenceTemplateLength; k++) { 33007 i0 = i + referenceTemplateY[k] - offsetY; 33008 j0 = j + referenceTemplateX[k] - offsetX; 33009 if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || j0 >= referenceWidth) { 33010 contextLabel <<= 1; 33011 } else { 33012 contextLabel = contextLabel << 1 | referenceBitmap[i0][j0]; 33013 } 33014 } 33015 var pixel = decoder.readBit(contexts, contextLabel); 33016 row[j] = pixel; 33017 } 33018 } 33019 return bitmap; 33020 } 33021 function decodeSymbolDictionary(huffman, refinement, symbols, numberOfNewSymbols, numberOfExportedSymbols, huffmanTables, templateIndex, at, refinementTemplateIndex, refinementAt, decodingContext) { 33022 if (huffman) { 33023 throw new Jbig2Error('huffman is not supported'); 33024 } 33025 var newSymbols = []; 33026 var currentHeight = 0; 33027 var symbolCodeLength = (0, _util.log2)(symbols.length + numberOfNewSymbols); 33028 var decoder = decodingContext.decoder; 33029 var contextCache = decodingContext.contextCache; 33030 while (newSymbols.length < numberOfNewSymbols) { 33031 var deltaHeight = decodeInteger(contextCache, 'IADH', decoder); 33032 currentHeight += deltaHeight; 33033 var currentWidth = 0; 33034 while (true) { 33035 var deltaWidth = decodeInteger(contextCache, 'IADW', decoder); 33036 if (deltaWidth === null) { 33037 break; 33038 } 33039 currentWidth += deltaWidth; 33040 var bitmap; 33041 if (refinement) { 33042 var numberOfInstances = decodeInteger(contextCache, 'IAAI', decoder); 33043 if (numberOfInstances > 1) { 33044 bitmap = decodeTextRegion(huffman, refinement, currentWidth, currentHeight, 0, numberOfInstances, 1, symbols.concat(newSymbols), symbolCodeLength, 0, 0, 1, 0, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext); 33045 } else { 33046 var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); 33047 var rdx = decodeInteger(contextCache, 'IARDX', decoder); 33048 var rdy = decodeInteger(contextCache, 'IARDY', decoder); 33049 var symbol = symbolId < symbols.length ? symbols[symbolId] : newSymbols[symbolId - symbols.length]; 33050 bitmap = decodeRefinement(currentWidth, currentHeight, refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt, decodingContext); 33051 } 33052 } else { 33053 bitmap = decodeBitmap(false, currentWidth, currentHeight, templateIndex, false, null, at, decodingContext); 33054 } 33055 newSymbols.push(bitmap); 33056 } 33057 } 33058 var exportedSymbols = []; 33059 var flags = [], 33060 currentFlag = false;
vendor: 18,630 bytes, lines 33061-33554
33061 var totalSymbolsLength = symbols.length + numberOfNewSymbols; 33062 while (flags.length < totalSymbolsLength) { 33063 var runLength = decodeInteger(contextCache, 'IAEX', decoder); 33064 while (runLength--) { 33065 flags.push(currentFlag); 33066 } 33067 currentFlag = !currentFlag; 33068 } 33069 for (var i = 0, ii = symbols.length; i < ii; i++) { 33070 if (flags[i]) { 33071 exportedSymbols.push(symbols[i]); 33072 } 33073 } 33074 for (var j = 0; j < numberOfNewSymbols; i++, j++) { 33075 if (flags[i]) { 33076 exportedSymbols.push(newSymbols[j]); 33077 } 33078 } 33079 return exportedSymbols; 33080 } 33081 function decodeTextRegion(huffman, refinement, width, height, defaultPixelValue, numberOfSymbolInstances, stripSize, inputSymbols, symbolCodeLength, transposed, dsOffset, referenceCorner, combinationOperator, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext) { 33082 if (huffman) { 33083 throw new Jbig2Error('huffman is not supported'); 33084 } 33085 var bitmap = []; 33086 var i, row; 33087 for (i = 0; i < height; i++) { 33088 row = new Uint8Array(width); 33089 if (defaultPixelValue) { 33090 for (var j = 0; j < width; j++) { 33091 row[j] = defaultPixelValue; 33092 } 33093 } 33094 bitmap.push(row); 33095 } 33096 var decoder = decodingContext.decoder; 33097 var contextCache = decodingContext.contextCache; 33098 var stripT = -decodeInteger(contextCache, 'IADT', decoder); 33099 var firstS = 0; 33100 i = 0; 33101 while (i < numberOfSymbolInstances) { 33102 var deltaT = decodeInteger(contextCache, 'IADT', decoder); 33103 stripT += deltaT; 33104 var deltaFirstS = decodeInteger(contextCache, 'IAFS', decoder); 33105 firstS += deltaFirstS; 33106 var currentS = firstS; 33107 do { 33108 var currentT = stripSize === 1 ? 0 : decodeInteger(contextCache, 'IAIT', decoder); 33109 var t = stripSize * stripT + currentT; 33110 var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); 33111 var applyRefinement = refinement && decodeInteger(contextCache, 'IARI', decoder); 33112 var symbolBitmap = inputSymbols[symbolId]; 33113 var symbolWidth = symbolBitmap[0].length; 33114 var symbolHeight = symbolBitmap.length; 33115 if (applyRefinement) { 33116 var rdw = decodeInteger(contextCache, 'IARDW', decoder); 33117 var rdh = decodeInteger(contextCache, 'IARDH', decoder); 33118 var rdx = decodeInteger(contextCache, 'IARDX', decoder); 33119 var rdy = decodeInteger(contextCache, 'IARDY', decoder); 33120 symbolWidth += rdw; 33121 symbolHeight += rdh; 33122 symbolBitmap = decodeRefinement(symbolWidth, symbolHeight, refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx, (rdh >> 1) + rdy, false, refinementAt, decodingContext); 33123 } 33124 var offsetT = t - (referenceCorner & 1 ? 0 : symbolHeight - 1); 33125 var offsetS = currentS - (referenceCorner & 2 ? symbolWidth - 1 : 0); 33126 var s2, t2, symbolRow; 33127 if (transposed) { 33128 for (s2 = 0; s2 < symbolHeight; s2++) { 33129 row = bitmap[offsetS + s2]; 33130 if (!row) { 33131 continue; 33132 } 33133 symbolRow = symbolBitmap[s2]; 33134 var maxWidth = Math.min(width - offsetT, symbolWidth); 33135 switch (combinationOperator) { 33136 case 0: 33137 for (t2 = 0; t2 < maxWidth; t2++) { 33138 row[offsetT + t2] |= symbolRow[t2]; 33139 } 33140 break; 33141 case 2: 33142 for (t2 = 0; t2 < maxWidth; t2++) { 33143 row[offsetT + t2] ^= symbolRow[t2]; 33144 } 33145 break; 33146 default: 33147 throw new Jbig2Error('operator ' + combinationOperator + ' is not supported'); 33148 } 33149 } 33150 currentS += symbolHeight - 1; 33151 } else { 33152 for (t2 = 0; t2 < symbolHeight; t2++) { 33153 row = bitmap[offsetT + t2]; 33154 if (!row) { 33155 continue; 33156 } 33157 symbolRow = symbolBitmap[t2]; 33158 switch (combinationOperator) { 33159 case 0: 33160 for (s2 = 0; s2 < symbolWidth; s2++) { 33161 row[offsetS + s2] |= symbolRow[s2]; 33162 } 33163 break; 33164 case 2: 33165 for (s2 = 0; s2 < symbolWidth; s2++) { 33166 row[offsetS + s2] ^= symbolRow[s2]; 33167 } 33168 break; 33169 default: 33170 throw new Jbig2Error('operator ' + combinationOperator + ' is not supported'); 33171 } 33172 } 33173 currentS += symbolWidth - 1; 33174 } 33175 i++; 33176 var deltaS = decodeInteger(contextCache, 'IADS', decoder); 33177 if (deltaS === null) { 33178 break; 33179 } 33180 currentS += deltaS + dsOffset; 33181 } while (true); 33182 } 33183 return bitmap; 33184 } 33185 function decodePatternDictionary(mmr, patternWidth, patternHeight, maxPatternIndex, template, decodingContext) { 33186 var at = []; 33187 at.push({ 33188 x: -patternWidth, 33189 y: 0 33190 }); 33191 if (template === 0) { 33192 at.push({ 33193 x: -3, 33194 y: -1 33195 }); 33196 at.push({ 33197 x: 2, 33198 y: -2 33199 }); 33200 at.push({ 33201 x: -2, 33202 y: -2 33203 }); 33204 } 33205 var collectiveWidth = (maxPatternIndex + 1) * patternWidth; 33206 var collectiveBitmap = decodeBitmap(mmr, collectiveWidth, patternHeight, template, false, null, at, decodingContext); 33207 var patterns = [], 33208 i = 0, 33209 patternBitmap = void 0, 33210 xMin = void 0, 33211 xMax = void 0, 33212 y = void 0; 33213 while (i <= maxPatternIndex) { 33214 patternBitmap = []; 33215 xMin = patternWidth * i; 33216 xMax = xMin + patternWidth; 33217 for (y = 0; y < patternHeight; y++) { 33218 patternBitmap.push(collectiveBitmap[y].subarray(xMin, xMax)); 33219 } 33220 patterns.push(patternBitmap); 33221 i++; 33222 } 33223 return patterns; 33224 } 33225 function decodeHalftoneRegion(mmr, patterns, template, regionWidth, regionHeight, defaultPixelValue, enableSkip, combinationOperator, gridWidth, gridHeight, gridOffsetX, gridOffsetY, gridVectorX, gridVectorY, decodingContext) { 33226 var skip = null; 33227 if (enableSkip) { 33228 throw new Jbig2Error('skip is not supported'); 33229 } 33230 if (combinationOperator !== 0) { 33231 throw new Jbig2Error('operator ' + combinationOperator + ' is not supported in halftone region'); 33232 } 33233 var regionBitmap = []; 33234 var i = void 0, 33235 j = void 0, 33236 row = void 0; 33237 for (i = 0; i < regionHeight; i++) { 33238 row = new Uint8Array(regionWidth); 33239 if (defaultPixelValue) { 33240 for (j = 0; j < regionWidth; j++) { 33241 row[j] = defaultPixelValue; 33242 } 33243 } 33244 regionBitmap.push(row); 33245 } 33246 var numberOfPatterns = patterns.length; 33247 var pattern0 = patterns[0]; 33248 var patternWidth = pattern0[0].length, 33249 patternHeight = pattern0.length; 33250 var bitsPerValue = (0, _util.log2)(numberOfPatterns); 33251 var at = []; 33252 at.push({ 33253 x: template <= 1 ? 3 : 2, 33254 y: -1 33255 }); 33256 if (template === 0) { 33257 at.push({ 33258 x: -3, 33259 y: -1 33260 }); 33261 at.push({ 33262 x: 2, 33263 y: -2 33264 }); 33265 at.push({ 33266 x: -2, 33267 y: -2 33268 }); 33269 } 33270 var grayScaleBitPlanes = []; 33271 for (i = bitsPerValue - 1; i >= 0; i--) { 33272 grayScaleBitPlanes[i] = decodeBitmap(mmr, gridWidth, gridHeight, template, false, skip, at, decodingContext); 33273 } 33274 var mg = void 0, 33275 ng = void 0, 33276 bit = void 0, 33277 patternIndex = void 0, 33278 patternBitmap = void 0, 33279 x = void 0, 33280 y = void 0, 33281 patternRow = void 0, 33282 regionRow = void 0; 33283 for (mg = 0; mg < gridHeight; mg++) { 33284 for (ng = 0; ng < gridWidth; ng++) { 33285 bit = 0; 33286 patternIndex = 0; 33287 for (j = bitsPerValue - 1; j >= 0; j--) { 33288 bit = grayScaleBitPlanes[j][mg][ng] ^ bit; 33289 patternIndex |= bit << j; 33290 } 33291 patternBitmap = patterns[patternIndex]; 33292 x = gridOffsetX + mg * gridVectorY + ng * gridVectorX >> 8; 33293 y = gridOffsetY + mg * gridVectorX - ng * gridVectorY >> 8; 33294 if (x >= 0 && x + patternWidth <= regionWidth && y >= 0 && y + patternHeight <= regionHeight) { 33295 for (i = 0; i < patternHeight; i++) { 33296 regionRow = regionBitmap[y + i]; 33297 patternRow = patternBitmap[i]; 33298 for (j = 0; j < patternWidth; j++) { 33299 regionRow[x + j] |= patternRow[j]; 33300 } 33301 } 33302 } else { 33303 var regionX = void 0, 33304 regionY = void 0; 33305 for (i = 0; i < patternHeight; i++) { 33306 regionY = y + i; 33307 if (regionY < 0 || regionY >= regionHeight) { 33308 continue; 33309 } 33310 regionRow = regionBitmap[regionY]; 33311 patternRow = patternBitmap[i]; 33312 for (j = 0; j < patternWidth; j++) { 33313 regionX = x + j; 33314 if (regionX >= 0 && regionX < regionWidth) { 33315 regionRow[regionX] |= patternRow[j]; 33316 } 33317 } 33318 } 33319 } 33320 } 33321 } 33322 return regionBitmap; 33323 } 33324 function readSegmentHeader(data, start) { 33325 var segmentHeader = {}; 33326 segmentHeader.number = (0, _util.readUint32)(data, start); 33327 var flags = data[start + 4]; 33328 var segmentType = flags & 0x3F; 33329 if (!SegmentTypes[segmentType]) { 33330 throw new Jbig2Error('invalid segment type: ' + segmentType); 33331 } 33332 segmentHeader.type = segmentType; 33333 segmentHeader.typeName = SegmentTypes[segmentType]; 33334 segmentHeader.deferredNonRetain = !!(flags & 0x80); 33335 var pageAssociationFieldSize = !!(flags & 0x40); 33336 var referredFlags = data[start + 5]; 33337 var referredToCount = referredFlags >> 5 & 7; 33338 var retainBits = [referredFlags & 31]; 33339 var position = start + 6; 33340 if (referredFlags === 7) { 33341 referredToCount = (0, _util.readUint32)(data, position - 1) & 0x1FFFFFFF; 33342 position += 3; 33343 var bytes = referredToCount + 7 >> 3; 33344 retainBits[0] = data[position++]; 33345 while (--bytes > 0) { 33346 retainBits.push(data[position++]); 33347 } 33348 } else if (referredFlags === 5 || referredFlags === 6) { 33349 throw new Jbig2Error('invalid referred-to flags'); 33350 } 33351 segmentHeader.retainBits = retainBits; 33352 var referredToSegmentNumberSize = segmentHeader.number <= 256 ? 1 : segmentHeader.number <= 65536 ? 2 : 4; 33353 var referredTo = []; 33354 var i, ii; 33355 for (i = 0; i < referredToCount; i++) { 33356 var number = referredToSegmentNumberSize === 1 ? data[position] : referredToSegmentNumberSize === 2 ? (0, _util.readUint16)(data, position) : (0, _util.readUint32)(data, position); 33357 referredTo.push(number); 33358 position += referredToSegmentNumberSize; 33359 } 33360 segmentHeader.referredTo = referredTo; 33361 if (!pageAssociationFieldSize) { 33362 segmentHeader.pageAssociation = data[position++]; 33363 } else { 33364 segmentHeader.pageAssociation = (0, _util.readUint32)(data, position); 33365 position += 4; 33366 } 33367 segmentHeader.length = (0, _util.readUint32)(data, position); 33368 position += 4; 33369 if (segmentHeader.length === 0xFFFFFFFF) { 33370 if (segmentType === 38) { 33371 var genericRegionInfo = readRegionSegmentInformation(data, position); 33372 var genericRegionSegmentFlags = data[position + RegionSegmentInformationFieldLength]; 33373 var genericRegionMmr = !!(genericRegionSegmentFlags & 1); 33374 var searchPatternLength = 6; 33375 var searchPattern = new Uint8Array(searchPatternLength); 33376 if (!genericRegionMmr) { 33377 searchPattern[0] = 0xFF; 33378 searchPattern[1] = 0xAC; 33379 } 33380 searchPattern[2] = genericRegionInfo.height >>> 24 & 0xFF; 33381 searchPattern[3] = genericRegionInfo.height >> 16 & 0xFF; 33382 searchPattern[4] = genericRegionInfo.height >> 8 & 0xFF; 33383 searchPattern[5] = genericRegionInfo.height & 0xFF; 33384 for (i = position, ii = data.length; i < ii; i++) { 33385 var j = 0; 33386 while (j < searchPatternLength && searchPattern[j] === data[i + j]) { 33387 j++; 33388 } 33389 if (j === searchPatternLength) { 33390 segmentHeader.length = i + searchPatternLength; 33391 break; 33392 } 33393 } 33394 if (segmentHeader.length === 0xFFFFFFFF) { 33395 throw new Jbig2Error('segment end was not found'); 33396 } 33397 } else { 33398 throw new Jbig2Error('invalid unknown segment length'); 33399 } 33400 } 33401 segmentHeader.headerEnd = position; 33402 return segmentHeader; 33403 } 33404 function readSegments(header, data, start, end) { 33405 var segments = []; 33406 var position = start; 33407 while (position < end) { 33408 var segmentHeader = readSegmentHeader(data, position); 33409 position = segmentHeader.headerEnd; 33410 var segment = { 33411 header: segmentHeader, 33412 data: data 33413 }; 33414 if (!header.randomAccess) { 33415 segment.start = position; 33416 position += segmentHeader.length; 33417 segment.end = position; 33418 } 33419 segments.push(segment); 33420 if (segmentHeader.type === 51) { 33421 break; 33422 } 33423 } 33424 if (header.randomAccess) { 33425 for (var i = 0, ii = segments.length; i < ii; i++) { 33426 segments[i].start = position; 33427 position += segments[i].header.length; 33428 segments[i].end = position; 33429 } 33430 } 33431 return segments; 33432 } 33433 function readRegionSegmentInformation(data, start) { 33434 return { 33435 width: (0, _util.readUint32)(data, start), 33436 height: (0, _util.readUint32)(data, start + 4), 33437 x: (0, _util.readUint32)(data, start + 8), 33438 y: (0, _util.readUint32)(data, start + 12), 33439 combinationOperator: data[start + 16] & 7 33440 }; 33441 } 33442 var RegionSegmentInformationFieldLength = 17; 33443 function processSegment(segment, visitor) { 33444 var header = segment.header; 33445 var data = segment.data, 33446 position = segment.start, 33447 end = segment.end; 33448 var args, at, i, atLength; 33449 switch (header.type) { 33450 case 0: 33451 var dictionary = {}; 33452 var dictionaryFlags = (0, _util.readUint16)(data, position); 33453 dictionary.huffman = !!(dictionaryFlags & 1); 33454 dictionary.refinement = !!(dictionaryFlags & 2); 33455 dictionary.huffmanDHSelector = dictionaryFlags >> 2 & 3; 33456 dictionary.huffmanDWSelector = dictionaryFlags >> 4 & 3; 33457 dictionary.bitmapSizeSelector = dictionaryFlags >> 6 & 1; 33458 dictionary.aggregationInstancesSelector = dictionaryFlags >> 7 & 1; 33459 dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256); 33460 dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512); 33461 dictionary.template = dictionaryFlags >> 10 & 3; 33462 dictionary.refinementTemplate = dictionaryFlags >> 12 & 1; 33463 position += 2; 33464 if (!dictionary.huffman) { 33465 atLength = dictionary.template === 0 ? 4 : 1; 33466 at = []; 33467 for (i = 0; i < atLength; i++) { 33468 at.push({ 33469 x: (0, _util.readInt8)(data, position), 33470 y: (0, _util.readInt8)(data, position + 1) 33471 }); 33472 position += 2; 33473 } 33474 dictionary.at = at; 33475 } 33476 if (dictionary.refinement && !dictionary.refinementTemplate) { 33477 at = []; 33478 for (i = 0; i < 2; i++) { 33479 at.push({ 33480 x: (0, _util.readInt8)(data, position), 33481 y: (0, _util.readInt8)(data, position + 1) 33482 }); 33483 position += 2; 33484 } 33485 dictionary.refinementAt = at; 33486 } 33487 dictionary.numberOfExportedSymbols = (0, _util.readUint32)(data, position); 33488 position += 4; 33489 dictionary.numberOfNewSymbols = (0, _util.readUint32)(data, position); 33490 position += 4; 33491 args = [dictionary, header.number, header.referredTo, data, position, end]; 33492 break; 33493 case 6: 33494 case 7: 33495 var textRegion = {}; 33496 textRegion.info = readRegionSegmentInformation(data, position); 33497 position += RegionSegmentInformationFieldLength; 33498 var textRegionSegmentFlags = (0, _util.readUint16)(data, position); 33499 position += 2; 33500 textRegion.huffman = !!(textRegionSegmentFlags & 1); 33501 textRegion.refinement = !!(textRegionSegmentFlags & 2); 33502 textRegion.stripSize = 1 << (textRegionSegmentFlags >> 2 & 3); 33503 textRegion.referenceCorner = textRegionSegmentFlags >> 4 & 3; 33504 textRegion.transposed = !!(textRegionSegmentFlags & 64); 33505 textRegion.combinationOperator = textRegionSegmentFlags >> 7 & 3; 33506 textRegion.defaultPixelValue = textRegionSegmentFlags >> 9 & 1; 33507 textRegion.dsOffset = textRegionSegmentFlags << 17 >> 27; 33508 textRegion.refinementTemplate = textRegionSegmentFlags >> 15 & 1; 33509 if (textRegion.huffman) { 33510 var textRegionHuffmanFlags = (0, _util.readUint16)(data, position); 33511 position += 2; 33512 textRegion.huffmanFS = textRegionHuffmanFlags & 3; 33513 textRegion.huffmanDS = textRegionHuffmanFlags >> 2 & 3; 33514 textRegion.huffmanDT = textRegionHuffmanFlags >> 4 & 3; 33515 textRegion.huffmanRefinementDW = textRegionHuffmanFlags >> 6 & 3; 33516 textRegion.huffmanRefinementDH = textRegionHuffmanFlags >> 8 & 3; 33517 textRegion.huffmanRefinementDX = textRegionHuffmanFlags >> 10 & 3; 33518 textRegion.huffmanRefinementDY = textRegionHuffmanFlags >> 12 & 3; 33519 textRegion.huffmanRefinementSizeSelector = !!(textRegionHuffmanFlags & 14); 33520 } 33521 if (textRegion.refinement && !textRegion.refinementTemplate) { 33522 at = []; 33523 for (i = 0; i < 2; i++) { 33524 at.push({ 33525 x: (0, _util.readInt8)(data, position), 33526 y: (0, _util.readInt8)(data, position + 1) 33527 }); 33528 position += 2; 33529 } 33530 textRegion.refinementAt = at; 33531 } 33532 textRegion.numberOfSymbolInstances = (0, _util.readUint32)(data, position); 33533 position += 4; 33534 if (textRegion.huffman) { 33535 throw new Jbig2Error('huffman is not supported'); 33536 } 33537 args = [textRegion, header.referredTo, data, position, end]; 33538 break; 33539 case 16: 33540 var patternDictionary = {}; 33541 var patternDictionaryFlags = data[position++]; 33542 patternDictionary.mmr = !!(patternDictionaryFlags & 1); 33543 patternDictionary.template = patternDictionaryFlags >> 1 & 3; 33544 patternDictionary.patternWidth = data[position++]; 33545 patternDictionary.patternHeight = data[position++]; 33546 patternDictionary.maxPatternIndex = (0, _util.readUint32)(data, position); 33547 position += 4; 33548 args = [patternDictionary, header.number, data, position, end]; 33549 break; 33550 case 22: 33551 case 23: 33552 var halftoneRegion = {}; 33553 halftoneRegion.info = readRegionSegmentInformation(data, position); 33554 position += RegionSegmentInformationFieldLength;
vendor: 16,384 bytes, lines 33555-33994
33555 var halftoneRegionFlags = data[position++]; 33556 halftoneRegion.mmr = !!(halftoneRegionFlags & 1); 33557 halftoneRegion.template = halftoneRegionFlags >> 1 & 3; 33558 halftoneRegion.enableSkip = !!(halftoneRegionFlags & 8); 33559 halftoneRegion.combinationOperator = halftoneRegionFlags >> 4 & 7; 33560 halftoneRegion.defaultPixelValue = halftoneRegionFlags >> 7 & 1; 33561 halftoneRegion.gridWidth = (0, _util.readUint32)(data, position); 33562 position += 4; 33563 halftoneRegion.gridHeight = (0, _util.readUint32)(data, position); 33564 position += 4; 33565 halftoneRegion.gridOffsetX = (0, _util.readUint32)(data, position) & 0xFFFFFFFF; 33566 position += 4; 33567 halftoneRegion.gridOffsetY = (0, _util.readUint32)(data, position) & 0xFFFFFFFF; 33568 position += 4; 33569 halftoneRegion.gridVectorX = (0, _util.readUint16)(data, position); 33570 position += 2; 33571 halftoneRegion.gridVectorY = (0, _util.readUint16)(data, position); 33572 position += 2; 33573 args = [halftoneRegion, header.referredTo, data, position, end]; 33574 break; 33575 case 38: 33576 case 39: 33577 var genericRegion = {}; 33578 genericRegion.info = readRegionSegmentInformation(data, position); 33579 position += RegionSegmentInformationFieldLength; 33580 var genericRegionSegmentFlags = data[position++]; 33581 genericRegion.mmr = !!(genericRegionSegmentFlags & 1); 33582 genericRegion.template = genericRegionSegmentFlags >> 1 & 3; 33583 genericRegion.prediction = !!(genericRegionSegmentFlags & 8); 33584 if (!genericRegion.mmr) { 33585 atLength = genericRegion.template === 0 ? 4 : 1; 33586 at = []; 33587 for (i = 0; i < atLength; i++) { 33588 at.push({ 33589 x: (0, _util.readInt8)(data, position), 33590 y: (0, _util.readInt8)(data, position + 1) 33591 }); 33592 position += 2; 33593 } 33594 genericRegion.at = at; 33595 } 33596 args = [genericRegion, data, position, end]; 33597 break; 33598 case 48: 33599 var pageInfo = { 33600 width: (0, _util.readUint32)(data, position), 33601 height: (0, _util.readUint32)(data, position + 4), 33602 resolutionX: (0, _util.readUint32)(data, position + 8), 33603 resolutionY: (0, _util.readUint32)(data, position + 12) 33604 }; 33605 if (pageInfo.height === 0xFFFFFFFF) { 33606 delete pageInfo.height; 33607 } 33608 var pageSegmentFlags = data[position + 16]; 33609 (0, _util.readUint16)(data, position + 17); 33610 pageInfo.lossless = !!(pageSegmentFlags & 1); 33611 pageInfo.refinement = !!(pageSegmentFlags & 2); 33612 pageInfo.defaultPixelValue = pageSegmentFlags >> 2 & 1; 33613 pageInfo.combinationOperator = pageSegmentFlags >> 3 & 3; 33614 pageInfo.requiresBuffer = !!(pageSegmentFlags & 32); 33615 pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64); 33616 args = [pageInfo]; 33617 break; 33618 case 49: 33619 break; 33620 case 50: 33621 break; 33622 case 51: 33623 break; 33624 case 62: 33625 break; 33626 default: 33627 throw new Jbig2Error('segment type ' + header.typeName + '(' + header.type + ')' + ' is not implemented'); 33628 } 33629 var callbackName = 'on' + header.typeName; 33630 if (callbackName in visitor) { 33631 visitor[callbackName].apply(visitor, args); 33632 } 33633 } 33634 function processSegments(segments, visitor) { 33635 for (var i = 0, ii = segments.length; i < ii; i++) { 33636 processSegment(segments[i], visitor); 33637 } 33638 } 33639 function parseJbig2(data, start, end) { 33640 var position = start; 33641 if (data[position] !== 0x97 || data[position + 1] !== 0x4A || data[position + 2] !== 0x42 || data[position + 3] !== 0x32 || data[position + 4] !== 0x0D || data[position + 5] !== 0x0A || data[position + 6] !== 0x1A || data[position + 7] !== 0x0A) { 33642 throw new Jbig2Error('invalid header'); 33643 } 33644 var header = {}; 33645 position += 8; 33646 var flags = data[position++]; 33647 header.randomAccess = !(flags & 1); 33648 if (!(flags & 2)) { 33649 header.numberOfPages = (0, _util.readUint32)(data, position); 33650 position += 4; 33651 } 33652 readSegments(header, data, position, end); 33653 throw new Error('Not implemented'); 33654 } 33655 function parseJbig2Chunks(chunks) { 33656 var visitor = new SimpleSegmentVisitor(); 33657 for (var i = 0, ii = chunks.length; i < ii; i++) { 33658 var chunk = chunks[i]; 33659 var segments = readSegments({}, chunk.data, chunk.start, chunk.end); 33660 processSegments(segments, visitor); 33661 } 33662 return visitor.buffer; 33663 } 33664 function SimpleSegmentVisitor() {} 33665 SimpleSegmentVisitor.prototype = { 33666 onPageInformation: function SimpleSegmentVisitor_onPageInformation(info) { 33667 this.currentPageInfo = info; 33668 var rowSize = info.width + 7 >> 3; 33669 var buffer = new Uint8ClampedArray(rowSize * info.height); 33670 if (info.defaultPixelValue) { 33671 for (var i = 0, ii = buffer.length; i < ii; i++) { 33672 buffer[i] = 0xFF; 33673 } 33674 } 33675 this.buffer = buffer; 33676 }, 33677 drawBitmap: function SimpleSegmentVisitor_drawBitmap(regionInfo, bitmap) { 33678 var pageInfo = this.currentPageInfo; 33679 var width = regionInfo.width, 33680 height = regionInfo.height; 33681 var rowSize = pageInfo.width + 7 >> 3; 33682 var combinationOperator = pageInfo.combinationOperatorOverride ? regionInfo.combinationOperator : pageInfo.combinationOperator; 33683 var buffer = this.buffer; 33684 var mask0 = 128 >> (regionInfo.x & 7); 33685 var offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3); 33686 var i, j, mask, offset; 33687 switch (combinationOperator) { 33688 case 0: 33689 for (i = 0; i < height; i++) { 33690 mask = mask0; 33691 offset = offset0; 33692 for (j = 0; j < width; j++) { 33693 if (bitmap[i][j]) { 33694 buffer[offset] |= mask; 33695 } 33696 mask >>= 1; 33697 if (!mask) { 33698 mask = 128; 33699 offset++; 33700 } 33701 } 33702 offset0 += rowSize; 33703 } 33704 break; 33705 case 2: 33706 for (i = 0; i < height; i++) { 33707 mask = mask0; 33708 offset = offset0; 33709 for (j = 0; j < width; j++) { 33710 if (bitmap[i][j]) { 33711 buffer[offset] ^= mask; 33712 } 33713 mask >>= 1; 33714 if (!mask) { 33715 mask = 128; 33716 offset++; 33717 } 33718 } 33719 offset0 += rowSize; 33720 } 33721 break; 33722 default: 33723 throw new Jbig2Error('operator ' + combinationOperator + ' is not supported'); 33724 } 33725 }, 33726 onImmediateGenericRegion: function SimpleSegmentVisitor_onImmediateGenericRegion(region, data, start, end) { 33727 var regionInfo = region.info; 33728 var decodingContext = new DecodingContext(data, start, end); 33729 var bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height, region.template, region.prediction, null, region.at, decodingContext); 33730 this.drawBitmap(regionInfo, bitmap); 33731 }, 33732 onImmediateLosslessGenericRegion: function SimpleSegmentVisitor_onImmediateLosslessGenericRegion() { 33733 this.onImmediateGenericRegion.apply(this, arguments); 33734 }, 33735 onSymbolDictionary: function SimpleSegmentVisitor_onSymbolDictionary(dictionary, currentSegment, referredSegments, data, start, end) { 33736 var huffmanTables; 33737 if (dictionary.huffman) { 33738 throw new Jbig2Error('huffman is not supported'); 33739 } 33740 var symbols = this.symbols; 33741 if (!symbols) { 33742 this.symbols = symbols = {}; 33743 } 33744 var inputSymbols = []; 33745 for (var i = 0, ii = referredSegments.length; i < ii; i++) { 33746 inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); 33747 } 33748 var decodingContext = new DecodingContext(data, start, end); 33749 symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman, dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols, dictionary.numberOfExportedSymbols, huffmanTables, dictionary.template, dictionary.at, dictionary.refinementTemplate, dictionary.refinementAt, decodingContext); 33750 }, 33751 onImmediateTextRegion: function SimpleSegmentVisitor_onImmediateTextRegion(region, referredSegments, data, start, end) { 33752 var regionInfo = region.info; 33753 var huffmanTables; 33754 var symbols = this.symbols; 33755 var inputSymbols = []; 33756 for (var i = 0, ii = referredSegments.length; i < ii; i++) { 33757 inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); 33758 } 33759 var symbolCodeLength = (0, _util.log2)(inputSymbols.length); 33760 var decodingContext = new DecodingContext(data, start, end); 33761 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); 33762 this.drawBitmap(regionInfo, bitmap); 33763 }, 33764 onImmediateLosslessTextRegion: function SimpleSegmentVisitor_onImmediateLosslessTextRegion() { 33765 this.onImmediateTextRegion.apply(this, arguments); 33766 }, 33767 onPatternDictionary: function onPatternDictionary(dictionary, currentSegment, data, start, end) { 33768 var patterns = this.patterns; 33769 if (!patterns) { 33770 this.patterns = patterns = {}; 33771 } 33772 var decodingContext = new DecodingContext(data, start, end); 33773 patterns[currentSegment] = decodePatternDictionary(dictionary.mmr, dictionary.patternWidth, dictionary.patternHeight, dictionary.maxPatternIndex, dictionary.template, decodingContext); 33774 }, 33775 onImmediateHalftoneRegion: function onImmediateHalftoneRegion(region, referredSegments, data, start, end) { 33776 var patterns = this.patterns[referredSegments[0]]; 33777 var regionInfo = region.info; 33778 var decodingContext = new DecodingContext(data, start, end); 33779 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); 33780 this.drawBitmap(regionInfo, bitmap); 33781 }, 33782 onImmediateLosslessHalftoneRegion: function onImmediateLosslessHalftoneRegion() { 33783 this.onImmediateHalftoneRegion.apply(this, arguments); 33784 } 33785 }; 33786 function Jbig2Image() {} 33787 Jbig2Image.prototype = { 33788 parseChunks: function Jbig2Image_parseChunks(chunks) { 33789 return parseJbig2Chunks(chunks); 33790 } 33791 }; 33792 return Jbig2Image; 33793}(); 33794exports.Jbig2Image = Jbig2Image; 33795 33796/***/ }), 33797/* 112 */ 33798/***/ (function(module, exports, __w_pdfjs_require__) { 33799 33800"use strict"; 33801 33802 33803Object.defineProperty(exports, "__esModule", { 33804 value: true 33805}); 33806exports.JpegImage = undefined; 33807 33808var _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; }; 33809 33810var _util = __w_pdfjs_require__(0); 33811 33812var JpegError = function JpegErrorClosure() { 33813 function JpegError(msg) { 33814 this.message = 'JPEG error: ' + msg; 33815 } 33816 JpegError.prototype = new Error(); 33817 JpegError.prototype.name = 'JpegError'; 33818 JpegError.constructor = JpegError; 33819 return JpegError; 33820}(); 33821var JpegImage = function JpegImageClosure() { 33822 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]); 33823 var dctCos1 = 4017; 33824 var dctSin1 = 799; 33825 var dctCos3 = 3406; 33826 var dctSin3 = 2276; 33827 var dctCos6 = 1567; 33828 var dctSin6 = 3784; 33829 var dctSqrt2 = 5793; 33830 var dctSqrt1d2 = 2896; 33831 function JpegImage() { 33832 this.decodeTransform = null; 33833 this.colorTransform = -1; 33834 } 33835 function buildHuffmanTable(codeLengths, values) { 33836 var k = 0, 33837 code = [], 33838 i, 33839 j, 33840 length = 16; 33841 while (length > 0 && !codeLengths[length - 1]) { 33842 length--; 33843 } 33844 code.push({ 33845 children: [], 33846 index: 0 33847 }); 33848 var p = code[0], 33849 q; 33850 for (i = 0; i < length; i++) { 33851 for (j = 0; j < codeLengths[i]; j++) { 33852 p = code.pop(); 33853 p.children[p.index] = values[k]; 33854 while (p.index > 0) { 33855 p = code.pop(); 33856 } 33857 p.index++; 33858 code.push(p); 33859 while (code.length <= i) { 33860 code.push(q = { 33861 children: [], 33862 index: 0 33863 }); 33864 p.children[p.index] = q.children; 33865 p = q; 33866 } 33867 k++; 33868 } 33869 if (i + 1 < length) { 33870 code.push(q = { 33871 children: [], 33872 index: 0 33873 }); 33874 p.children[p.index] = q.children; 33875 p = q; 33876 } 33877 } 33878 return code[0].children; 33879 } 33880 function getBlockBufferOffset(component, row, col) { 33881 return 64 * ((component.blocksPerLine + 1) * row + col); 33882 } 33883 function decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive) { 33884 var mcusPerLine = frame.mcusPerLine; 33885 var progressive = frame.progressive; 33886 var startOffset = offset, 33887 bitsData = 0, 33888 bitsCount = 0; 33889 function readBit() { 33890 if (bitsCount > 0) { 33891 bitsCount--; 33892 return bitsData >> bitsCount & 1; 33893 } 33894 bitsData = data[offset++]; 33895 if (bitsData === 0xFF) { 33896 var nextByte = data[offset++]; 33897 if (nextByte) { 33898 throw new JpegError('unexpected marker ' + (bitsData << 8 | nextByte).toString(16)); 33899 } 33900 } 33901 bitsCount = 7; 33902 return bitsData >>> 7; 33903 } 33904 function decodeHuffman(tree) { 33905 var node = tree; 33906 while (true) { 33907 node = node[readBit()]; 33908 if (typeof node === 'number') { 33909 return node; 33910 } 33911 if ((typeof node === 'undefined' ? 'undefined' : _typeof(node)) !== 'object') { 33912 throw new JpegError('invalid huffman sequence'); 33913 } 33914 } 33915 } 33916 function receive(length) { 33917 var n = 0; 33918 while (length > 0) { 33919 n = n << 1 | readBit(); 33920 length--; 33921 } 33922 return n; 33923 } 33924 function receiveAndExtend(length) { 33925 if (length === 1) { 33926 return readBit() === 1 ? 1 : -1; 33927 } 33928 var n = receive(length); 33929 if (n >= 1 << length - 1) { 33930 return n; 33931 } 33932 return n + (-1 << length) + 1; 33933 } 33934 function decodeBaseline(component, offset) { 33935 var t = decodeHuffman(component.huffmanTableDC); 33936 var diff = t === 0 ? 0 : receiveAndExtend(t); 33937 component.blockData[offset] = component.pred += diff; 33938 var k = 1; 33939 while (k < 64) { 33940 var rs = decodeHuffman(component.huffmanTableAC); 33941 var s = rs & 15, 33942 r = rs >> 4; 33943 if (s === 0) { 33944 if (r < 15) { 33945 break; 33946 } 33947 k += 16; 33948 continue; 33949 } 33950 k += r; 33951 var z = dctZigZag[k]; 33952 component.blockData[offset + z] = receiveAndExtend(s); 33953 k++; 33954 } 33955 } 33956 function decodeDCFirst(component, offset) { 33957 var t = decodeHuffman(component.huffmanTableDC); 33958 var diff = t === 0 ? 0 : receiveAndExtend(t) << successive; 33959 component.blockData[offset] = component.pred += diff; 33960 } 33961 function decodeDCSuccessive(component, offset) { 33962 component.blockData[offset] |= readBit() << successive; 33963 } 33964 var eobrun = 0; 33965 function decodeACFirst(component, offset) { 33966 if (eobrun > 0) { 33967 eobrun--; 33968 return; 33969 } 33970 var k = spectralStart, 33971 e = spectralEnd; 33972 while (k <= e) { 33973 var rs = decodeHuffman(component.huffmanTableAC); 33974 var s = rs & 15, 33975 r = rs >> 4; 33976 if (s === 0) { 33977 if (r < 15) { 33978 eobrun = receive(r) + (1 << r) - 1; 33979 break; 33980 } 33981 k += 16; 33982 continue; 33983 } 33984 k += r; 33985 var z = dctZigZag[k]; 33986 component.blockData[offset + z] = receiveAndExtend(s) * (1 << successive); 33987 k++; 33988 } 33989 } 33990 var successiveACState = 0, 33991 successiveACNextValue; 33992 function decodeACSuccessive(component, offset) { 33993 var k = spectralStart; 33994
33994var e = spectralEnd; 33995 var r = 0; 33996 var s; 33997 var rs; 33998 while (k <= e) { 33999 var z = dctZigZag[k]; 34000 switch (successiveACState) { 34001 case 0: 34002 rs = decodeHuffman(component.huffmanTableAC); 34003 s = rs & 15; 34004 r = rs >> 4; 34005 if (s === 0) { 34006 if (r < 15) { 34007 eobrun = receive(r) + (1 << r); 34008 successiveACState = 4; 34009 } else { 34010 r = 16; 34011 successiveACState = 1; 34012 } 34013 } else { 34014 if (s !== 1) { 34015 throw new JpegError('invalid ACn encoding'); 34016 } 34017 successiveACNextValue = receiveAndExtend(s); 34018 successiveACState = r ? 2 : 3; 34019 } 34020 continue; 34021 case 1: 34022 case 2: 34023 if (component.blockData[offset + z]) { 34024 component.blockData[offset + z] += readBit() << successive; 34025 } else { 34026 r--; 34027 if (r === 0) { 34028 successiveACState = successiveACState === 2 ? 3 : 0; 34029 } 34030 } 34031 break; 34032 case 3: 34033 if (component.blockData[offset + z]) { 34034 component.blockData[offset + z] += readBit() << successive; 34035 } else { 34036 component.blockData[offset + z] = successiveACNextValue << successive; 34037 successiveACState = 0; 34038 } 34039 break; 34040 case 4: 34041 if (component.blockData[offset + z]) { 34042 component.blockData[offset + z] += readBit() << successive; 34043 } 34044 break; 34045 } 34046 k++; 34047 } 34048 if (successiveACState === 4) { 34049 eobrun--; 34050 if (eobrun === 0) { 34051 successiveACState = 0; 34052 } 34053 } 34054 } 34055 function decodeMcu(component, decode, mcu, row, col) { 34056 var mcuRow = mcu / mcusPerLine | 0; 34057 var mcuCol = mcu % mcusPerLine; 34058 var blockRow = mcuRow * component.v + row; 34059 var blockCol = mcuCol * component.h + col; 34060 var offset = getBlockBufferOffset(component, blockRow, blockCol); 34061 decode(component, offset); 34062 } 34063 function decodeBlock(component, decode, mcu) { 34064 var blockRow = mcu / component.blocksPerLine | 0; 34065 var blockCol = mcu % component.blocksPerLine; 34066 var offset = getBlockBufferOffset(component, blockRow, blockCol); 34067 decode(component, offset); 34068 } 34069 var componentsLength = components.length; 34070 var component, i, j, k, n; 34071 var decodeFn; 34072 if (progressive) { 34073 if (spectralStart === 0) { 34074 decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive; 34075 } else { 34076 decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive; 34077 } 34078 } else { 34079 decodeFn = decodeBaseline; 34080 } 34081 var mcu = 0, 34082 fileMarker; 34083 var mcuExpected; 34084 if (componentsLength === 1) { 34085 mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn; 34086 } else { 34087 mcuExpected = mcusPerLine * frame.mcusPerColumn; 34088 } 34089 var h, v; 34090 while (mcu < mcuExpected) { 34091 var mcuToRead = resetInterval ? Math.min(mcuExpected - mcu, resetInterval) : mcuExpected; 34092 for (i = 0; i < componentsLength; i++) { 34093 components[i].pred = 0; 34094 } 34095 eobrun = 0; 34096 if (componentsLength === 1) { 34097 component = components[0]; 34098 for (n = 0; n < mcuToRead; n++) { 34099 decodeBlock(component, decodeFn, mcu); 34100 mcu++; 34101 } 34102 } else { 34103 for (n = 0; n < mcuToRead; n++) { 34104 for (i = 0; i < componentsLength; i++) { 34105 component = components[i]; 34106 h = component.h; 34107 v = component.v; 34108 for (j = 0; j < v; j++) { 34109 for (k = 0; k < h; k++) { 34110 decodeMcu(component, decodeFn, mcu, j, k); 34111 } 34112 } 34113 } 34114 mcu++; 34115 } 34116 } 34117 bitsCount = 0; 34118 fileMarker = findNextFileMarker(data, offset); 34119 if (fileMarker && fileMarker.invalid) { 34120 (0, _util.warn)('decodeScan - unexpected MCU data, next marker is: ' + fileMarker.invalid); 34121 offset = fileMarker.offset; 34122 } 34123 var marker = fileMarker && fileMarker.marker; 34124 if (!marker || marker <= 0xFF00) { 34125 throw new JpegError('marker was not found'); 34126 } 34127 if (marker >= 0xFFD0 && marker <= 0xFFD7) { 34128 offset += 2; 34129 } else { 34130 break; 34131 } 34132 } 34133 fileMarker = findNextFileMarker(data, offset); 34134 if (fileMarker && fileMarker.invalid) { 34135 (0, _util.warn)('decodeScan - unexpected Scan data, next marker is: ' + fileMarker.invalid); 34136 offset = fileMarker.offset; 34137 } 34138 return offset - startOffset; 34139 } 34140 function quantizeAndInverse(component, blockBufferOffset, p) { 34141 var qt = component.quantizationTable, 34142 blockData = component.blockData; 34143 var v0, v1, v2, v3, v4, v5, v6, v7; 34144 var p0, p1, p2, p3, p4, p5, p6, p7; 34145 var t; 34146 if (!qt) { 34147 throw new JpegError('missing required Quantization Table.'); 34148 } 34149 for (var row = 0; row < 64; row += 8) { 34150 p0 = blockData[blockBufferOffset + row]; 34151 p1 = blockData[blockBufferOffset + row + 1]; 34152 p2 = blockData[blockBufferOffset + row + 2]; 34153 p3 = blockData[blockBufferOffset + row + 3]; 34154 p4 = blockData[blockBufferOffset + row + 4]; 34155 p5 = blockData[blockBufferOffset + row + 5]; 34156 p6 = blockData[blockBufferOffset + row + 6]; 34157 p7 = blockData[blockBufferOffset + row + 7]; 34158 p0 *= qt[row]; 34159 if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { 34160 t = dctSqrt2 * p0 + 512 >> 10; 34161 p[row] = t; 34162 p[row + 1] = t; 34163 p[row + 2] = t; 34164 p[row + 3] = t; 34165 p[row + 4] = t; 34166 p[row + 5] = t; 34167 p[row + 6] = t; 34168 p[row + 7] = t; 34169 continue; 34170 } 34171 p1 *= qt[row + 1]; 34172 p2 *= qt[row + 2]; 34173 p3 *= qt[row + 3]; 34174 p4 *= qt[row + 4]; 34175 p5 *= qt[row + 5]; 34176 p6 *= qt[row + 6]; 34177 p7 *= qt[row + 7]; 34178 v0 = dctSqrt2 * p0 + 128 >> 8; 34179 v1 = dctSqrt2 * p4 + 128 >> 8; 34180 v2 = p2; 34181 v3 = p6; 34182 v4 = dctSqrt1d2 * (p1 - p7) + 128 >> 8; 34183 v7 = dctSqrt1d2 * (p1 + p7) + 128 >> 8; 34184 v5 = p3 << 4; 34185 v6 = p5 << 4; 34186 v0 = v0 + v1 + 1 >> 1; 34187 v1 = v0 - v1; 34188 t = v2 * dctSin6 + v3 * dctCos6 + 128 >> 8; 34189 v2 = v2 * dctCos6 - v3 * dctSin6 + 128 >> 8; 34190 v3 = t; 34191 v4 = v4 + v6 + 1 >> 1; 34192 v6 = v4 - v6; 34193 v7 = v7 + v5 + 1 >> 1; 34194 v5 = v7 - v5; 34195 v0 = v0 + v3 + 1 >> 1;
vendor: 2,012 bytes, lines 34196-34257
34196 v3 = v0 - v3; 34197 v1 = v1 + v2 + 1 >> 1; 34198 v2 = v1 - v2; 34199 t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12; 34200 v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; 34201 v7 = t; 34202 t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; 34203 v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; 34204 v6 = t; 34205 p[row] = v0 + v7; 34206 p[row + 7] = v0 - v7; 34207 p[row + 1] = v1 + v6; 34208 p[row + 6] = v1 - v6; 34209 p[row + 2] = v2 + v5; 34210 p[row + 5] = v2 - v5; 34211 p[row + 3] = v3 + v4; 34212 p[row + 4] = v3 - v4; 34213 } 34214 for (var col = 0; col < 8; ++col) { 34215 p0 = p[col]; 34216 p1 = p[col + 8]; 34217 p2 = p[col + 16]; 34218 p3 = p[col + 24]; 34219 p4 = p[col + 32]; 34220 p5 = p[col + 40]; 34221 p6 = p[col + 48]; 34222 p7 = p[col + 56]; 34223 if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { 34224 t = dctSqrt2 * p0 + 8192 >> 14; 34225 t = t < -2040 ? 0 : t >= 2024 ? 255 : t + 2056 >> 4; 34226 blockData[blockBufferOffset + col] = t; 34227 blockData[blockBufferOffset + col + 8] = t; 34228 blockData[blockBufferOffset + col + 16] = t; 34229 blockData[blockBufferOffset + col + 24] = t; 34230 blockData[blockBufferOffset + col + 32] = t; 34231 blockData[blockBufferOffset + col + 40] = t; 34232 blockData[blockBufferOffset + col + 48] = t; 34233 blockData[blockBufferOffset + col + 56] = t; 34234 continue; 34235 } 34236 v0 = dctSqrt2 * p0 + 2048 >> 12; 34237 v1 = dctSqrt2 * p4 + 2048 >> 12; 34238 v2 = p2; 34239 v3 = p6; 34240 v4 = dctSqrt1d2 * (p1 - p7) + 2048 >> 12; 34241 v7 = dctSqrt1d2 * (p1 + p7) + 2048 >> 12; 34242 v5 = p3; 34243 v6 = p5; 34244 v0 = (v0 + v1 + 1 >> 1) + 4112; 34245 v1 = v0 - v1; 34246 t = v2 * dctSin6 + v3 * dctCos6 + 2048 >> 12; 34247 v2 = v2 * dctCos6 - v3 * dctSin6 + 2048 >> 12; 34248 v3 = t; 34249 v4 = v4 + v6 + 1 >> 1; 34250 v6 = v4 - v6; 34251 v7 = v7 + v5 + 1 >> 1; 34252 v5 = v7 - v5; 34253 v0 = v0 + v3 + 1 >> 1; 34254 v3 = v0 - v3; 34255 v1 = v1 + v2 + 1 >> 1; 34256 v2 = v1 - v2; 34257 t = v4 * dctSin3 + v7 * dctCos3 + 2048 >>
vendor: 5,664 bytes, lines 34257-34410
34257 12; 34258 v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; 34259 v7 = t; 34260 t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; 34261 v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; 34262 v6 = t; 34263 p0 = v0 + v7; 34264 p7 = v0 - v7; 34265 p1 = v1 + v6; 34266 p6 = v1 - v6; 34267 p2 = v2 + v5; 34268 p5 = v2 - v5; 34269 p3 = v3 + v4; 34270 p4 = v3 - v4; 34271 p0 = p0 < 16 ? 0 : p0 >= 4080 ? 255 : p0 >> 4; 34272 p1 = p1 < 16 ? 0 : p1 >= 4080 ? 255 : p1 >> 4; 34273 p2 = p2 < 16 ? 0 : p2 >= 4080 ? 255 : p2 >> 4; 34274 p3 = p3 < 16 ? 0 : p3 >= 4080 ? 255 : p3 >> 4; 34275 p4 = p4 < 16 ? 0 : p4 >= 4080 ? 255 : p4 >> 4; 34276 p5 = p5 < 16 ? 0 : p5 >= 4080 ? 255 : p5 >> 4; 34277 p6 = p6 < 16 ? 0 : p6 >= 4080 ? 255 : p6 >> 4; 34278 p7 = p7 < 16 ? 0 : p7 >= 4080 ? 255 : p7 >> 4; 34279 blockData[blockBufferOffset + col] = p0; 34280 blockData[blockBufferOffset + col + 8] = p1; 34281 blockData[blockBufferOffset + col + 16] = p2; 34282 blockData[blockBufferOffset + col + 24] = p3; 34283 blockData[blockBufferOffset + col + 32] = p4; 34284 blockData[blockBufferOffset + col + 40] = p5; 34285 blockData[blockBufferOffset + col + 48] = p6; 34286 blockData[blockBufferOffset + col + 56] = p7; 34287 } 34288 } 34289 function buildComponentData(frame, component) { 34290 var blocksPerLine = component.blocksPerLine; 34291 var blocksPerColumn = component.blocksPerColumn; 34292 var computationBuffer = new Int16Array(64); 34293 for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) { 34294 for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) { 34295 var offset = getBlockBufferOffset(component, blockRow, blockCol); 34296 quantizeAndInverse(component, offset, computationBuffer); 34297 } 34298 } 34299 return component.blockData; 34300 } 34301 function findNextFileMarker(data, currentPos, startPos) { 34302 function peekUint16(pos) { 34303 return data[pos] << 8 | data[pos + 1]; 34304 } 34305 var maxPos = data.length - 1; 34306 var newPos = startPos < currentPos ? startPos : currentPos; 34307 if (currentPos >= maxPos) { 34308 return null; 34309 } 34310 var currentMarker = peekUint16(currentPos); 34311 if (currentMarker >= 0xFFC0 && currentMarker <= 0xFFFE) { 34312 return { 34313 invalid: null, 34314 marker: currentMarker, 34315 offset: currentPos 34316 }; 34317 } 34318 var newMarker = peekUint16(newPos); 34319 while (!(newMarker >= 0xFFC0 && newMarker <= 0xFFFE)) { 34320 if (++newPos >= maxPos) { 34321 return null; 34322 } 34323 newMarker = peekUint16(newPos); 34324 } 34325 return { 34326 invalid: currentMarker.toString(16), 34327 marker: newMarker, 34328 offset: newPos 34329 }; 34330 } 34331 JpegImage.prototype = { 34332 parse: function parse(data) { 34333 function readUint16() { 34334 var value = data[offset] << 8 | data[offset + 1]; 34335 offset += 2; 34336 return value; 34337 } 34338 function readDataBlock() { 34339 var length = readUint16(); 34340 var endOffset = offset + length - 2; 34341 var fileMarker = findNextFileMarker(data, endOffset, offset); 34342 if (fileMarker && fileMarker.invalid) { 34343 (0, _util.warn)('readDataBlock - incorrect length, next marker is: ' + fileMarker.invalid); 34344 endOffset = fileMarker.offset; 34345 } 34346 var array = data.subarray(offset, endOffset); 34347 offset += array.length; 34348 return array; 34349 } 34350 function prepareComponents(frame) { 34351 var mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH); 34352 var mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV); 34353 for (var i = 0; i < frame.components.length; i++) { 34354 component = frame.components[i]; 34355 var blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * component.h / frame.maxH); 34356 var blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * component.v / frame.maxV); 34357 var blocksPerLineForMcu = mcusPerLine * component.h; 34358 var blocksPerColumnForMcu = mcusPerColumn * component.v; 34359 var blocksBufferSize = 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1); 34360 component.blockData = new Int16Array(blocksBufferSize); 34361 component.blocksPerLine = blocksPerLine; 34362 component.blocksPerColumn = blocksPerColumn; 34363 } 34364 frame.mcusPerLine = mcusPerLine; 34365 frame.mcusPerColumn = mcusPerColumn; 34366 } 34367 var offset = 0; 34368 var jfif = null; 34369 var adobe = null; 34370 var frame, resetInterval; 34371 var quantizationTables = []; 34372 var huffmanTablesAC = [], 34373 huffmanTablesDC = []; 34374 var fileMarker = readUint16(); 34375 if (fileMarker !== 0xFFD8) { 34376 throw new JpegError('SOI not found'); 34377 } 34378 fileMarker = readUint16(); 34379 while (fileMarker !== 0xFFD9) { 34380 var i, j, l; 34381 switch (fileMarker) { 34382 case 0xFFE0: 34383 case 0xFFE1: 34384 case 0xFFE2: 34385 case 0xFFE3: 34386 case 0xFFE4: 34387 case 0xFFE5: 34388 case 0xFFE6: 34389 case 0xFFE7: 34390 case 0xFFE8: 34391 case 0xFFE9: 34392 case 0xFFEA: 34393 case 0xFFEB: 34394 case 0xFFEC: 34395 case 0xFFED: 34396 case 0xFFEE: 34397 case 0xFFEF: 34398 case 0xFFFE: 34399 var appData = readDataBlock(); 34400 if (fileMarker === 0xFFE0) { 34401 if (appData[0] === 0x4A && appData[1] === 0x46 && appData[2] === 0x49 && appData[3] === 0x46 && appData[4] === 0) { 34402 jfif = { 34403 version: { 34404 major: appData[5], 34405 minor: appData[6] 34406 }, 34407 densityUnits: appData[7], 34408 xDensity: appData[8] << 8 | appData[9], 34409 yDensity: appData[10] << 8 | appData[11], 34410 thumbWidth: appData[12],
vendor: 6,532 bytes, lines 34411-34576
34411 thumbHeight: appData[13], 34412 thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13]) 34413 }; 34414 } 34415 } 34416 if (fileMarker === 0xFFEE) { 34417 if (appData[0] === 0x41 && appData[1] === 0x64 && appData[2] === 0x6F && appData[3] === 0x62 && appData[4] === 0x65) { 34418 adobe = { 34419 version: appData[5] << 8 | appData[6], 34420 flags0: appData[7] << 8 | appData[8], 34421 flags1: appData[9] << 8 | appData[10], 34422 transformCode: appData[11] 34423 }; 34424 } 34425 } 34426 break; 34427 case 0xFFDB: 34428 var quantizationTablesLength = readUint16(); 34429 var quantizationTablesEnd = quantizationTablesLength + offset - 2; 34430 var z; 34431 while (offset < quantizationTablesEnd) { 34432 var quantizationTableSpec = data[offset++]; 34433 var tableData = new Uint16Array(64); 34434 if (quantizationTableSpec >> 4 === 0) { 34435 for (j = 0; j < 64; j++) { 34436 z = dctZigZag[j]; 34437 tableData[z] = data[offset++]; 34438 } 34439 } else if (quantizationTableSpec >> 4 === 1) { 34440 for (j = 0; j < 64; j++) { 34441 z = dctZigZag[j]; 34442 tableData[z] = readUint16(); 34443 } 34444 } else { 34445 throw new JpegError('DQT - invalid table spec'); 34446 } 34447 quantizationTables[quantizationTableSpec & 15] = tableData; 34448 } 34449 break; 34450 case 0xFFC0: 34451 case 0xFFC1: 34452 case 0xFFC2: 34453 if (frame) { 34454 throw new JpegError('Only single frame JPEGs supported'); 34455 } 34456 readUint16(); 34457 frame = {}; 34458 frame.extended = fileMarker === 0xFFC1; 34459 frame.progressive = fileMarker === 0xFFC2; 34460 frame.precision = data[offset++]; 34461 frame.scanLines = readUint16(); 34462 frame.samplesPerLine = readUint16(); 34463 frame.components = []; 34464 frame.componentIds = {}; 34465 var componentsCount = data[offset++], 34466 componentId; 34467 var maxH = 0, 34468 maxV = 0; 34469 for (i = 0; i < componentsCount; i++) { 34470 componentId = data[offset]; 34471 var h = data[offset + 1] >> 4; 34472 var v = data[offset + 1] & 15; 34473 if (maxH < h) { 34474 maxH = h; 34475 } 34476 if (maxV < v) { 34477 maxV = v; 34478 } 34479 var qId = data[offset + 2]; 34480 l = frame.components.push({ 34481 h: h, 34482 v: v, 34483 quantizationId: qId, 34484 quantizationTable: null 34485 }); 34486 frame.componentIds[componentId] = l - 1; 34487 offset += 3; 34488 } 34489 frame.maxH = maxH; 34490 frame.maxV = maxV; 34491 prepareComponents(frame); 34492 break; 34493 case 0xFFC4: 34494 var huffmanLength = readUint16(); 34495 for (i = 2; i < huffmanLength;) { 34496 var huffmanTableSpec = data[offset++]; 34497 var codeLengths = new Uint8Array(16); 34498 var codeLengthSum = 0; 34499 for (j = 0; j < 16; j++, offset++) { 34500 codeLengthSum += codeLengths[j] = data[offset]; 34501 } 34502 var huffmanValues = new Uint8Array(codeLengthSum); 34503 for (j = 0; j < codeLengthSum; j++, offset++) { 34504 huffmanValues[j] = data[offset]; 34505 } 34506 i += 17 + codeLengthSum; 34507 (huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = buildHuffmanTable(codeLengths, huffmanValues); 34508 } 34509 break; 34510 case 0xFFDD: 34511 readUint16(); 34512 resetInterval = readUint16(); 34513 break; 34514 case 0xFFDA: 34515 readUint16(); 34516 var selectorsCount = data[offset++]; 34517 var components = [], 34518 component; 34519 for (i = 0; i < selectorsCount; i++) { 34520 var componentIndex = frame.componentIds[data[offset++]]; 34521 component = frame.components[componentIndex]; 34522 var tableSpec = data[offset++]; 34523 component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; 34524 component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; 34525 components.push(component); 34526 } 34527 var spectralStart = data[offset++]; 34528 var spectralEnd = data[offset++]; 34529 var successiveApproximation = data[offset++]; 34530 var processed = decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successiveApproximation >> 4, successiveApproximation & 15); 34531 offset += processed; 34532 break; 34533 case 0xFFFF: 34534 if (data[offset] !== 0xFF) { 34535 offset--; 34536 } 34537 break; 34538 default: 34539 if (data[offset - 3] === 0xFF && data[offset - 2] >= 0xC0 && data[offset - 2] <= 0xFE) { 34540 offset -= 3; 34541 break; 34542 } 34543 throw new JpegError('unknown marker ' + fileMarker.toString(16)); 34544 } 34545 fileMarker = readUint16(); 34546 } 34547 this.width = frame.samplesPerLine; 34548 this.height = frame.scanLines; 34549 this.jfif = jfif; 34550 this.adobe = adobe; 34551 this.components = []; 34552 for (i = 0; i < frame.components.length; i++) { 34553 component = frame.components[i]; 34554 var quantizationTable = quantizationTables[component.quantizationId]; 34555 if (quantizationTable) { 34556 component.quantizationTable = quantizationTable; 34557 } 34558 this.components.push({ 34559 output: buildComponentData(frame, component), 34560 scaleX: component.h / frame.maxH, 34561 scaleY: component.v / frame.maxV, 34562 blocksPerLine: component.blocksPerLine, 34563 blocksPerColumn: component.blocksPerColumn 34564 }); 34565 } 34566 this.numComponents = this.components.length; 34567 }, 34568 _getLinearizedBlockData: function getLinearizedBlockData(width, height) { 34569 var scaleX = this.width / width, 34570 scaleY = this.height / height; 34571 var component, componentScaleX, componentScaleY, blocksPerScanline; 34572 var x, y, i, j, k; 34573 var index; 34574 var offset = 0; 34575 var output; 34576 var numComponents = this.components.length;
vendor: 4,718 bytes, lines 34577-34674
34577 var dataLength = width * height * numComponents; 34578 var data = new Uint8ClampedArray(dataLength); 34579 var xScaleBlockOffset = new Uint32Array(width); 34580 var mask3LSB = 0xfffffff8; 34581 for (i = 0; i < numComponents; i++) { 34582 component = this.components[i]; 34583 componentScaleX = component.scaleX * scaleX; 34584 componentScaleY = component.scaleY * scaleY; 34585 offset = i; 34586 output = component.output; 34587 blocksPerScanline = component.blocksPerLine + 1 << 3; 34588 for (x = 0; x < width; x++) { 34589 j = 0 | x * componentScaleX; 34590 xScaleBlockOffset[x] = (j & mask3LSB) << 3 | j & 7; 34591 } 34592 for (y = 0; y < height; y++) { 34593 j = 0 | y * componentScaleY; 34594 index = blocksPerScanline * (j & mask3LSB) | (j & 7) << 3; 34595 for (x = 0; x < width; x++) { 34596 data[offset] = output[index + xScaleBlockOffset[x]]; 34597 offset += numComponents; 34598 } 34599 } 34600 } 34601 var transform = this.decodeTransform; 34602 if (transform) { 34603 for (i = 0; i < dataLength;) { 34604 for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) { 34605 data[i] = (data[i] * transform[k] >> 8) + transform[k + 1]; 34606 } 34607 } 34608 } 34609 return data; 34610 }, 34611 _isColorConversionNeeded: function _isColorConversionNeeded() { 34612 if (this.adobe) { 34613 return !!this.adobe.transformCode; 34614 } 34615 if (this.numComponents === 3) { 34616 if (this.colorTransform === 0) { 34617 return false; 34618 } 34619 return true; 34620 } 34621 if (this.colorTransform === 1) { 34622 return true; 34623 } 34624 return false; 34625 }, 34626 34627 _convertYccToRgb: function convertYccToRgb(data) { 34628 var Y, Cb, Cr; 34629 for (var i = 0, length = data.length; i < length; i += 3) { 34630 Y = data[i]; 34631 Cb = data[i + 1]; 34632 Cr = data[i + 2]; 34633 data[i] = Y - 179.456 + 1.402 * Cr; 34634 data[i + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr; 34635 data[i + 2] = Y - 226.816 + 1.772 * Cb; 34636 } 34637 return data; 34638 }, 34639 _convertYcckToRgb: function convertYcckToRgb(data) { 34640 var Y, Cb, Cr, k; 34641 var offset = 0; 34642 for (var i = 0, length = data.length; i < length; i += 4) { 34643 Y = data[i]; 34644 Cb = data[i + 1]; 34645 Cr = data[i + 2]; 34646 k = data[i + 3]; 34647 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); 34648 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); 34649 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); 34650 } 34651 return data; 34652 }, 34653 _convertYcckToCmyk: function convertYcckToCmyk(data) { 34654 var Y, Cb, Cr; 34655 for (var i = 0, length = data.length; i < length; i += 4) { 34656 Y = data[i]; 34657 Cb = data[i + 1]; 34658 Cr = data[i + 2]; 34659 data[i] = 434.456 - Y - 1.402 * Cr; 34660 data[i + 1] = 119.541 - Y + 0.344 * Cb + 0.714 * Cr; 34661 data[i + 2] = 481.816 - Y - 1.772 * Cb; 34662 } 34663 return data; 34664 }, 34665 _convertCmykToRgb: function convertCmykToRgb(data) { 34666 var c, m, y, k; 34667 var offset = 0; 34668 var scale = 1 / 255; 34669 for (var i = 0, length = data.length; i < length; i += 4) { 34670 c = data[i] * scale; 34671 m = data[i + 1] * scale; 34672 y = data[i + 2] * scale; 34673 k = data[i + 3] * scale; 34674 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);
34675 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); 34676 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); 34677 } 34678 return data; 34679 }, 34680 getData: function getData(width, height, forceRGBoutput) { 34681 if (this.numComponents > 4) { 34682 throw new JpegError('Unsupported color mode'); 34683 } 34684 var data = this._getLinearizedBlockData(width, height); 34685 if (this.numComponents === 1 && forceRGBoutput) { 34686 var dataLength = data.length; 34687 var rgbData = new Uint8ClampedArray(dataLength * 3); 34688 var offset = 0; 34689 for (var i = 0; i < dataLength; i++) { 34690 var grayColor = data[i]; 34691 rgbData[offset++] = grayColor; 34692 rgbData[offset++] = grayColor; 34693 rgbData[offset++] = grayColor; 34694 } 34695 return rgbData; 34696 } else if (this.numComponents === 3 && this._isColorConversionNeeded()) { 34697 return this._convertYccToRgb(data); 34698 } else if (this.numComponents === 4) { 34699 if (this._isColorConversionNeeded()) { 34700 if (forceRGBoutput) { 34701 return this._convertYcckToRgb(data); 34702 } 34703 return this._convertYcckToCmyk(data); 34704 } else if (forceRGBoutput) { 34705 return this._convertCmykToRgb(data); 34706 } 34707 } 34708 return data; 34709 } 34710 }; 34711 return JpegImage; 34712}(); 34713exports.JpegImage = JpegImage; 34714 34715/***/ }), 34716/* 113 */ 34717/***/ (function(module, exports, __w_pdfjs_require__) { 34718 34719"use strict"; 34720 34721 34722Object.defineProperty(exports, "__esModule", { 34723 value: true 34724}); 34725exports.CMapFactory = exports.IdentityCMap = exports.CMap = undefined; 34726 34727var _util = __w_pdfjs_require__(0); 34728 34729var _primitives = __w_pdfjs_require__(2); 34730 34731var _parser = __w_pdfjs_require__(29); 34732 34733var _stream = __w_pdfjs_require__(5); 34734 34735var 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']; 34736var CMap = function CMapClosure() { 34737 function CMap(builtInCMap) { 34738 this.codespaceRanges = [[], [], [], []]; 34739 this.numCodespaceRanges = 0; 34740 this._map = []; 34741 this.name = ''; 34742 this.vertical = false;
34743 this.useCMap = null; 34744 this.builtInCMap = builtInCMap; 34745 } 34746 CMap.prototype = { 34747 addCodespaceRange: function addCodespaceRange(n, low, high) { 34748 this.codespaceRanges[n - 1].push(low, high); 34749 this.numCodespaceRanges++; 34750 }, 34751 mapCidRange: function mapCidRange(low, high, dstLow) { 34752 while (low <= high) { 34753 this._map[low++] = dstLow++; 34754 } 34755 }, 34756 mapBfRange: function mapBfRange(low, high, dstLow) { 34757 var lastByte = dstLow.length - 1; 34758 while (low <= high) { 34759 this._map[low++] = dstLow; 34760 dstLow = dstLow.substr(0, lastByte) + String.fromCharCode(dstLow.charCodeAt(lastByte) + 1); 34761 } 34762 }, 34763 mapBfRangeToArray: function mapBfRangeToArray(low, high, array) { 34764 var i = 0, 34765 ii = array.length; 34766 while (low <= high && i < ii) { 34767 this._map[low] = array[i++]; 34768 ++low; 34769 } 34770 }, 34771 mapOne: function mapOne(src, dst) { 34772 this._map[src] = dst; 34773 }, 34774 lookup: function lookup(code) { 34775 return this._map[code]; 34776 }, 34777 contains: function contains(code) { 34778 return this._map[code] !== undefined; 34779 }, 34780 forEach: function forEach(callback) { 34781 var map = this._map; 34782 var length = map.length; 34783 if (length <= 0x10000) { 34784 for (var i = 0; i < length; i++) { 34785 if (map[i] !== undefined) { 34786 callback(i, map[i]); 34787 } 34788 } 34789 } else { 34790 for (var _i in map) { 34791 callback(_i, map[_i]); 34792 } 34793 } 34794 }, 34795 charCodeOf: function charCodeOf(value) { 34796 var map = this._map; 34797 if (map.length <= 0x10000) { 34798 return map.indexOf(value); 34799 } 34800 for (var charCode in map) { 34801 if (map[charCode] === value) { 34802 return charCode | 0; 34803 } 34804 } 34805 return -1; 34806 }, 34807 getMap: function getMap() { 34808 return this._map; 34809 }, 34810 readCharCode: function readCharCode(str, offset, out) { 34811 var c = 0; 34812 var codespaceRanges = this.codespaceRanges; 34813 var codespaceRangesLen = this.codespaceRanges.length; 34814 for (var n = 0; n < codespaceRangesLen; n++) { 34815 c = (c << 8 | str.charCodeAt(offset + n)) >>> 0; 34816 var codespaceRange = codespaceRanges[n]; 34817 for (var k = 0, kk = codespaceRange.length; k < kk;) { 34818 var low = codespaceRange[k++]; 34819 var high = codespaceRange[k++]; 34820 if (c >= low && c <= high) {
vendor: 5,567 bytes, lines 34821-35025
34821 out.charcode = c; 34822 out.length = n + 1; 34823 return; 34824 } 34825 } 34826 } 34827 out.charcode = 0; 34828 out.length = 1; 34829 }, 34830 34831 get length() { 34832 return this._map.length; 34833 }, 34834 get isIdentityCMap() { 34835 if (!(this.name === 'Identity-H' || this.name === 'Identity-V')) { 34836 return false; 34837 } 34838 if (this._map.length !== 0x10000) { 34839 return false; 34840 } 34841 for (var i = 0; i < 0x10000; i++) { 34842 if (this._map[i] !== i) { 34843 return false; 34844 } 34845 } 34846 return true; 34847 } 34848 }; 34849 return CMap; 34850}(); 34851var IdentityCMap = function IdentityCMapClosure() { 34852 function IdentityCMap(vertical, n) { 34853 CMap.call(this); 34854 this.vertical = vertical; 34855 this.addCodespaceRange(n, 0, 0xffff); 34856 } 34857 _util.Util.inherit(IdentityCMap, CMap, {}); 34858 IdentityCMap.prototype = { 34859 addCodespaceRange: CMap.prototype.addCodespaceRange, 34860 mapCidRange: function mapCidRange(low, high, dstLow) { 34861 throw new Error('should not call mapCidRange'); 34862 }, 34863 mapBfRange: function mapBfRange(low, high, dstLow) { 34864 throw new Error('should not call mapBfRange'); 34865 }, 34866 mapBfRangeToArray: function mapBfRangeToArray(low, high, array) { 34867 throw new Error('should not call mapBfRangeToArray'); 34868 }, 34869 mapOne: function mapOne(src, dst) { 34870 throw new Error('should not call mapCidOne'); 34871 }, 34872 lookup: function lookup(code) { 34873 return Number.isInteger(code) && code <= 0xffff ? code : undefined; 34874 }, 34875 contains: function contains(code) { 34876 return Number.isInteger(code) && code <= 0xffff; 34877 }, 34878 forEach: function forEach(callback) { 34879 for (var i = 0; i <= 0xffff; i++) { 34880 callback(i, i); 34881 } 34882 }, 34883 charCodeOf: function charCodeOf(value) { 34884 return Number.isInteger(value) && value <= 0xffff ? value : -1; 34885 }, 34886 getMap: function getMap() { 34887 var map = new Array(0x10000); 34888 for (var i = 0; i <= 0xffff; i++) { 34889 map[i] = i; 34890 } 34891 return map; 34892 }, 34893 34894 readCharCode: CMap.prototype.readCharCode, 34895 get length() { 34896 return 0x10000; 34897 }, 34898 get isIdentityCMap() { 34899 throw new Error('should not access .isIdentityCMap'); 34900 } 34901 }; 34902 return IdentityCMap; 34903}(); 34904var BinaryCMapReader = function BinaryCMapReaderClosure() { 34905 function hexToInt(a, size) { 34906 var n = 0; 34907 for (var i = 0; i <= size; i++) { 34908 n = n << 8 | a[i]; 34909 } 34910 return n >>> 0; 34911 } 34912 function hexToStr(a, size) { 34913 if (size === 1) { 34914 return String.fromCharCode(a[0], a[1]); 34915 } 34916 if (size === 3) { 34917 return String.fromCharCode(a[0], a[1], a[2], a[3]); 34918 } 34919 return String.fromCharCode.apply(null, a.subarray(0, size + 1)); 34920 } 34921 function addHex(a, b, size) { 34922 var c = 0; 34923 for (var i = size; i >= 0; i--) { 34924 c += a[i] + b[i]; 34925 a[i] = c & 255; 34926 c >>= 8; 34927 } 34928 } 34929 function incHex(a, size) { 34930 var c = 1; 34931 for (var i = size; i >= 0 && c > 0; i--) { 34932 c += a[i]; 34933 a[i] = c & 255; 34934 c >>= 8; 34935 } 34936 } 34937 var MAX_NUM_SIZE = 16; 34938 var MAX_ENCODED_NUM_SIZE = 19; 34939 function BinaryCMapStream(data) { 34940 this.buffer = data; 34941 this.pos = 0; 34942 this.end = data.length; 34943 this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE); 34944 } 34945 BinaryCMapStream.prototype = { 34946 readByte: function readByte() { 34947 if (this.pos >= this.end) { 34948 return -1; 34949 } 34950 return this.buffer[this.pos++]; 34951 }, 34952 readNumber: function readNumber() { 34953 var n = 0; 34954 var last; 34955 do { 34956 var b = this.readByte(); 34957 if (b < 0) { 34958 throw new _util.FormatError('unexpected EOF in bcmap'); 34959 } 34960 last = !(b & 0x80); 34961 n = n << 7 | b & 0x7F; 34962 } while (!last); 34963 return n; 34964 }, 34965 readSigned: function readSigned() { 34966 var n = this.readNumber(); 34967 return n & 1 ? ~(n >>> 1) : n >>> 1; 34968 }, 34969 readHex: function readHex(num, size) { 34970 num.set(this.buffer.subarray(this.pos, this.pos + size + 1)); 34971 this.pos += size + 1; 34972 }, 34973 readHexNumber: function readHexNumber(num, size) { 34974 var last; 34975 var stack = this.tmpBuf, 34976 sp = 0; 34977 do { 34978 var b = this.readByte(); 34979 if (b < 0) { 34980 throw new _util.FormatError('unexpected EOF in bcmap'); 34981 } 34982 last = !(b & 0x80); 34983 stack[sp++] = b & 0x7F; 34984 } while (!last); 34985 var i = size, 34986 buffer = 0, 34987 bufferSize = 0; 34988 while (i >= 0) { 34989 while (bufferSize < 8 && stack.length > 0) { 34990 buffer = stack[--sp] << bufferSize | buffer; 34991 bufferSize += 7; 34992 } 34993 num[i] = buffer & 255; 34994 i--; 34995 buffer >>= 8; 34996 bufferSize -= 8; 34997 } 34998 }, 34999 readHexSigned: function readHexSigned(num, size) { 35000 this.readHexNumber(num, size); 35001 var sign = num[size] & 1 ? 255 : 0; 35002 var c = 0; 35003 for (var i = 0; i <= size; i++) { 35004 c = (c & 1) << 8 | num[i]; 35005 num[i] = c >> 1 ^ sign; 35006 } 35007 }, 35008 readString: function readString() { 35009 var len = this.readNumber(); 35010 var s = ''; 35011 for (var i = 0; i < len; i++) { 35012 s += String.fromCharCode(this.readNumber()); 35013 } 35014 return s; 35015 } 35016 }; 35017 function processBinaryCMap(data, cMap, extend) { 35018 return new Promise(function (resolve, reject) { 35019 var stream = new BinaryCMapStream(data); 35020 var header = stream.readByte(); 35021 cMap.vertical = !!(header & 1); 35022 var useCMap = null; 35023 var start = new Uint8Array(MAX_NUM_SIZE); 35024 var end = new Uint8Array(MAX_NUM_SIZE); 35025 var char = new Uint8Array(MAX_NUM_SIZE);
35026 var charCode = new Uint8Array(MAX_NUM_SIZE); 35027 var tmp = new Uint8Array(MAX_NUM_SIZE); 35028 var code; 35029 var b; 35030 while ((b = stream.readByte()) >= 0) { 35031 var type = b >> 5; 35032 if (type === 7) { 35033 switch (b & 0x1F) { 35034 case 0: 35035 stream.readString(); 35036 break; 35037 case 1: 35038 useCMap = stream.readString(); 35039 break; 35040 } 35041 continue; 35042 } 35043 var sequence = !!(b & 0x10); 35044 var dataSize = b & 15; 35045 if (dataSize + 1 > MAX_NUM_SIZE) { 35046 throw new Error('processBinaryCMap: Invalid dataSize.'); 35047 } 35048 var ucs2DataSize = 1; 35049 var subitemsCount = stream.readNumber(); 35050 var i; 35051 switch (type) { 35052 case 0: 35053 stream.readHex(start, dataSize); 35054 stream.readHexNumber(end, dataSize); 35055 addHex(end, start, dataSize); 35056 cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); 35057 for (i = 1; i < subitemsCount; i++) { 35058 incHex(end, dataSize); 35059 stream.readHexNumber(start, dataSize); 35060 addHex(start, end, dataSize); 35061 stream.readHexNumber(end, dataSize); 35062 addHex(end, start, dataSize); 35063 cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); 35064 } 35065 break; 35066 case 1: 35067 stream.readHex(start, dataSize); 35068 stream.readHexNumber(end, dataSize); 35069 addHex(end, start, dataSize); 35070 code = stream.readNumber(); 35071 for (i = 1; i < subitemsCount; i++) { 35072 incHex(end, dataSize); 35073 stream.readHexNumber(start, dataSize); 35074 addHex(start, end, dataSize); 35075 stream.readHexNumber(end, dataSize); 35076 addHex(end, start, dataSize); 35077 code = stream.readNumber(); 35078 } 35079 break; 35080 case 2: 35081 stream.readHex(char, dataSize); 35082 code = stream.readNumber(); 35083 cMap.mapOne(hexToInt(char, dataSize), code); 35084 for (i = 1; i < subitemsCount; i++) { 35085 incHex(char, dataSize); 35086 if (!sequence) { 35087 stream.readHexNumber(tmp, dataSize); 35088 addHex(char, tmp, dataSize); 35089 } 35090 code = stream.readSigned() + (code + 1); 35091 cMap.mapOne(hexToInt(char, dataSize), code); 35092 } 35093 break; 35094 case 3: 35095 stream.readHex(start, dataSize); 35096 stream.readHexNumber(end, dataSize); 35097 addHex(end, start, dataSize); 35098 code = stream.readNumber(); 35099 cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); 35100 for (i = 1; i < subitemsCount; i++) { 35101 incHex(end, dataSize); 35102 if (!sequence) { 35103 stream.readHexNumber(start, dataSize); 35104 addHex(start, end, dataSize); 35105 } else { 35106 start.set(end); 35107 } 35108 stream.readHexNumber(end, dataSize); 35109 addHex(end, start, dataSize); 35110 code = stream.readNumber(); 35111 cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); 35112 } 35113 break; 35114 case 4: 35115 stream.readHex(char, ucs2DataSize); 35116 stream.readHex(charCode, dataSize); 35117 cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); 35118 for (i = 1; i < subitemsCount; i++) { 35119 incHex(char, ucs2DataSize); 35120 if (!sequence) { 35121 stream.readHexNumber(tmp, ucs2DataSize); 35122 addHex(char, tmp, ucs2DataSize); 35123 } 35124 incHex(charCode, dataSize); 35125 stream.readHexSigned(tmp, dataSize); 35126 addHex(charCode, tmp, dataSize); 35127 cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); 35128 } 35129 break; 35130 case 5: 35131 stream.readHex(start, ucs2DataSize); 35132 stream.readHexNumber(end, ucs2DataSize); 35133 addHex(end, start, ucs2DataSize); 35134 stream.readHex(charCode, dataSize); 35135 cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); 35136 for (i = 1; i < subitemsCount; i++) { 35137 incHex(end, ucs2DataSize); 35138 if (!sequence) { 35139 stream.readHexNumber(start, ucs2DataSize); 35140 addHex(start, end, ucs2DataSize); 35141 } else { 35142 start.set(end); 35143 } 35144 stream.readHexNumber(end, ucs2DataSize); 35145 addHex(end, start, ucs2DataSize); 35146 stream.readHex(charCode, dataSize); 35147 cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); 35148 } 35149 break; 35150 default: 35151 reject(new Error('processBinaryCMap: Unknown type: ' + type)); 35152 return; 35153 } 35154 } 35155 if (useCMap) { 35156 resolve(extend(useCMap)); 35157 return; 35158 } 35159 resolve(cMap); 35160 }); 35161 } 35162 function BinaryCMapReader() {} 35163 BinaryCMapReader.prototype = { process: processBinaryCMap }; 35164 return BinaryCMapReader; 35165}(); 35166var CMapFactory = function CMapFactoryClosure() { 35167 function strToInt(str) { 35168 var a = 0; 35169 for (var i = 0; i < str.length; i++) { 35170 a = a << 8 | str.charCodeAt(i); 35171 } 35172 return a >>> 0; 35173 } 35174 function expectString(obj) { 35175 if (!(0, _util.isString)(obj)) { 35176 throw new _util.FormatError('Malformed CMap: expected string.'); 35177 } 35178 } 35179 function expectInt(obj) { 35180 if (!Number.isInteger(obj)) { 35181 throw new _util.FormatError('Malformed CMap: expected int.'); 35182 } 35183 } 35184 function parseBfChar(cMap, lexer) { 35185 while (true) { 35186 var obj = lexer.getObj(); 35187 if ((0, _primitives.isEOF)(obj)) { 35188 break; 35189 } 35190 if ((0, _primitives.isCmd)(obj, 'endbfchar')) { 35191 return; 35192 } 35193 expectString(obj); 35194 var src = strToInt(obj); 35195 obj = lexer.getObj(); 35196 expectString(obj); 35197 var dst = obj; 35198 cMap.mapOne(src, dst); 35199 } 35200 } 35201 function parseBfRange(cMap, lexer) { 35202 while (true) { 35203 var obj = lexer.getObj(); 35204 if ((0, _primitives.isEOF)(obj)) { 35205 break; 35206 } 35207 if ((0, _primitives.isCmd)(obj, 'endbfrange')) { 35208 return; 35209 } 35210 expectString(obj); 35211 var low = strToInt(obj); 35212 obj = lexer.getObj(); 35213 expectString(obj); 35214 var high = strToInt(obj); 35215 obj = lexer.getObj(); 35216 if (Number.isInteger(obj) || (0, _util.isString)(obj)) { 35217 var dstLow = Number.isInteger(obj) ? String.fromCharCode(obj) : obj; 35218 cMap.mapBfRange(low, high, dstLow); 35219 } else if ((0, _primitives.isCmd)(obj, '[')) { 35220 obj = lexer.getObj(); 35221 var array = []; 35222 while (!(0, _primitives.isCmd)(obj, ']') && !(0, _primitives.isEOF)(obj)) { 35223 array.push(obj); 35224 obj = lexer.getObj(); 35225 } 35226 cMap.mapBfRangeToArray(low, high, array); 35227 } else { 35228 break; 35229 } 35230 } 35231 throw new _util.FormatError('Invalid bf range.'); 35232 } 35233 function parseCidChar(cMap, lexer) { 35234 while (true) { 35235 var obj = lexer.getObj(); 35236 if ((0, _primitives.isEOF)(obj)) { 35237 break; 35238 } 35239 if ((0, _primitives.isCmd)(obj, 'endcidchar')) { 35240 return; 35241 } 35242 expectString(obj); 35243 var src = strToInt(obj); 35244 obj = lexer.getObj(); 35245 expectInt(obj); 35246 var dst = obj; 35247 cMap.mapOne(src, dst); 35248 } 35249 } 35250 function parseCidRange(cMap, lexer) { 35251 while (true) { 35252 var obj = lexer.getObj(); 35253 if ((0, _primitives.isEOF)(obj)) { 35254 break; 35255 } 35256 if ((0, _primitives.isCmd)(obj, 'endcidrange')) { 35257 return; 35258 } 35259 expectString(obj); 35260 var low = strToInt(obj); 35261 obj = lexer.getObj(); 35262 expectString(obj); 35263 var high = strToInt(obj); 35264 obj = lexer.getObj(); 35265 expectInt(obj); 35266 var dstLow = obj; 35267 cMap.mapCidRange(low, high, dstLow); 35268 } 35269 } 35270 function parseCodespaceRange(cMap, lexer) { 35271 while (true) { 35272 var obj = lexer.getObj(); 35273 if ((0, _primitives.isEOF)(obj)) { 35274 break; 35275 } 35276 if ((0, _primitives.isCmd)(obj, 'endcodespacerange')) { 35277 return; 35278 } 35279 if (!(0, _util.isString)(obj)) { 35280 break; 35281 } 35282 var low = strToInt(obj); 35283 obj = lexer.getObj(); 35284 if (!(0, _util.isString)(obj)) { 35285 break; 35286 } 35287 var high = strToInt(obj); 35288 cMap.addCodespaceRange(obj.length, low, high); 35289 } 35290 throw new _util.FormatError('Invalid codespace range.'); 35291 } 35292 function parseWMode(cMap, lexer) { 35293 var obj = lexer.getObj(); 35294 if (Number.isInteger(obj)) { 35295 cMap.vertical = !!obj; 35296 } 35297 } 35298 function parseCMapName(cMap, lexer) { 35299 var obj = lexer.getObj(); 35300 if ((0, _primitives.isName)(obj) && (0, _util.isString)(obj.name)) { 35301 cMap.name = obj.name; 35302 } 35303 } 35304 function parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap) { 35305 var previous; 35306 var embededUseCMap; 35307 objLoop: while (true) {
35308 try { 35309 var obj = lexer.getObj(); 35310 if ((0, _primitives.isEOF)(obj)) { 35311 break; 35312 } else if ((0, _primitives.isName)(obj)) { 35313 if (obj.name === 'WMode') { 35314 parseWMode(cMap, lexer); 35315 } else if (obj.name === 'CMapName') { 35316 parseCMapName(cMap, lexer); 35317 } 35318 previous = obj; 35319 } else if ((0, _primitives.isCmd)(obj)) { 35320 switch (obj.cmd) { 35321 case 'endcmap': 35322 break objLoop; 35323 case 'usecmap': 35324 if ((0, _primitives.isName)(previous)) { 35325 embededUseCMap = previous.name; 35326 } 35327 break; 35328 case 'begincodespacerange': 35329 parseCodespaceRange(cMap, lexer); 35330 break; 35331 case 'beginbfchar': 35332 parseBfChar(cMap, lexer); 35333 break; 35334 case 'begincidchar': 35335 parseCidChar(cMap, lexer); 35336 break; 35337 case 'beginbfrange': 35338 parseBfRange(cMap, lexer); 35339 break; 35340 case 'begincidrange': 35341 parseCidRange(cMap, lexer); 35342 break; 35343 } 35344 } 35345 } catch (ex) { 35346 if (ex instanceof _util.MissingDataException) { 35347 throw ex; 35348 } 35349 (0, _util.warn)('Invalid cMap data: ' + ex); 35350 continue; 35351 } 35352 } 35353 if (!useCMap && embededUseCMap) { 35354 useCMap = embededUseCMap; 35355 } 35356 if (useCMap) { 35357 return extendCMap(cMap, fetchBuiltInCMap, useCMap); 35358 } 35359 return Promise.resolve(cMap); 35360 } 35361 function extendCMap(cMap, fetchBuiltInCMap, useCMap) { 35362 return createBuiltInCMap(useCMap, fetchBuiltInCMap).then(function (newCMap) { 35363 cMap.useCMap = newCMap; 35364 if (cMap.numCodespaceRanges === 0) { 35365 var useCodespaceRanges = cMap.useCMap.codespaceRanges; 35366 for (var i = 0; i < useCodespaceRanges.length; i++) { 35367 cMap.codespaceRanges[i] = useCodespaceRanges[i].slice(); 35368 } 35369 cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges; 35370 } 35371 cMap.useCMap.forEach(function (key, value) { 35372 if (!cMap.contains(key)) { 35373 cMap.mapOne(key, cMap.useCMap.lookup(key)); 35374 } 35375 }); 35376 return cMap; 35377 }); 35378 } 35379 function createBuiltInCMap(name, fetchBuiltInCMap) { 35380 if (name === 'Identity-H') { 35381 return Promise.resolve(new IdentityCMap(false, 2)); 35382 } else if (name === 'Identity-V') { 35383 return Promise.resolve(new IdentityCMap(true, 2)); 35384 } 35385 if (BUILT_IN_CMAPS.indexOf(name) === -1) { 35386 return Promise.reject(new Error('Unknown CMap name: ' + name)); 35387 } 35388 if (!fetchBuiltInCMap) { 35389 return Promise.reject(new Error('Built-in CMap parameters are not provided.')); 35390 } 35391 return fetchBuiltInCMap(name).then(function (data) { 35392 var cMapData = data.cMapData, 35393 compressionType = data.compressionType; 35394 var cMap = new CMap(true); 35395 if (compressionType === _util.CMapCompressionType.BINARY) { 35396 return new BinaryCMapReader().process(cMapData, cMap, function (useCMap) { 35397 return extendCMap(cMap, fetchBuiltInCMap, useCMap); 35398 }); 35399 } 35400 if (compressionType === _util.CMapCompressionType.NONE) { 35401 var lexer = new _parser.Lexer(new _stream.Stream(cMapData)); 35402 return parseCMap(cMap, lexer, fetchBuiltInCMap, null); 35403 } 35404 return Promise.reject(new Error('TODO: Only BINARY/NONE CMap compression is currently supported.')); 35405 }); 35406 } 35407 return { 35408 create: function create(params) { 35409 var encoding = params.encoding; 35410 var fetchBuiltInCMap = params.fetchBuiltInCMap; 35411 var useCMap = params.useCMap; 35412 if ((0, _primitives.isName)(encoding)) { 35413 return createBuiltInCMap(encoding.name, fetchBuiltInCMap); 35414 } else if ((0, _primitives.isStream)(encoding)) { 35415 var cMap = new CMap(); 35416 var lexer = new _parser.Lexer(encoding); 35417 return parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap).then(function (parsedCMap) { 35418 if (parsedCMap.isIdentityCMap) { 35419 return createBuiltInCMap(parsedCMap.name, fetchBuiltInCMap); 35420 } 35421 return parsedCMap; 35422 }); 35423 } 35424 return Promise.reject(new Error('Encoding required.')); 35425 } 35426 }; 35427}(); 35428exports.CMap = CMap; 35429exports.IdentityCMap = IdentityCMap; 35430exports.CMapFactory = CMapFactory; 35431 35432/***/ }), 35433/* 114 */ 35434/***/ (function(module, exports, __w_pdfjs_require__) { 35435 35436"use strict"; 35437 35438 35439Object.defineProperty(exports, "__esModule", { 35440 value: true 35441});
35442exports.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; 35443 35444var _util = __w_pdfjs_require__(0); 35445 35446var _cff_parser = __w_pdfjs_require__(68); 35447 35448var _glyphlist = __w_pdfjs_require__(42); 35449 35450var _encodings = __w_pdfjs_require__(22); 35451 35452var _standard_fonts = __w_pdfjs_require__(69); 35453 35454var _unicode = __w_pdfjs_require__(70); 35455 35456var _font_renderer = __w_pdfjs_require__(116); 35457 35458var _stream = __w_pdfjs_require__(5); 35459 35460var _type1_parser = __w_pdfjs_require__(117); 35461 35462var PRIVATE_USE_OFFSET_START = 0xE000; 35463var PRIVATE_USE_OFFSET_END = 0xF8FF; 35464var SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = false; 35465var PDF_GLYPH_SPACE_UNITS = 1000; 35466var SEAC_ANALYSIS_ENABLED = false; 35467var FontFlags = { 35468 FixedPitch: 1, 35469 Serif: 2, 35470 Symbolic: 4, 35471 Script: 8, 35472 Nonsymbolic: 32, 35473 Italic: 64, 35474 AllCap: 65536, 35475 SmallCap: 131072, 35476 ForceBold: 262144 35477}; 35478var 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']; 35479function adjustWidths(properties) { 35480 if (!properties.fontMatrix) { 35481 return; 35482 } 35483 if (properties.fontMatrix[0] === _util.FONT_IDENTITY_MATRIX[0]) { 35484 return; 35485 } 35486 var scale = 0.001 / properties.fontMatrix[0]; 35487 var glyphsWidths = properties.widths; 35488 for (var glyph in glyphsWidths) { 35489 glyphsWidths[glyph] *= scale; 35490 } 35491 properties.defaultWidth *= scale; 35492} 35493function adjustToUnicode(properties, builtInEncoding) { 35494 if (properties.hasIncludedToUnicodeMap) { 35495 return; 35496 } 35497 if (properties.hasEncoding) { 35498 return; 35499 } 35500 if (builtInEncoding === properties.defaultEncoding) { 35501 return; 35502 } 35503 if (properties.toUnicode instanceof IdentityToUnicodeMap) { 35504 return; 35505 } 35506 var toUnicode = [], 35507 glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)();
35508 for (var charCode in builtInEncoding) { 35509 var glyphName = builtInEncoding[charCode]; 35510 var unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap); 35511 if (unicode !== -1) { 35512 toUnicode[charCode] = String.fromCharCode(unicode); 35513 } 35514 } 35515 properties.toUnicode.amend(toUnicode); 35516} 35517function getFontType(type, subtype) { 35518 switch (type) { 35519 case 'Type1': 35520 return subtype === 'Type1C' ? _util.FontType.TYPE1C : _util.FontType.TYPE1; 35521 case 'CIDFontType0': 35522 return subtype === 'CIDFontType0C' ? _util.FontType.CIDFONTTYPE0C : _util.FontType.CIDFONTTYPE0; 35523 case 'OpenType': 35524 return _util.FontType.OPENTYPE; 35525 case 'TrueType': 35526 return _util.FontType.TRUETYPE; 35527 case 'CIDFontType2': 35528 return _util.FontType.CIDFONTTYPE2; 35529 case 'MMType1': 35530 return _util.FontType.MMTYPE1; 35531 case 'Type0': 35532 return _util.FontType.TYPE0; 35533 default: 35534 return _util.FontType.UNKNOWN; 35535 } 35536} 35537function recoverGlyphName(name, glyphsUnicodeMap) { 35538 if (glyphsUnicodeMap[name] !== undefined) { 35539 return name; 35540 } 35541 var unicode = (0, _unicode.getUnicodeForGlyph)(name, glyphsUnicodeMap); 35542 if (unicode !== -1) { 35543 for (var key in glyphsUnicodeMap) { 35544 if (glyphsUnicodeMap[key] === unicode) { 35545 return key; 35546 } 35547 } 35548 } 35549 (0, _util.info)('Unable to recover a standard glyph name for: ' + name); 35550 return name; 35551} 35552var Glyph = function GlyphClosure() { 35553 function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont) { 35554 this.fontChar = fontChar; 35555 this.unicode = unicode; 35556 this.accent = accent; 35557 this.width = width; 35558 this.vmetric = vmetric; 35559 this.operatorListId = operatorListId; 35560 this.isSpace = isSpace; 35561 this.isInFont = isInFont; 35562 } 35563 Glyph.prototype.matchesForCache = function (fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont) { 35564 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; 35565 }; 35566 return Glyph; 35567}(); 35568var ToUnicodeMap = function ToUnicodeMapClosure() { 35569 function ToUnicodeMap(cmap) { 35570 this._map = cmap; 35571 } 35572 ToUnicodeMap.prototype = { 35573 get length() { 35574 return this._map.length; 35575 }, 35576 forEach: function forEach(callback) { 35577 for (var charCode in this._map) { 35578 callback(charCode, this._map[charCode].charCodeAt(0)); 35579 } 35580 }, 35581 has: function has(i) { 35582 return this._map[i] !== undefined; 35583 }, 35584 get: function get(i) { 35585 return this._map[i]; 35586 }, 35587 charCodeOf: function charCodeOf(value) { 35588 var map = this._map; 35589 if (map.length <= 0x10000) { 35590 return map.indexOf(value); 35591 } 35592 for (var charCode in map) { 35593 if (map[charCode] === value) { 35594 return charCode | 0; 35595 } 35596 } 35597 return -1; 35598 }, 35599 amend: function amend(map) { 35600 for (var charCode in map) { 35601 this._map[charCode] = map[charCode]; 35602 } 35603 } 35604 }; 35605 return ToUnicodeMap; 35606}(); 35607var IdentityToUnicodeMap = function IdentityToUnicodeMapClosure() { 35608 function IdentityToUnicodeMap(firstChar, lastChar) { 35609 this.firstChar = firstChar; 35610 this.lastChar = lastChar; 35611 } 35612 IdentityToUnicodeMap.prototype = { 35613 get length() { 35614 return this.lastChar + 1 - this.firstChar; 35615 }, 35616 forEach: function forEach(callback) { 35617 for (var i = this.firstChar, ii = this.lastChar; i <= ii; i++) { 35618 callback(i, i); 35619 } 35620 }, 35621 has: function has(i) { 35622 return this.firstChar <= i && i <= this.lastChar; 35623 }, 35624 get: function get(i) { 35625 if (this.firstChar <= i && i <= this.lastChar) { 35626 return String.fromCharCode(i); 35627 } 35628 return undefined; 35629 }, 35630 charCodeOf: function charCodeOf(v) { 35631 return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar ? v : -1; 35632 }, 35633 amend: function amend(map) { 35634 throw new Error('Should not call amend()'); 35635 } 35636 }; 35637 return IdentityToUnicodeMap; 35638}(); 35639var OpenTypeFileBuilder = function OpenTypeFileBuilderClosure() { 35640 function writeInt16(dest, offset, num) { 35641 dest[offset] = num >> 8 & 0xFF; 35642 dest[offset + 1] = num & 0xFF; 35643 } 35644 function writeInt32(dest, offset, num) { 35645 dest[offset] = num >> 24 & 0xFF; 35646 dest[offset + 1] = num >> 16 & 0xFF; 35647 dest[offset + 2] = num >> 8 & 0xFF; 35648 dest[offset + 3] = num & 0xFF; 35649 } 35650 function writeData(dest, offset, data) { 35651 var i, ii; 35652 if (data instanceof Uint8Array) { 35653 dest.set(data, offset); 35654 } else if (typeof data === 'string') { 35655 for (i = 0, ii = data.length; i < ii; i++) { 35656 dest[offset++] = data.charCodeAt(i) & 0xFF; 35657 } 35658 } else { 35659 for (i = 0, ii = data.length; i < ii; i++) { 35660 dest[offset++] = data[i] & 0xFF; 35661 } 35662 } 35663 } 35664 function OpenTypeFileBuilder(sfnt) { 35665 this.sfnt = sfnt; 35666 this.tables = Object.create(null); 35667 } 35668 OpenTypeFileBuilder.getSearchParams = function OpenTypeFileBuilder_getSearchParams(entriesCount, entrySize) { 35669 var maxPower2 = 1, 35670 log2 = 0; 35671 while ((maxPower2 ^ entriesCount) > maxPower2) { 35672 maxPower2 <<= 1; 35673 log2++; 35674 } 35675 var searchRange = maxPower2 * entrySize; 35676 return {
35677 range: searchRange, 35678 entry: log2, 35679 rangeShift: entrySize * entriesCount - searchRange 35680 }; 35681 }; 35682 var OTF_HEADER_SIZE = 12; 35683 var OTF_TABLE_ENTRY_SIZE = 16; 35684 OpenTypeFileBuilder.prototype = { 35685 toArray: function OpenTypeFileBuilder_toArray() { 35686 var sfnt = this.sfnt; 35687 var tables = this.tables; 35688 var tablesNames = Object.keys(tables); 35689 tablesNames.sort(); 35690 var numTables = tablesNames.length; 35691 var i, j, jj, table, tableName; 35692 var offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE; 35693 var tableOffsets = [offset]; 35694 for (i = 0; i < numTables; i++) { 35695 table = tables[tablesNames[i]]; 35696 var paddedLength = (table.length + 3 & ~3) >>> 0; 35697 offset += paddedLength; 35698 tableOffsets.push(offset); 35699 } 35700 var file = new Uint8Array(offset); 35701 for (i = 0; i < numTables; i++) { 35702 table = tables[tablesNames[i]]; 35703 writeData(file, tableOffsets[i], table); 35704 } 35705 if (sfnt === 'true') { 35706 sfnt = (0, _util.string32)(0x00010000); 35707 } 35708 file[0] = sfnt.charCodeAt(0) & 0xFF; 35709 file[1] = sfnt.charCodeAt(1) & 0xFF; 35710 file[2] = sfnt.charCodeAt(2) & 0xFF; 35711 file[3] = sfnt.charCodeAt(3) & 0xFF; 35712 writeInt16(file, 4, numTables); 35713 var searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16); 35714 writeInt16(file, 6, searchParams.range); 35715 writeInt16(file, 8, searchParams.entry); 35716 writeInt16(file, 10, searchParams.rangeShift); 35717 offset = OTF_HEADER_SIZE; 35718 for (i = 0; i < numTables; i++) { 35719 tableName = tablesNames[i]; 35720 file[offset] = tableName.charCodeAt(0) & 0xFF; 35721 file[offset + 1] = tableName.charCodeAt(1) & 0xFF; 35722 file[offset + 2] = tableName.charCodeAt(2) & 0xFF; 35723 file[offset + 3] = tableName.charCodeAt(3) & 0xFF; 35724 var checksum = 0; 35725 for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) { 35726 var quad = (0, _util.readUint32)(file, j); 35727 checksum = checksum + quad >>> 0; 35728 } 35729 writeInt32(file, offset + 4, checksum); 35730 writeInt32(file, offset + 8, tableOffsets[i]); 35731 writeInt32(file, offset + 12, tables[tableName].length); 35732 offset += OTF_TABLE_ENTRY_SIZE; 35733 } 35734 return file; 35735 }, 35736 addTable: function OpenTypeFileBuilder_addTable(tag, data) { 35737 if (tag in this.tables) { 35738 throw new Error('Table ' + tag + ' already exists'); 35739 } 35740 this.tables[tag] = data; 35741 } 35742 }; 35743 return OpenTypeFileBuilder; 35744}(); 35745var 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, 0xFFF0, 0x10000]); 35746var Font = function FontClosure() { 35747 function Font(name, file, properties) { 35748 var charCode; 35749 this.name = name; 35750 this.loadedName = properties.loadedName; 35751 this.isType3Font = properties.isType3Font; 35752 this.sizes = []; 35753 this.missingFile = false; 35754 this.glyphCache = Object.create(null); 35755 this.isSerifFont = !!(properties.flags & FontFlags.Serif); 35756 this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); 35757 this.isMonospace = !!(properties.flags & FontFlags.FixedPitch); 35758 var type = properties.type; 35759 var subtype = properties.subtype; 35760 this.type = type; 35761 this.subtype = subtype; 35762 this.fallbackName = this.isMonospace ? 'monospace' : this.isSerifFont ? 'serif' : 'sans-serif'; 35763 this.differences = properties.differences; 35764 this.widths = properties.widths; 35765 this.defaultWidth = properties.defaultWidth; 35766 this.composite = properties.composite; 35767 this.wideChars = properties.wideChars; 35768 this.cMap = properties.cMap; 35769 this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS; 35770 this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS; 35771 this.fontMatrix = properties.fontMatrix; 35772 this.bbox = properties.bbox; 35773 this.defaultEncoding = properties.defaultEncoding; 35774 this.toUnicode = properties.toUnicode; 35775 this.toFontChar = []; 35776 if (properties.type === 'Type3') { 35777 for (charCode = 0; charCode < 256; charCode++) { 35778 this.toFontChar[charCode] = this.differences[charCode] || properties.defaultEncoding[charCode]; 35779 } 35780 this.fontType = _util.FontType.TYPE3; 35781 return; 35782 } 35783 this.cidEncoding = properties.cidEncoding; 35784 this.vertical = properties.vertical; 35785 if (this.vertical) { 35786 this.vmetrics = properties.vmetrics; 35787 this.defaultVMetrics = properties.defaultVMetrics; 35788 } 35789 if (!file || file.isEmpty) { 35790 if (file) { 35791 (0, _util.warn)('Font file is empty in "' + name + '" (' + this.loadedName + ')'); 35792 } 35793 this.fallbackToSystemFont(); 35794 return; 35795 } 35796 if (subtype === 'Type1C') { 35797 if (type !== 'Type1' && type !== 'MMType1') { 35798 if (isTrueTypeFile(file)) { 35799 subtype = 'TrueType'; 35800 } else { 35801 type = 'Type1'; 35802 } 35803 } else if (isOpenTypeFile(file)) { 35804 subtype = 'OpenType'; 35805 } 35806 } 35807 if (subtype === 'CIDFontType0C' && type !== 'CIDFontType0') { 35808 type = 'CIDFontType0'; 35809 } 35810 if (type === 'CIDFontType0') { 35811 if (isType1File(file)) { 35812 subtype = 'CIDFontType0'; 35813 } else if (isOpenTypeFile(file)) { 35814 subtype = 'OpenType'; 35815 } else { 35816 subtype = 'CIDFontType0C'; 35817 } 35818 } 35819 if (subtype === 'OpenType' && type !== 'OpenType') { 35820 type = 'OpenType'; 35821 } 35822 try { 35823 var data; 35824 switch (type) { 35825 case 'MMType1': 35826 (0, _util.info)('MMType1 font (' + name + '), falling back to Type1.'); 35827 case 'Type1': 35828 case 'CIDFontType0': 35829 this.mimetype = 'font/opentype'; 35830 var cff = subtype === 'Type1C' || subtype === 'CIDFontType0C' ? new CFFFont(file, properties) : new Type1Font(name, file, properties); 35831 adjustWidths(properties); 35832 data = this.convert(name, cff, properties); 35833 break; 35834 case 'OpenType': 35835 case 'TrueType': 35836 case 'CIDFontType2': 35837 this.mimetype = 'font/opentype'; 35838 data = this.checkAndRepair(name, file, properties); 35839 if (this.isOpenType) { 35840 adjustWidths(properties); 35841 type = 'OpenType'; 35842 } 35843 break; 35844 default: 35845 throw new _util.FormatError('Font ' + type + ' is not supported'); 35846 } 35847 } catch (e) { 35848 if (!(e instanceof _util.FormatError)) { 35849 throw e; 35850 } 35851 (0, _util.warn)(e); 35852 this.fallbackToSystemFont(); 35853 return; 35854 } 35855 this.data = data; 35856 this.fontType = getFontType(type, subtype); 35857 this.fontMatrix = properties.fontMatrix; 35858 this.widths = properties.widths; 35859 this.defaultWidth = properties.defaultWidth; 35860 this.toUnicode = properties.toUnicode; 35861 this.encoding = properties.baseEncoding; 35862 this.seacMap = properties.seacMap; 35863 this.loading = true; 35864 } 35865 Font.getFontID = function () { 35866 var ID = 1; 35867 return function Font_getFontID() { 35868 return String(ID++); 35869 }; 35870 }(); 35871 function int16(b0, b1) { 35872 return (b0 << 8) + b1; 35873 } 35874 function signedInt16(b0, b1) { 35875 var value = (b0 << 8) + b1; 35876 return value & 1 << 15 ? value - 0x10000 : value; 35877 } 35878 function int32(b0, b1, b2, b3) { 35879 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 35880 } 35881 function string16(value) { 35882 return String.fromCharCode(value >> 8 & 0xff, value & 0xff); 35883 } 35884 function safeString16(value) { 35885 value = value > 0x7FFF ? 0x7FFF : value < -0x8000 ? -0x8000 : value; 35886 return String.fromCharCode(value >> 8 & 0xff, value & 0xff); 35887 } 35888 function isTrueTypeFile(file) { 35889 var header = file.peekBytes(4); 35890 return (0, _util.readUint32)(header, 0) === 0x00010000; 35891 } 35892 function isOpenTypeFile(file) { 35893 var header = file.peekBytes(4); 35894 return (0, _util.bytesToString)(header) === 'OTTO'; 35895 } 35896 function isType1File(file) { 35897 var header = file.peekBytes(2); 35898 if (header[0] === 0x25 && header[1] === 0x21) { 35899 return true; 35900 } 35901 if (header[0] === 0x80 && header[1] === 0x01) { 35902 return true; 35903 } 35904 return false;
35905 } 35906 function buildToFontChar(encoding, glyphsUnicodeMap, differences) { 35907 var toFontChar = [], 35908 unicode; 35909 for (var i = 0, ii = encoding.length; i < ii; i++) { 35910 unicode = (0, _unicode.getUnicodeForGlyph)(encoding[i], glyphsUnicodeMap); 35911 if (unicode !== -1) { 35912 toFontChar[i] = unicode; 35913 } 35914 } 35915 for (var charCode in differences) { 35916 unicode = (0, _unicode.getUnicodeForGlyph)(differences[charCode], glyphsUnicodeMap); 35917 if (unicode !== -1) { 35918 toFontChar[+charCode] = unicode; 35919 } 35920 } 35921 return toFontChar; 35922 } 35923 function isProblematicUnicodeLocation(code) { 35924 var i = 0, 35925 j = ProblematicCharRanges.length - 1; 35926 while (i < j) { 35927 var c = i + j + 1 >> 1; 35928 if (code < ProblematicCharRanges[c]) { 35929 j = c - 1; 35930 } else { 35931 i = c; 35932 } 35933 } 35934 return !(i & 1); 35935 } 35936 function adjustMapping(charCodeToGlyphId, properties, missingGlyphs) { 35937 var toUnicode = properties.toUnicode; 35938 var isSymbolic = !!(properties.flags & FontFlags.Symbolic); 35939 var isIdentityUnicode = properties.toUnicode instanceof IdentityToUnicodeMap; 35940 var newMap = Object.create(null); 35941 var toFontChar = []; 35942 var usedFontCharCodes = []; 35943 var nextAvailableFontCharCode = PRIVATE_USE_OFFSET_START; 35944 for (var originalCharCode in charCodeToGlyphId) { 35945 originalCharCode |= 0; 35946 var glyphId = charCodeToGlyphId[originalCharCode]; 35947 if (missingGlyphs[glyphId]) { 35948 continue; 35949 } 35950 var fontCharCode = originalCharCode; 35951 var hasUnicodeValue = false; 35952 if (!isIdentityUnicode && toUnicode.has(originalCharCode)) { 35953 hasUnicodeValue = true; 35954 var unicode = toUnicode.get(fontCharCode); 35955 if (unicode.length === 1) { 35956 fontCharCode = unicode.charCodeAt(0); 35957 } 35958 } 35959 if (usedFontCharCodes[fontCharCode] !== undefined || isProblematicUnicodeLocation(fontCharCode) || isSymbolic && !hasUnicodeValue) { 35960 do { 35961 if (nextAvailableFontCharCode > PRIVATE_USE_OFFSET_END) { 35962 (0, _util.warn)('Ran out of space in font private use area.'); 35963 break; 35964 } 35965 fontCharCode = nextAvailableFontCharCode++; 35966 if (SKIP_PRIVATE_USE_RANGE_F000_TO_F01F && fontCharCode === 0xF000) { 35967 fontCharCode = 0xF020; 35968 nextAvailableFontCharCode = fontCharCode + 1; 35969 } 35970 } while (usedFontCharCodes[fontCharCode] !== undefined); 35971 } 35972 newMap[fontCharCode] = glyphId; 35973 toFontChar[originalCharCode] = fontCharCode; 35974 usedFontCharCodes[fontCharCode] = true; 35975 } 35976 return { 35977 toFontChar: toFontChar, 35978 charCodeToGlyphId: newMap, 35979 nextAvailableFontCharCode: nextAvailableFontCharCode 35980 }; 35981 } 35982 function getRanges(glyphs, numGlyphs) { 35983 var codes = []; 35984 for (var charCode in glyphs) { 35985 if (glyphs[charCode] >= numGlyphs) { 35986 continue; 35987 } 35988 codes.push({ 35989 fontCharCode: charCode | 0, 35990 glyphId: glyphs[charCode] 35991 }); 35992 } 35993 if (codes.length === 0) { 35994 codes.push({ 35995 fontCharCode: 0, 35996 glyphId: 0 35997 }); 35998 } 35999 codes.sort(function fontGetRangesSort(a, b) { 36000 return a.fontCharCode - b.fontCharCode; 36001 }); 36002 var ranges = []; 36003 var length = codes.length; 36004 for (var n = 0; n < length;) { 36005 var start = codes[n].fontCharCode; 36006 var codeIndices = [codes[n].glyphId]; 36007 ++n; 36008 var end = start; 36009 while (n < length && end + 1 === codes[n].fontCharCode) { 36010 codeIndices.push(codes[n].glyphId); 36011 ++end; 36012 ++n; 36013 if (end === 0xFFFF) { 36014 break; 36015 } 36016 } 36017 ranges.push([start, end, codeIndices]); 36018 } 36019 return ranges; 36020 } 36021 function createCmapTable(glyphs, numGlyphs) { 36022 var ranges = getRanges(glyphs, numGlyphs); 36023 var numTables = ranges[ranges.length - 1][1] > 0xFFFF ? 2 : 1; 36024 var cmap = '\x00\x00' + string16(numTables) + '\x00\x03' + '\x00\x01' + (0, _util.string32)(4 + numTables * 8); 36025 var i, ii, j, jj; 36026 for (i = ranges.length - 1; i >= 0; --i) { 36027 if (ranges[i][0] <= 0xFFFF) { 36028 break; 36029 } 36030 } 36031 var bmpLength = i + 1; 36032 if (ranges[i][0] < 0xFFFF && ranges[i][1] === 0xFFFF) { 36033 ranges[i][1] = 0xFFFE; 36034 } 36035 var trailingRangesCount = ranges[i][1] < 0xFFFF ? 1 : 0; 36036 var segCount = bmpLength + trailingRangesCount; 36037 var searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2); 36038 var startCount = ''; 36039 var endCount = ''; 36040 var idDeltas = ''; 36041 var idRangeOffsets = ''; 36042 var glyphsIds = ''; 36043 var bias = 0; 36044 var range, start, end, codes; 36045 for (i = 0, ii = bmpLength; i < ii; i++) { 36046 range = ranges[i]; 36047 start = range[0]; 36048 end = range[1]; 36049 startCount += string16(start); 36050 endCount += string16(end); 36051 codes = range[2]; 36052 var contiguous = true; 36053 for (j = 1, jj = codes.length; j < jj; ++j) { 36054 if (codes[j] !== codes[j - 1] + 1) { 36055 contiguous = false;
vendor: 6,319 bytes, lines 36056-36193
36056 break; 36057 } 36058 } 36059 if (!contiguous) { 36060 var offset = (segCount - i) * 2 + bias * 2; 36061 bias += end - start + 1; 36062 idDeltas += string16(0); 36063 idRangeOffsets += string16(offset); 36064 for (j = 0, jj = codes.length; j < jj; ++j) { 36065 glyphsIds += string16(codes[j]); 36066 } 36067 } else { 36068 var startCode = codes[0]; 36069 idDeltas += string16(startCode - start & 0xFFFF); 36070 idRangeOffsets += string16(0); 36071 } 36072 } 36073 if (trailingRangesCount > 0) { 36074 endCount += '\xFF\xFF'; 36075 startCount += '\xFF\xFF'; 36076 idDeltas += '\x00\x01'; 36077 idRangeOffsets += '\x00\x00'; 36078 } 36079 var format314 = '\x00\x00' + string16(2 * segCount) + string16(searchParams.range) + string16(searchParams.entry) + string16(searchParams.rangeShift) + endCount + '\x00\x00' + startCount + idDeltas + idRangeOffsets + glyphsIds; 36080 var format31012 = ''; 36081 var header31012 = ''; 36082 if (numTables > 1) { 36083 cmap += '\x00\x03' + '\x00\x0A' + (0, _util.string32)(4 + numTables * 8 + 4 + format314.length); 36084 format31012 = ''; 36085 for (i = 0, ii = ranges.length; i < ii; i++) { 36086 range = ranges[i]; 36087 start = range[0]; 36088 codes = range[2]; 36089 var code = codes[0]; 36090 for (j = 1, jj = codes.length; j < jj; ++j) { 36091 if (codes[j] !== codes[j - 1] + 1) { 36092 end = range[0] + j - 1; 36093 format31012 += (0, _util.string32)(start) + (0, _util.string32)(end) + (0, _util.string32)(code); 36094 start = end + 1; 36095 code = codes[j]; 36096 } 36097 } 36098 format31012 += (0, _util.string32)(start) + (0, _util.string32)(range[1]) + (0, _util.string32)(code); 36099 } 36100 header31012 = '\x00\x0C' + '\x00\x00' + (0, _util.string32)(format31012.length + 16) + '\x00\x00\x00\x00' + (0, _util.string32)(format31012.length / 12); 36101 } 36102 return cmap + '\x00\x04' + string16(format314.length + 4) + format314 + header31012 + format31012; 36103 } 36104 function validateOS2Table(os2) { 36105 var stream = new _stream.Stream(os2.data); 36106 var version = stream.getUint16(); 36107 stream.getBytes(60); 36108 var selection = stream.getUint16(); 36109 if (version < 4 && selection & 0x0300) { 36110 return false; 36111 } 36112 var firstChar = stream.getUint16(); 36113 var lastChar = stream.getUint16(); 36114 if (firstChar > lastChar) { 36115 return false; 36116 } 36117 stream.getBytes(6); 36118 var usWinAscent = stream.getUint16(); 36119 if (usWinAscent === 0) { 36120 return false; 36121 } 36122 os2.data[8] = os2.data[9] = 0; 36123 return true; 36124 } 36125 function createOS2Table(properties, charstrings, override) { 36126 override = override || { 36127 unitsPerEm: 0, 36128 yMax: 0, 36129 yMin: 0, 36130 ascent: 0, 36131 descent: 0 36132 }; 36133 var ulUnicodeRange1 = 0; 36134 var ulUnicodeRange2 = 0; 36135 var ulUnicodeRange3 = 0; 36136 var ulUnicodeRange4 = 0; 36137 var firstCharIndex = null; 36138 var lastCharIndex = 0; 36139 if (charstrings) { 36140 for (var code in charstrings) { 36141 code |= 0; 36142 if (firstCharIndex > code || !firstCharIndex) { 36143 firstCharIndex = code; 36144 } 36145 if (lastCharIndex < code) { 36146 lastCharIndex = code; 36147 } 36148 var position = (0, _unicode.getUnicodeRangeFor)(code); 36149 if (position < 32) { 36150 ulUnicodeRange1 |= 1 << position; 36151 } else if (position < 64) { 36152 ulUnicodeRange2 |= 1 << position - 32; 36153 } else if (position < 96) { 36154 ulUnicodeRange3 |= 1 << position - 64; 36155 } else if (position < 123) { 36156 ulUnicodeRange4 |= 1 << position - 96; 36157 } else { 36158 throw new _util.FormatError('Unicode ranges Bits > 123 are reserved for internal usage'); 36159 } 36160 } 36161 } else { 36162 firstCharIndex = 0; 36163 lastCharIndex = 255; 36164 } 36165 var bbox = properties.bbox || [0, 0, 0, 0]; 36166 var unitsPerEm = override.unitsPerEm || 1 / (properties.fontMatrix || _util.FONT_IDENTITY_MATRIX)[0]; 36167 var scale = properties.ascentScaled ? 1.0 : unitsPerEm / PDF_GLYPH_SPACE_UNITS; 36168 var typoAscent = override.ascent || Math.round(scale * (properties.ascent || bbox[3])); 36169 var typoDescent = override.descent || Math.round(scale * (properties.descent || bbox[1])); 36170 if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) { 36171 typoDescent = -typoDescent; 36172 } 36173 var winAscent = override.yMax || typoAscent; 36174 var winDescent = -override.yMin || -typoDescent; 36175 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'; 36176 } 36177 function createPostTable(properties) { 36178 var angle = Math.floor(properties.italicAngle * Math.pow(2, 16)); 36179 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'; 36180 } 36181 function createNameTable(name, proto) { 36182 if (!proto) { 36183 proto = [[], []]; 36184 } 36185 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']; 36186 var stringsUnicode = []; 36187 var i, ii, j, jj, str; 36188 for (i = 0, ii = strings.length; i < ii; i++) { 36189 str = proto[1][i] || strings[i]; 36190 var strBufUnicode = []; 36191 for (j = 0, jj = str.length; j < jj; j++) { 36192 strBufUnicode.push(string16(str.charCodeAt(j))); 36193 }
36194 stringsUnicode.push(strBufUnicode.join('')); 36195 } 36196 var names = [strings, stringsUnicode]; 36197 var platforms = ['\x00\x01', '\x00\x03']; 36198 var encodings = ['\x00\x00', '\x00\x01']; 36199 var languages = ['\x00\x00', '\x04\x09']; 36200 var namesRecordCount = strings.length * platforms.length; 36201 var nameTable = '\x00\x00' + string16(namesRecordCount) + string16(namesRecordCount * 12 + 6); 36202 var strOffset = 0; 36203 for (i = 0, ii = platforms.length; i < ii; i++) { 36204 var strs = names[i]; 36205 for (j = 0, jj = strs.length; j < jj; j++) { 36206 str = strs[j]; 36207 var nameRecord = platforms[i] + encodings[i] + languages[i] + string16(j) + string16(str.length) + string16(strOffset); 36208 nameTable += nameRecord; 36209 strOffset += str.length; 36210 } 36211 } 36212 nameTable += strings.join('') + stringsUnicode.join(''); 36213 return nameTable; 36214 } 36215 Font.prototype = { 36216 name: null, 36217 font: null, 36218 mimetype: null, 36219 encoding: null, 36220 get renderer() { 36221 var renderer = _font_renderer.FontRendererFactory.create(this, SEAC_ANALYSIS_ENABLED); 36222 return (0, _util.shadow)(this, 'renderer', renderer); 36223 }, 36224 exportData: function Font_exportData() { 36225 var data = {}; 36226 for (var i in this) { 36227 if (this.hasOwnProperty(i)) { 36228 data[i] = this[i]; 36229 } 36230 } 36231 return data; 36232 }, 36233 fallbackToSystemFont: function Font_fallbackToSystemFont() { 36234 var _this = this; 36235 36236 this.missingFile = true; 36237 var charCode, unicode; 36238 var name = this.name; 36239 var type = this.type; 36240 var subtype = this.subtype; 36241 var fontName = name.replace(/[,_]/g, '-'); 36242 var stdFontMap = (0, _standard_fonts.getStdFontMap)(), 36243 nonStdFontMap = (0, _standard_fonts.getNonStdFontMap)(); 36244 var isStandardFont = !!stdFontMap[fontName] || !!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]); 36245 fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName; 36246 this.bold = fontName.search(/bold/gi) !== -1; 36247 this.italic = fontName.search(/oblique/gi) !== -1 || fontName.search(/italic/gi) !== -1; 36248 this.black = name.search(/Black/g) !== -1; 36249 this.remeasure = Object.keys(this.widths).length > 0; 36250 if (isStandardFont && type === 'CIDFontType2' && this.cidEncoding.indexOf('Identity-') === 0) { 36251 var GlyphMapForStandardFonts = (0, _standard_fonts.getGlyphMapForStandardFonts)(); 36252 var map = []; 36253 for (charCode in GlyphMapForStandardFonts) { 36254 map[+charCode] = GlyphMapForStandardFonts[charCode]; 36255 } 36256 if (/Arial-?Black/i.test(name)) { 36257 var SupplementalGlyphMapForArialBlack = (0, _standard_fonts.getSupplementalGlyphMapForArialBlack)(); 36258 for (charCode in SupplementalGlyphMapForArialBlack) { 36259 map[+charCode] = SupplementalGlyphMapForArialBlack[charCode]; 36260 } 36261 } 36262 var isIdentityUnicode = this.toUnicode instanceof IdentityToUnicodeMap; 36263 if (!isIdentityUnicode) { 36264 this.toUnicode.forEach(function (charCode, unicodeCharCode) { 36265 map[+charCode] = unicodeCharCode; 36266 }); 36267 } 36268 this.toFontChar = map; 36269 this.toUnicode = new ToUnicodeMap(map); 36270 } else if (/Symbol/i.test(fontName)) { 36271 this.toFontChar = buildToFontChar(_encodings.SymbolSetEncoding, (0, _glyphlist.getGlyphsUnicode)(), this.differences); 36272 } else if (/Dingbats/i.test(fontName)) { 36273 if (/Wingdings/i.test(name)) { 36274 (0, _util.warn)('Non-embedded Wingdings font, falling back to ZapfDingbats.'); 36275 } 36276 this.toFontChar = buildToFontChar(_encodings.ZapfDingbatsEncoding, (0, _glyphlist.getDingbatsGlyphsUnicode)(), this.differences); 36277 } else if (isStandardFont) { 36278 this.toFontChar = buildToFontChar(this.defaultEncoding, (0, _glyphlist.getGlyphsUnicode)(), this.differences); 36279 } else { 36280 var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 36281 this.toUnicode.forEach(function (charCode, unicodeCharCode) { 36282 if (!_this.composite) { 36283 var glyphName = _this.differences[charCode] || _this.defaultEncoding[charCode]; 36284 unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap); 36285 if (unicode !== -1) { 36286 unicodeCharCode = unicode; 36287 } 36288 } 36289 _this.toFontChar[charCode] = unicodeCharCode; 36290 }); 36291 } 36292 this.loadedName = fontName.split('-')[0]; 36293 this.loading = false;
vendor: 5,486 bytes, lines 36294-36450
36294 this.fontType = getFontType(type, subtype); 36295 }, 36296 checkAndRepair: function Font_checkAndRepair(name, font, properties) { 36297 function readTableEntry(file) { 36298 var tag = (0, _util.bytesToString)(file.getBytes(4)); 36299 var checksum = file.getInt32() >>> 0; 36300 var offset = file.getInt32() >>> 0; 36301 var length = file.getInt32() >>> 0; 36302 var previousPosition = file.pos; 36303 file.pos = file.start ? file.start : 0; 36304 file.skip(offset); 36305 var data = file.getBytes(length); 36306 file.pos = previousPosition; 36307 if (tag === 'head') { 36308 data[8] = data[9] = data[10] = data[11] = 0; 36309 data[17] |= 0x20; 36310 } 36311 return { 36312 tag: tag, 36313 checksum: checksum, 36314 length: length, 36315 offset: offset, 36316 data: data 36317 }; 36318 } 36319 function readOpenTypeHeader(ttf) { 36320 return { 36321 version: (0, _util.bytesToString)(ttf.getBytes(4)), 36322 numTables: ttf.getUint16(), 36323 searchRange: ttf.getUint16(), 36324 entrySelector: ttf.getUint16(), 36325 rangeShift: ttf.getUint16() 36326 }; 36327 } 36328 function readCmapTable(cmap, font, isSymbolicFont, hasEncoding) { 36329 if (!cmap) { 36330 (0, _util.warn)('No cmap table available.'); 36331 return { 36332 platformId: -1, 36333 encodingId: -1, 36334 mappings: [], 36335 hasShortCmap: false 36336 }; 36337 } 36338 var segment; 36339 var start = (font.start ? font.start : 0) + cmap.offset; 36340 font.pos = start; 36341 font.getUint16(); 36342 var numTables = font.getUint16(); 36343 var potentialTable; 36344 var canBreak = false; 36345 for (var i = 0; i < numTables; i++) { 36346 var platformId = font.getUint16(); 36347 var encodingId = font.getUint16(); 36348 var offset = font.getInt32() >>> 0; 36349 var useTable = false; 36350 if (potentialTable && potentialTable.platformId === platformId && potentialTable.encodingId === encodingId) { 36351 continue; 36352 } 36353 if (platformId === 0 && encodingId === 0) { 36354 useTable = true; 36355 } else if (platformId === 1 && encodingId === 0) { 36356 useTable = true; 36357 } else if (platformId === 3 && encodingId === 1 && (hasEncoding || !potentialTable)) { 36358 useTable = true; 36359 if (!isSymbolicFont) { 36360 canBreak = true; 36361 } 36362 } else if (isSymbolicFont && platformId === 3 && encodingId === 0) { 36363 useTable = true; 36364 canBreak = true; 36365 } 36366 if (useTable) { 36367 potentialTable = { 36368 platformId: platformId, 36369 encodingId: encodingId, 36370 offset: offset 36371 }; 36372 } 36373 if (canBreak) { 36374 break; 36375 } 36376 } 36377 if (potentialTable) { 36378 font.pos = start + potentialTable.offset; 36379 } 36380 if (!potentialTable || font.peekByte() === -1) { 36381 (0, _util.warn)('Could not find a preferred cmap table.'); 36382 return { 36383 platformId: -1, 36384 encodingId: -1, 36385 mappings: [], 36386 hasShortCmap: false 36387 }; 36388 } 36389 var format = font.getUint16(); 36390 font.getUint16(); 36391 font.getUint16(); 36392 var hasShortCmap = false; 36393 var mappings = []; 36394 var j, glyphId; 36395 if (format === 0) { 36396 for (j = 0; j < 256; j++) { 36397 var index = font.getByte(); 36398 if (!index) { 36399 continue; 36400 } 36401 mappings.push({ 36402 charCode: j, 36403 glyphId: index 36404 }); 36405 } 36406 hasShortCmap = true; 36407 } else if (format === 4) { 36408 var segCount = font.getUint16() >> 1; 36409 font.getBytes(6); 36410 var segIndex, 36411 segments = []; 36412 for (segIndex = 0; segIndex < segCount; segIndex++) { 36413 segments.push({ end: font.getUint16() }); 36414 } 36415 font.getUint16(); 36416 for (segIndex = 0; segIndex < segCount; segIndex++) { 36417 segments[segIndex].start = font.getUint16(); 36418 } 36419 for (segIndex = 0; segIndex < segCount; segIndex++) { 36420 segments[segIndex].delta = font.getUint16(); 36421 } 36422 var offsetsCount = 0; 36423 for (segIndex = 0; segIndex < segCount; segIndex++) { 36424 segment = segments[segIndex]; 36425 var rangeOffset = font.getUint16(); 36426 if (!rangeOffset) { 36427 segment.offsetIndex = -1; 36428 continue; 36429 } 36430 var offsetIndex = (rangeOffset >> 1) - (segCount - segIndex); 36431 segment.offsetIndex = offsetIndex; 36432 offsetsCount = Math.max(offsetsCount, offsetIndex + segment.end - segment.start + 1); 36433 } 36434 var offsets = []; 36435 for (j = 0; j < offsetsCount; j++) { 36436 offsets.push(font.getUint16()); 36437 } 36438 for (segIndex = 0; segIndex < segCount; segIndex++) { 36439 segment = segments[segIndex]; 36440 start = segment.start; 36441 var end = segment.end; 36442 var delta = segment.delta; 36443 offsetIndex = segment.offsetIndex; 36444 for (j = start; j <= end; j++) { 36445 if (j === 0xFFFF) { 36446 continue; 36447 } 36448 glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start]; 36449 glyphId = glyphId + delta & 0xFFFF; 36450 mappings.push({
36451 charCode: j, 36452 glyphId: glyphId 36453 }); 36454 } 36455 } 36456 } else if (format === 6) { 36457 var firstCode = font.getUint16(); 36458 var entryCount = font.getUint16(); 36459 for (j = 0; j < entryCount; j++) { 36460 glyphId = font.getUint16(); 36461 var charCode = firstCode + j; 36462 mappings.push({ 36463 charCode: charCode, 36464 glyphId: glyphId 36465 }); 36466 } 36467 } else { 36468 (0, _util.warn)('cmap table has unsupported format: ' + format); 36469 return { 36470 platformId: -1, 36471 encodingId: -1, 36472 mappings: [], 36473 hasShortCmap: false 36474 }; 36475 } 36476 mappings.sort(function (a, b) { 36477 return a.charCode - b.charCode; 36478 }); 36479 for (i = 1; i < mappings.length; i++) { 36480 if (mappings[i - 1].charCode === mappings[i].charCode) { 36481 mappings.splice(i, 1); 36482 i--; 36483 } 36484 } 36485 return { 36486 platformId: potentialTable.platformId, 36487 encodingId: potentialTable.encodingId, 36488 mappings: mappings, 36489 hasShortCmap: hasShortCmap 36490 }; 36491 } 36492 function sanitizeMetrics(font, header, metrics, numGlyphs) { 36493 if (!header) { 36494 if (metrics) { 36495 metrics.data = null; 36496 } 36497 return; 36498 } 36499 font.pos = (font.start ? font.start : 0) + header.offset; 36500 font.pos += header.length - 2; 36501 var numOfMetrics = font.getUint16(); 36502 if (numOfMetrics > numGlyphs) { 36503 (0, _util.info)('The numOfMetrics (' + numOfMetrics + ') should not be ' + 'greater than the numGlyphs (' + numGlyphs + ')'); 36504 numOfMetrics = numGlyphs; 36505 header.data[34] = (numOfMetrics & 0xff00) >> 8; 36506 header.data[35] = numOfMetrics & 0x00ff; 36507 } 36508 var numOfSidebearings = numGlyphs - numOfMetrics; 36509 var numMissing = numOfSidebearings - (metrics.length - numOfMetrics * 4 >> 1); 36510 if (numMissing > 0) { 36511 var entries = new Uint8Array(metrics.length + numMissing * 2); 36512 entries.set(metrics.data); 36513 metrics.data = entries; 36514 } 36515 } 36516 function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, hintsValid) { 36517 var glyphProfile = { 36518 length: 0, 36519 sizeOfInstructions: 0 36520 }; 36521 if (sourceEnd - sourceStart <= 12) { 36522 return glyphProfile; 36523 } 36524 var glyf = source.subarray(sourceStart, sourceEnd); 36525 var contoursCount = glyf[0] << 8 | glyf[1]; 36526 if (contoursCount & 0x8000) { 36527 dest.set(glyf, destStart); 36528 glyphProfile.length = glyf.length; 36529 return glyphProfile; 36530 } 36531 var i, 36532 j = 10, 36533 flagsCount = 0; 36534 for (i = 0; i < contoursCount; i++) { 36535 var endPoint = glyf[j] << 8 | glyf[j + 1]; 36536 flagsCount = endPoint + 1; 36537 j += 2; 36538 } 36539 var instructionsStart = j; 36540 var instructionsLength = glyf[j] << 8 | glyf[j + 1]; 36541 glyphProfile.sizeOfInstructions = instructionsLength; 36542 j += 2 + instructionsLength; 36543 var instructionsEnd = j; 36544 var coordinatesLength = 0; 36545 for (i = 0; i < flagsCount; i++) { 36546 var flag = glyf[j++]; 36547 if (flag & 0xC0) { 36548 glyf[j - 1] = flag & 0x3F; 36549 } 36550 var xyLength = (flag & 2 ? 1 : flag & 16 ? 0 : 2) + (flag & 4 ? 1 : flag & 32 ? 0 : 2); 36551 coordinatesLength += xyLength; 36552 if (flag & 8) { 36553 var repeat = glyf[j++]; 36554 i += repeat; 36555 coordinatesLength += repeat * xyLength; 36556 } 36557 } 36558 if (coordinatesLength === 0) { 36559 return glyphProfile; 36560 } 36561 var glyphDataLength = j + coordinatesLength; 36562 if (glyphDataLength > glyf.length) { 36563 return glyphProfile; 36564 } 36565 if (!hintsValid && instructionsLength > 0) { 36566 dest.set(glyf.subarray(0, instructionsStart), destStart); 36567 dest.set([0, 0], destStart + instructionsStart);
36568 dest.set(glyf.subarray(instructionsEnd, glyphDataLength), destStart + instructionsStart + 2); 36569 glyphDataLength -= instructionsLength; 36570 if (glyf.length - glyphDataLength > 3) { 36571 glyphDataLength = glyphDataLength + 3 & ~3; 36572 } 36573 glyphProfile.length = glyphDataLength; 36574 return glyphProfile; 36575 } 36576 if (glyf.length - glyphDataLength > 3) { 36577 glyphDataLength = glyphDataLength + 3 & ~3; 36578 dest.set(glyf.subarray(0, glyphDataLength), destStart); 36579 glyphProfile.length = glyphDataLength; 36580 return glyphProfile; 36581 } 36582 dest.set(glyf, destStart); 36583 glyphProfile.length = glyf.length; 36584 return glyphProfile; 36585 } 36586 function sanitizeHead(head, numGlyphs, locaLength) { 36587 var data = head.data; 36588 var version = int32(data[0], data[1], data[2], data[3]); 36589 if (version >> 16 !== 1) { 36590 (0, _util.info)('Attempting to fix invalid version in head table: ' + version); 36591 data[0] = 0; 36592 data[1] = 1; 36593 data[2] = 0; 36594 data[3] = 0; 36595 } 36596 var indexToLocFormat = int16(data[50], data[51]); 36597 if (indexToLocFormat < 0 || indexToLocFormat > 1) { 36598 (0, _util.info)('Attempting to fix invalid indexToLocFormat in head table: ' + indexToLocFormat); 36599 var numGlyphsPlusOne = numGlyphs + 1; 36600 if (locaLength === numGlyphsPlusOne << 1) { 36601 data[50] = 0; 36602 data[51] = 0; 36603 } else if (locaLength === numGlyphsPlusOne << 2) { 36604 data[50] = 0; 36605 data[51] = 1; 36606 } else { 36607 throw new _util.FormatError('Could not fix indexToLocFormat: ' + indexToLocFormat); 36608 } 36609 } 36610 } 36611 function sanitizeGlyphLocations(loca, glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions) { 36612 var itemSize, itemDecode, itemEncode; 36613 if (isGlyphLocationsLong) { 36614 itemSize = 4; 36615 itemDecode = function fontItemDecodeLong(data, offset) { 36616 return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; 36617 }; 36618 itemEncode = function fontItemEncodeLong(data, offset, value) { 36619 data[offset] = value >>> 24 & 0xFF; 36620 data[offset + 1] = value >> 16 & 0xFF; 36621 data[offset + 2] = value >> 8 & 0xFF; 36622 data[offset + 3] = value & 0xFF; 36623 }; 36624 } else { 36625 itemSize = 2; 36626 itemDecode = function fontItemDecode(data, offset) { 36627 return data[offset] << 9 | data[offset + 1] << 1; 36628 }; 36629 itemEncode = function fontItemEncode(data, offset, value) { 36630 data[offset] = value >> 9 & 0xFF; 36631 data[offset + 1] = value >> 1 & 0xFF; 36632 }; 36633 } 36634 var locaData = loca.data; 36635 var locaDataSize = itemSize * (1 + numGlyphs); 36636 if (locaData.length !== locaDataSize) { 36637 locaData = new Uint8Array(locaDataSize); 36638 locaData.set(loca.data.subarray(0, locaDataSize)); 36639 loca.data = locaData; 36640 } 36641 var oldGlyfData = glyf.data; 36642 var oldGlyfDataLength = oldGlyfData.length; 36643 var newGlyfData = new Uint8Array(oldGlyfDataLength); 36644 var startOffset = itemDecode(locaData, 0); 36645 var writeOffset = 0; 36646 var missingGlyphs = Object.create(null); 36647 itemEncode(locaData, 0, writeOffset); 36648 var i, j; 36649 var locaCount = dupFirstEntry ? numGlyphs - 1 : numGlyphs; 36650 for (i = 0, j = itemSize; i < locaCount; i++, j += itemSize) { 36651 var endOffset = itemDecode(locaData, j); 36652 if (endOffset > oldGlyfDataLength && (oldGlyfDataLength + 3 & ~3) === endOffset) { 36653 endOffset = oldGlyfDataLength; 36654 } 36655 if (endOffset > oldGlyfDataLength) { 36656 startOffset = endOffset; 36657 } 36658 var glyphProfile = sanitizeGlyph(oldGlyfData, startOffset, endOffset, newGlyfData, writeOffset, hintsValid); 36659 var newLength = glyphProfile.length; 36660 if (newLength === 0) { 36661 missingGlyphs[i] = true; 36662 }
vendor: 11,683 bytes, lines 36663-36979
36663 if (glyphProfile.sizeOfInstructions > maxSizeOfInstructions) { 36664 maxSizeOfInstructions = glyphProfile.sizeOfInstructions; 36665 } 36666 writeOffset += newLength; 36667 itemEncode(locaData, j, writeOffset); 36668 startOffset = endOffset; 36669 } 36670 if (writeOffset === 0) { 36671 var simpleGlyph = new Uint8Array([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]); 36672 for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { 36673 itemEncode(locaData, j, simpleGlyph.length); 36674 } 36675 glyf.data = simpleGlyph; 36676 } else if (dupFirstEntry) { 36677 var firstEntryLength = itemDecode(locaData, itemSize); 36678 if (newGlyfData.length > firstEntryLength + writeOffset) { 36679 glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset); 36680 } else { 36681 glyf.data = new Uint8Array(firstEntryLength + writeOffset); 36682 glyf.data.set(newGlyfData.subarray(0, writeOffset)); 36683 } 36684 glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset); 36685 itemEncode(loca.data, locaData.length - itemSize, writeOffset + firstEntryLength); 36686 } else { 36687 glyf.data = newGlyfData.subarray(0, writeOffset); 36688 } 36689 return { 36690 missingGlyphs: missingGlyphs, 36691 maxSizeOfInstructions: maxSizeOfInstructions 36692 }; 36693 } 36694 function readPostScriptTable(post, properties, maxpNumGlyphs) { 36695 var start = (font.start ? font.start : 0) + post.offset; 36696 font.pos = start; 36697 var length = post.length, 36698 end = start + length; 36699 var version = font.getInt32(); 36700 font.getBytes(28); 36701 var glyphNames; 36702 var valid = true; 36703 var i; 36704 switch (version) { 36705 case 0x00010000: 36706 glyphNames = MacStandardGlyphOrdering; 36707 break; 36708 case 0x00020000: 36709 var numGlyphs = font.getUint16(); 36710 if (numGlyphs !== maxpNumGlyphs) { 36711 valid = false; 36712 break; 36713 } 36714 var glyphNameIndexes = []; 36715 for (i = 0; i < numGlyphs; ++i) { 36716 var index = font.getUint16(); 36717 if (index >= 32768) { 36718 valid = false; 36719 break; 36720 } 36721 glyphNameIndexes.push(index); 36722 } 36723 if (!valid) { 36724 break; 36725 } 36726 var customNames = []; 36727 var strBuf = []; 36728 while (font.pos < end) { 36729 var stringLength = font.getByte(); 36730 strBuf.length = stringLength; 36731 for (i = 0; i < stringLength; ++i) { 36732 strBuf[i] = String.fromCharCode(font.getByte()); 36733 } 36734 customNames.push(strBuf.join('')); 36735 } 36736 glyphNames = []; 36737 for (i = 0; i < numGlyphs; ++i) { 36738 var j = glyphNameIndexes[i]; 36739 if (j < 258) { 36740 glyphNames.push(MacStandardGlyphOrdering[j]); 36741 continue; 36742 } 36743 glyphNames.push(customNames[j - 258]); 36744 } 36745 break; 36746 case 0x00030000: 36747 break; 36748 default: 36749 (0, _util.warn)('Unknown/unsupported post table version ' + version); 36750 valid = false; 36751 if (properties.defaultEncoding) { 36752 glyphNames = properties.defaultEncoding; 36753 } 36754 break; 36755 } 36756 properties.glyphNames = glyphNames; 36757 return valid; 36758 } 36759 function readNameTable(nameTable) { 36760 var start = (font.start ? font.start : 0) + nameTable.offset; 36761 font.pos = start; 36762 var names = [[], []]; 36763 var length = nameTable.length, 36764 end = start + length; 36765 var format = font.getUint16(); 36766 var FORMAT_0_HEADER_LENGTH = 6; 36767 if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) { 36768 return names; 36769 } 36770 var numRecords = font.getUint16(); 36771 var stringsStart = font.getUint16(); 36772 var records = []; 36773 var NAME_RECORD_LENGTH = 12; 36774 var i, ii; 36775 for (i = 0; i < numRecords && font.pos + NAME_RECORD_LENGTH <= end; i++) { 36776 var r = { 36777 platform: font.getUint16(), 36778 encoding: font.getUint16(), 36779 language: font.getUint16(), 36780 name: font.getUint16(), 36781 length: font.getUint16(), 36782 offset: font.getUint16() 36783 }; 36784 if (r.platform === 1 && r.encoding === 0 && r.language === 0 || r.platform === 3 && r.encoding === 1 && r.language === 0x409) { 36785 records.push(r); 36786 } 36787 } 36788 for (i = 0, ii = records.length; i < ii; i++) { 36789 var record = records[i]; 36790 if (record.length <= 0) { 36791 continue; 36792 } 36793 var pos = start + stringsStart + record.offset; 36794 if (pos + record.length > end) { 36795 continue; 36796 } 36797 font.pos = pos; 36798 var nameIndex = record.name; 36799 if (record.encoding) { 36800 var str = ''; 36801 for (var j = 0, jj = record.length; j < jj; j += 2) { 36802 str += String.fromCharCode(font.getUint16()); 36803 } 36804 names[1][nameIndex] = str; 36805 } else { 36806 names[0][nameIndex] = (0, _util.bytesToString)(font.getBytes(record.length)); 36807 } 36808 } 36809 return names; 36810 } 36811 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]; 36812 function sanitizeTTProgram(table, ttContext) { 36813 var data = table.data; 36814 var i = 0, 36815 j, 36816 n, 36817 b, 36818 funcId, 36819 pc, 36820 lastEndf = 0, 36821 lastDeff = 0; 36822 var stack = []; 36823 var callstack = []; 36824 var functionsCalled = []; 36825 var tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions; 36826 var inFDEF = false, 36827 ifLevel = 0, 36828 inELSE = 0; 36829 for (var ii = data.length; i < ii;) { 36830 var op = data[i++]; 36831 if (op === 0x40) { 36832 n = data[i++]; 36833 if (inFDEF || inELSE) { 36834 i += n; 36835 } else { 36836 for (j = 0; j < n; j++) { 36837 stack.push(data[i++]); 36838 } 36839 } 36840 } else if (op === 0x41) { 36841 n = data[i++]; 36842 if (inFDEF || inELSE) { 36843 i += n * 2; 36844 } else { 36845 for (j = 0; j < n; j++) { 36846 b = data[i++]; 36847 stack.push(b << 8 | data[i++]); 36848 } 36849 } 36850 } else if ((op & 0xF8) === 0xB0) { 36851 n = op - 0xB0 + 1; 36852 if (inFDEF || inELSE) { 36853 i += n; 36854 } else { 36855 for (j = 0; j < n; j++) { 36856 stack.push(data[i++]); 36857 } 36858 } 36859 } else if ((op & 0xF8) === 0xB8) { 36860 n = op - 0xB8 + 1; 36861 if (inFDEF || inELSE) { 36862 i += n * 2; 36863 } else { 36864 for (j = 0; j < n; j++) { 36865 b = data[i++]; 36866 stack.push(b << 8 | data[i++]); 36867 } 36868 } 36869 } else if (op === 0x2B && !tooComplexToFollowFunctions) { 36870 if (!inFDEF && !inELSE) { 36871 funcId = stack[stack.length - 1]; 36872 ttContext.functionsUsed[funcId] = true; 36873 if (funcId in ttContext.functionsStackDeltas) { 36874 stack.length += ttContext.functionsStackDeltas[funcId]; 36875 } else if (funcId in ttContext.functionsDefined && functionsCalled.indexOf(funcId) < 0) { 36876 callstack.push({ 36877 data: data, 36878 i: i, 36879 stackTop: stack.length - 1 36880 }); 36881 functionsCalled.push(funcId); 36882 pc = ttContext.functionsDefined[funcId]; 36883 if (!pc) { 36884 (0, _util.warn)('TT: CALL non-existent function'); 36885 ttContext.hintsValid = false; 36886 return; 36887 } 36888 data = pc.data; 36889 i = pc.i; 36890 } 36891 } 36892 } else if (op === 0x2C && !tooComplexToFollowFunctions) { 36893 if (inFDEF || inELSE) { 36894 (0, _util.warn)('TT: nested FDEFs not allowed'); 36895 tooComplexToFollowFunctions = true; 36896 } 36897 inFDEF = true; 36898 lastDeff = i; 36899 funcId = stack.pop(); 36900 ttContext.functionsDefined[funcId] = { 36901 data: data, 36902 i: i 36903 }; 36904 } else if (op === 0x2D) { 36905 if (inFDEF) { 36906 inFDEF = false; 36907 lastEndf = i; 36908 } else { 36909 pc = callstack.pop(); 36910 if (!pc) { 36911 (0, _util.warn)('TT: ENDF bad stack'); 36912 ttContext.hintsValid = false; 36913 return; 36914 } 36915 funcId = functionsCalled.pop(); 36916 data = pc.data; 36917 i = pc.i; 36918 ttContext.functionsStackDeltas[funcId] = stack.length - pc.stackTop; 36919 } 36920 } else if (op === 0x89) { 36921 if (inFDEF || inELSE) { 36922 (0, _util.warn)('TT: nested IDEFs not allowed'); 36923 tooComplexToFollowFunctions = true; 36924 } 36925 inFDEF = true; 36926 lastDeff = i; 36927 } else if (op === 0x58) { 36928 ++ifLevel; 36929 } else if (op === 0x1B) { 36930 inELSE = ifLevel; 36931 } else if (op === 0x59) { 36932 if (inELSE === ifLevel) { 36933 inELSE = 0; 36934 } 36935 --ifLevel; 36936 } else if (op === 0x1C) { 36937 if (!inFDEF && !inELSE) { 36938 var offset = stack[stack.length - 1]; 36939 if (offset > 0) { 36940 i += offset - 1; 36941 } 36942 } 36943 } 36944 if (!inFDEF && !inELSE) { 36945 var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0; 36946 if (op >= 0x71 && op <= 0x75) { 36947 n = stack.pop(); 36948 if (!isNaN(n)) { 36949 stackDelta = -n * 2; 36950 } 36951 } 36952 while (stackDelta < 0 && stack.length > 0) { 36953 stack.pop(); 36954 stackDelta++; 36955 } 36956 while (stackDelta > 0) { 36957 stack.push(NaN); 36958 stackDelta--; 36959 } 36960 } 36961 } 36962 ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; 36963 var content = [data]; 36964 if (i > data.length) { 36965 content.push(new Uint8Array(i - data.length)); 36966 } 36967 if (lastDeff > lastEndf) { 36968 (0, _util.warn)('TT: complementing a missing function tail'); 36969 content.push(new Uint8Array([0x22, 0x2D])); 36970 } 36971 foldTTTable(table, content); 36972 } 36973 function checkInvalidFunctions(ttContext, maxFunctionDefs) { 36974 if (ttContext.tooComplexToFollowFunctions) { 36975 return; 36976 } 36977 if (ttContext.functionsDefined.length > maxFunctionDefs) { 36978 (0, _util.warn)('TT: more functions defined than expected'); 36979 ttContext.hintsValid = false;
36980 return; 36981 } 36982 for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { 36983 if (j > maxFunctionDefs) { 36984 (0, _util.warn)('TT: invalid function id: ' + j); 36985 ttContext.hintsValid = false; 36986 return; 36987 } 36988 if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) { 36989 (0, _util.warn)('TT: undefined function: ' + j); 36990 ttContext.hintsValid = false; 36991 return; 36992 } 36993 } 36994 } 36995 function foldTTTable(table, content) { 36996 if (content.length > 1) { 36997 var newLength = 0; 36998 var j, jj; 36999 for (j = 0, jj = content.length; j < jj; j++) { 37000 newLength += content[j].length; 37001 } 37002 newLength = newLength + 3 & ~3; 37003 var result = new Uint8Array(newLength); 37004 var pos = 0; 37005 for (j = 0, jj = content.length; j < jj; j++) { 37006 result.set(content[j], pos); 37007 pos += content[j].length; 37008 } 37009 table.data = result; 37010 table.length = newLength; 37011 } 37012 } 37013 function sanitizeTTPrograms(fpgm, prep, cvt, maxFunctionDefs) { 37014 var ttContext = { 37015 functionsDefined: [], 37016 functionsUsed: [], 37017 functionsStackDeltas: [], 37018 tooComplexToFollowFunctions: false, 37019 hintsValid: true 37020 }; 37021 if (fpgm) { 37022 sanitizeTTProgram(fpgm, ttContext); 37023 } 37024 if (prep) { 37025 sanitizeTTProgram(prep, ttContext); 37026 } 37027 if (fpgm) { 37028 checkInvalidFunctions(ttContext, maxFunctionDefs); 37029 } 37030 if (cvt && cvt.length & 1) { 37031 var cvtData = new Uint8Array(cvt.length + 1); 37032 cvtData.set(cvt.data); 37033 cvt.data = cvtData; 37034 } 37035 return ttContext.hintsValid; 37036 } 37037 font = new _stream.Stream(new Uint8Array(font.getBytes())); 37038 var VALID_TABLES = ['OS/2', 'cmap', 'head', 'hhea', 'hmtx', 'maxp', 'name', 'post', 'loca', 'glyf', 'fpgm', 'prep', 'cvt ', 'CFF ']; 37039 var header = readOpenTypeHeader(font); 37040 var numTables = header.numTables; 37041 var cff, cffFile; 37042 var tables = Object.create(null); 37043 tables['OS/2'] = null; 37044 tables['cmap'] = null; 37045 tables['head'] = null; 37046 tables['hhea'] = null; 37047 tables['hmtx'] = null; 37048 tables['maxp'] = null; 37049 tables['name'] = null; 37050 tables['post'] = null; 37051 var table; 37052 for (var i = 0; i < numTables; i++) { 37053 table = readTableEntry(font); 37054 if (VALID_TABLES.indexOf(table.tag) < 0) { 37055 continue; 37056 } 37057 if (table.length === 0) { 37058 continue; 37059 } 37060 tables[table.tag] = table; 37061 } 37062 var isTrueType = !tables['CFF ']; 37063 if (!isTrueType) { 37064 if (header.version === 'OTTO' && !(properties.composite && properties.cidToGidMap) || !tables['head'] || !tables['hhea'] || !tables['maxp'] || !tables['post']) { 37065 cffFile = new _stream.Stream(tables['CFF '].data); 37066 cff = new CFFFont(cffFile, properties); 37067 adjustWidths(properties); 37068 return this.convert(name, cff, properties); 37069 } 37070 delete tables['glyf']; 37071 delete tables['loca']; 37072 delete tables['fpgm']; 37073 delete tables['prep']; 37074 delete tables['cvt ']; 37075 this.isOpenType = true; 37076 } else { 37077 if (!tables['loca']) { 37078 throw new _util.FormatError('Required "loca" table is not found'); 37079 } 37080 if (!tables['glyf']) { 37081 (0, _util.warn)('Required "glyf" table is not found -- trying to recover.'); 37082 tables['glyf'] = { 37083 tag: 'glyf', 37084 data: new Uint8Array(0) 37085 }; 37086 } 37087 this.isOpenType = false;
vendor: 5,093 bytes, lines 37088-37197
37088 } 37089 if (!tables['maxp']) { 37090 throw new _util.FormatError('Required "maxp" table is not found'); 37091 } 37092 font.pos = (font.start || 0) + tables['maxp'].offset; 37093 var version = font.getInt32(); 37094 var numGlyphs = font.getUint16(); 37095 var maxFunctionDefs = 0; 37096 var maxSizeOfInstructions = 0; 37097 if (version >= 0x00010000 && tables['maxp'].length >= 22) { 37098 font.pos += 8; 37099 var maxZones = font.getUint16(); 37100 if (maxZones > 2) { 37101 tables['maxp'].data[14] = 0; 37102 tables['maxp'].data[15] = 2; 37103 } 37104 font.pos += 4; 37105 maxFunctionDefs = font.getUint16(); 37106 font.pos += 6; 37107 maxSizeOfInstructions = font.getUint16(); 37108 } 37109 var dupFirstEntry = false; 37110 if (properties.type === 'CIDFontType2' && properties.toUnicode && properties.toUnicode.get(0) > '\0') { 37111 dupFirstEntry = true; 37112 numGlyphs++; 37113 tables['maxp'].data[4] = numGlyphs >> 8; 37114 tables['maxp'].data[5] = numGlyphs & 255; 37115 } 37116 var hintsValid = sanitizeTTPrograms(tables['fpgm'], tables['prep'], tables['cvt '], maxFunctionDefs); 37117 if (!hintsValid) { 37118 delete tables['fpgm']; 37119 delete tables['prep']; 37120 delete tables['cvt ']; 37121 } 37122 sanitizeMetrics(font, tables['hhea'], tables['hmtx'], numGlyphs); 37123 if (!tables['head']) { 37124 throw new _util.FormatError('Required "head" table is not found'); 37125 } 37126 sanitizeHead(tables['head'], numGlyphs, isTrueType ? tables['loca'].length : 0); 37127 var missingGlyphs = Object.create(null); 37128 if (isTrueType) { 37129 var isGlyphLocationsLong = int16(tables['head'].data[50], tables['head'].data[51]); 37130 var glyphsInfo = sanitizeGlyphLocations(tables['loca'], tables['glyf'], numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions); 37131 missingGlyphs = glyphsInfo.missingGlyphs; 37132 if (version >= 0x00010000 && tables['maxp'].length >= 22) { 37133 tables['maxp'].data[26] = glyphsInfo.maxSizeOfInstructions >> 8; 37134 tables['maxp'].data[27] = glyphsInfo.maxSizeOfInstructions & 255; 37135 } 37136 } 37137 if (!tables['hhea']) { 37138 throw new _util.FormatError('Required "hhea" table is not found'); 37139 } 37140 if (tables['hhea'].data[10] === 0 && tables['hhea'].data[11] === 0) { 37141 tables['hhea'].data[10] = 0xFF; 37142 tables['hhea'].data[11] = 0xFF; 37143 } 37144 var metricsOverride = { 37145 unitsPerEm: int16(tables['head'].data[18], tables['head'].data[19]), 37146 yMax: int16(tables['head'].data[42], tables['head'].data[43]), 37147 yMin: signedInt16(tables['head'].data[38], tables['head'].data[39]), 37148 ascent: int16(tables['hhea'].data[4], tables['hhea'].data[5]), 37149 descent: signedInt16(tables['hhea'].data[6], tables['hhea'].data[7]) 37150 }; 37151 this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm; 37152 this.descent = metricsOverride.descent / metricsOverride.unitsPerEm; 37153 if (tables['post']) { 37154 var valid = readPostScriptTable(tables['post'], properties, numGlyphs); 37155 if (!valid) { 37156 tables['post'] = null; 37157 } 37158 } 37159 var charCodeToGlyphId = [], 37160 charCode; 37161 function hasGlyph(glyphId) { 37162 return !missingGlyphs[glyphId]; 37163 } 37164 if (properties.composite) { 37165 var cidToGidMap = properties.cidToGidMap || []; 37166 var isCidToGidMapEmpty = cidToGidMap.length === 0; 37167 properties.cMap.forEach(function (charCode, cid) { 37168 if (cid > 0xffff) { 37169 throw new _util.FormatError('Max size of CID is 65,535'); 37170 } 37171 var glyphId = -1; 37172 if (isCidToGidMapEmpty) { 37173 glyphId = cid; 37174 } else if (cidToGidMap[cid] !== undefined) { 37175 glyphId = cidToGidMap[cid]; 37176 } 37177 if (glyphId >= 0 && glyphId < numGlyphs && hasGlyph(glyphId)) { 37178 charCodeToGlyphId[charCode] = glyphId; 37179 } 37180 }); 37181 if (dupFirstEntry && (isCidToGidMapEmpty || !charCodeToGlyphId[0])) { 37182 charCodeToGlyphId[0] = numGlyphs - 1; 37183 } 37184 } else { 37185 var cmapTable = readCmapTable(tables['cmap'], font, this.isSymbolicFont, properties.hasEncoding); 37186 var cmapPlatformId = cmapTable.platformId; 37187 var cmapEncodingId = cmapTable.encodingId; 37188 var cmapMappings = cmapTable.mappings; 37189 var cmapMappingsLength = cmapMappings.length; 37190 if (properties.hasEncoding && (cmapPlatformId === 3 && cmapEncodingId === 1 || cmapPlatformId === 1 && cmapEncodingId === 0) || cmapPlatformId === -1 && cmapEncodingId === -1 && !!(0, _encodings.getEncoding)(properties.baseEncodingName)) { 37191 var baseEncoding = []; 37192 if (properties.baseEncodingName === 'MacRomanEncoding' || properties.baseEncodingName === 'WinAnsiEncoding') { 37193 baseEncoding = (0, _encodings.getEncoding)(properties.baseEncodingName); 37194 } 37195 var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 37196 for (charCode = 0; charCode < 256; charCode++) { 37197 var glyphName, standardGlyphName;
37198 if (this.differences && charCode in this.differences) { 37199 glyphName = this.differences[charCode]; 37200 } else if (charCode in baseEncoding && baseEncoding[charCode] !== '') { 37201 glyphName = baseEncoding[charCode]; 37202 } else { 37203 glyphName = _encodings.StandardEncoding[charCode]; 37204 } 37205 if (!glyphName) { 37206 continue; 37207 } 37208 standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); 37209 var unicodeOrCharCode; 37210 if (cmapPlatformId === 3 && cmapEncodingId === 1) { 37211 unicodeOrCharCode = glyphsUnicodeMap[standardGlyphName]; 37212 } else if (cmapPlatformId === 1 && cmapEncodingId === 0) { 37213 unicodeOrCharCode = _encodings.MacRomanEncoding.indexOf(standardGlyphName); 37214 } 37215 var found = false; 37216 for (i = 0; i < cmapMappingsLength; ++i) { 37217 if (cmapMappings[i].charCode !== unicodeOrCharCode) { 37218 continue; 37219 } 37220 charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; 37221 found = true; 37222 break; 37223 } 37224 if (!found && properties.glyphNames) { 37225 var glyphId = properties.glyphNames.indexOf(glyphName); 37226 if (glyphId === -1 && standardGlyphName !== glyphName) { 37227 glyphId = properties.glyphNames.indexOf(standardGlyphName); 37228 } 37229 if (glyphId > 0 && hasGlyph(glyphId)) { 37230 charCodeToGlyphId[charCode] = glyphId; 37231 found = true; 37232 } 37233 } 37234 } 37235 } else if (cmapPlatformId === 0 && cmapEncodingId === 0) { 37236 for (i = 0; i < cmapMappingsLength; ++i) { 37237 charCodeToGlyphId[cmapMappings[i].charCode] = cmapMappings[i].glyphId; 37238 } 37239 } else { 37240 for (i = 0; i < cmapMappingsLength; ++i) { 37241 charCode = cmapMappings[i].charCode; 37242 if (cmapPlatformId === 3 && charCode >= 0xF000 && charCode <= 0xF0FF) { 37243 charCode &= 0xFF; 37244 } 37245 charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; 37246 } 37247 } 37248 } 37249 if (charCodeToGlyphId.length === 0) { 37250 charCodeToGlyphId[0] = 0; 37251 } 37252 var newMapping = adjustMapping(charCodeToGlyphId, properties, missingGlyphs); 37253 this.toFontChar = newMapping.toFontChar; 37254 tables['cmap'] = { 37255 tag: 'cmap', 37256 data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphs) 37257 }; 37258 if (!tables['OS/2'] || !validateOS2Table(tables['OS/2'])) { 37259 tables['OS/2'] = { 37260 tag: 'OS/2', 37261 data: createOS2Table(properties, newMapping.charCodeToGlyphId, metricsOverride) 37262 }; 37263 } 37264 if (!tables['post']) { 37265 tables['post'] = { 37266 tag: 'post', 37267 data: createPostTable(properties) 37268 }; 37269 } 37270 if (!isTrueType) { 37271 try { 37272 cffFile = new _stream.Stream(tables['CFF '].data); 37273 var parser = new _cff_parser.CFFParser(cffFile, properties, SEAC_ANALYSIS_ENABLED); 37274 cff = parser.parse(); 37275 var compiler = new _cff_parser.CFFCompiler(cff); 37276 tables['CFF '].data = compiler.compile(); 37277 } catch (e) { 37278 (0, _util.warn)('Failed to compile font ' + properties.loadedName); 37279 } 37280 } 37281 if (!tables['name']) { 37282 tables['name'] = { 37283 tag: 'name', 37284 data: createNameTable(this.name) 37285 }; 37286 } else { 37287 var namePrototype = readNameTable(tables['name']); 37288 tables['name'].data = createNameTable(name, namePrototype); 37289 } 37290 var builder = new OpenTypeFileBuilder(header.version); 37291 for (var tableTag in tables) { 37292 builder.addTable(tableTag, tables[tableTag].data); 37293 } 37294 return builder.toArray(); 37295 }, 37296 convert: function Font_convert(fontName, font, properties) { 37297 properties.fixedPitch = false; 37298 if (properties.builtInEncoding) { 37299 adjustToUnicode(properties, properties.builtInEncoding); 37300 } 37301 var mapping = font.getGlyphMapping(properties); 37302 var newMapping = adjustMapping(mapping, properties, Object.create(null)); 37303 this.toFontChar = newMapping.toFontChar; 37304 var numGlyphs = font.numGlyphs; 37305 function getCharCodes(charCodeToGlyphId, glyphId) {
vendor: 5,548 bytes, lines 37306-37427
37306 var charCodes = null; 37307 for (var charCode in charCodeToGlyphId) { 37308 if (glyphId === charCodeToGlyphId[charCode]) { 37309 if (!charCodes) { 37310 charCodes = []; 37311 } 37312 charCodes.push(charCode | 0); 37313 } 37314 } 37315 return charCodes; 37316 } 37317 function createCharCode(charCodeToGlyphId, glyphId) { 37318 for (var charCode in charCodeToGlyphId) { 37319 if (glyphId === charCodeToGlyphId[charCode]) { 37320 return charCode | 0; 37321 } 37322 } 37323 newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = glyphId; 37324 return newMapping.nextAvailableFontCharCode++; 37325 } 37326 var seacs = font.seacs; 37327 if (SEAC_ANALYSIS_ENABLED && seacs && seacs.length) { 37328 var matrix = properties.fontMatrix || _util.FONT_IDENTITY_MATRIX; 37329 var charset = font.getCharset(); 37330 var seacMap = Object.create(null); 37331 for (var glyphId in seacs) { 37332 glyphId |= 0; 37333 var seac = seacs[glyphId]; 37334 var baseGlyphName = _encodings.StandardEncoding[seac[2]]; 37335 var accentGlyphName = _encodings.StandardEncoding[seac[3]]; 37336 var baseGlyphId = charset.indexOf(baseGlyphName); 37337 var accentGlyphId = charset.indexOf(accentGlyphName); 37338 if (baseGlyphId < 0 || accentGlyphId < 0) { 37339 continue; 37340 } 37341 var accentOffset = { 37342 x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4], 37343 y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] 37344 }; 37345 var charCodes = getCharCodes(mapping, glyphId); 37346 if (!charCodes) { 37347 continue; 37348 } 37349 for (var i = 0, ii = charCodes.length; i < ii; i++) { 37350 var charCode = charCodes[i]; 37351 var charCodeToGlyphId = newMapping.charCodeToGlyphId; 37352 var baseFontCharCode = createCharCode(charCodeToGlyphId, baseGlyphId); 37353 var accentFontCharCode = createCharCode(charCodeToGlyphId, accentGlyphId); 37354 seacMap[charCode] = { 37355 baseFontCharCode: baseFontCharCode, 37356 accentFontCharCode: accentFontCharCode, 37357 accentOffset: accentOffset 37358 }; 37359 } 37360 } 37361 properties.seacMap = seacMap; 37362 } 37363 var unitsPerEm = 1 / (properties.fontMatrix || _util.FONT_IDENTITY_MATRIX)[0]; 37364 var builder = new OpenTypeFileBuilder('\x4F\x54\x54\x4F'); 37365 builder.addTable('CFF ', font.data); 37366 builder.addTable('OS/2', createOS2Table(properties, newMapping.charCodeToGlyphId)); 37367 builder.addTable('cmap', createCmapTable(newMapping.charCodeToGlyphId, numGlyphs)); 37368 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'); 37369 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)); 37370 builder.addTable('hmtx', function fontFieldsHmtx() { 37371 var charstrings = font.charstrings; 37372 var cffWidths = font.cff ? font.cff.widths : null; 37373 var hmtx = '\x00\x00\x00\x00'; 37374 for (var i = 1, ii = numGlyphs; i < ii; i++) { 37375 var width = 0; 37376 if (charstrings) { 37377 var charstring = charstrings[i - 1]; 37378 width = 'width' in charstring ? charstring.width : 0; 37379 } else if (cffWidths) { 37380 width = Math.ceil(cffWidths[i] || 0); 37381 } 37382 hmtx += string16(width) + string16(0); 37383 } 37384 return hmtx; 37385 }()); 37386 builder.addTable('maxp', '\x00\x00\x50\x00' + string16(numGlyphs)); 37387 builder.addTable('name', createNameTable(fontName)); 37388 builder.addTable('post', createPostTable(properties)); 37389 return builder.toArray(); 37390 }, 37391 get spaceWidth() { 37392 if ('_shadowWidth' in this) { 37393 return this._shadowWidth; 37394 } 37395 var possibleSpaceReplacements = ['space', 'minus', 'one', 'i', 'I']; 37396 var width; 37397 for (var i = 0, ii = possibleSpaceReplacements.length; i < ii; i++) { 37398 var glyphName = possibleSpaceReplacements[i]; 37399 if (glyphName in this.widths) { 37400 width = this.widths[glyphName]; 37401 break; 37402 } 37403 var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 37404 var glyphUnicode = glyphsUnicodeMap[glyphName]; 37405 var charcode = 0; 37406 if (this.composite) { 37407 if (this.cMap.contains(glyphUnicode)) { 37408 charcode = this.cMap.lookup(glyphUnicode); 37409 } 37410 } 37411 if (!charcode && this.toUnicode) { 37412 charcode = this.toUnicode.charCodeOf(glyphUnicode); 37413 } 37414 if (charcode <= 0) { 37415 charcode = glyphUnicode; 37416 } 37417 width = this.widths[charcode]; 37418 if (width) { 37419 break; 37420 } 37421 } 37422 width = width || this.defaultWidth; 37423 this._shadowWidth = width; 37424 return width; 37425 }, 37426 charToGlyph: function Font_charToGlyph(charcode, isSpace) { 37427 var fontCharCode, width, operatorListId;
37428 var widthCode = charcode; 37429 if (this.cMap && this.cMap.contains(charcode)) { 37430 widthCode = this.cMap.lookup(charcode); 37431 } 37432 width = this.widths[widthCode]; 37433 width = (0, _util.isNum)(width) ? width : this.defaultWidth; 37434 var vmetric = this.vmetrics && this.vmetrics[widthCode]; 37435 var unicode = this.toUnicode.get(charcode) || charcode; 37436 if (typeof unicode === 'number') { 37437 unicode = String.fromCharCode(unicode); 37438 } 37439 var isInFont = charcode in this.toFontChar; 37440 fontCharCode = this.toFontChar[charcode] || charcode; 37441 if (this.missingFile) { 37442 fontCharCode = (0, _unicode.mapSpecialUnicodeValues)(fontCharCode); 37443 } 37444 if (this.isType3Font) { 37445 operatorListId = fontCharCode; 37446 } 37447 var accent = null; 37448 if (this.seacMap && this.seacMap[charcode]) { 37449 isInFont = true; 37450 var seac = this.seacMap[charcode]; 37451 fontCharCode = seac.baseFontCharCode; 37452 accent = { 37453 fontChar: String.fromCharCode(seac.accentFontCharCode), 37454 offset: seac.accentOffset 37455 }; 37456 } 37457 var fontChar = String.fromCharCode(fontCharCode); 37458 var glyph = this.glyphCache[charcode]; 37459 if (!glyph || !glyph.matchesForCache(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont)) { 37460 glyph = new Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont); 37461 this.glyphCache[charcode] = glyph; 37462 } 37463 return glyph; 37464 }, 37465 charsToGlyphs: function Font_charsToGlyphs(chars) { 37466 var charsCache = this.charsCache; 37467 var glyphs, glyph, charcode; 37468 if (charsCache) { 37469 glyphs = charsCache[chars]; 37470 if (glyphs) { 37471 return glyphs; 37472 } 37473 } 37474 if (!charsCache) { 37475 charsCache = this.charsCache = Object.create(null); 37476 } 37477 glyphs = []; 37478 var charsCacheKey = chars; 37479 var i = 0, 37480 ii; 37481 if (this.cMap) { 37482 var c = Object.create(null); 37483 while (i < chars.length) { 37484 this.cMap.readCharCode(chars, i, c); 37485 charcode = c.charcode; 37486 var length = c.length; 37487 i += length; 37488 var isSpace = length === 1 && chars.charCodeAt(i - 1) === 0x20; 37489 glyph = this.charToGlyph(charcode, isSpace); 37490 glyphs.push(glyph); 37491 } 37492 } else { 37493 for (i = 0, ii = chars.length; i < ii; ++i) { 37494 charcode = chars.charCodeAt(i); 37495 glyph = this.charToGlyph(charcode, charcode === 0x20); 37496 glyphs.push(glyph); 37497 } 37498 } 37499 return charsCache[charsCacheKey] = glyphs; 37500 } 37501 }; 37502 return Font; 37503}(); 37504var ErrorFont = function ErrorFontClosure() { 37505 function ErrorFont(error) { 37506 this.error = error; 37507 this.loadedName = 'g_font_error'; 37508 this.loading = false; 37509 } 37510 ErrorFont.prototype = { 37511 charsToGlyphs: function ErrorFont_charsToGlyphs() { 37512 return []; 37513 }, 37514 exportData: function ErrorFont_exportData() { 37515 return { error: this.error }; 37516 } 37517 }; 37518 return ErrorFont; 37519}(); 37520function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) { 37521 var charCodeToGlyphId = Object.create(null); 37522 var glyphId, charCode, baseEncoding; 37523 var isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); 37524 if (properties.baseEncodingName) { 37525 baseEncoding = (0, _encodings.getEncoding)(properties.baseEncodingName); 37526 for (charCode = 0; charCode < baseEncoding.length; charCode++) { 37527 glyphId = glyphNames.indexOf(baseEncoding[charCode]); 37528 if (glyphId >= 0) { 37529 charCodeToGlyphId[charCode] = glyphId; 37530 } else { 37531 charCodeToGlyphId[charCode] = 0; 37532 } 37533 } 37534 } else if (isSymbolicFont) { 37535 for (charCode in builtInEncoding) { 37536 charCodeToGlyphId[charCode] = builtInEncoding[charCode]; 37537 } 37538 } else { 37539 baseEncoding = _encodings.StandardEncoding; 37540 for (charCode = 0; charCode < baseEncoding.length; charCode++) { 37541 glyphId = glyphNames.indexOf(baseEncoding[charCode]); 37542 if (glyphId >= 0) { 37543 charCodeToGlyphId[charCode] = glyphId; 37544 } else { 37545 charCodeToGlyphId[charCode] = 0; 37546 } 37547 } 37548 } 37549 var differences = properties.differences, 37550 glyphsUnicodeMap; 37551 if (differences) { 37552 for (charCode in differences) { 37553 var glyphName = differences[charCode]; 37554 glyphId = glyphNames.indexOf(glyphName); 37555 if (glyphId === -1) { 37556 if (!glyphsUnicodeMap) { 37557 glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 37558 } 37559 var standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); 37560 if (standardGlyphName !== glyphName) { 37561 glyphId = glyphNames.indexOf(standardGlyphName); 37562 } 37563 } 37564 if (glyphId >= 0) {
37565 charCodeToGlyphId[charCode] = glyphId; 37566 } else { 37567 charCodeToGlyphId[charCode] = 0; 37568 } 37569 } 37570 } 37571 return charCodeToGlyphId; 37572} 37573var Type1Font = function Type1FontClosure() { 37574 function findBlock(streamBytes, signature, startIndex) { 37575 var streamBytesLength = streamBytes.length; 37576 var signatureLength = signature.length; 37577 var scanLength = streamBytesLength - signatureLength; 37578 var i = startIndex, 37579 j, 37580 found = false; 37581 while (i < scanLength) { 37582 j = 0; 37583 while (j < signatureLength && streamBytes[i + j] === signature[j]) { 37584 j++; 37585 } 37586 if (j >= signatureLength) { 37587 i += j; 37588 while (i < streamBytesLength && (0, _util.isSpace)(streamBytes[i])) { 37589 i++; 37590 } 37591 found = true; 37592 break; 37593 } 37594 i++; 37595 } 37596 return { 37597 found: found, 37598 length: i 37599 }; 37600 } 37601 function getHeaderBlock(stream, suggestedLength) { 37602 var EEXEC_SIGNATURE = [0x65, 0x65, 0x78, 0x65, 0x63]; 37603 var streamStartPos = stream.pos; 37604 var headerBytes, headerBytesLength, block; 37605 try { 37606 headerBytes = stream.getBytes(suggestedLength); 37607 headerBytesLength = headerBytes.length; 37608 } catch (ex) { 37609 if (ex instanceof _util.MissingDataException) { 37610 throw ex; 37611 } 37612 } 37613 if (headerBytesLength === suggestedLength) { 37614 block = findBlock(headerBytes, EEXEC_SIGNATURE, suggestedLength - 2 * EEXEC_SIGNATURE.length); 37615 if (block.found && block.length === suggestedLength) { 37616 return { 37617 stream: new _stream.Stream(headerBytes), 37618 length: suggestedLength 37619 }; 37620 } 37621 } 37622 (0, _util.warn)('Invalid "Length1" property in Type1 font -- trying to recover.'); 37623 stream.pos = streamStartPos; 37624 var SCAN_BLOCK_LENGTH = 2048; 37625 var actualLength; 37626 while (true) { 37627 var scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); 37628 block = findBlock(scanBytes, EEXEC_SIGNATURE, 0); 37629 if (block.length === 0) { 37630 break; 37631 } 37632 stream.pos += block.length; 37633 if (block.found) { 37634 actualLength = stream.pos - streamStartPos; 37635 break; 37636 } 37637 } 37638 stream.pos = streamStartPos; 37639 if (actualLength) { 37640 return { 37641 stream: new _stream.Stream(stream.getBytes(actualLength)), 37642 length: actualLength 37643 }; 37644 } 37645 (0, _util.warn)('Unable to recover "Length1" property in Type1 font -- using as is.'); 37646 return { 37647 stream: new _stream.Stream(stream.getBytes(suggestedLength)), 37648 length: suggestedLength 37649 }; 37650 } 37651 function getEexecBlock(stream, suggestedLength) { 37652 var eexecBytes = stream.getBytes(); 37653 return { 37654 stream: new _stream.Stream(eexecBytes), 37655 length: eexecBytes.length 37656 }; 37657 } 37658 function Type1Font(name, file, properties) { 37659 var PFB_HEADER_SIZE = 6; 37660 var headerBlockLength = properties.length1; 37661 var eexecBlockLength = properties.length2; 37662 var pfbHeader = file.peekBytes(PFB_HEADER_SIZE); 37663 var pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01; 37664 if (pfbHeaderPresent) { 37665 file.skip(PFB_HEADER_SIZE); 37666 headerBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; 37667 } 37668 var headerBlock = getHeaderBlock(file, headerBlockLength); 37669 headerBlockLength = headerBlock.length; 37670 var headerBlockParser = new _type1_parser.Type1Parser(headerBlock.stream, false, SEAC_ANALYSIS_ENABLED); 37671 headerBlockParser.extractFontHeader(properties); 37672 if (pfbHeaderPresent) { 37673 pfbHeader = file.getBytes(PFB_HEADER_SIZE); 37674 eexecBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; 37675 } 37676 var eexecBlock = getEexecBlock(file, eexecBlockLength); 37677 eexecBlockLength = eexecBlock.length; 37678 var eexecBlockParser = new _type1_parser.Type1Parser(eexecBlock.stream, true, SEAC_ANALYSIS_ENABLED); 37679 var data = eexecBlockParser.extractFontProgram(); 37680 for (var info in data.properties) { 37681 properties[info] = data.properties[info]; 37682 } 37683 var charstrings = data.charstrings; 37684 var type2Charstrings = this.getType2Charstrings(charstrings); 37685 var subrs = this.getType2Subrs(data.subrs); 37686 this.charstrings = charstrings; 37687 this.data = this.wrap(name, type2Charstrings, this.charstrings, subrs, properties);
37688 this.seacs = this.getSeacs(data.charstrings); 37689 } 37690 Type1Font.prototype = { 37691 get numGlyphs() { 37692 return this.charstrings.length + 1; 37693 }, 37694 getCharset: function Type1Font_getCharset() { 37695 var charset = ['.notdef']; 37696 var charstrings = this.charstrings; 37697 for (var glyphId = 0; glyphId < charstrings.length; glyphId++) { 37698 charset.push(charstrings[glyphId].glyphName); 37699 } 37700 return charset; 37701 }, 37702 getGlyphMapping: function Type1Font_getGlyphMapping(properties) { 37703 var charstrings = this.charstrings; 37704 var glyphNames = ['.notdef'], 37705 glyphId; 37706 for (glyphId = 0; glyphId < charstrings.length; glyphId++) { 37707 glyphNames.push(charstrings[glyphId].glyphName); 37708 } 37709 var encoding = properties.builtInEncoding; 37710 if (encoding) { 37711 var builtInEncoding = Object.create(null); 37712 for (var charCode in encoding) { 37713 glyphId = glyphNames.indexOf(encoding[charCode]); 37714 if (glyphId >= 0) { 37715 builtInEncoding[charCode] = glyphId; 37716 } 37717 } 37718 } 37719 return type1FontGlyphMapping(properties, builtInEncoding, glyphNames); 37720 }, 37721 getSeacs: function Type1Font_getSeacs(charstrings) { 37722 var i, ii; 37723 var seacMap = []; 37724 for (i = 0, ii = charstrings.length; i < ii; i++) { 37725 var charstring = charstrings[i]; 37726 if (charstring.seac) { 37727 seacMap[i + 1] = charstring.seac; 37728 } 37729 } 37730 return seacMap; 37731 }, 37732 getType2Charstrings: function Type1Font_getType2Charstrings(type1Charstrings) { 37733 var type2Charstrings = []; 37734 for (var i = 0, ii = type1Charstrings.length; i < ii; i++) { 37735 type2Charstrings.push(type1Charstrings[i].charstring); 37736 } 37737 return type2Charstrings; 37738 }, 37739 getType2Subrs: function Type1Font_getType2Subrs(type1Subrs) { 37740 var bias = 0; 37741 var count = type1Subrs.length; 37742 if (count < 1133) { 37743 bias = 107; 37744 } else if (count < 33769) { 37745 bias = 1131; 37746 } else { 37747 bias = 32768; 37748 } 37749 var type2Subrs = []; 37750 var i; 37751 for (i = 0; i < bias; i++) { 37752 type2Subrs.push([0x0B]); 37753 } 37754 for (i = 0; i < count; i++) { 37755 type2Subrs.push(type1Subrs[i]); 37756 } 37757 return type2Subrs; 37758 }, 37759 wrap: function Type1Font_wrap(name, glyphs, charstrings, subrs, properties) { 37760 var cff = new _cff_parser.CFF(); 37761 cff.header = new _cff_parser.CFFHeader(1, 0, 4, 4); 37762 cff.names = [name]; 37763 var topDict = new _cff_parser.CFFTopDict(); 37764 topDict.setByName('version', 391); 37765 topDict.setByName('Notice', 392); 37766 topDict.setByName('FullName', 393); 37767 topDict.setByName('FamilyName', 394); 37768 topDict.setByName('Weight', 395); 37769 topDict.setByName('Encoding', null); 37770 topDict.setByName('FontMatrix', properties.fontMatrix); 37771 topDict.setByName('FontBBox', properties.bbox); 37772 topDict.setByName('charset', null); 37773 topDict.setByName('CharStrings', null); 37774 topDict.setByName('Private', null); 37775 cff.topDict = topDict; 37776 var strings = new _cff_parser.CFFStrings(); 37777 strings.add('Version 0.11'); 37778 strings.add('See original notice'); 37779 strings.add(name); 37780 strings.add(name); 37781 strings.add('Medium'); 37782 cff.strings = strings; 37783 cff.globalSubrIndex = new _cff_parser.CFFIndex(); 37784 var count = glyphs.length; 37785 var charsetArray = [0]; 37786 var i, ii; 37787 for (i = 0; i < count; i++) { 37788 var index = _cff_parser.CFFStandardStrings.indexOf(charstrings[i].glyphName); 37789 if (index === -1) { 37790 index = 0; 37791 } 37792 charsetArray.push(index >> 8 & 0xff, index & 0xff); 37793 } 37794 cff.charset = new _cff_parser.CFFCharset(false, 0, [], charsetArray); 37795 var charStringsIndex = new _cff_parser.CFFIndex(); 37796 charStringsIndex.add([0x8B, 0x0E]); 37797 for (i = 0; i < count; i++) { 37798 var glyph = glyphs[i]; 37799 if (glyph.length === 0) { 37800 charStringsIndex.add([0x8B, 0x0E]); 37801 continue; 37802 } 37803 charStringsIndex.add(glyph); 37804 } 37805 cff.charStrings = charStringsIndex; 37806 var privateDict = new _cff_parser.CFFPrivateDict(); 37807 privateDict.setByName('Subrs', null); 37808 var fields = ['BlueValues', 'OtherBlues', 'FamilyBlues', 'FamilyOtherBlues', 'StemSnapH', 'StemSnapV', 'BlueShift', 'BlueFuzz', 'BlueScale', 'LanguageGroup', 'ExpansionFactor', 'ForceBold', 'StdHW', 'StdVW']; 37809 for (i = 0, ii = fields.length; i < ii; i++) { 37810 var field = fields[i]; 37811 if (!(field in properties.privateData)) { 37812 continue; 37813 } 37814 var value = properties.privateData[field]; 37815 if (Array.isArray(value)) { 37816 for (var j = value.length - 1; j > 0; j--) { 37817 value[j] -= value[j - 1]; 37818 } 37819 } 37820 privateDict.setByName(field, value); 37821 } 37822 cff.topDict.privateDict = privateDict; 37823 var subrIndex = new _cff_parser.CFFIndex(); 37824 for (i = 0, ii = subrs.length; i < ii; i++) { 37825 subrIndex.add(subrs[i]); 37826 } 37827 privateDict.subrsIndex = subrIndex; 37828 var compiler = new _cff_parser.CFFCompiler(cff); 37829 return compiler.compile(); 37830 } 37831 }; 37832 return Type1Font; 37833}(); 37834var CFFFont = function CFFFontClosure() { 37835 function CFFFont(file, properties) { 37836 this.properties = properties; 37837 var parser = new _cff_parser.CFFParser(file, properties, SEAC_ANALYSIS_ENABLED); 37838 this.cff = parser.parse(); 37839 var compiler = new _cff_parser.CFFCompiler(this.cff); 37840 this.seacs = this.cff.seacs; 37841 try { 37842 this.data = compiler.compile(); 37843 } catch (e) { 37844 (0, _util.warn)('Failed to compile font ' + properties.loadedName); 37845 this.data = file; 37846 } 37847 } 37848 CFFFont.prototype = { 37849 get numGlyphs() { 37850 return this.cff.charStrings.count; 37851 },
37852 getCharset: function CFFFont_getCharset() { 37853 return this.cff.charset.charset; 37854 }, 37855 getGlyphMapping: function CFFFont_getGlyphMapping() { 37856 var cff = this.cff; 37857 var properties = this.properties; 37858 var charsets = cff.charset.charset; 37859 var charCodeToGlyphId; 37860 var glyphId; 37861 if (properties.composite) { 37862 charCodeToGlyphId = Object.create(null); 37863 if (cff.isCIDFont) { 37864 for (glyphId = 0; glyphId < charsets.length; glyphId++) { 37865 var cid = charsets[glyphId]; 37866 var charCode = properties.cMap.charCodeOf(cid); 37867 charCodeToGlyphId[charCode] = glyphId; 37868 } 37869 } else { 37870 for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) { 37871 charCodeToGlyphId[glyphId] = glyphId; 37872 } 37873 } 37874 return charCodeToGlyphId; 37875 } 37876 var encoding = cff.encoding ? cff.encoding.encoding : null; 37877 charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets); 37878 return charCodeToGlyphId; 37879 } 37880 }; 37881 return CFFFont; 37882}(); 37883(function checkSeacSupport() { 37884 if (typeof navigator !== 'undefined' && /Windows/.test(navigator.userAgent)) { 37885 exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED = true; 37886 } 37887})(); 37888(function checkChromeWindows() { 37889 if (typeof navigator !== 'undefined' && /Windows.*Chrome/.test(navigator.userAgent)) { 37890 SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = true; 37891 } 37892})(); 37893exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED; 37894exports.PRIVATE_USE_OFFSET_START = PRIVATE_USE_OFFSET_START; 37895exports.PRIVATE_USE_OFFSET_END = PRIVATE_USE_OFFSET_END; 37896exports.ErrorFont = ErrorFont; 37897exports.Font = Font; 37898exports.FontFlags = FontFlags; 37899exports.ToUnicodeMap = ToUnicodeMap; 37900exports.IdentityToUnicodeMap = IdentityToUnicodeMap; 37901exports.ProblematicCharRanges = ProblematicCharRanges; 37902exports.getFontType = getFontType; 37903 37904/***/ }), 37905/* 115 */ 37906/***/ (function(module, exports, __w_pdfjs_require__) { 37907 37908"use strict"; 37909 37910 37911Object.defineProperty(exports, "__esModule", { 37912 value: true 37913}); 37914var 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']; 37915var 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']; 37916var 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']; 37917exports.ISOAdobeCharset = ISOAdobeCharset; 37918exports.ExpertCharset = ExpertCharset; 37919exports.ExpertSubsetCharset = ExpertSubsetCharset; 37920 37921/***/ }), 37922/* 116 */ 37923/***/ (function(module, exports, __w_pdfjs_require__) { 37924 37925"use strict"; 37926 37927 37928Object.defineProperty(exports, "__esModule", { 37929 value: true 37930}); 37931exports.FontRendererFactory = undefined; 37932 37933var _util = __w_pdfjs_require__(0); 37934 37935var _cff_parser = __w_pdfjs_require__(68); 37936 37937var _glyphlist = __w_pdfjs_require__(42); 37938 37939var _encodings = __w_pdfjs_require__(22); 37940 37941var _stream = __w_pdfjs_require__(5); 37942 37943var FontRendererFactory = function FontRendererFactoryClosure() { 37944 function getLong(data, offset) { 37945 return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; 37946 } 37947 function getUshort(data, offset) { 37948 return data[offset] << 8 | data[offset + 1]; 37949 } 37950 function parseCmap(data, start, end) {
37951 var offset = getUshort(data, start + 2) === 1 ? getLong(data, start + 8) : getLong(data, start + 16); 37952 var format = getUshort(data, start + offset); 37953 var ranges, p, i; 37954 if (format === 4) { 37955 getUshort(data, start + offset + 2); 37956 var segCount = getUshort(data, start + offset + 6) >> 1; 37957 p = start + offset + 14; 37958 ranges = []; 37959 for (i = 0; i < segCount; i++, p += 2) { 37960 ranges[i] = { end: getUshort(data, p) }; 37961 } 37962 p += 2; 37963 for (i = 0; i < segCount; i++, p += 2) { 37964 ranges[i].start = getUshort(data, p); 37965 } 37966 for (i = 0; i < segCount; i++, p += 2) { 37967 ranges[i].idDelta = getUshort(data, p); 37968 } 37969 for (i = 0; i < segCount; i++, p += 2) { 37970 var idOffset = getUshort(data, p); 37971 if (idOffset === 0) { 37972 continue; 37973 } 37974 ranges[i].ids = []; 37975 for (var j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) { 37976 ranges[i].ids[j] = getUshort(data, p + idOffset); 37977 idOffset += 2; 37978 } 37979 } 37980 return ranges; 37981 } else if (format === 12) { 37982 getLong(data, start + offset + 4); 37983 var groups = getLong(data, start + offset + 12); 37984 p = start + offset + 16; 37985 ranges = []; 37986 for (i = 0; i < groups; i++) { 37987 ranges.push({ 37988 start: getLong(data, p), 37989 end: getLong(data, p + 4), 37990 idDelta: getLong(data, p + 8) - getLong(data, p) 37991 }); 37992 p += 12; 37993 } 37994 return ranges; 37995 } 37996 throw new _util.FormatError('unsupported cmap: ' + format); 37997 } 37998 function parseCff(data, start, end, seacAnalysisEnabled) { 37999 var properties = {}; 38000 var parser = new _cff_parser.CFFParser(new _stream.Stream(data, start, end - start), properties, seacAnalysisEnabled); 38001 var cff = parser.parse(); 38002 return { 38003 glyphs: cff.charStrings.objects, 38004 subrs: cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex && cff.topDict.privateDict.subrsIndex.objects, 38005 gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects 38006 }; 38007 } 38008 function parseGlyfTable(glyf, loca, isGlyphLocationsLong) { 38009 var itemSize, itemDecode; 38010 if (isGlyphLocationsLong) { 38011 itemSize = 4; 38012 itemDecode = function fontItemDecodeLong(data, offset) { 38013 return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; 38014 }; 38015 } else { 38016 itemSize = 2; 38017 itemDecode = function fontItemDecode(data, offset) { 38018 return data[offset] << 9 | data[offset + 1] << 1; 38019 }; 38020 } 38021 var glyphs = []; 38022 var startOffset = itemDecode(loca, 0); 38023 for (var j = itemSize; j < loca.length; j += itemSize) { 38024 var endOffset = itemDecode(loca, j); 38025 glyphs.push(glyf.subarray(startOffset, endOffset)); 38026 startOffset = endOffset; 38027 } 38028 return glyphs; 38029 } 38030 function lookupCmap(ranges, unicode) { 38031 var code = unicode.charCodeAt(0), 38032 gid = 0; 38033 var l = 0, 38034 r = ranges.length - 1; 38035 while (l < r) { 38036 var c = l + r + 1 >> 1; 38037 if (code < ranges[c].start) { 38038 r = c - 1; 38039 } else { 38040 l = c; 38041 } 38042 } 38043 if (ranges[l].start <= code && code <= ranges[l].end) { 38044 gid = ranges[l].idDelta + (ranges[l].ids ? ranges[l].ids[code - ranges[l].start] : code) & 0xFFFF; 38045 } 38046 return { 38047 charCode: code, 38048 glyphId: gid 38049 }; 38050 } 38051 function compileGlyf(code, cmds, font) { 38052 function moveTo(x, y) { 38053 cmds.push({ 38054 cmd: 'moveTo', 38055 args: [x, y] 38056 }); 38057 } 38058 function lineTo(x, y) { 38059 cmds.push({ 38060 cmd: 'lineTo', 38061 args: [x, y] 38062 }); 38063 } 38064 function quadraticCurveTo(xa, ya, x, y) { 38065 cmds.push({ 38066 cmd: 'quadraticCurveTo', 38067 args: [xa, ya, x, y] 38068 }); 38069 } 38070 var i = 0; 38071 var numberOfContours = (code[i] << 24 | code[i + 1] << 16) >> 16; 38072 var flags; 38073 var x = 0, 38074 y = 0; 38075 i += 10; 38076 if (numberOfContours < 0) { 38077 do { 38078 flags = code[i] << 8 | code[i + 1]; 38079 var glyphIndex = code[i + 2] << 8 | code[i + 3]; 38080 i += 4; 38081 var arg1, arg2; 38082 if (flags & 0x01) { 38083 arg1 = (code[i] << 24 | code[i + 1] << 16) >> 16; 38084 arg2 = (code[i + 2] << 24 | code[i + 3] << 16) >> 16; 38085 i += 4; 38086 } else { 38087 arg1 = code[i++]; 38088 arg2 = code[i++]; 38089 } 38090 if (flags & 0x02) { 38091 x = arg1; 38092 y = arg2; 38093 } else { 38094 x = 0; 38095 y = 0; 38096 } 38097 var scaleX = 1, 38098 scaleY = 1, 38099 scale01 = 0, 38100 scale10 = 0; 38101 if (flags & 0x08) { 38102 scaleX = scaleY = (code[i] << 24 | code[i + 1] << 16) / 1073741824; 38103 i += 2; 38104 } else if (flags & 0x40) { 38105 scaleX = (code[i] << 24 | code[i + 1] << 16) / 1073741824; 38106 scaleY = (code[i + 2] << 24 | code[i + 3] << 16) / 1073741824; 38107 i += 4; 38108 } else if (flags & 0x80) { 38109 scaleX = (code[i] << 24 | code[i + 1] << 16) / 1073741824; 38110 scale01 = (code[i + 2] << 24 | code[i + 3] << 16) / 1073741824; 38111 scale10 = (code[i + 4] << 24 | code[i + 5] << 16) / 1073741824; 38112 scaleY = (code[i + 6] << 24 | code[i + 7] << 16) / 1073741824; 38113 i += 8; 38114 } 38115 var subglyph = font.glyphs[glyphIndex]; 38116 if (subglyph) { 38117 cmds.push({ cmd: 'save' }); 38118 cmds.push({ 38119 cmd: 'transform', 38120 args: [scaleX, scale01, scale10, scaleY, x, y] 38121 }); 38122 compileGlyf(subglyph, cmds, font); 38123 cmds.push({ cmd: 'restore' }); 38124 } 38125 } while (flags & 0x20); 38126 } else { 38127 var endPtsOfContours = []; 38128 var j, jj; 38129 for (j = 0; j < numberOfContours; j++) { 38130 endPtsOfContours.push(code[i] << 8 | code[i + 1]); 38131 i += 2; 38132 } 38133 var instructionLength = code[i] << 8 | code[i + 1]; 38134 i += 2 + instructionLength; 38135 var numberOfPoints = endPtsOfContours[endPtsOfContours.length - 1] + 1; 38136 var points = []; 38137 while (points.length < numberOfPoints) { 38138 flags = code[i++]; 38139 var repeat = 1; 38140 if (flags & 0x08) { 38141 repeat += code[i++]; 38142 } 38143 while (repeat-- > 0) { 38144 points.push({ flags: flags }); 38145 } 38146 } 38147 for (j = 0; j < numberOfPoints; j++) { 38148 switch (points[j].flags & 0x12) { 38149 case 0x00: 38150 x += (code[i] << 24 | code[i + 1] << 16) >> 16; 38151 i += 2; 38152 break; 38153 case 0x02: 38154 x -= code[i++]; 38155 break; 38156 case 0x12: 38157 x += code[i++]; 38158 break; 38159 } 38160 points[j].x = x; 38161 } 38162 for (j = 0; j < numberOfPoints; j++) { 38163 switch (points[j].flags & 0x24) { 38164 case 0x00: 38165 y += (code[i] << 24 | code[i + 1] << 16) >> 16; 38166 i += 2; 38167 break; 38168 case 0x04: 38169 y -= code[i++]; 38170 break; 38171 case 0x24: 38172 y += code[i++]; 38173 break; 38174 } 38175 points[j].y = y; 38176 } 38177 var startPoint = 0; 38178 for (i = 0; i < numberOfContours; i++) { 38179 var endPoint = endPtsOfContours[i]; 38180 var contour = points.slice(startPoint, endPoint + 1); 38181 if (contour[0].flags & 1) { 38182 contour.push(contour[0]); 38183 } else if (contour[contour.length - 1].flags & 1) { 38184 contour.unshift(contour[contour.length - 1]); 38185 } else { 38186 var p = { 38187 flags: 1, 38188 x: (contour[0].x + contour[contour.length - 1].x) / 2, 38189 y: (contour[0].y + contour[contour.length - 1].y) / 2 38190 }; 38191 contour.unshift(p); 38192 contour.push(p); 38193 } 38194 moveTo(contour[0].x, contour[0].y); 38195 for (j = 1, jj = contour.length; j < jj; j++) { 38196 if (contour[j].flags & 1) { 38197 lineTo(contour[j].x, contour[j].y); 38198 } else if (contour[j + 1].flags & 1) { 38199 quadraticCurveTo(contour[j].x, contour[j].y, contour[j + 1].x, contour[j + 1].y); 38200 j++; 38201 } else { 38202 quadraticCurveTo(contour[j].x, contour[j].y, (contour[j].x + contour[j + 1].x) / 2, (contour[j].y + contour[j + 1].y) / 2); 38203 } 38204 } 38205 startPoint = endPoint + 1; 38206 } 38207 } 38208 } 38209 function compileCharString(code, cmds, font) { 38210 var stack = []; 38211 var x = 0, 38212 y = 0; 38213 var stems = 0; 38214 function moveTo(x, y) { 38215 cmds.push({ 38216 cmd: 'moveTo', 38217 args: [x, y] 38218 }); 38219 } 38220 function lineTo(x, y) { 38221 cmds.push({ 38222 cmd: 'lineTo', 38223 args: [x, y] 38224 }); 38225 } 38226 function bezierCurveTo(x1, y1, x2, y2, x, y) { 38227 cmds.push({ 38228 cmd: 'bezierCurveTo', 38229 args: [x1, y1, x2, y2, x, y] 38230 }); 38231 } 38232 function parse(code) { 38233 var i = 0; 38234 while (i < code.length) { 38235 var stackClean = false;
vendor: 9,979 bytes, lines 38236-38536
38236 var v = code[i++]; 38237 var xa, xb, ya, yb, y1, y2, y3, n, subrCode; 38238 switch (v) { 38239 case 1: 38240 stems += stack.length >> 1; 38241 stackClean = true; 38242 break; 38243 case 3: 38244 stems += stack.length >> 1; 38245 stackClean = true; 38246 break; 38247 case 4: 38248 y += stack.pop(); 38249 moveTo(x, y); 38250 stackClean = true; 38251 break; 38252 case 5: 38253 while (stack.length > 0) { 38254 x += stack.shift(); 38255 y += stack.shift(); 38256 lineTo(x, y); 38257 } 38258 break; 38259 case 6: 38260 while (stack.length > 0) { 38261 x += stack.shift(); 38262 lineTo(x, y); 38263 if (stack.length === 0) { 38264 break; 38265 } 38266 y += stack.shift(); 38267 lineTo(x, y); 38268 } 38269 break; 38270 case 7: 38271 while (stack.length > 0) { 38272 y += stack.shift(); 38273 lineTo(x, y); 38274 if (stack.length === 0) { 38275 break; 38276 } 38277 x += stack.shift(); 38278 lineTo(x, y); 38279 } 38280 break; 38281 case 8: 38282 while (stack.length > 0) { 38283 xa = x + stack.shift(); 38284 ya = y + stack.shift(); 38285 xb = xa + stack.shift(); 38286 yb = ya + stack.shift(); 38287 x = xb + stack.shift(); 38288 y = yb + stack.shift(); 38289 bezierCurveTo(xa, ya, xb, yb, x, y); 38290 } 38291 break; 38292 case 10: 38293 n = stack.pop() + font.subrsBias; 38294 subrCode = font.subrs[n]; 38295 if (subrCode) { 38296 parse(subrCode); 38297 } 38298 break; 38299 case 11: 38300 return; 38301 case 12: 38302 v = code[i++]; 38303 switch (v) { 38304 case 34: 38305 xa = x + stack.shift(); 38306 xb = xa + stack.shift(); 38307 y1 = y + stack.shift(); 38308 x = xb + stack.shift(); 38309 bezierCurveTo(xa, y, xb, y1, x, y1); 38310 xa = x + stack.shift(); 38311 xb = xa + stack.shift(); 38312 x = xb + stack.shift(); 38313 bezierCurveTo(xa, y1, xb, y, x, y); 38314 break; 38315 case 35: 38316 xa = x + stack.shift(); 38317 ya = y + stack.shift(); 38318 xb = xa + stack.shift(); 38319 yb = ya + stack.shift(); 38320 x = xb + stack.shift(); 38321 y = yb + stack.shift(); 38322 bezierCurveTo(xa, ya, xb, yb, x, y); 38323 xa = x + stack.shift(); 38324 ya = y + stack.shift(); 38325 xb = xa + stack.shift(); 38326 yb = ya + stack.shift(); 38327 x = xb + stack.shift(); 38328 y = yb + stack.shift(); 38329 bezierCurveTo(xa, ya, xb, yb, x, y); 38330 stack.pop(); 38331 break; 38332 case 36: 38333 xa = x + stack.shift(); 38334 y1 = y + stack.shift(); 38335 xb = xa + stack.shift(); 38336 y2 = y1 + stack.shift(); 38337 x = xb + stack.shift(); 38338 bezierCurveTo(xa, y1, xb, y2, x, y2); 38339 xa = x + stack.shift(); 38340 xb = xa + stack.shift(); 38341 y3 = y2 + stack.shift(); 38342 x = xb + stack.shift(); 38343 bezierCurveTo(xa, y2, xb, y3, x, y); 38344 break; 38345 case 37: 38346 var x0 = x, 38347 y0 = y; 38348 xa = x + stack.shift(); 38349 ya = y + stack.shift(); 38350 xb = xa + stack.shift(); 38351 yb = ya + stack.shift(); 38352 x = xb + stack.shift(); 38353 y = yb + stack.shift(); 38354 bezierCurveTo(xa, ya, xb, yb, x, y); 38355 xa = x + stack.shift(); 38356 ya = y + stack.shift(); 38357 xb = xa + stack.shift(); 38358 yb = ya + stack.shift(); 38359 x = xb; 38360 y = yb; 38361 if (Math.abs(x - x0) > Math.abs(y - y0)) { 38362 x += stack.shift(); 38363 } else { 38364 y += stack.shift(); 38365 } 38366 bezierCurveTo(xa, ya, xb, yb, x, y); 38367 break; 38368 default: 38369 throw new _util.FormatError('unknown operator: 12 ' + v); 38370 } 38371 break; 38372 case 14: 38373 if (stack.length >= 4) { 38374 var achar = stack.pop(); 38375 var bchar = stack.pop(); 38376 y = stack.pop(); 38377 x = stack.pop(); 38378 cmds.push({ cmd: 'save' }); 38379 cmds.push({ 38380 cmd: 'translate', 38381 args: [x, y] 38382 }); 38383 var cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[_encodings.StandardEncoding[achar]])); 38384 compileCharString(font.glyphs[cmap.glyphId], cmds, font); 38385 cmds.push({ cmd: 'restore' }); 38386 cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[_encodings.StandardEncoding[bchar]])); 38387 compileCharString(font.glyphs[cmap.glyphId], cmds, font); 38388 } 38389 return; 38390 case 18: 38391 stems += stack.length >> 1; 38392 stackClean = true; 38393 break; 38394 case 19: 38395 stems += stack.length >> 1; 38396 i += stems + 7 >> 3; 38397 stackClean = true; 38398 break; 38399 case 20: 38400 stems += stack.length >> 1; 38401 i += stems + 7 >> 3; 38402 stackClean = true; 38403 break; 38404 case 21: 38405 y += stack.pop(); 38406 x += stack.pop(); 38407 moveTo(x, y); 38408 stackClean = true; 38409 break; 38410 case 22: 38411 x += stack.pop(); 38412 moveTo(x, y); 38413 stackClean = true; 38414 break; 38415 case 23: 38416 stems += stack.length >> 1; 38417 stackClean = true; 38418 break; 38419 case 24: 38420 while (stack.length > 2) { 38421 xa = x + stack.shift(); 38422 ya = y + stack.shift(); 38423 xb = xa + stack.shift(); 38424 yb = ya + stack.shift(); 38425 x = xb + stack.shift(); 38426 y = yb + stack.shift(); 38427 bezierCurveTo(xa, ya, xb, yb, x, y); 38428 } 38429 x += stack.shift(); 38430 y += stack.shift(); 38431 lineTo(x, y); 38432 break; 38433 case 25: 38434 while (stack.length > 6) { 38435 x += stack.shift(); 38436 y += stack.shift(); 38437 lineTo(x, y); 38438 } 38439 xa = x + stack.shift(); 38440 ya = y + stack.shift(); 38441 xb = xa + stack.shift(); 38442 yb = ya + stack.shift(); 38443 x = xb + stack.shift(); 38444 y = yb + stack.shift(); 38445 bezierCurveTo(xa, ya, xb, yb, x, y); 38446 break; 38447 case 26: 38448 if (stack.length % 2) { 38449 x += stack.shift(); 38450 } 38451 while (stack.length > 0) { 38452 xa = x; 38453 ya = y + stack.shift(); 38454 xb = xa + stack.shift(); 38455 yb = ya + stack.shift(); 38456 x = xb; 38457 y = yb + stack.shift(); 38458 bezierCurveTo(xa, ya, xb, yb, x, y); 38459 } 38460 break; 38461 case 27: 38462 if (stack.length % 2) { 38463 y += stack.shift(); 38464 } 38465 while (stack.length > 0) { 38466 xa = x + stack.shift(); 38467 ya = y; 38468 xb = xa + stack.shift(); 38469 yb = ya + stack.shift(); 38470 x = xb + stack.shift(); 38471 y = yb; 38472 bezierCurveTo(xa, ya, xb, yb, x, y); 38473 } 38474 break; 38475 case 28: 38476 stack.push((code[i] << 24 | code[i + 1] << 16) >> 16); 38477 i += 2; 38478 break; 38479 case 29: 38480 n = stack.pop() + font.gsubrsBias; 38481 subrCode = font.gsubrs[n]; 38482 if (subrCode) { 38483 parse(subrCode); 38484 } 38485 break; 38486 case 30: 38487 while (stack.length > 0) { 38488 xa = x; 38489 ya = y + stack.shift(); 38490 xb = xa + stack.shift(); 38491 yb = ya + stack.shift(); 38492 x = xb + stack.shift(); 38493 y = yb + (stack.length === 1 ? stack.shift() : 0); 38494 bezierCurveTo(xa, ya, xb, yb, x, y); 38495 if (stack.length === 0) { 38496 break; 38497 } 38498 xa = x + stack.shift(); 38499 ya = y; 38500 xb = xa + stack.shift(); 38501 yb = ya + stack.shift(); 38502 y = yb + stack.shift(); 38503 x = xb + (stack.length === 1 ? stack.shift() : 0); 38504 bezierCurveTo(xa, ya, xb, yb, x, y); 38505 } 38506 break; 38507 case 31: 38508 while (stack.length > 0) { 38509 xa = x + stack.shift(); 38510 ya = y; 38511 xb = xa + stack.shift(); 38512 yb = ya + stack.shift(); 38513 y = yb + stack.shift(); 38514 x = xb + (stack.length === 1 ? stack.shift() : 0); 38515 bezierCurveTo(xa, ya, xb, yb, x, y); 38516 if (stack.length === 0) { 38517 break; 38518 } 38519 xa = x; 38520 ya = y + stack.shift(); 38521 xb = xa + stack.shift(); 38522 yb = ya + stack.shift(); 38523 x = xb + stack.shift(); 38524 y = yb + (stack.length === 1 ? stack.shift() : 0); 38525 bezierCurveTo(xa, ya, xb, yb, x, y); 38526 } 38527 break; 38528 default: 38529 if (v < 32) { 38530 throw new _util.FormatError('unknown operator: ' + v); 38531 } 38532 if (v < 247) { 38533 stack.push(v - 139); 38534 } else if (v < 251) { 38535 stack.push((v - 247) * 256 + code[i++] + 108); 38536 } else if (v < 255) {
38537 stack.push(-(v - 251) * 256 - code[i++] - 108); 38538 } else { 38539 stack.push((code[i] << 24 | code[i + 1] << 16 | code[i + 2] << 8 | code[i + 3]) / 65536); 38540 i += 4; 38541 } 38542 break; 38543 } 38544 if (stackClean) { 38545 stack.length = 0; 38546 } 38547 } 38548 } 38549 parse(code); 38550 } 38551 var noop = ''; 38552 function CompiledFont(fontMatrix) { 38553 this.compiledGlyphs = Object.create(null); 38554 this.compiledCharCodeToGlyphId = Object.create(null); 38555 this.fontMatrix = fontMatrix; 38556 } 38557 CompiledFont.prototype = { 38558 getPathJs: function getPathJs(unicode) { 38559 var cmap = lookupCmap(this.cmap, unicode); 38560 var fn = this.compiledGlyphs[cmap.glyphId]; 38561 if (!fn) { 38562 fn = this.compileGlyph(this.glyphs[cmap.glyphId]); 38563 this.compiledGlyphs[cmap.glyphId] = fn; 38564 } 38565 if (this.compiledCharCodeToGlyphId[cmap.charCode] === undefined) { 38566 this.compiledCharCodeToGlyphId[cmap.charCode] = cmap.glyphId; 38567 } 38568 return fn; 38569 }, 38570 compileGlyph: function compileGlyph(code) { 38571 if (!code || code.length === 0 || code[0] === 14) { 38572 return noop; 38573 } 38574 var cmds = []; 38575 cmds.push({ cmd: 'save' }); 38576 cmds.push({ 38577 cmd: 'transform', 38578 args: this.fontMatrix.slice() 38579 }); 38580 cmds.push({ 38581 cmd: 'scale', 38582 args: ['size', '-size'] 38583 }); 38584 this.compileGlyphImpl(code, cmds); 38585 cmds.push({ cmd: 'restore' }); 38586 return cmds; 38587 }, 38588 compileGlyphImpl: function compileGlyphImpl() { 38589 throw new Error('Children classes should implement this.'); 38590 }, 38591 hasBuiltPath: function hasBuiltPath(unicode) { 38592 var cmap = lookupCmap(this.cmap, unicode); 38593 return this.compiledGlyphs[cmap.glyphId] !== undefined && this.compiledCharCodeToGlyphId[cmap.charCo
vendor: 9,157 bytes, lines 38593-38865
38593de] !== undefined; 38594 } 38595 }; 38596 function TrueTypeCompiled(glyphs, cmap, fontMatrix) { 38597 fontMatrix = fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0]; 38598 CompiledFont.call(this, fontMatrix); 38599 this.glyphs = glyphs; 38600 this.cmap = cmap; 38601 } 38602 _util.Util.inherit(TrueTypeCompiled, CompiledFont, { 38603 compileGlyphImpl: function compileGlyphImpl(code, cmds) { 38604 compileGlyf(code, cmds, this); 38605 } 38606 }); 38607 function Type2Compiled(cffInfo, cmap, fontMatrix, glyphNameMap) { 38608 fontMatrix = fontMatrix || [0.001, 0, 0, 0.001, 0, 0]; 38609 CompiledFont.call(this, fontMatrix); 38610 this.glyphs = cffInfo.glyphs; 38611 this.gsubrs = cffInfo.gsubrs || []; 38612 this.subrs = cffInfo.subrs || []; 38613 this.cmap = cmap; 38614 this.glyphNameMap = glyphNameMap || (0, _glyphlist.getGlyphsUnicode)(); 38615 this.gsubrsBias = this.gsubrs.length < 1240 ? 107 : this.gsubrs.length < 33900 ? 1131 : 32768; 38616 this.subrsBias = this.subrs.length < 1240 ? 107 : this.subrs.length < 33900 ? 1131 : 32768; 38617 } 38618 _util.Util.inherit(Type2Compiled, CompiledFont, { 38619 compileGlyphImpl: function compileGlyphImpl(code, cmds) { 38620 compileCharString(code, cmds, this); 38621 } 38622 }); 38623 return { 38624 create: function FontRendererFactory_create(font, seacAnalysisEnabled) { 38625 var data = new Uint8Array(font.data); 38626 var cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm; 38627 var numTables = getUshort(data, 4); 38628 for (var i = 0, p = 12; i < numTables; i++, p += 16) { 38629 var tag = (0, _util.bytesToString)(data.subarray(p, p + 4)); 38630 var offset = getLong(data, p + 8); 38631 var length = getLong(data, p + 12); 38632 switch (tag) { 38633 case 'cmap': 38634 cmap = parseCmap(data, offset, offset + length); 38635 break; 38636 case 'glyf': 38637 glyf = data.subarray(offset, offset + length); 38638 break; 38639 case 'loca': 38640 loca = data.subarray(offset, offset + length); 38641 break; 38642 case 'head': 38643 unitsPerEm = getUshort(data, offset + 18); 38644 indexToLocFormat = getUshort(data, offset + 50); 38645 break; 38646 case 'CFF ': 38647 cff = parseCff(data, offset, offset + length, seacAnalysisEnabled); 38648 break; 38649 } 38650 } 38651 if (glyf) { 38652 var fontMatrix = !unitsPerEm ? font.fontMatrix : [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0]; 38653 return new TrueTypeCompiled(parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); 38654 } 38655 return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap); 38656 } 38657 }; 38658}(); 38659exports.FontRendererFactory = FontRendererFactory; 38660 38661/***/ }), 38662/* 117 */ 38663/***/ (function(module, exports, __w_pdfjs_require__) { 38664 38665"use strict"; 38666 38667 38668Object.defineProperty(exports, "__esModule", { 38669 value: true 38670}); 38671exports.Type1Parser = undefined; 38672 38673var _util = __w_pdfjs_require__(0); 38674 38675var _encodings = __w_pdfjs_require__(22); 38676 38677var _stream = __w_pdfjs_require__(5); 38678 38679var HINTING_ENABLED = false; 38680var Type1CharString = function Type1CharStringClosure() { 38681 var COMMAND_MAP = { 38682 'hstem': [1], 38683 'vstem': [3], 38684 'vmoveto': [4], 38685 'rlineto': [5], 38686 'hlineto': [6], 38687 'vlineto': [7], 38688 'rrcurveto': [8], 38689 'callsubr': [10], 38690 'flex': [12, 35], 38691 'drop': [12, 18], 38692 'endchar': [14], 38693 'rmoveto': [21], 38694 'hmoveto': [22], 38695 'vhcurveto': [30], 38696 'hvcurveto': [31] 38697 }; 38698 function Type1CharString() { 38699 this.width = 0; 38700 this.lsb = 0; 38701 this.flexing = false; 38702 this.output = []; 38703 this.stack = []; 38704 } 38705 Type1CharString.prototype = { 38706 convert: function Type1CharString_convert(encoded, subrs, seacAnalysisEnabled) { 38707 var count = encoded.length; 38708 var error = false; 38709 var wx, sbx, subrNumber; 38710 for (var i = 0; i < count; i++) { 38711 var value = encoded[i]; 38712 if (value < 32) { 38713 if (value === 12) { 38714 value = (value << 8) + encoded[++i]; 38715 } 38716 switch (value) { 38717 case 1: 38718 if (!HINTING_ENABLED) { 38719 this.stack = []; 38720 break; 38721 } 38722 error = this.executeCommand(2, COMMAND_MAP.hstem); 38723 break; 38724 case 3: 38725 if (!HINTING_ENABLED) { 38726 this.stack = []; 38727 break; 38728 } 38729 error = this.executeCommand(2, COMMAND_MAP.vstem); 38730 break; 38731 case 4: 38732 if (this.flexing) { 38733 if (this.stack.length < 1) { 38734 error = true; 38735 break; 38736 } 38737 var dy = this.stack.pop(); 38738 this.stack.push(0, dy); 38739 break; 38740 } 38741 error = this.executeCommand(1, COMMAND_MAP.vmoveto); 38742 break; 38743 case 5: 38744 error = this.executeCommand(2, COMMAND_MAP.rlineto); 38745 break; 38746 case 6: 38747 error = this.executeCommand(1, COMMAND_MAP.hlineto); 38748 break; 38749 case 7: 38750 error = this.executeCommand(1, COMMAND_MAP.vlineto); 38751 break; 38752 case 8: 38753 error = this.executeCommand(6, COMMAND_MAP.rrcurveto); 38754 break; 38755 case 9: 38756 this.stack = []; 38757 break; 38758 case 10: 38759 if (this.stack.length < 1) { 38760 error = true; 38761 break; 38762 } 38763 subrNumber = this.stack.pop(); 38764 if (!subrs[subrNumber]) { 38765 error = true; 38766 break; 38767 } 38768 error = this.convert(subrs[subrNumber], subrs, seacAnalysisEnabled); 38769 break; 38770 case 11: 38771 return error; 38772 case 13: 38773 if (this.stack.length < 2) { 38774 error = true; 38775 break; 38776 } 38777 wx = this.stack.pop(); 38778 sbx = this.stack.pop(); 38779 this.lsb = sbx; 38780 this.width = wx; 38781 this.stack.push(wx, sbx); 38782 error = this.executeCommand(2, COMMAND_MAP.hmoveto); 38783 break; 38784 case 14: 38785 this.output.push(COMMAND_MAP.endchar[0]); 38786 break; 38787 case 21: 38788 if (this.flexing) { 38789 break; 38790 } 38791 error = this.executeCommand(2, COMMAND_MAP.rmoveto); 38792 break; 38793 case 22: 38794 if (this.flexing) { 38795 this.stack.push(0); 38796 break; 38797 } 38798 error = this.executeCommand(1, COMMAND_MAP.hmoveto); 38799 break; 38800 case 30: 38801 error = this.executeCommand(4, COMMAND_MAP.vhcurveto); 38802 break; 38803 case 31: 38804 error = this.executeCommand(4, COMMAND_MAP.hvcurveto); 38805 break; 38806 case (12 << 8) + 0: 38807 this.stack = []; 38808 break; 38809 case (12 << 8) + 1: 38810 if (!HINTING_ENABLED) { 38811 this.stack = []; 38812 break; 38813 } 38814 error = this.executeCommand(2, COMMAND_MAP.vstem); 38815 break; 38816 case (12 << 8) + 2: 38817 if (!HINTING_ENABLED) { 38818 this.stack = []; 38819 break; 38820 } 38821 error = this.executeCommand(2, COMMAND_MAP.hstem); 38822 break; 38823 case (12 << 8) + 6: 38824 if (seacAnalysisEnabled) { 38825 this.seac = this.stack.splice(-4, 4); 38826 error = this.executeCommand(0, COMMAND_MAP.endchar); 38827 } else { 38828 error = this.executeCommand(4, COMMAND_MAP.endchar); 38829 } 38830 break; 38831 case (12 << 8) + 7: 38832 if (this.stack.length < 4) { 38833 error = true; 38834 break; 38835 } 38836 this.stack.pop(); 38837 wx = this.stack.pop(); 38838 var sby = this.stack.pop(); 38839 sbx = this.stack.pop(); 38840 this.lsb = sbx; 38841 this.width = wx; 38842 this.stack.push(wx, sbx, sby); 38843 error = this.executeCommand(3, COMMAND_MAP.rmoveto); 38844 break; 38845 case (12 << 8) + 12: 38846 if (this.stack.length < 2) { 38847 error = true; 38848 break; 38849 } 38850 var num2 = this.stack.pop(); 38851 var num1 = this.stack.pop(); 38852 this.stack.push(num1 / num2); 38853 break; 38854 case (12 << 8) + 16: 38855 if (this.stack.length < 2) { 38856 error = true; 38857 break; 38858 } 38859 subrNumber = this.stack.pop(); 38860 var numArgs = this.stack.pop(); 38861 if (subrNumber === 0 && numArgs === 3) { 38862 var flexArgs = this.stack.splice(this.stack.length - 17, 17); 38863 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]); 38864 error = this.executeCommand(13, COMMAND_MAP.flex, true); 38865 this.flexing = false;
38866 this.stack.push(flexArgs[15], flexArgs[16]); 38867 } else if (subrNumber === 1 && numArgs === 0) { 38868 this.flexing = true; 38869 } 38870 break; 38871 case (12 << 8) + 17: 38872 break; 38873 case (12 << 8) + 33: 38874 this.stack = []; 38875 break; 38876 default: 38877 (0, _util.warn)('Unknown type 1 charstring command of "' + value + '"'); 38878 break; 38879 } 38880 if (error) { 38881 break; 38882 } 38883 continue; 38884 } else if (value <= 246) { 38885 value = value - 139; 38886 } else if (value <= 250) { 38887 value = (value - 247) * 256 + encoded[++i] + 108; 38888 } else if (value <= 254) { 38889 value = -((value - 251) * 256) - encoded[++i] - 108; 38890 } else { 38891 value = (encoded[++i] & 0xff) << 24 | (encoded[++i] & 0xff) << 16 | (encoded[++i] & 0xff) << 8 | (encoded[++i] & 0xff) << 0; 38892 } 38893 this.stack.push(value); 38894 } 38895 return error; 38896 }, 38897 executeCommand: function executeCommand(howManyArgs, command, keepStack) { 38898 var stackLength = this.stack.length; 38899 if (howManyArgs > stackLength) { 38900 return true; 38901 } 38902 var start = stackLength - howManyArgs; 38903 for (var i = start; i < stackLength; i++) { 38904 var value = this.stack[i]; 38905 if (Number.isInteger(value)) { 38906 this.output.push(28, value >> 8 & 0xff, value & 0xff); 38907 } else { 38908 value = 65536 * value | 0; 38909 this.output.push(255, value >> 24 & 0xFF, value >> 16 & 0xFF, value >> 8 & 0xFF, value & 0xFF); 38910 } 38911 } 38912 this.output.push.apply(this.output, command); 38913 if (keepStack) { 38914 this.stack.splice(start, howManyArgs); 38915 } else { 38916 this.stack.length = 0; 38917 } 38918 return false; 38919 } 38920 }; 38921 return Type1CharString; 38922}(); 38923var Type1Parser = function Type1ParserClosure() { 38924 var EEXEC_ENCRYPT_KEY = 55665; 38925 var CHAR_STRS_ENCRYPT_KEY = 4330; 38926 function isHexDigit(code) { 38927 return code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102; 38928 } 38929 function decrypt(data, key, discardNumber) { 38930 if (discardNumber >= data.length) { 38931 return new Uint8Array(0); 38932 } 38933 var r = key | 0, 38934 c1 = 52845, 38935 c2 = 22719, 38936 i, 38937 j; 38938 for (i = 0; i < discardNumber; i++) { 38939 r = (data[i] + r) * c1 + c2 & (1 << 16) - 1; 38940 } 38941 var count = data.length - discardNumber; 38942 var decrypted = new Uint8Array(count); 38943 for (i = discardNumber, j = 0; j < count; i++, j++) { 38944 var value = data[i]; 38945 decrypted[j] = value ^ r >> 8; 38946 r = (value + r) * c1 + c2 & (1 << 16) - 1; 38947 } 38948 return decrypted; 38949 } 38950 function decryptAscii(data, key, discardNumber) { 38951 var r = key | 0, 38952 c1 = 52845, 38953 c2 = 22719; 38954 var count = data.length, 38955 maybeLength = count >>> 1; 38956 var decrypted = new Uint8Array(maybeLength); 38957 var i, j; 38958 for (i = 0, j = 0; i < count; i++) { 38959 var digit1 = data[i]; 38960 if (!isHexDigit(digit1)) { 38961 continue; 38962 } 38963 i++; 38964 var digit2; 38965 while (i < count && !isHexDigit(digit2 = data[i])) { 38966 i++; 38967 } 38968 if (i < count) { 38969 var value = parseInt(String.fromCharCode(digit1, digit2), 16); 38970 decrypted[j++] = value ^ r >> 8; 38971 r = (value + r) * c1 + c2 & (1 << 16) - 1; 38972 } 38973 } 38974 return Array.prototype.slice.call(decrypted, discardNumber, j); 38975 } 38976 function isSpecial(c) { 38977 return c === 0x2F || c === 0x5B || c === 0x5D || c === 0x7B || c === 0x7D || c === 0x28 || c === 0x29; 38978 } 38979 function Type1Parser(stream, encrypted, seacAnalysisEnabled) { 38980 if (encrypted) { 38981 var data = stream.getBytes(); 38982 var isBinary = !(isHexDigit(data[0]) && isHexDigit(data[1]) && isHexDigit(data[2]) && isHexDigit(data[3])); 38983 stream = new _stream.Stream(isBinary ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) : decryptAscii(data, EEXEC_ENCRYPT_KEY, 4)); 38984 } 38985 this.seacAnalysisEnabled = !!seacAnalysisEnabled; 38986 this.stream = stream; 38987 this.nextChar(); 38988 } 38989 Type1Parser.prototype = { 38990 readNumberArray: function Type1Parser_readNumberArray() { 38991 this.getToken(); 38992 var array = []; 38993 while (true) { 38994 var token = this.getToken(); 38995 if (token === null || token === ']' || token === '}') { 38996 break; 38997 } 38998 array.push(parseFloat(token || 0)); 38999 } 39000 return array; 39001 }, 39002 readNumber: function Type1Parser_readNumber() { 39003 var token = this.getToken(); 39004 return parseFloat(token || 0); 39005 }, 39006 readInt: function Type1Parser_readInt() { 39007 var token = this.getToken(); 39008 return parseInt(token || 0, 10) | 0; 39009 }, 39010 readBoolean: function Type1Parser_readBoolean() { 39011 var token = this.getToken(); 39012 return token === 'true' ? 1 : 0; 39013 }, 39014 nextChar: function Type1_nextChar() { 39015 return this.currentChar = this.stream.getByte(); 39016 }, 39017 getToken: function Type1Parser_getToken() { 39018 var comment = false;
39019 var ch = this.currentChar; 39020 while (true) { 39021 if (ch === -1) { 39022 return null; 39023 } 39024 if (comment) { 39025 if (ch === 0x0A || ch === 0x0D) { 39026 comment = false; 39027 } 39028 } else if (ch === 0x25) { 39029 comment = true; 39030 } else if (!(0, _util.isSpace)(ch)) { 39031 break; 39032 } 39033 ch = this.nextChar(); 39034 } 39035 if (isSpecial(ch)) { 39036 this.nextChar(); 39037 return String.fromCharCode(ch); 39038 } 39039 var token = ''; 39040 do { 39041 token += String.fromCharCode(ch); 39042 ch = this.nextChar(); 39043 } while (ch >= 0 && !(0, _util.isSpace)(ch) && !isSpecial(ch)); 39044 return token; 39045 }, 39046 readCharStrings: function Type1Parser_readCharStrings(bytes, lenIV) { 39047 if (lenIV === -1) { 39048 return bytes; 39049 } 39050 return decrypt(bytes, CHAR_STRS_ENCRYPT_KEY, lenIV); 39051 }, 39052 extractFontProgram: function Type1Parser_extractFontProgram() { 39053 var stream = this.stream; 39054 var subrs = [], 39055 charstrings = []; 39056 var privateData = Object.create(null); 39057 privateData['lenIV'] = 4; 39058 var program = { 39059 subrs: [], 39060 charstrings: [], 39061 properties: { 'privateData': privateData } 39062 }; 39063 var token, length, data, lenIV, encoded; 39064 while ((token = this.getToken()) !== null) { 39065 if (token !== '/') { 39066 continue; 39067 } 39068 token = this.getToken(); 39069 switch (token) { 39070 case 'CharStrings': 39071 this.getToken(); 39072 this.getToken(); 39073 this.getToken(); 39074 this.getToken(); 39075 while (true) { 39076 token = this.getToken(); 39077 if (token === null || token === 'end') { 39078 break; 39079 } 39080 if (token !== '/') { 39081 continue; 39082 } 39083 var glyph = this.getToken(); 39084 length = this.readInt(); 39085 this.getToken(); 39086 data = stream.makeSubStream(stream.pos, length); 39087 lenIV = program.properties.privateData['lenIV']; 39088 encoded = this.readCharStrings(data.getBytes(), lenIV); 39089 stream.skip(length); 39090 this.nextChar(); 39091 token = this.getToken(); 39092 if (token === 'noaccess') { 39093 this.getToken(); 39094 } 39095 charstrings.push({ 39096 glyph: glyph, 39097 encoded: encoded 39098 }); 39099 } 39100 break; 39101 case 'Subrs': 39102 this.readInt(); 39103 this.getToken(); 39104 while ((token = this.getToken()) === 'dup') { 39105 var index = this.readInt(); 39106 length = this.readInt(); 39107 this.getToken(); 39108 data = stream.makeSubStream(stream.pos, length); 39109 lenIV = program.properties.privateData['lenIV']; 39110 encoded = this.readCharStrings(data.getBytes(), lenIV); 39111 stream.skip(length); 39112 this.nextChar(); 39113 token = this.getToken(); 39114 if (token === 'noaccess') { 39115 this.getToken(); 39116 } 39117 subrs[index] = encoded; 39118 } 39119 break; 39120 case 'BlueValues': 39121 case 'OtherBlues': 39122 case 'FamilyBlues': 39123 case 'FamilyOtherBlues': 39124 var blueArray = this.readNumberArray(); 39125 if (blueArray.length > 0 && blueArray.length % 2 === 0 && HINTING_ENABLED) { 39126 program.properties.privateData[token] = blueArray; 39127 } 39128 break; 39129 case 'StemSnapH': 39130 case 'StemSnapV': 39131 program.properties.privateData[token] = this.readNumberArray(); 39132 break; 39133 case 'StdHW': 39134 case 'StdVW': 39135 program.properties.privateData[token] = this.readNumberArray()[0]; 39136 break; 39137 case 'BlueShift': 39138 case 'lenIV': 39139 case 'BlueFuzz': 39140 case 'BlueScale': 39141 case 'LanguageGroup': 39142 case 'ExpansionFactor': 39143 program.properties.privateData[token] = this.readNumber(); 39144 break; 39145 case 'ForceBold': 39146 program.properties.privateData[token] = this.readBoolean(); 39147 break; 39148 } 39149 } 39150 for (var i = 0; i < charstrings.length; i++) { 39151 glyph = charstrings[i].glyph; 39152 encoded = charstrings[i].encoded; 39153 var charString = new Type1CharString(); 39154 var error = charString.convert(encoded, subrs, this.seacAnalysisEnabled); 39155 var output = charString.output; 39156 if (error) { 39157 output = [14]; 39158 } 39159 program.charstrings.push({ 39160 glyphName: glyph, 39161 charstring: output, 39162 width: charString.width, 39163 lsb: charString.lsb, 39164 seac: charString.seac 39165 }); 39166 } 39167 return program; 39168 }, 39169 extractFontHeader: function Type1Parser_extractFontHeader(properties) { 39170 var token; 39171 while ((token = this.getToken()) !== null) { 39172 if (token !== '/') { 39173 continue; 39174 } 39175 token = this.getToken(); 39176 switch (token) { 39177 case 'FontMatrix': 39178 var matrix = this.readNumberArray(); 39179 properties.fontMatrix = matrix; 39180 break; 39181 case 'Encoding': 39182 var encodingArg = this.getToken(); 39183 var encoding; 39184 if (!/^\d+$/.test(encodingArg)) { 39185 encoding = (0, _encodings.getEncoding)(encodingArg); 39186 } else { 39187 encoding = []; 39188 var size = parseInt(encodingArg, 10) | 0; 39189 this.getToken(); 39190 for (var j = 0; j < size; j++) { 39191 token = this.getToken(); 39192 while (token !== 'dup' && token !== 'def') { 39193 token = this.getToken(); 39194 if (token === null) { 39195 return; 39196 } 39197 } 39198 if (token === 'def') { 39199 break; 39200 } 39201 var index = this.readInt(); 39202 this.getToken(); 39203 var glyph = this.getToken(); 39204 encoding[index] = glyph; 39205 this.getToken(); 39206 } 39207 } 39208 properties.builtInEncoding = encoding; 39209 break; 39210 case 'FontBBox': 39211 var fontBBox = this.readNumberArray(); 39212 properties.ascent = Math.max(fontBBox[3], fontBBox[1]); 39213 properties.descent = Math.min(fontBBox[1], fontBBox[3]); 39214 properties.ascentScaled = true; 39215 break; 39216 } 39217 } 39218 } 39219 }; 39220 return Type1Parser; 39221}(); 39222exports.Type1Parser = Type1Parser; 39223 39224/***/ }), 39225/* 118 */ 39226/***/ (function(module, exports, __w_pdfjs_require__) { 39227 39228"use strict"; 39229 39230 39231Object.defineProperty(exports, "__esModule", { 39232 value: true 39233}); 39234exports.getTilingPatternIR = exports.Pattern = undefined; 39235 39236var _util = __w_pdfjs_require__(0); 39237 39238var _colorspace = __w_pdfjs_require__(21); 39239 39240var _primitives = __w_pdfjs_require__(2); 39241 39242var ShadingType = { 39243 FUNCTION_BASED: 1, 39244 AXIAL: 2, 39245 RADIAL: 3, 39246 FREE_FORM_MESH: 4, 39247 LATTICE_FORM_MESH: 5, 39248 COONS_PATCH_MESH: 6, 39249 TENSOR_PATCH_MESH: 7 39250}; 39251var Pattern = function PatternClosure() { 39252 function Pattern() { 39253 throw new Error('should not call Pattern constructor'); 39254 } 39255 Pattern.prototype = { 39256 getPattern: function Pattern_getPattern(ctx) { 39257 throw new Error('Should not call Pattern.getStyle: ' + ctx); 39258 } 39259 }; 39260 Pattern.parseShading = function (shading, matrix, xref, res, handler, pdfFunctionFactory) { 39261 var dict = (0, _primitives.isStream)(shading) ? shading.dict : shading; 39262 var type = dict.get('ShadingType'); 39263 try { 39264 switch (type) { 39265 case ShadingType.AXIAL: 39266 case ShadingType.RADIAL: 39267 return new Shadings.RadialAxial(dict, matrix, xref, res, pdfFunctionFactory); 39268 case ShadingType.FREE_FORM_MESH: 39269 case ShadingType.LATTICE_FORM_MESH: 39270 case ShadingType.COONS_PATCH_MESH: 39271 case ShadingType.TENSOR_PATCH_MESH: 39272 return new Shadings.Mesh(shading, matrix, xref, res, pdfFunctionFactory); 39273 default: 39274 throw new _util.FormatError('Unsupported ShadingType: ' + type); 39275 } 39276 } catch (ex) { 39277 if (ex instanceof _util.MissingDataException) { 39278 throw ex; 39279 } 39280 handler.send('UnsupportedFeature', { featureId: _util.UNSUPPORTED_FEATURES.shadingPattern }); 39281 (0, _util.warn)(ex); 39282 return new Shadings.Dummy(); 39283 } 39284 }; 39285 return Pattern; 39286}(); 39287var Shadings = {}; 39288Shadings.SMALL_NUMBER = 1e-6; 39289Shadings.RadialAxial = function RadialAxialClosure() { 39290 function RadialAxial(dict, matrix, xref, res, pdfFunctionFactory) { 39291 this.matrix = matrix; 39292 this.coordsArr = dict.getArray('Coords'); 39293 this.shadingType = dict.get('ShadingType'); 39294 this.type = 'Pattern'; 39295 var cs = dict.get('ColorSpace', 'CS'); 39296 cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory); 39297 this.cs = cs; 39298 var t0 = 0.0, 39299 t1 = 1.0; 39300 if (dict.has('Domain')) { 39301 var domainArr = dict.getArray('Domain'); 39302 t0 = domainArr[0]; 39303 t1 = domainArr[1]; 39304 } 39305 var extendStart = false, 39306 extendEnd = false;
39307 if (dict.has('Extend')) { 39308 var extendArr = dict.getArray('Extend'); 39309 extendStart = extendArr[0]; 39310 extendEnd = extendArr[1]; 39311 } 39312 if (this.shadingType === ShadingType.RADIAL && (!extendStart || !extendEnd)) { 39313 var x1 = this.coordsArr[0]; 39314 var y1 = this.coordsArr[1]; 39315 var r1 = this.coordsArr[2]; 39316 var x2 = this.coordsArr[3]; 39317 var y2 = this.coordsArr[4]; 39318 var r2 = this.coordsArr[5]; 39319 var distance = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); 39320 if (r1 <= r2 + distance && r2 <= r1 + distance) { 39321 (0, _util.warn)('Unsupported radial gradient.'); 39322 } 39323 } 39324 this.extendStart = extendStart; 39325 this.extendEnd = extendEnd; 39326 var fnObj = dict.get('Function'); 39327 var fn = pdfFunctionFactory.createFromArray(fnObj); 39328 var diff = t1 - t0; 39329 var step = diff / 10; 39330 var colorStops = this.colorStops = []; 39331 if (t0 >= t1 || step <= 0) { 39332 (0, _util.info)('Bad shading domain.'); 39333 return; 39334 } 39335 var color = new Float32Array(cs.numComps), 39336 ratio = new Float32Array(1); 39337 var rgbColor; 39338 for (var i = t0; i <= t1; i += step) { 39339 ratio[0] = i; 39340 fn(ratio, 0, color, 0); 39341 rgbColor = cs.getRgb(color, 0); 39342 var cssColor = _util.Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); 39343 colorStops.push([(i - t0) / diff, cssColor]); 39344 } 39345 var background = 'transparent'; 39346 if (dict.has('Background')) { 39347 rgbColor = cs.getRgb(dict.get('Background'), 0); 39348 background = _util.Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); 39349 } 39350 if (!extendStart) { 39351 colorStops.unshift([0, background]); 39352 colorStops[1][0] += Shadings.SMALL_NUMBER; 39353 } 39354 if (!extendEnd) { 39355 colorStops[colorStops.length - 1][0] -= Shadings.SMALL_NUMBER; 39356 colorStops.push([1, background]); 39357 } 39358 this.colorStops = colorStops; 39359 } 39360 RadialAxial.prototype = { 39361 getIR: function RadialAxial_getIR() { 39362 var coordsArr = this.coordsArr; 39363 var shadingType = this.shadingType; 39364 var type, p0, p1, r0, r1; 39365 if (shadingType === ShadingType.AXIAL) { 39366 p0 = [coordsArr[0], coordsArr[1]]; 39367 p1 = [coordsArr[2], coordsArr[3]]; 39368 r0 = null; 39369 r1 = null; 39370 type = 'axial'; 39371 } else if (shadingType === ShadingType.RADIAL) { 39372 p0 = [coordsArr[0], coordsArr[1]]; 39373 p1 = [coordsArr[3], coordsArr[4]]; 39374 r0 = coordsArr[2]; 39375 r1 = coordsArr[5]; 39376 type = 'radial'; 39377 } else { 39378 (0, _util.unreachable)('getPattern type unknown: ' + shadingType); 39379 } 39380 var matrix = this.matrix; 39381 if (matrix) { 39382 p0 = _util.Util.applyTransform(p0, matrix); 39383 p1 = _util.Util.applyTransform(p1, matrix); 39384 if (shadingType === ShadingType.RADIAL) { 39385 var scale = _util.Util.singularValueDecompose2dScale(matrix); 39386 r0 *= scale[0]; 39387 r1 *= scale[1]; 39388 } 39389 } 39390 return ['RadialAxial', type, this.colorStops, p0, p1, r0, r1]; 39391 } 39392 }; 39393 return RadialAxial; 39394}(); 39395Shadings.Mesh = function MeshClosure() { 39396 function MeshStreamReader(stream, context) { 39397 this.stream = stream; 39398 this.context = context; 39399 this.buffer = 0; 39400 this.bufferLength = 0; 39401 var numComps = context.numComps; 39402 this.tmpCompsBuf = new Float32Array(numComps); 39403 var csNumComps = context.colorSpace.numComps; 39404 this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : this.tmpCompsBuf; 39405 } 39406 MeshStreamReader.prototype = { 39407 get hasData() { 39408 if (this.stream.end) { 39409 return this.stream.pos < this.stream.end; 39410 } 39411 if (this.bufferLength > 0) { 39412 return true; 39413 } 39414 var nextByte = this.stream.getByte(); 39415 if (nextByte < 0) { 39416 return false; 39417 } 39418 this.buffer = nextByte; 39419 this.bufferLength = 8; 39420 return true; 39421 }, 39422 readBits: function MeshStreamReader_readBits(n) { 39423 var buffer = this.buffer; 39424 var bufferLength = this.bufferLength; 39425 if (n === 32) { 39426 if (bufferLength === 0) { 39427 return (this.stream.getByte() << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte()) >>> 0; 39428 } 39429 buffer = buffer << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte(); 39430 var nextByte = this.stream.getByte(); 39431 this.buffer = nextByte & (1 << bufferLength) - 1; 39432 return (buffer << 8 - bufferLength | (nextByte & 0xFF) >> bufferLength) >>> 0; 39433 } 39434 if (n === 8 && bufferLength === 0) { 39435 return this.stream.getByte(); 39436 } 39437 while (bufferLength < n) { 39438 buffer = buffer << 8 | this.stream.getByte(); 39439 bufferLength += 8; 39440 } 39441 bufferLength -= n; 39442 this.bufferLength = bufferLength; 39443 this.buffer = buffer & (1 << bufferLength) - 1; 39444 return buffer >> bufferLength; 39445 },
vendor: 6,691 bytes, lines 39446-39618
39446 align: function MeshStreamReader_align() { 39447 this.buffer = 0; 39448 this.bufferLength = 0; 39449 }, 39450 readFlag: function MeshStreamReader_readFlag() { 39451 return this.readBits(this.context.bitsPerFlag); 39452 }, 39453 readCoordinate: function MeshStreamReader_readCoordinate() { 39454 var bitsPerCoordinate = this.context.bitsPerCoordinate; 39455 var xi = this.readBits(bitsPerCoordinate); 39456 var yi = this.readBits(bitsPerCoordinate); 39457 var decode = this.context.decode; 39458 var scale = bitsPerCoordinate < 32 ? 1 / ((1 << bitsPerCoordinate) - 1) : 2.3283064365386963e-10; 39459 return [xi * scale * (decode[1] - decode[0]) + decode[0], yi * scale * (decode[3] - decode[2]) + decode[2]]; 39460 }, 39461 readComponents: function MeshStreamReader_readComponents() { 39462 var numComps = this.context.numComps; 39463 var bitsPerComponent = this.context.bitsPerComponent; 39464 var scale = bitsPerComponent < 32 ? 1 / ((1 << bitsPerComponent) - 1) : 2.3283064365386963e-10; 39465 var decode = this.context.decode; 39466 var components = this.tmpCompsBuf; 39467 for (var i = 0, j = 4; i < numComps; i++, j += 2) { 39468 var ci = this.readBits(bitsPerComponent); 39469 components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j]; 39470 } 39471 var color = this.tmpCsCompsBuf; 39472 if (this.context.colorFn) { 39473 this.context.colorFn(components, 0, color, 0); 39474 } 39475 return this.context.colorSpace.getRgb(color, 0); 39476 } 39477 }; 39478 function decodeType4Shading(mesh, reader) { 39479 var coords = mesh.coords; 39480 var colors = mesh.colors; 39481 var operators = []; 39482 var ps = []; 39483 var verticesLeft = 0; 39484 while (reader.hasData) { 39485 var f = reader.readFlag(); 39486 var coord = reader.readCoordinate(); 39487 var color = reader.readComponents(); 39488 if (verticesLeft === 0) { 39489 if (!(0 <= f && f <= 2)) { 39490 throw new _util.FormatError('Unknown type4 flag'); 39491 } 39492 switch (f) { 39493 case 0: 39494 verticesLeft = 3; 39495 break; 39496 case 1: 39497 ps.push(ps[ps.length - 2], ps[ps.length - 1]); 39498 verticesLeft = 1; 39499 break; 39500 case 2: 39501 ps.push(ps[ps.length - 3], ps[ps.length - 1]); 39502 verticesLeft = 1; 39503 break; 39504 } 39505 operators.push(f); 39506 } 39507 ps.push(coords.length); 39508 coords.push(coord); 39509 colors.push(color); 39510 verticesLeft--; 39511 reader.align(); 39512 } 39513 mesh.figures.push({ 39514 type: 'triangles', 39515 coords: new Int32Array(ps), 39516 colors: new Int32Array(ps) 39517 }); 39518 } 39519 function decodeType5Shading(mesh, reader, verticesPerRow) { 39520 var coords = mesh.coords; 39521 var colors = mesh.colors; 39522 var ps = []; 39523 while (reader.hasData) { 39524 var coord = reader.readCoordinate(); 39525 var color = reader.readComponents(); 39526 ps.push(coords.length); 39527 coords.push(coord); 39528 colors.push(color); 39529 } 39530 mesh.figures.push({ 39531 type: 'lattice', 39532 coords: new Int32Array(ps), 39533 colors: new Int32Array(ps), 39534 verticesPerRow: verticesPerRow 39535 }); 39536 } 39537 var MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3; 39538 var MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20; 39539 var TRIANGLE_DENSITY = 20; 39540 var getB = function getBClosure() { 39541 function buildB(count) { 39542 var lut = []; 39543 for (var i = 0; i <= count; i++) { 39544 var t = i / count, 39545 t_ = 1 - t; 39546 lut.push(new Float32Array([t_ * t_ * t_, 3 * t * t_ * t_, 3 * t * t * t_, t * t * t])); 39547 } 39548 return lut; 39549 } 39550 var cache = []; 39551 return function getB(count) { 39552 if (!cache[count]) { 39553 cache[count] = buildB(count); 39554 } 39555 return cache[count]; 39556 }; 39557 }(); 39558 function buildFigureFromPatch(mesh, index) { 39559 var figure = mesh.figures[index]; 39560 (0, _util.assert)(figure.type === 'patch', 'Unexpected patch mesh figure'); 39561 var coords = mesh.coords, 39562 colors = mesh.colors; 39563 var pi = figure.coords; 39564 var ci = figure.colors; 39565 var figureMinX = Math.min(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); 39566 var figureMinY = Math.min(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); 39567 var figureMaxX = Math.max(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); 39568 var figureMaxY = Math.max(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); 39569 var splitXBy = Math.ceil((figureMaxX - figureMinX) * TRIANGLE_DENSITY / (mesh.bounds[2] - mesh.bounds[0])); 39570 splitXBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy)); 39571 var splitYBy = Math.ceil((figureMaxY - figureMinY) * TRIANGLE_DENSITY / (mesh.bounds[3] - mesh.bounds[1])); 39572 splitYBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy)); 39573 var verticesPerRow = splitXBy + 1; 39574 var figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow); 39575 var figureColors = new Int32Array((splitYBy + 1) * verticesPerRow); 39576 var k = 0; 39577 var cl = new Uint8Array(3), 39578 cr = new Uint8Array(3); 39579 var c0 = colors[ci[0]], 39580 c1 = colors[ci[1]], 39581 c2 = colors[ci[2]], 39582 c3 = colors[ci[3]]; 39583 var bRow = getB(splitYBy), 39584 bCol = getB(splitXBy); 39585 for (var row = 0; row <= splitYBy; row++) { 39586 cl[0] = (c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy | 0; 39587 cl[1] = (c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy | 0; 39588 cl[2] = (c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy | 0; 39589 cr[0] = (c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy | 0; 39590 cr[1] = (c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy | 0; 39591 cr[2] = (c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy | 0; 39592 for (var col = 0; col <= splitXBy; col++, k++) { 39593 if ((row === 0 || row === splitYBy) && (col === 0 || col === splitXBy)) { 39594 continue; 39595 } 39596 var x = 0, 39597 y = 0; 39598 var q = 0; 39599 for (var i = 0; i <= 3; i++) { 39600 for (var j = 0; j <= 3; j++, q++) { 39601 var m = bRow[row][i] * bCol[col][j]; 39602 x += coords[pi[q]][0] * m; 39603 y += coords[pi[q]][1] * m; 39604 } 39605 } 39606 figureCoords[k] = coords.length; 39607 coords.push([x, y]); 39608 figureColors[k] = colors.length; 39609 var newColor = new Uint8Array(3); 39610 newColor[0] = (cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy | 0; 39611 newColor[1] = (cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy | 0; 39612 newColor[2] = (cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy | 0; 39613 colors.push(newColor); 39614 } 39615 } 39616 figureCoords[0] = pi[0]; 39617 figureColors[0] = ci[0]; 39618 figureCoords[splitXBy] = pi[3];
vendor: 5,672 bytes, lines 39619-39772
39619 figureColors[splitXBy] = ci[1]; 39620 figureCoords[verticesPerRow * splitYBy] = pi[12]; 39621 figureColors[verticesPerRow * splitYBy] = ci[2]; 39622 figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15]; 39623 figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3]; 39624 mesh.figures[index] = { 39625 type: 'lattice', 39626 coords: figureCoords, 39627 colors: figureColors, 39628 verticesPerRow: verticesPerRow 39629 }; 39630 } 39631 function decodeType6Shading(mesh, reader) { 39632 var coords = mesh.coords; 39633 var colors = mesh.colors; 39634 var ps = new Int32Array(16); 39635 var cs = new Int32Array(4); 39636 while (reader.hasData) { 39637 var f = reader.readFlag(); 39638 if (!(0 <= f && f <= 3)) { 39639 throw new _util.FormatError('Unknown type6 flag'); 39640 } 39641 var i, ii; 39642 var pi = coords.length; 39643 for (i = 0, ii = f !== 0 ? 8 : 12; i < ii; i++) { 39644 coords.push(reader.readCoordinate()); 39645 } 39646 var ci = colors.length; 39647 for (i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { 39648 colors.push(reader.readComponents()); 39649 } 39650 var tmp1, tmp2, tmp3, tmp4; 39651 switch (f) { 39652 case 0: 39653 ps[12] = pi + 3; 39654 ps[13] = pi + 4; 39655 ps[14] = pi + 5; 39656 ps[15] = pi + 6; 39657 ps[8] = pi + 2; 39658 ps[11] = pi + 7; 39659 ps[4] = pi + 1; 39660 ps[7] = pi + 8; 39661 ps[0] = pi; 39662 ps[1] = pi + 11; 39663 ps[2] = pi + 10; 39664 ps[3] = pi + 9; 39665 cs[2] = ci + 1; 39666 cs[3] = ci + 2; 39667 cs[0] = ci; 39668 cs[1] = ci + 3; 39669 break; 39670 case 1: 39671 tmp1 = ps[12]; 39672 tmp2 = ps[13]; 39673 tmp3 = ps[14]; 39674 tmp4 = ps[15]; 39675 ps[12] = tmp4; 39676 ps[13] = pi + 0; 39677 ps[14] = pi + 1; 39678 ps[15] = pi + 2; 39679 ps[8] = tmp3; 39680 ps[11] = pi + 3; 39681 ps[4] = tmp2; 39682 ps[7] = pi + 4; 39683 ps[0] = tmp1; 39684 ps[1] = pi + 7; 39685 ps[2] = pi + 6; 39686 ps[3] = pi + 5; 39687 tmp1 = cs[2]; 39688 tmp2 = cs[3]; 39689 cs[2] = tmp2; 39690 cs[3] = ci; 39691 cs[0] = tmp1; 39692 cs[1] = ci + 1; 39693 break; 39694 case 2: 39695 tmp1 = ps[15]; 39696 tmp2 = ps[11]; 39697 ps[12] = ps[3]; 39698 ps[13] = pi + 0; 39699 ps[14] = pi + 1; 39700 ps[15] = pi + 2; 39701 ps[8] = ps[7]; 39702 ps[11] = pi + 3; 39703 ps[4] = tmp2; 39704 ps[7] = pi + 4; 39705 ps[0] = tmp1; 39706 ps[1] = pi + 7; 39707 ps[2] = pi + 6; 39708 ps[3] = pi + 5; 39709 tmp1 = cs[3]; 39710 cs[2] = cs[1]; 39711 cs[3] = ci; 39712 cs[0] = tmp1; 39713 cs[1] = ci + 1; 39714 break; 39715 case 3: 39716 ps[12] = ps[0]; 39717 ps[13] = pi + 0; 39718 ps[14] = pi + 1; 39719 ps[15] = pi + 2; 39720 ps[8] = ps[1]; 39721 ps[11] = pi + 3; 39722 ps[4] = ps[2]; 39723 ps[7] = pi + 4; 39724 ps[0] = ps[3]; 39725 ps[1] = pi + 7; 39726 ps[2] = pi + 6; 39727 ps[3] = pi + 5; 39728 cs[2] = cs[0]; 39729 cs[3] = ci; 39730 cs[0] = cs[1]; 39731 cs[1] = ci + 1; 39732 break; 39733 } 39734 ps[5] = coords.length; 39735 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]); 39736 ps[6] = coords.length; 39737 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]); 39738 ps[9] = coords.length; 39739 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]); 39740 ps[10] = coords.length; 39741 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]); 39742 mesh.figures.push({ 39743 type: 'patch', 39744 coords: new Int32Array(ps), 39745 colors: new Int32Array(cs) 39746 }); 39747 } 39748 } 39749 function decodeType7Shading(mesh, reader) { 39750 var coords = mesh.coords; 39751 var colors = mesh.colors; 39752 var ps = new Int32Array(16); 39753 var cs = new Int32Array(4); 39754 while (reader.hasData) { 39755 var f = reader.readFlag(); 39756 if (!(0 <= f && f <= 3)) { 39757 throw new _util.FormatError('Unknown type7 flag'); 39758 } 39759 var i, ii; 39760 var pi = coords.length; 39761 for (i = 0, ii = f !== 0 ? 12 : 16; i < ii; i++) { 39762 coords.push(reader.readCoordinate()); 39763 } 39764 var ci = colors.length; 39765 for (i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { 39766 colors.push(reader.readComponents()); 39767 } 39768 var tmp1, tmp2, tmp3, tmp4; 39769 switch (f) { 39770 case 0: 39771 ps[12] = pi + 3; 39772 ps[13] = pi + 4;
vendor: 4,358 bytes, lines 39773-39931
39773 ps[14] = pi + 5; 39774 ps[15] = pi + 6; 39775 ps[8] = pi + 2; 39776 ps[9] = pi + 13; 39777 ps[10] = pi + 14; 39778 ps[11] = pi + 7; 39779 ps[4] = pi + 1; 39780 ps[5] = pi + 12; 39781 ps[6] = pi + 15; 39782 ps[7] = pi + 8; 39783 ps[0] = pi; 39784 ps[1] = pi + 11; 39785 ps[2] = pi + 10; 39786 ps[3] = pi + 9; 39787 cs[2] = ci + 1; 39788 cs[3] = ci + 2; 39789 cs[0] = ci; 39790 cs[1] = ci + 3; 39791 break; 39792 case 1: 39793 tmp1 = ps[12]; 39794 tmp2 = ps[13]; 39795 tmp3 = ps[14]; 39796 tmp4 = ps[15]; 39797 ps[12] = tmp4; 39798 ps[13] = pi + 0; 39799 ps[14] = pi + 1; 39800 ps[15] = pi + 2; 39801 ps[8] = tmp3; 39802 ps[9] = pi + 9; 39803 ps[10] = pi + 10; 39804 ps[11] = pi + 3; 39805 ps[4] = tmp2; 39806 ps[5] = pi + 8; 39807 ps[6] = pi + 11; 39808 ps[7] = pi + 4; 39809 ps[0] = tmp1; 39810 ps[1] = pi + 7; 39811 ps[2] = pi + 6; 39812 ps[3] = pi + 5; 39813 tmp1 = cs[2]; 39814 tmp2 = cs[3]; 39815 cs[2] = tmp2; 39816 cs[3] = ci; 39817 cs[0] = tmp1; 39818 cs[1] = ci + 1; 39819 break; 39820 case 2: 39821 tmp1 = ps[15]; 39822 tmp2 = ps[11]; 39823 ps[12] = ps[3]; 39824 ps[13] = pi + 0; 39825 ps[14] = pi + 1; 39826 ps[15] = pi + 2; 39827 ps[8] = ps[7]; 39828 ps[9] = pi + 9; 39829 ps[10] = pi + 10; 39830 ps[11] = pi + 3; 39831 ps[4] = tmp2; 39832 ps[5] = pi + 8; 39833 ps[6] = pi + 11; 39834 ps[7] = pi + 4; 39835 ps[0] = tmp1; 39836 ps[1] = pi + 7; 39837 ps[2] = pi + 6; 39838 ps[3] = pi + 5; 39839 tmp1 = cs[3]; 39840 cs[2] = cs[1]; 39841 cs[3] = ci; 39842 cs[0] = tmp1; 39843 cs[1] = ci + 1; 39844 break; 39845 case 3: 39846 ps[12] = ps[0]; 39847 ps[13] = pi + 0; 39848 ps[14] = pi + 1; 39849 ps[15] = pi + 2; 39850 ps[8] = ps[1]; 39851 ps[9] = pi + 9; 39852 ps[10] = pi + 10; 39853 ps[11] = pi + 3; 39854 ps[4] = ps[2]; 39855 ps[5] = pi + 8; 39856 ps[6] = pi + 11; 39857 ps[7] = pi + 4; 39858 ps[0] = ps[3]; 39859 ps[1] = pi + 7; 39860 ps[2] = pi + 6; 39861 ps[3] = pi + 5; 39862 cs[2] = cs[0]; 39863 cs[3] = ci; 39864 cs[0] = cs[1]; 39865 cs[1] = ci + 1; 39866 break; 39867 } 39868 mesh.figures.push({ 39869 type: 'patch', 39870 coords: new Int32Array(ps), 39871 colors: new Int32Array(cs) 39872 }); 39873 } 39874 } 39875 function updateBounds(mesh) { 39876 var minX = mesh.coords[0][0], 39877 minY = mesh.coords[0][1], 39878 maxX = minX, 39879 maxY = minY; 39880 for (var i = 1, ii = mesh.coords.length; i < ii; i++) { 39881 var x = mesh.coords[i][0], 39882 y = mesh.coords[i][1]; 39883 minX = minX > x ? x : minX; 39884 minY = minY > y ? y : minY; 39885 maxX = maxX < x ? x : maxX; 39886 maxY = maxY < y ? y : maxY; 39887 } 39888 mesh.bounds = [minX, minY, maxX, maxY]; 39889 } 39890 function packData(mesh) { 39891 var i, ii, j, jj; 39892 var coords = mesh.coords; 39893 var coordsPacked = new Float32Array(coords.length * 2); 39894 for (i = 0, j = 0, ii = coords.length; i < ii; i++) { 39895 var xy = coords[i]; 39896 coordsPacked[j++] = xy[0]; 39897 coordsPacked[j++] = xy[1]; 39898 } 39899 mesh.coords = coordsPacked; 39900 var colors = mesh.colors; 39901 var colorsPacked = new Uint8Array(colors.length * 3); 39902 for (i = 0, j = 0, ii = colors.length; i < ii; i++) { 39903 var c = colors[i]; 39904 colorsPacked[j++] = c[0]; 39905 colorsPacked[j++] = c[1]; 39906 colorsPacked[j++] = c[2]; 39907 } 39908 mesh.colors = colorsPacked; 39909 var figures = mesh.figures; 39910 for (i = 0, ii = figures.length; i < ii; i++) { 39911 var figure = figures[i], 39912 ps = figure.coords, 39913 cs = figure.colors; 39914 for (j = 0, jj = ps.length; j < jj; j++) { 39915 ps[j] *= 2; 39916 cs[j] *= 3; 39917 } 39918 } 39919 } 39920 function Mesh(stream, matrix, xref, res, pdfFunctionFactory) { 39921 if (!(0, _primitives.isStream)(stream)) { 39922 throw new _util.FormatError('Mesh data is not a stream'); 39923 } 39924 var dict = stream.dict; 39925 this.matrix = matrix; 39926 this.shadingType = dict.get('ShadingType'); 39927 this.type = 'Pattern'; 39928 this.bbox = dict.getArray('BBox'); 39929 var cs = dict.get('ColorSpace', 'CS'); 39930 cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory); 39931 this.cs = cs;
39932 this.background = dict.has('Background') ? cs.getRgb(dict.get('Background'), 0) : null; 39933 var fnObj = dict.get('Function'); 39934 var fn = fnObj ? pdfFunctionFactory.createFromArray(fnObj) : null; 39935 this.coords = []; 39936 this.colors = []; 39937 this.figures = []; 39938 var decodeContext = { 39939 bitsPerCoordinate: dict.get('BitsPerCoordinate'), 39940 bitsPerComponent: dict.get('BitsPerComponent'), 39941 bitsPerFlag: dict.get('BitsPerFlag'), 39942 decode: dict.getArray('Decode'), 39943 colorFn: fn, 39944 colorSpace: cs, 39945 numComps: fn ? 1 : cs.numComps 39946 }; 39947 var reader = new MeshStreamReader(stream, decodeContext); 39948 var patchMesh = false; 39949 switch (this.shadingType) { 39950 case ShadingType.FREE_FORM_MESH: 39951 decodeType4Shading(this, reader); 39952 break; 39953 case ShadingType.LATTICE_FORM_MESH: 39954 var verticesPerRow = dict.get('VerticesPerRow') | 0; 39955 if (verticesPerRow < 2) { 39956 throw new _util.FormatError('Invalid VerticesPerRow'); 39957 } 39958 decodeType5Shading(this, reader, verticesPerRow); 39959 break; 39960 case ShadingType.COONS_PATCH_MESH: 39961 decodeType6Shading(this, reader); 39962 patchMesh = true; 39963 break; 39964 case ShadingType.TENSOR_PATCH_MESH: 39965 decodeType7Shading(this, reader); 39966 patchMesh = true; 39967 break; 39968 default: 39969 (0, _util.unreachable)('Unsupported mesh type.'); 39970 break; 39971 } 39972 if (patchMesh) { 39973 updateBounds(this); 39974 for (var i = 0, ii = this.figures.length; i < ii; i++) { 39975 buildFigureFromPatch(this, i); 39976 } 39977 } 39978 updateBounds(this); 39979 packData(this); 39980 } 39981 Mesh.prototype = { 39982 getIR: function Mesh_getIR() { 39983 return ['Mesh', this.shadingType, this.coords, this.colors, this.figures, this.bounds, this.matrix, this.bbox, this.background]; 39984 } 39985 }; 39986 return Mesh; 39987}(); 39988Shadings.Dummy = function DummyClosure() { 39989 function Dummy() { 39990 this.type = 'Pattern'; 39991 } 39992 Dummy.prototype = { 39993 getIR: function Dummy_getIR() { 39994 return ['Dummy']; 39995 } 39996 }; 39997 return Dummy; 39998}(); 39999function getTilingPatternIR(operatorList, dict, args) { 40000 var matrix = dict.getArray('Matrix'); 40001 var bbox = _util.Util.normalizeRect(dict.getArray('BBox')); 40002 var xstep = dict.get('XStep'); 40003 var ystep = dict.get('YStep'); 40004 var paintType = dict.get('PaintType'); 40005 var tilingType = dict.get('TilingType'); 40006 if (bbox[2] - bbox[0] === 0 || bbox[3] - bbox[1] === 0) { 40007 throw new _util.FormatError('Invalid getTilingPatternIR /BBox array: [' + bbox + '].'); 40008 } 40009 return ['TilingPattern', args, operatorList, matrix, bbox, xstep, ystep, paintType, tilingType]; 40010} 40011exports.Pattern = Pattern; 40012exports.getTilingPatternIR = getTilingPatternIR; 40013 40014/***/ }), 40015/* 119 */ 40016/***/ (function(module, exports, __w_pdfjs_require__) { 40017 40018"use strict"; 40019 40020 40021Object.defineProperty(exports, "__esModule", { 40022 value: true 40023}); 40024exports.bidi = undefined; 40025 40026var _util = __w_pdfjs_require__(0); 40027 40028var 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']; 40029var 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']; 40030function isOdd(i) { 40031 return (i & 1) !== 0; 40032} 40033function isEven(i) { 40034 return (i & 1) === 0; 40035} 40036function findUnequal(arr, start, value) { 40037 for (var j = start, jj = arr.length; j < jj; ++j) { 40038 if (arr[j] !== value) { 40039 return j; 40040 } 40041 } 40042 return j; 40043} 40044function setValues(arr, start, end, value) { 40045 for (var j = start; j < end; ++j) { 40046 arr[j] = value; 40047 } 40048} 40049function reverseValues(arr, start, end) { 40050 for (var i = start, j = end - 1; i < j; ++i, --j) { 40051 var temp = arr[i]; 40052 arr[i] = arr[j]; 40053 arr[j] = temp; 40054 } 40055} 40056function createBidiText(str, isLTR, vertical) { 40057 return { 40058 str: str, 40059 dir: vertical ? 'ttb' : isLTR ? 'ltr' : 'rtl' 40060 }; 40061} 40062var chars = []; 40063var types = []; 40064function bidi(str, startLevel, vertical) { 40065 var isLTR = true; 40066 var strLength = str.length; 40067 if (strLength === 0 || vertical) { 40068 return createBidiText(str, isLTR, vertical); 40069 } 40070 chars.length = strLength; 40071 types.length = strLength; 40072 var numBidi = 0; 40073 var i, ii; 40074 for (i = 0; i < strLength; ++i) { 40075 chars[i] = str.charAt(i);
vendor: 7,307 bytes, lines 40076-40391
40076 var charCode = str.charCodeAt(i); 40077 var charType = 'L'; 40078 if (charCode <= 0x00ff) { 40079 charType = baseTypes[charCode]; 40080 } else if (0x0590 <= charCode && charCode <= 0x05f4) { 40081 charType = 'R'; 40082 } else if (0x0600 <= charCode && charCode <= 0x06ff) { 40083 charType = arabicTypes[charCode & 0xff]; 40084 if (!charType) { 40085 (0, _util.warn)('Bidi: invalid Unicode character ' + charCode.toString(16)); 40086 } 40087 } else if (0x0700 <= charCode && charCode <= 0x08AC) { 40088 charType = 'AL'; 40089 } 40090 if (charType === 'R' || charType === 'AL' || charType === 'AN') { 40091 numBidi++; 40092 } 40093 types[i] = charType; 40094 } 40095 if (numBidi === 0) { 40096 isLTR = true; 40097 return createBidiText(str, isLTR); 40098 } 40099 if (startLevel === -1) { 40100 if (numBidi / strLength < 0.3) { 40101 isLTR = true; 40102 startLevel = 0; 40103 } else { 40104 isLTR = false; 40105 startLevel = 1; 40106 } 40107 } 40108 var levels = []; 40109 for (i = 0; i < strLength; ++i) { 40110 levels[i] = startLevel; 40111 } 40112 var e = isOdd(startLevel) ? 'R' : 'L'; 40113 var sor = e; 40114 var eor = sor; 40115 var lastType = sor; 40116 for (i = 0; i < strLength; ++i) { 40117 if (types[i] === 'NSM') { 40118 types[i] = lastType; 40119 } else { 40120 lastType = types[i]; 40121 } 40122 } 40123 lastType = sor; 40124 var t; 40125 for (i = 0; i < strLength; ++i) { 40126 t = types[i]; 40127 if (t === 'EN') { 40128 types[i] = lastType === 'AL' ? 'AN' : 'EN'; 40129 } else if (t === 'R' || t === 'L' || t === 'AL') { 40130 lastType = t; 40131 } 40132 } 40133 for (i = 0; i < strLength; ++i) { 40134 t = types[i]; 40135 if (t === 'AL') { 40136 types[i] = 'R'; 40137 } 40138 } 40139 for (i = 1; i < strLength - 1; ++i) { 40140 if (types[i] === 'ES' && types[i - 1] === 'EN' && types[i + 1] === 'EN') { 40141 types[i] = 'EN'; 40142 } 40143 if (types[i] === 'CS' && (types[i - 1] === 'EN' || types[i - 1] === 'AN') && types[i + 1] === types[i - 1]) { 40144 types[i] = types[i - 1]; 40145 } 40146 } 40147 for (i = 0; i < strLength; ++i) { 40148 if (types[i] === 'EN') { 40149 var j; 40150 for (j = i - 1; j >= 0; --j) { 40151 if (types[j] !== 'ET') { 40152 break; 40153 } 40154 types[j] = 'EN'; 40155 } 40156 for (j = i + 1; j < strLength; ++j) { 40157 if (types[j] !== 'ET') { 40158 break; 40159 } 40160 types[j] = 'EN'; 40161 } 40162 } 40163 } 40164 for (i = 0; i < strLength; ++i) { 40165 t = types[i]; 40166 if (t === 'WS' || t === 'ES' || t === 'ET' || t === 'CS') { 40167 types[i] = 'ON'; 40168 } 40169 } 40170 lastType = sor; 40171 for (i = 0; i < strLength; ++i) { 40172 t = types[i]; 40173 if (t === 'EN') { 40174 types[i] = lastType === 'L' ? 'L' : 'EN'; 40175 } else if (t === 'R' || t === 'L') { 40176 lastType = t; 40177 } 40178 } 40179 for (i = 0; i < strLength; ++i) { 40180 if (types[i] === 'ON') { 40181 var end = findUnequal(types, i + 1, 'ON'); 40182 var before = sor; 40183 if (i > 0) { 40184 before = types[i - 1]; 40185 } 40186 var after = eor; 40187 if (end + 1 < strLength) { 40188 after = types[end + 1]; 40189 } 40190 if (before !== 'L') { 40191 before = 'R'; 40192 } 40193 if (after !== 'L') { 40194 after = 'R'; 40195 } 40196 if (before === after) { 40197 setValues(types, i, end, before); 40198 } 40199 i = end - 1; 40200 } 40201 } 40202 for (i = 0; i < strLength; ++i) { 40203 if (types[i] === 'ON') { 40204 types[i] = e; 40205 } 40206 } 40207 for (i = 0; i < strLength; ++i) { 40208 t = types[i]; 40209 if (isEven(levels[i])) { 40210 if (t === 'R') { 40211 levels[i] += 1; 40212 } else if (t === 'AN' || t === 'EN') { 40213 levels[i] += 2; 40214 } 40215 } else { 40216 if (t === 'L' || t === 'AN' || t === 'EN') { 40217 levels[i] += 1; 40218 } 40219 } 40220 } 40221 var highestLevel = -1; 40222 var lowestOddLevel = 99; 40223 var level; 40224 for (i = 0, ii = levels.length; i < ii; ++i) { 40225 level = levels[i]; 40226 if (highestLevel < level) { 40227 highestLevel = level; 40228 } 40229 if (lowestOddLevel > level && isOdd(level)) { 40230 lowestOddLevel = level; 40231 } 40232 } 40233 for (level = highestLevel; level >= lowestOddLevel; --level) { 40234 var start = -1; 40235 for (i = 0, ii = levels.length; i < ii; ++i) { 40236 if (levels[i] < level) { 40237 if (start >= 0) { 40238 reverseValues(chars, start, i); 40239 start = -1; 40240 } 40241 } else if (start < 0) { 40242 start = i; 40243 } 40244 } 40245 if (start >= 0) { 40246 reverseValues(chars, start, levels.length); 40247 } 40248 } 40249 for (i = 0, ii = chars.length; i < ii; ++i) { 40250 var ch = chars[i]; 40251 if (ch === '<' || ch === '>') { 40252 chars[i] = ''; 40253 } 40254 } 40255 return createBidiText(chars.join(''), isLTR); 40256} 40257exports.bidi = bidi; 40258 40259/***/ }), 40260/* 120 */ 40261/***/ (function(module, exports, __w_pdfjs_require__) { 40262 40263"use strict"; 40264 40265 40266Object.defineProperty(exports, "__esModule", { 40267 value: true 40268}); 40269exports.getMetrics = undefined; 40270 40271var _util = __w_pdfjs_require__(0); 40272 40273var getMetrics = (0, _util.getLookupTableFactory)(function (t) { 40274 t['Courier'] = 600; 40275 t['Courier-Bold'] = 600; 40276 t['Courier-BoldOblique'] = 600; 40277 t['Courier-Oblique'] = 600; 40278 t['Helvetica'] = (0, _util.getLookupTableFactory)(function (t) { 40279 t['space'] = 278; 40280 t['exclam'] = 278; 40281 t['quotedbl'] = 355; 40282 t['numbersign'] = 556; 40283 t['dollar'] = 556; 40284 t['percent'] = 889; 40285 t['ampersand'] = 667; 40286 t['quoteright'] = 222; 40287 t['parenleft'] = 333; 40288 t['parenright'] = 333; 40289 t['asterisk'] = 389; 40290 t['plus'] = 584; 40291 t['comma'] = 278; 40292 t['hyphen'] = 333; 40293 t['period'] = 278; 40294 t['slash'] = 278; 40295 t['zero'] = 556; 40296 t['one'] = 556; 40297 t['two'] = 556; 40298 t['three'] = 556; 40299 t['four'] = 556; 40300 t['five'] = 556; 40301 t['six'] = 556; 40302 t['seven'] = 556; 40303 t['eight'] = 556; 40304 t['nine'] = 556; 40305 t['colon'] = 278; 40306 t['semicolon'] = 278; 40307 t['less'] = 584; 40308 t['equal'] = 584; 40309 t['greater'] = 584; 40310 t['question'] = 556; 40311 t['at'] = 1015; 40312 t['A'] = 667; 40313 t['B'] = 667; 40314 t['C'] = 722; 40315 t['D'] = 722; 40316 t['E'] = 667; 40317 t['F'] = 611; 40318 t['G'] = 778; 40319 t['H'] = 722; 40320 t['I'] = 278; 40321 t['J'] = 500; 40322 t['K'] = 667; 40323 t['L'] = 556; 40324 t['M'] = 833; 40325 t['N'] = 722; 40326 t['O'] = 778; 40327 t['P'] = 667; 40328 t['Q'] = 778; 40329 t['R'] = 722; 40330 t['S'] = 667; 40331 t['T'] = 611; 40332 t['U'] = 722; 40333 t['V'] = 667; 40334 t['W'] = 944; 40335 t['X'] = 667; 40336 t['Y'] = 667; 40337 t['Z'] = 611; 40338 t['bracketleft'] = 278; 40339 t['backslash'] = 278; 40340 t['bracketright'] = 278; 40341 t['asciicircum'] = 469; 40342 t['underscore'] = 556; 40343 t['quoteleft'] = 222; 40344 t['a'] = 556; 40345 t['b'] = 556; 40346 t['c'] = 500; 40347 t['d'] = 556; 40348 t['e'] = 556; 40349 t['f'] = 278; 40350 t['g'] = 556; 40351 t['h'] = 556; 40352 t['i'] = 222; 40353 t['j'] = 222; 40354 t['k'] = 500; 40355 t['l'] = 222; 40356 t['m'] = 833; 40357 t['n'] = 556; 40358 t['o'] = 556; 40359 t['p'] = 556; 40360 t['q'] = 556; 40361 t['r'] = 333; 40362 t['s'] = 500; 40363 t['t'] = 278; 40364 t['u'] = 556; 40365 t['v'] = 500; 40366 t['w'] = 722; 40367 t['x'] = 500; 40368 t['y'] = 500; 40369 t['z'] = 500; 40370 t['braceleft'] = 334; 40371 t['bar'] = 260; 40372 t['braceright'] = 334; 40373 t['asciitilde'] = 584; 40374 t['exclamdown'] = 333; 40375 t['cent'] = 556; 40376 t['sterling'] = 556; 40377 t['fraction'] = 167; 40378 t['yen'] = 556; 40379 t['florin'] = 556; 40380 t['section'] = 556; 40381 t['currency'] = 556; 40382 t['quotesingle'] = 191; 40383 t['quotedblleft'] = 333; 40384 t['guillemotleft'] = 556; 40385 t['guilsinglleft'] = 333; 40386 t['guilsinglright'] = 333; 40387 t['fi'] = 500; 40388 t['fl'] = 500; 40389 t['endash'] = 556; 40390 t['dagger'] = 556; 40391 t['daggerdbl'] = 556;
40392 t['periodcentered'] = 278; 40393 t['paragraph'] = 537; 40394 t['bullet'] = 350; 40395 t['quotesinglbase'] = 222; 40396 t['quotedblbase'] = 333; 40397 t['quotedblright'] = 333; 40398 t['guillemotright'] = 556; 40399 t['ellipsis'] = 1000; 40400 t['perthousand'] = 1000; 40401 t['questiondown'] = 611; 40402 t['grave'] = 333; 40403 t['acute'] = 333; 40404 t['circumflex'] = 333; 40405 t['tilde'] = 333; 40406 t['macron'] = 333; 40407 t['breve'] = 333; 40408 t['dotaccent'] = 333; 40409 t['dieresis'] = 333; 40410 t['ring'] = 333; 40411 t['cedilla'] = 333; 40412 t['hungarumlaut'] = 333; 40413 t['ogonek'] = 333; 40414 t['caron'] = 333; 40415 t['emdash'] = 1000; 40416 t['AE'] = 1000; 40417 t['ordfeminine'] = 370; 40418 t['Lslash'] = 556; 40419 t['Oslash'] = 778; 40420 t['OE'] = 1000; 40421 t['ordmasculine'] = 365; 40422 t['ae'] = 889; 40423 t['dotlessi'] = 278; 40424 t['lslash'] = 222; 40425 t['oslash'] = 611; 40426 t['oe'] = 944; 40427 t['germandbls'] = 611; 40428 t['Idieresis'] = 278; 40429 t['eacute'] = 556; 40430 t['abreve'] = 556; 40431 t['uhungarumlaut'] = 556; 40432 t['ecaron'] = 556; 40433 t['Ydieresis'] = 667; 40434 t['divide'] = 584; 40435 t['Yacute'] = 667; 40436 t['Acircumflex'] = 667; 40437 t['aacute'] = 556; 40438 t['Ucircumflex'] = 722; 40439 t['yacute'] = 500; 40440 t['scommaaccent'] = 500; 40441 t['ecircumflex'] = 556; 40442 t['Uring'] = 722; 40443 t['Udieresis'] = 722; 40444 t['aogonek'] = 556; 40445 t['Uacute'] = 722; 40446 t['uogonek'] = 556; 40447 t['Edieresis'] = 667; 40448 t['Dcroat'] = 722; 40449 t['commaaccent'] = 250; 40450 t['copyright'] = 737; 40451 t['Emacron'] = 667; 40452 t['ccaron'] = 500; 40453 t['aring'] = 556; 40454 t['Ncommaaccent'] = 722; 40455 t['lacute'] = 222; 40456 t['agrave'] = 556; 40457 t['Tcommaaccent'] = 611; 40458 t['Cacute'] = 722; 40459 t['atilde'] = 556; 40460 t['Edotaccent'] = 667; 40461 t['scaron'] = 500; 40462 t['scedilla'] = 500; 40463 t['iacute'] = 278; 40464 t['lozenge'] = 471; 40465 t['Rcaron'] = 722; 40466 t['Gcommaaccent'] = 778; 40467 t['ucircumflex'] = 556; 40468 t['acircumflex'] = 556; 40469 t['Amacron'] = 667; 40470 t['rcaron'] = 333; 40471 t['ccedilla'] = 500; 40472 t['Zdotaccent'] = 611; 40473 t['Thorn'] = 667; 40474 t['Omacron'] = 778; 40475 t['Racute'] = 722; 40476 t['Sacute'] = 667; 40477 t['dcaron'] = 643; 40478 t['Umacron'] = 722; 40479 t['uring'] = 556; 40480 t['threesuperior'] = 333; 40481 t['Ograve'] = 778; 40482 t['Agrave'] = 667; 40483 t['Abreve'] = 667; 40484 t['multiply'] = 584; 40485 t['uacute'] = 556; 40486 t['Tcaron'] = 611; 40487 t['partialdiff'] = 476; 40488 t['ydieresis'] = 500; 40489 t['Nacute'] = 722; 40490 t['icircumflex'] = 278; 40491 t['Ecircumflex'] = 667; 40492 t['adieresis'] = 556; 40493 t['edieresis'] = 556; 40494 t['cacute'] = 500; 40495 t['nacute'] = 556; 40496 t['umacron'] = 556; 40497 t['Ncaron'] = 722; 40498 t['Iacute'] = 278; 40499 t['plusminus'] = 584; 40500 t['brokenbar'] = 260; 40501 t['registered'] = 737; 40502 t['Gbreve'] = 778; 40503 t['Idotaccent'] = 278; 40504 t['summation'] = 600; 40505 t['Egrave'] = 667; 40506 t['racute'] = 333; 40507 t['omacron'] = 556; 40508 t['Zacute'] = 611; 40509 t['Zcaron'] = 611; 40510 t['greaterequal'] = 549; 40511 t['Eth'] = 722; 40512 t['Ccedilla'] = 722; 40513 t['lcommaaccent'] = 222; 40514 t['tcaron'] = 317; 40515 t['eogonek'] = 556; 40516 t['Uogonek'] = 722; 40517 t['Aacute'] = 667; 40518 t['Adieresis'] = 667; 40519 t['egrave'] = 556; 40520 t['zacute'] = 500; 40521 t['iogonek'] = 222; 40522 t['Oacute'] = 778; 40523 t['oacute'] = 556; 40524 t['amacron'] = 556; 40525 t['sacute'] = 500; 40526 t['idieresis'] = 278; 40527 t['Ocircumflex'] = 778; 40528 t['Ugrave'] = 722; 40529 t['Delta'] = 612; 40530 t['thorn'] = 556; 40531 t['twosuperior'] = 333; 40532 t['Odieresis'] = 778; 40533 t['mu'] = 556; 40534 t['igrave'] = 278; 40535 t['ohungarumlaut'] = 556; 40536 t['Eogonek'] = 667; 40537 t['dcroat'] = 556; 40538 t['threequarters'] = 834; 40539 t['Scedilla'] = 667; 40540 t['lcaron'] = 299; 40541 t['Kcommaaccent'] = 667; 40542 t['Lacute'] = 556; 40543 t['trademark'] = 1000; 40544 t['edotaccent'] = 556; 40545 t['Igrave'] = 278; 40546 t['Imacron'] = 278; 40547 t['Lcaron'] = 556; 40548 t['onehalf'] = 834; 40549 t['lessequal'] = 549; 40550 t['ocircumflex'] = 556; 40551 t['ntilde'] = 556; 40552 t['Uhungarumlaut'] = 722; 40553 t['Eacute'] = 667; 40554 t['emacron'] = 556; 40555 t['gbreve'] = 556; 40556 t['onequarter'] = 834; 40557 t['Scaron'] = 667; 40558 t['Scommaaccent'] = 667; 40559 t['Ohungarumlaut'] = 778; 40560 t['degree'] = 400; 40561 t['ograve'] = 556; 40562 t['Ccaron'] = 722; 40563 t['ugrave'] = 556; 40564 t['radical'] = 453; 40565 t['Dcaron'] = 722; 40566 t['rcommaaccent'] = 333; 40567 t['Ntilde'] = 722; 40568 t['otilde'] = 556; 40569 t['Rcommaaccent'] = 722; 40570 t['Lcommaaccent'] = 556; 40571 t['Atilde'] = 667; 40572 t['Aogonek'] = 667; 40573 t['Aring'] = 667; 40574 t['Otilde'] = 778; 40575 t['zdotaccent'] = 500; 40576 t['Ecaron'] = 667; 40577 t['Iogonek'] = 278; 40578 t['kcommaaccent'] = 500; 40579 t['minus'] = 584; 40580 t['Icircumflex'] = 278; 40581 t['ncaron'] = 556; 40582 t['tcommaaccent'] = 278; 40583 t['logicalnot'] = 584; 40584 t['odieresis'] = 556; 40585 t['udieresis'] = 556; 40586 t['notequal'] = 549; 40587 t['gcommaaccent'] = 556; 40588 t['eth'] = 556; 40589 t['zcaron'] = 500; 40590 t['ncommaaccent'] = 556; 40591 t['onesuperior'] = 333; 40592 t['imacron'] = 278; 40593 t['Euro'] = 556; 40594 }); 40595 t['Helvetica-Bold'] = (0, _util.getLookupTableFactory)(function (t) { 40596 t['space'] = 278; 40597 t['exclam'] = 333; 40598 t['quotedbl'] = 474; 40599 t['numbersign'] = 556; 40600 t['dollar'] = 556; 40601 t['percent'] = 889; 40602 t['ampersand'] = 722; 40603 t['quoteright'] = 278; 40604 t['parenleft'] = 333; 40605 t['parenright'] = 333; 40606 t['asterisk'] = 389; 40607 t['plus'] = 584; 40608 t['comma'] = 278; 40609 t['hyphen'] = 333; 40610 t['period'] = 278; 40611 t['slash'] = 278; 40612 t['zero'] = 556; 40613 t['one'] = 556; 40614 t['two'] = 556; 40615 t['three'] = 556; 40616 t['four'] = 556; 40617 t['five'] = 556; 40618 t['six'] = 556; 40619 t['seven'] = 556; 40620 t['eight'] = 556; 40621 t['nine'] = 556; 40622 t['colon'] = 333; 40623 t['semicolon'] = 333; 40624 t['less'] = 584; 40625 t['equal'] = 584; 40626 t['greater'] = 584; 40627 t['question'] = 611; 40628 t['at'] = 975; 40629 t['A'] = 722; 40630 t['B'] = 722; 40631 t['C'] = 722; 40632 t['D'] = 722; 40633 t['E'] = 667; 40634 t['F'] = 611; 40635 t['G'] = 778; 40636 t['H'] = 722; 40637 t['I'] = 278; 40638 t['J'] = 556; 40639 t['K'] = 722; 40640 t['L'] = 611; 40641 t['M'] = 833; 40642 t['N'] = 722; 40643 t['O'] = 778; 40644 t['P'] = 667; 40645 t['Q'] = 778; 40646 t['R'] = 722; 40647 t['S'] = 667; 40648 t['T'] = 611; 40649 t['U'] = 722; 40650 t['V'] = 667; 40651 t['W'] = 944; 40652 t['X'] = 667; 40653 t['Y'] = 667; 40654 t['Z'] = 611; 40655 t['bracketleft'] = 333; 40656 t['backslash'] = 278; 40657 t['bracketright'] = 333; 40658 t['asciicircum'] = 584; 40659 t['underscore'] = 556; 40660 t['quoteleft'] = 278; 40661 t['a'] = 556; 40662 t['b'] = 611; 40663 t['c'] = 556; 40664 t['d'] = 611; 40665 t['e'] = 556; 40666 t['f'] = 333; 40667 t['g'] = 611; 40668 t['h'] = 611; 40669 t['i'] = 278; 40670 t['j'] = 278; 40671 t['k'] = 556; 40672 t['l'] = 278; 40673 t['m'] = 889; 40674 t['n'] = 611; 40675 t['o'] = 611; 40676 t['p'] = 611; 40677 t['q'] = 611; 40678 t['r'] = 389; 40679 t['s'] = 556; 40680 t['t'] = 333; 40681 t['u'] = 611; 40682 t['v'] = 556; 40683 t['w'] = 778; 40684 t['x'] = 556; 40685 t['y'] = 556; 40686 t['z'] = 500; 40687 t['braceleft'] = 389; 40688 t['bar'] = 280; 40689 t['braceright'] = 389; 40690 t['asciitilde'] = 584; 40691 t['exclamdown'] = 333; 40692 t['cent'] = 556; 40693 t['sterling'] = 556; 40694 t['fraction'] = 167; 40695 t['yen'] = 556; 40696 t['florin'] = 556; 40697 t['section'] = 556; 40698 t['currency'] = 556; 40699 t['quotesingle'] = 238; 40700 t['quotedblleft'] = 500; 40701 t['guillemotleft'] = 556; 40702 t['guilsinglleft'] = 333; 40703 t['guilsinglright'] = 333; 40704 t['fi'] = 611; 40705 t['fl'] = 611; 40706 t['endash'] = 556; 40707 t['dagger'] = 556; 40708 t['daggerdbl'] = 556;
40709 t['periodcentered'] = 278; 40710 t['paragraph'] = 556; 40711 t['bullet'] = 350; 40712 t['quotesinglbase'] = 278; 40713 t['quotedblbase'] = 500; 40714 t['quotedblright'] = 500; 40715 t['guillemotright'] = 556; 40716 t['ellipsis'] = 1000; 40717 t['perthousand'] = 1000; 40718 t['questiondown'] = 611; 40719 t['grave'] = 333; 40720 t['acute'] = 333; 40721 t['circumflex'] = 333; 40722 t['tilde'] = 333; 40723 t['macron'] = 333; 40724 t['breve'] = 333; 40725 t['dotaccent'] = 333; 40726 t['dieresis'] = 333; 40727 t['ring'] = 333; 40728 t['cedilla'] = 333; 40729 t['hungarumlaut'] = 333; 40730 t['ogonek'] = 333; 40731 t['caron'] = 333; 40732 t['emdash'] = 1000; 40733 t['AE'] = 1000; 40734 t['ordfeminine'] = 370; 40735 t['Lslash'] = 611; 40736 t['Oslash'] = 778; 40737 t['OE'] = 1000; 40738 t['ordmasculine'] = 365; 40739 t['ae'] = 889; 40740 t['dotlessi'] = 278; 40741 t['lslash'] = 278; 40742 t['oslash'] = 611; 40743 t['oe'] = 944; 40744 t['germandbls'] = 611; 40745 t['Idieresis'] = 278; 40746 t['eacute'] = 556; 40747 t['abreve'] = 556; 40748 t['uhungarumlaut'] = 611; 40749 t['ecaron'] = 556; 40750 t['Ydieresis'] = 667; 40751 t['divide'] = 584; 40752 t['Yacute'] = 667; 40753 t['Acircumflex'] = 722; 40754 t['aacute'] = 556; 40755 t['Ucircumflex'] = 722; 40756 t['yacute'] = 556; 40757 t['scommaaccent'] = 556; 40758 t['ecircumflex'] = 556; 40759 t['Uring'] = 722; 40760 t['Udieresis'] = 722; 40761 t['aogonek'] = 556; 40762 t['Uacute'] = 722; 40763 t['uogonek'] = 611; 40764 t['Edieresis'] = 667; 40765 t['Dcroat'] = 722; 40766 t['commaaccent'] = 250; 40767 t['copyright'] = 737; 40768 t['Emacron'] = 667; 40769 t['ccaron'] = 556; 40770 t['aring'] = 556; 40771 t['Ncommaaccent'] = 722; 40772 t['lacute'] = 278; 40773 t['agrave'] = 556; 40774 t['Tcommaaccent'] = 611; 40775 t['Cacute'] = 722; 40776 t['atilde'] = 556; 40777 t['Edotaccent'] = 667; 40778 t['scaron'] = 556; 40779 t['scedilla'] = 556; 40780 t['iacute'] = 278; 40781 t['lozenge'] = 494; 40782 t['Rcaron'] = 722; 40783 t['Gcommaaccent'] = 778; 40784 t['ucircumflex'] = 611; 40785 t['acircumflex'] = 556; 40786 t['Amacron'] = 722; 40787 t['rcaron'] = 389; 40788 t['ccedilla'] = 556; 40789 t['Zdotaccent'] = 611; 40790 t['Thorn'] = 667; 40791 t['Omacron'] = 778; 40792 t['Racute'] = 722; 40793 t['Sacute'] = 667; 40794 t['dcaron'] = 743; 40795 t['Umacron'] = 722; 40796 t['uring'] = 611; 40797 t['threesuperior'] = 333; 40798 t['Ograve'] = 778; 40799 t['Agrave'] = 722; 40800 t['Abreve'] = 722; 40801 t['multiply'] = 584; 40802 t['uacute'] = 611; 40803 t['Tcaron'] = 611; 40804 t['partialdiff'] = 494; 40805 t['ydieresis'] = 556; 40806 t['Nacute'] = 722; 40807 t['icircumflex'] = 278; 40808 t['Ecircumflex'] = 667; 40809 t['adieresis'] = 556; 40810 t['edieresis'] = 556; 40811 t['cacute'] = 556; 40812 t['nacute'] = 611; 40813 t['umacron'] = 611; 40814 t['Ncaron'] = 722; 40815 t['Iacute'] = 278; 40816 t['plusminus'] = 584; 40817 t['brokenbar'] = 280; 40818 t['registered'] = 737; 40819 t['Gbreve'] = 778; 40820 t['Idotaccent'] = 278; 40821 t['summation'] = 600; 40822 t['Egrave'] = 667; 40823 t['racute'] = 389; 40824 t['omacron'] = 611; 40825 t['Zacute'] = 611; 40826 t['Zcaron'] = 611; 40827 t['greaterequal'] = 549; 40828 t['Eth'] = 722; 40829 t['Ccedilla'] = 722; 40830 t['lcommaaccent'] = 278; 40831 t['tcaron'] = 389; 40832 t['eogonek'] = 556; 40833 t['Uogonek'] = 722; 40834 t['Aacute'] = 722; 40835 t['Adieresis'] = 722; 40836 t['egrave'] = 556; 40837 t['zacute'] = 500; 40838 t['iogonek'] = 278; 40839 t['Oacute'] = 778; 40840 t['oacute'] = 611; 40841 t['amacron'] = 556; 40842 t['sacute'] = 556; 40843 t['idieresis'] = 278; 40844 t['Ocircumflex'] = 778; 40845 t['Ugrave'] = 722; 40846 t['Delta'] = 612; 40847 t['thorn'] = 611; 40848 t['twosuperior'] = 333; 40849 t['Odieresis'] = 778; 40850 t['mu'] = 611; 40851 t['igrave'] = 278; 40852 t['ohungarumlaut'] = 611; 40853 t['Eogonek'] = 667; 40854 t['dcroat'] = 611; 40855 t['threequarters'] = 834; 40856 t['Scedilla'] = 667; 40857 t['lcaron'] = 400; 40858 t['Kcommaaccent'] = 722; 40859 t['Lacute'] = 611; 40860 t['trademark'] = 1000; 40861 t['edotaccent'] = 556; 40862 t['Igrave'] = 278; 40863 t['Imacron'] = 278; 40864 t['Lcaron'] = 611; 40865 t['onehalf'] = 834; 40866 t['lessequal'] = 549; 40867 t['ocircumflex'] = 611; 40868 t['ntilde'] = 611; 40869 t['Uhungarumlaut'] = 722; 40870 t['Eacute'] = 667; 40871 t['emacron'] = 556; 40872 t['gbreve'] = 611; 40873 t['onequarter'] = 834; 40874 t['Scaron'] = 667; 40875 t['Scommaaccent'] = 667; 40876 t['Ohungarumlaut'] = 778; 40877 t['degree'] = 400; 40878 t['ograve'] = 611; 40879 t['Ccaron'] = 722; 40880 t['ugrave'] = 611; 40881 t['radical'] = 549; 40882 t['Dcaron'] = 722; 40883 t['rcommaaccent'] = 389; 40884 t['Ntilde'] = 722; 40885 t['otilde'] = 611; 40886 t['Rcommaaccent'] = 722; 40887 t['Lcommaaccent'] = 611; 40888 t['Atilde'] = 722; 40889 t['Aogonek'] = 722; 40890 t['Aring'] = 722; 40891 t['Otilde'] = 778; 40892 t['zdotaccent'] = 500; 40893 t['Ecaron'] = 667; 40894 t['Iogonek'] = 278; 40895 t['kcommaaccent'] = 556; 40896 t['minus'] = 584; 40897 t['Icircumflex'] = 278; 40898 t['ncaron'] = 611; 40899 t['tcommaaccent'] = 333; 40900 t['logicalnot'] = 584; 40901 t['odieresis'] = 611; 40902 t['udieresis'] = 611; 40903 t['notequal'] = 549; 40904 t['gcommaaccent'] = 611; 40905 t['eth'] = 611; 40906 t['zcaron'] = 500; 40907 t['ncommaaccent'] = 611; 40908 t['onesuperior'] = 333; 40909 t['imacron'] = 278; 40910 t['Euro'] = 556; 40911 }); 40912 t['Helvetica-BoldOblique'] = (0, _util.getLookupTableFactory)(function (t) { 40913 t['space'] = 278; 40914 t['exclam'] = 333; 40915 t['quotedbl'] = 474; 40916 t['numbersign'] = 556; 40917 t['dollar'] = 556; 40918 t['percent'] = 889; 40919 t['ampersand'] = 722; 40920 t['quoteright'] = 278; 40921 t['parenleft'] = 333; 40922 t['parenright'] = 333; 40923 t['asterisk'] = 389; 40924 t['plus'] = 584; 40925 t['comma'] = 278; 40926 t['hyphen'] = 333; 40927 t['period'] = 278; 40928 t['slash'] = 278; 40929 t['zero'] = 556; 40930 t['one'] = 556; 40931 t['two'] = 556; 40932 t['three'] = 556; 40933 t['four'] = 556; 40934 t['five'] = 556; 40935 t['six'] = 556; 40936 t['seven'] = 556; 40937 t['eight'] = 556; 40938 t['nine'] = 556; 40939 t['colon'] = 333; 40940 t['semicolon'] = 333; 40941 t['less'] = 584; 40942 t['equal'] = 584; 40943 t['greater'] = 584; 40944 t['question'] = 611; 40945 t['at'] = 975; 40946 t['A'] = 722; 40947 t['B'] = 722; 40948 t['C'] = 722; 40949 t['D'] = 722; 40950 t['E'] = 667; 40951 t['F'] = 611; 40952 t['G'] = 778; 40953 t['H'] = 722; 40954 t['I'] = 278; 40955 t['J'] = 556; 40956 t['K'] = 722; 40957 t['L'] = 611; 40958 t['M'] = 833; 40959 t['N'] = 722; 40960 t['O'] = 778; 40961 t['P'] = 667; 40962 t['Q'] = 778; 40963 t['R'] = 722; 40964 t['S'] = 667; 40965 t['T'] = 611; 40966 t['U'] = 722; 40967 t['V'] = 667; 40968 t['W'] = 944; 40969 t['X'] = 667; 40970 t['Y'] = 667; 40971 t['Z'] = 611; 40972 t['bracketleft'] = 333; 40973 t['backslash'] = 278; 40974 t['bracketright'] = 333; 40975 t['asciicircum'] = 584; 40976 t['underscore'] = 556; 40977 t['quoteleft'] = 278; 40978 t['a'] = 556; 40979 t['b'] = 611; 40980 t['c'] = 556; 40981 t['d'] = 611; 40982 t['e'] = 556; 40983 t['f'] = 333; 40984 t['g'] = 611; 40985 t['h'] = 611; 40986 t['i'] = 278; 40987 t['j'] = 278; 40988 t['k'] = 556; 40989 t['l'] = 278; 40990 t['m'] = 889; 40991 t['n'] = 611; 40992 t['o'] = 611; 40993 t['p'] = 611; 40994 t['q'] = 611; 40995 t['r'] = 389; 40996 t['s'] = 556; 40997 t['t'] = 333; 40998 t['u'] = 611; 40999 t['v'] = 556; 41000 t['w'] = 778; 41001 t['x'] = 556; 41002 t['y'] = 556; 41003 t['z'] = 500; 41004 t['braceleft'] = 389; 41005 t['bar'] = 280; 41006 t['braceright'] = 389; 41007 t['asciitilde'] = 584; 41008 t['exclamdown'] = 333; 41009 t['cent'] = 556; 41010 t['sterling'] = 556; 41011 t['fraction'] = 167; 41012 t['yen'] = 556; 41013 t['florin'] = 556; 41014 t['section'] = 556; 41015 t['currency'] = 556; 41016 t['quotesingle'] = 238; 41017 t['quotedblleft'] = 500; 41018 t['guillemotleft'] = 556; 41019 t['guilsinglleft'] = 333; 41020 t['guilsinglright'] = 333; 41021 t['fi'] = 611; 41022 t['fl'] = 611; 41023 t['endash'] = 556; 41024 t['dagger'] = 556; 41025 t['daggerdbl'] = 556;
41026 t['periodcentered'] = 278; 41027 t['paragraph'] = 556; 41028 t['bullet'] = 350; 41029 t['quotesinglbase'] = 278; 41030 t['quotedblbase'] = 500; 41031 t['quotedblright'] = 500; 41032 t['guillemotright'] = 556; 41033 t['ellipsis'] = 1000; 41034 t['perthousand'] = 1000; 41035 t['questiondown'] = 611; 41036 t['grave'] = 333; 41037 t['acute'] = 333; 41038 t['circumflex'] = 333; 41039 t['tilde'] = 333; 41040 t['macron'] = 333; 41041 t['breve'] = 333; 41042 t['dotaccent'] = 333; 41043 t['dieresis'] = 333; 41044 t['ring'] = 333; 41045 t['cedilla'] = 333; 41046 t['hungarumlaut'] = 333; 41047 t['ogonek'] = 333; 41048 t['caron'] = 333; 41049 t['emdash'] = 1000; 41050 t['AE'] = 1000; 41051 t['ordfeminine'] = 370; 41052 t['Lslash'] = 611; 41053 t['Oslash'] = 778; 41054 t['OE'] = 1000; 41055 t['ordmasculine'] = 365; 41056 t['ae'] = 889; 41057 t['dotlessi'] = 278; 41058 t['lslash'] = 278; 41059 t['oslash'] = 611; 41060 t['oe'] = 944; 41061 t['germandbls'] = 611; 41062 t['Idieresis'] = 278; 41063 t['eacute'] = 556; 41064 t['abreve'] = 556; 41065 t['uhungarumlaut'] = 611; 41066 t['ecaron'] = 556; 41067 t['Ydieresis'] = 667; 41068 t['divide'] = 584; 41069 t['Yacute'] = 667; 41070 t['Acircumflex'] = 722; 41071 t['aacute'] = 556; 41072 t['Ucircumflex'] = 722; 41073 t['yacute'] = 556; 41074 t['scommaaccent'] = 556; 41075 t['ecircumflex'] = 556; 41076 t['Uring'] = 722; 41077 t['Udieresis'] = 722; 41078 t['aogonek'] = 556; 41079 t['Uacute'] = 722; 41080 t['uogonek'] = 611; 41081 t['Edieresis'] = 667; 41082 t['Dcroat'] = 722; 41083 t['commaaccent'] = 250; 41084 t['copyright'] = 737; 41085 t['Emacron'] = 667; 41086 t['ccaron'] = 556; 41087 t['aring'] = 556; 41088 t['Ncommaaccent'] = 722; 41089 t['lacute'] = 278; 41090 t['agrave'] = 556; 41091 t['Tcommaaccent'] = 611; 41092 t['Cacute'] = 722; 41093 t['atilde'] = 556; 41094 t['Edotaccent'] = 667; 41095 t['scaron'] = 556; 41096 t['scedilla'] = 556; 41097 t['iacute'] = 278; 41098 t['lozenge'] = 494; 41099 t['Rcaron'] = 722; 41100 t['Gcommaaccent'] = 778; 41101 t['ucircumflex'] = 611; 41102 t['acircumflex'] = 556; 41103 t['Amacron'] = 722; 41104 t['rcaron'] = 389; 41105 t['ccedilla'] = 556; 41106 t['Zdotaccent'] = 611; 41107 t['Thorn'] = 667; 41108 t['Omacron'] = 778; 41109 t['Racute'] = 722; 41110 t['Sacute'] = 667; 41111 t['dcaron'] = 743; 41112 t['Umacron'] = 722; 41113 t['uring'] = 611; 41114 t['threesuperior'] = 333; 41115 t['Ograve'] = 778; 41116 t['Agrave'] = 722; 41117 t['Abreve'] = 722; 41118 t['multiply'] = 584; 41119 t['uacute'] = 611; 41120 t['Tcaron'] = 611; 41121 t['partialdiff'] = 494; 41122 t['ydieresis'] = 556; 41123 t['Nacute'] = 722; 41124 t['icircumflex'] = 278; 41125 t['Ecircumflex'] = 667; 41126 t['adieresis'] = 556; 41127 t['edieresis'] = 556; 41128 t['cacute'] = 556; 41129 t['nacute'] = 611; 41130 t['umacron'] = 611; 41131 t['Ncaron'] = 722; 41132 t['Iacute'] = 278; 41133 t['plusminus'] = 584; 41134 t['brokenbar'] = 280; 41135 t['registered'] = 737; 41136 t['Gbreve'] = 778; 41137 t['Idotaccent'] = 278; 41138 t['summation'] = 600; 41139 t['Egrave'] = 667; 41140 t['racute'] = 389; 41141 t['omacron'] = 611; 41142 t['Zacute'] = 611; 41143 t['Zcaron'] = 611; 41144 t['greaterequal'] = 549; 41145 t['Eth'] = 722; 41146 t['Ccedilla'] = 722; 41147 t['lcommaaccent'] = 278; 41148 t['tcaron'] = 389; 41149 t['eogonek'] = 556; 41150 t['Uogonek'] = 722; 41151 t['Aacute'] = 722; 41152 t['Adieresis'] = 722; 41153 t['egrave'] = 556; 41154 t['zacute'] = 500; 41155 t['iogonek'] = 278; 41156 t['Oacute'] = 778; 41157 t['oacute'] = 611; 41158 t['amacron'] = 556; 41159 t['sacute'] = 556; 41160 t['idieresis'] = 278; 41161 t['Ocircumflex'] = 778; 41162 t['Ugrave'] = 722; 41163 t['Delta'] = 612; 41164 t['thorn'] = 611; 41165 t['twosuperior'] = 333; 41166 t['Odieresis'] = 778; 41167 t['mu'] = 611; 41168 t['igrave'] = 278; 41169 t['ohungarumlaut'] = 611; 41170 t['Eogonek'] = 667; 41171 t['dcroat'] = 611; 41172 t['threequarters'] = 834; 41173 t['Scedilla'] = 667; 41174 t['lcaron'] = 400; 41175 t['Kcommaaccent'] = 722; 41176 t['Lacute'] = 611; 41177 t['trademark'] = 1000; 41178 t['edotaccent'] = 556; 41179 t['Igrave'] = 278; 41180 t['Imacron'] = 278; 41181 t['Lcaron'] = 611; 41182 t['onehalf'] = 834; 41183 t['lessequal'] = 549; 41184 t['ocircumflex'] = 611; 41185 t['ntilde'] = 611; 41186 t['Uhungarumlaut'] = 722; 41187 t['Eacute'] = 667; 41188 t['emacron'] = 556; 41189 t['gbreve'] = 611; 41190 t['onequarter'] = 834; 41191 t['Scaron'] = 667; 41192 t['Scommaaccent'] = 667; 41193 t['Ohungarumlaut'] = 778; 41194 t['degree'] = 400; 41195 t['ograve'] = 611; 41196 t['Ccaron'] = 722; 41197 t['ugrave'] = 611; 41198 t['radical'] = 549; 41199 t['Dcaron'] = 722; 41200 t['rcommaaccent'] = 389; 41201 t['Ntilde'] = 722; 41202 t['otilde'] = 611; 41203 t['Rcommaaccent'] = 722; 41204 t['Lcommaaccent'] = 611; 41205 t['Atilde'] = 722; 41206 t['Aogonek'] = 722; 41207 t['Aring'] = 722; 41208 t['Otilde'] = 778; 41209 t['zdotaccent'] = 500; 41210 t['Ecaron'] = 667; 41211 t['Iogonek'] = 278; 41212 t['kcommaaccent'] = 556; 41213 t['minus'] = 584; 41214 t['Icircumflex'] = 278; 41215 t['ncaron'] = 611; 41216 t['tcommaaccent'] = 333; 41217 t['logicalnot'] = 584; 41218 t['odieresis'] = 611; 41219 t['udieresis'] = 611; 41220 t['notequal'] = 549; 41221 t['gcommaaccent'] = 611; 41222 t['eth'] = 611; 41223 t['zcaron'] = 500; 41224 t['ncommaaccent'] = 611; 41225 t['onesuperior'] = 333; 41226 t['imacron'] = 278; 41227 t['Euro'] = 556; 41228 }); 41229 t['Helvetica-Oblique'] = (0, _util.getLookupTableFactory)(function (t) { 41230 t['space'] = 278; 41231 t['exclam'] = 278; 41232 t['quotedbl'] = 355; 41233 t['numbersign'] = 556; 41234 t['dollar'] = 556; 41235 t['percent'] = 889; 41236 t['ampersand'] = 667; 41237 t['quoteright'] = 222; 41238 t['parenleft'] = 333; 41239 t['parenright'] = 333; 41240 t['asterisk'] = 389; 41241 t['plus'] = 584; 41242 t['comma'] = 278; 41243 t['hyphen'] = 333; 41244 t['period'] = 278; 41245 t['slash'] = 278; 41246 t['zero'] = 556; 41247 t['one'] = 556; 41248 t['two'] = 556; 41249 t['three'] = 556; 41250 t['four'] = 556; 41251 t['five'] = 556; 41252 t['six'] = 556; 41253 t['seven'] = 556; 41254 t['eight'] = 556; 41255 t['nine'] = 556; 41256 t['colon'] = 278; 41257 t['semicolon'] = 278; 41258 t['less'] = 584; 41259 t['equal'] = 584; 41260 t['greater'] = 584; 41261 t['question'] = 556; 41262 t['at'] = 1015; 41263 t['A'] = 667; 41264 t['B'] = 667; 41265 t['C'] = 722; 41266 t['D'] = 722; 41267 t['E'] = 667; 41268 t['F'] = 611; 41269 t['G'] = 778; 41270 t['H'] = 722; 41271 t['I'] = 278; 41272 t['J'] = 500; 41273 t['K'] = 667; 41274 t['L'] = 556; 41275 t['M'] = 833; 41276 t['N'] = 722; 41277 t['O'] = 778; 41278 t['P'] = 667; 41279 t['Q'] = 778; 41280 t['R'] = 722; 41281 t['S'] = 667; 41282 t['T'] = 611; 41283 t['U'] = 722; 41284 t['V'] = 667; 41285 t['W'] = 944; 41286 t['X'] = 667; 41287 t['Y'] = 667; 41288 t['Z'] = 611; 41289 t['bracketleft'] = 278; 41290 t['backslash'] = 278; 41291 t['bracketright'] = 278; 41292 t['asciicircum'] = 469; 41293 t['underscore'] = 556; 41294 t['quoteleft'] = 222; 41295 t['a'] = 556; 41296 t['b'] = 556; 41297 t['c'] = 500; 41298 t['d'] = 556; 41299 t['e'] = 556; 41300 t['f'] = 278; 41301 t['g'] = 556; 41302 t['h'] = 556; 41303 t['i'] = 222; 41304 t['j'] = 222; 41305 t['k'] = 500; 41306 t['l'] = 222; 41307 t['m'] = 833; 41308 t['n'] = 556; 41309 t['o'] = 556; 41310 t['p'] = 556; 41311 t['q'] = 556; 41312 t['r'] = 333; 41313 t['s'] = 500; 41314 t['t'] = 278; 41315 t['u'] = 556; 41316 t['v'] = 500; 41317 t['w'] = 722; 41318 t['x'] = 500; 41319 t['y'] = 500; 41320 t['z'] = 500; 41321 t['braceleft'] = 334; 41322 t['bar'] = 260; 41323 t['braceright'] = 334; 41324 t['asciitilde'] = 584; 41325 t['exclamdown'] = 333; 41326 t['cent'] = 556; 41327 t['sterling'] = 556; 41328 t['fraction'] = 167; 41329 t['yen'] = 556; 41330 t['florin'] = 556; 41331 t['section'] = 556; 41332 t['currency'] = 556; 41333 t['quotesingle'] = 191; 41334 t['quotedblleft'] = 333; 41335 t['guillemotleft'] = 556; 41336 t['guilsinglleft'] = 333; 41337 t['guilsinglright'] = 333; 41338 t['fi'] = 500; 41339 t['fl'] = 500; 41340 t['endash'] = 556; 41341 t['dagger'] = 556; 41342 t['daggerdbl'] = 556;
41343 t['periodcentered'] = 278; 41344 t['paragraph'] = 537; 41345 t['bullet'] = 350; 41346 t['quotesinglbase'] = 222; 41347 t['quotedblbase'] = 333; 41348 t['quotedblright'] = 333; 41349 t['guillemotright'] = 556; 41350 t['ellipsis'] = 1000; 41351 t['perthousand'] = 1000; 41352 t['questiondown'] = 611; 41353 t['grave'] = 333; 41354 t['acute'] = 333; 41355 t['circumflex'] = 333; 41356 t['tilde'] = 333; 41357 t['macron'] = 333; 41358 t['breve'] = 333; 41359 t['dotaccent'] = 333; 41360 t['dieresis'] = 333; 41361 t['ring'] = 333; 41362 t['cedilla'] = 333; 41363 t['hungarumlaut'] = 333; 41364 t['ogonek'] = 333; 41365 t['caron'] = 333; 41366 t['emdash'] = 1000; 41367 t['AE'] = 1000; 41368 t['ordfeminine'] = 370; 41369 t['Lslash'] = 556; 41370 t['Oslash'] = 778; 41371 t['OE'] = 1000; 41372 t['ordmasculine'] = 365; 41373 t['ae'] = 889; 41374 t['dotlessi'] = 278; 41375 t['lslash'] = 222; 41376 t['oslash'] = 611; 41377 t['oe'] = 944; 41378 t['germandbls'] = 611; 41379 t['Idieresis'] = 278; 41380 t['eacute'] = 556; 41381 t['abreve'] = 556; 41382 t['uhungarumlaut'] = 556; 41383 t['ecaron'] = 556; 41384 t['Ydieresis'] = 667; 41385 t['divide'] = 584; 41386 t['Yacute'] = 667; 41387 t['Acircumflex'] = 667; 41388 t['aacute'] = 556; 41389 t['Ucircumflex'] = 722; 41390 t['yacute'] = 500; 41391 t['scommaaccent'] = 500; 41392 t['ecircumflex'] = 556; 41393 t['Uring'] = 722; 41394 t['Udieresis'] = 722; 41395 t['aogonek'] = 556; 41396 t['Uacute'] = 722; 41397 t['uogonek'] = 556; 41398 t['Edieresis'] = 667; 41399 t['Dcroat'] = 722; 41400 t['commaaccent'] = 250; 41401 t['copyright'] = 737; 41402 t['Emacron'] = 667; 41403 t['ccaron'] = 500; 41404 t['aring'] = 556; 41405 t['Ncommaaccent'] = 722; 41406 t['lacute'] = 222; 41407 t['agrave'] = 556; 41408 t['Tcommaaccent'] = 611; 41409 t['Cacute'] = 722; 41410 t['atilde'] = 556; 41411 t['Edotaccent'] = 667; 41412 t['scaron'] = 500; 41413 t['scedilla'] = 500; 41414 t['iacute'] = 278; 41415 t['lozenge'] = 471; 41416 t['Rcaron'] = 722; 41417 t['Gcommaaccent'] = 778; 41418 t['ucircumflex'] = 556; 41419 t['acircumflex'] = 556; 41420 t['Amacron'] = 667; 41421 t['rcaron'] = 333; 41422 t['ccedilla'] = 500; 41423 t['Zdotaccent'] = 611; 41424 t['Thorn'] = 667; 41425 t['Omacron'] = 778; 41426 t['Racute'] = 722; 41427 t['Sacute'] = 667; 41428 t['dcaron'] = 643; 41429 t['Umacron'] = 722; 41430 t['uring'] = 556; 41431 t['threesuperior'] = 333; 41432 t['Ograve'] = 778; 41433 t['Agrave'] = 667; 41434 t['Abreve'] = 667; 41435 t['multiply'] = 584; 41436 t['uacute'] = 556; 41437 t['Tcaron'] = 611; 41438 t['partialdiff'] = 476; 41439 t['ydieresis'] = 500; 41440 t['Nacute'] = 722; 41441 t['icircumflex'] = 278; 41442 t['Ecircumflex'] = 667; 41443 t['adieresis'] = 556; 41444 t['edieresis'] = 556; 41445 t['cacute'] = 500; 41446 t['nacute'] = 556; 41447 t['umacron'] = 556; 41448 t['Ncaron'] = 722; 41449 t['Iacute'] = 278; 41450 t['plusminus'] = 584; 41451 t['brokenbar'] = 260; 41452 t['registered'] = 737; 41453 t['Gbreve'] = 778; 41454 t['Idotaccent'] = 278; 41455 t['summation'] = 600; 41456 t['Egrave'] = 667; 41457 t['racute'] = 333; 41458 t['omacron'] = 556; 41459 t['Zacute'] = 611; 41460 t['Zcaron'] = 611; 41461 t['greaterequal'] = 549; 41462 t['Eth'] = 722; 41463 t['Ccedilla'] = 722; 41464 t['lcommaaccent'] = 222; 41465 t['tcaron'] = 317; 41466 t['eogonek'] = 556; 41467 t['Uogonek'] = 722; 41468 t['Aacute'] = 667; 41469 t['Adieresis'] = 667; 41470 t['egrave'] = 556; 41471 t['zacute'] = 500; 41472 t['iogonek'] = 222; 41473 t['Oacute'] = 778; 41474 t['oacute'] = 556; 41475 t['amacron'] = 556; 41476 t['sacute'] = 500; 41477 t['idieresis'] = 278; 41478 t['Ocircumflex'] = 778; 41479 t['Ugrave'] = 722; 41480 t['Delta'] = 612; 41481 t['thorn'] = 556; 41482 t['twosuperior'] = 333; 41483 t['Odieresis'] = 778; 41484 t['mu'] = 556; 41485 t['igrave'] = 278; 41486 t['ohungarumlaut'] = 556; 41487 t['Eogonek'] = 667; 41488 t['dcroat'] = 556; 41489 t['threequarters'] = 834; 41490 t['Scedilla'] = 667; 41491 t['lcaron'] = 299; 41492 t['Kcommaaccent'] = 667; 41493 t['Lacute'] = 556; 41494 t['trademark'] = 1000; 41495 t['edotaccent'] = 556; 41496 t['Igrave'] = 278; 41497 t['Imacron'] = 278; 41498 t['Lcaron'] = 556; 41499 t['onehalf'] = 834; 41500 t['lessequal'] = 549; 41501 t['ocircumflex'] = 556; 41502 t['ntilde'] = 556; 41503 t['Uhungarumlaut'] = 722; 41504 t['Eacute'] = 667; 41505 t['emacron'] = 556; 41506 t['gbreve'] = 556; 41507 t['onequarter'] = 834; 41508 t['Scaron'] = 667; 41509 t['Scommaaccent'] = 667; 41510 t['Ohungarumlaut'] = 778; 41511 t['degree'] = 400; 41512 t['ograve'] = 556; 41513 t['Ccaron'] = 722; 41514 t['ugrave'] = 556; 41515 t['radical'] = 453; 41516 t['Dcaron'] = 722; 41517 t['rcommaaccent'] = 333; 41518 t['Ntilde'] = 722; 41519 t['otilde'] = 556; 41520 t['Rcommaaccent'] = 722; 41521 t['Lcommaaccent'] = 556; 41522 t['Atilde'] = 667; 41523 t['Aogonek'] = 667; 41524 t['Aring'] = 667; 41525 t['Otilde'] = 778; 41526 t['zdotaccent'] = 500; 41527 t['Ecaron'] = 667; 41528 t['Iogonek'] = 278; 41529 t['kcommaaccent'] = 500; 41530 t['minus'] = 584; 41531 t['Icircumflex'] = 278; 41532 t['ncaron'] = 556; 41533 t['tcommaaccent'] = 278; 41534 t['logicalnot'] = 584; 41535 t['odieresis'] = 556; 41536 t['udieresis'] = 556; 41537 t['notequal'] = 549; 41538 t['gcommaaccent'] = 556; 41539 t['eth'] = 556; 41540 t['zcaron'] = 500; 41541 t['ncommaaccent'] = 556; 41542 t['onesuperior'] = 333; 41543 t['imacron'] = 278; 41544 t['Euro'] = 556; 41545 }); 41546 t['Symbol'] = (0, _util.getLookupTableFactory)(function (t) { 41547 t['space'] = 250; 41548 t['exclam'] = 333; 41549 t['universal'] = 713; 41550 t['numbersign'] = 500; 41551 t['existential'] = 549; 41552 t['percent'] = 833; 41553 t['ampersand'] = 778; 41554 t['suchthat'] = 439; 41555 t['parenleft'] = 333; 41556 t['parenright'] = 333; 41557 t['asteriskmath'] = 500; 41558 t['plus'] = 549; 41559 t['comma'] = 250; 41560 t['minus'] = 549; 41561 t['period'] = 250; 41562 t['slash'] = 278; 41563 t['zero'] = 500; 41564 t['one'] = 500; 41565 t['two'] = 500; 41566 t['three'] = 500; 41567 t['four'] = 500; 41568 t['five'] = 500; 41569 t['six'] = 500; 41570 t['seven'] = 500; 41571 t['eight'] = 500; 41572 t['nine'] = 500; 41573 t['colon'] = 278; 41574 t['semicolon'] = 278; 41575 t['less'] = 549; 41576 t['equal'] = 549; 41577 t['greater'] = 549; 41578 t['question'] = 444; 41579 t['congruent'] = 549; 41580 t['Alpha'] = 722; 41581 t['Beta'] = 667; 41582 t['Chi'] = 722; 41583 t['Delta'] = 612; 41584 t['Epsilon'] = 611; 41585 t['Phi'] = 763; 41586 t['Gamma'] = 603; 41587 t['Eta'] = 722; 41588 t['Iota'] = 333; 41589 t['theta1'] = 631; 41590 t['Kappa'] = 722; 41591 t['Lambda'] = 686; 41592 t['Mu'] = 889; 41593 t['Nu'] = 722; 41594 t['Omicron'] = 722; 41595 t['Pi'] = 768; 41596 t['Theta'] = 741; 41597 t['Rho'] = 556;
41598 t['Sigma'] = 592; 41599 t['Tau'] = 611; 41600 t['Upsilon'] = 690; 41601 t['sigma1'] = 439; 41602 t['Omega'] = 768; 41603 t['Xi'] = 645; 41604 t['Psi'] = 795; 41605 t['Zeta'] = 611; 41606 t['bracketleft'] = 333; 41607 t['therefore'] = 863; 41608 t['bracketright'] = 333; 41609 t['perpendicular'] = 658; 41610 t['underscore'] = 500; 41611 t['radicalex'] = 500; 41612 t['alpha'] = 631; 41613 t['beta'] = 549; 41614 t['chi'] = 549; 41615 t['delta'] = 494; 41616 t['epsilon'] = 439; 41617 t['phi'] = 521; 41618 t['gamma'] = 411; 41619 t['eta'] = 603; 41620 t['iota'] = 329; 41621 t['phi1'] = 603; 41622 t['kappa'] = 549; 41623 t['lambda'] = 549; 41624 t['mu'] = 576; 41625 t['nu'] = 521; 41626 t['omicron'] = 549; 41627 t['pi'] = 549; 41628 t['theta'] = 521; 41629 t['rho'] = 549; 41630 t['sigma'] = 603; 41631 t['tau'] = 439; 41632 t['upsilon'] = 576; 41633 t['omega1'] = 713; 41634 t['omega'] = 686; 41635 t['xi'] = 493; 41636 t['psi'] = 686; 41637 t['zeta'] = 494; 41638 t['braceleft'] = 480; 41639 t['bar'] = 200; 41640 t['braceright'] = 480; 41641 t['similar'] = 549; 41642 t['Euro'] = 750; 41643 t['Upsilon1'] = 620; 41644 t['minute'] = 247; 41645 t['lessequal'] = 549; 41646 t['fraction'] = 167; 41647 t['infinity'] = 713; 41648 t['florin'] = 500; 41649 t['club'] = 753; 41650 t['diamond'] = 753; 41651 t['heart'] = 753; 41652 t['spade'] = 753; 41653 t['arrowboth'] = 1042; 41654 t['arrowleft'] = 987; 41655 t['arrowup'] = 603; 41656 t['arrowright'] = 987; 41657 t['arrowdown'] = 603; 41658 t['degree'] = 400; 41659 t['plusminus'] = 549; 41660 t['second'] = 411; 41661 t['greaterequal'] = 549; 41662 t['multiply'] = 549; 41663 t['proportional'] = 713; 41664 t['partialdiff'] = 494; 41665 t['bullet'] = 460; 41666 t['divide'] = 549; 41667 t['notequal'] = 549; 41668 t['equivalence'] = 549; 41669 t['approxequal'] = 549; 41670 t['ellipsis'] = 1000; 41671 t['arrowvertex'] = 603; 41672 t['arrowhorizex'] = 1000; 41673 t['carriagereturn'] = 658; 41674 t['aleph'] = 823; 41675 t['Ifraktur'] = 686; 41676 t['Rfraktur'] = 795; 41677 t['weierstrass'] = 987; 41678 t['circlemultiply'] = 768; 41679 t['circleplus'] = 768; 41680 t['emptyset'] = 823; 41681 t['intersection'] = 768; 41682 t['union'] = 768; 41683 t['propersuperset'] = 713; 41684 t['reflexsuperset'] = 713; 41685 t['notsubset'] = 713; 41686 t['propersubset'] = 713; 41687 t['reflexsubset'] = 713; 41688 t['element'] = 713; 41689 t['notelement'] = 713; 41690 t['angle'] = 768; 41691 t['gradient'] = 713; 41692 t['registerserif'] = 790; 41693 t['copyrightserif'] = 790; 41694 t['trademarkserif'] = 890; 41695 t['product'] = 823; 41696 t['radical'] = 549; 41697 t['dotmath'] = 250; 41698 t['logicalnot'] = 713; 41699 t['logicaland'] = 603; 41700 t['logicalor'] = 603; 41701 t['arrowdblboth'] = 1042; 41702 t['arrowdblleft'] = 987; 41703 t['arrowdblup'] = 603; 41704 t['arrowdblright'] = 987; 41705 t['arrowdbldown'] = 603; 41706 t['lozenge'] = 494; 41707 t['angleleft'] = 329; 41708 t['registersans'] = 790; 41709 t['copyrightsans'] = 790; 41710 t['trademarksans'] = 786; 41711 t['summation'] = 713; 41712 t['parenlefttp'] = 384; 41713 t['parenleftex'] = 384; 41714 t['parenleftbt'] = 384; 41715 t['bracketlefttp'] = 384; 41716 t['bracketleftex'] = 384; 41717 t['bracketleftbt'] = 384; 41718 t['bracelefttp'] = 494; 41719 t['braceleftmid'] = 494; 41720 t['braceleftbt'] = 494; 41721 t['braceex'] = 494; 41722 t['angleright'] = 329; 41723 t['integral'] = 274; 41724 t['integraltp'] = 686; 41725 t['integralex'] = 686; 41726 t['integralbt'] = 686; 41727 t['parenrighttp'] = 384; 41728 t['parenrightex'] = 384; 41729 t['parenrightbt'] = 384; 41730 t['bracketrighttp'] = 384; 41731 t['bracketrightex'] = 384; 41732 t['bracketrightbt'] = 384; 41733 t['bracerighttp'] = 494; 41734 t['bracerightmid'] = 494; 41735 t['bracerightbt'] = 494; 41736 t['apple'] = 790; 41737 }); 41738 t['Times-Roman'] = (0, _util.getLookupTableFactory)(function (t) { 41739 t['space'] = 250; 41740 t['exclam'] = 333; 41741 t['quotedbl'] = 408; 41742 t['numbersign'] = 500; 41743 t['dollar'] = 500; 41744 t['percent'] = 833; 41745 t['ampersand'] = 778; 41746 t['quoteright'] = 333; 41747 t['parenleft'] = 333; 41748 t['parenright'] = 333; 41749 t['asterisk'] = 500; 41750 t['plus'] = 564; 41751 t['comma'] = 250; 41752 t['hyphen'] = 333; 41753 t['period'] = 250; 41754 t['slash'] = 278; 41755 t['zero'] = 500; 41756 t['one'] = 500; 41757 t['two'] = 500; 41758 t['three'] = 500; 41759 t['four'] = 500; 41760 t['five'] = 500; 41761 t['six'] = 500; 41762 t['seven'] = 500; 41763 t['eight'] = 500; 41764 t['nine'] = 500; 41765 t['colon'] = 278; 41766 t['semicolon'] = 278; 41767 t['less'] = 564; 41768 t['equal'] = 564; 41769 t['greater'] = 564; 41770 t['question'] = 444; 41771 t['at'] = 921; 41772 t['A'] = 722; 41773 t['B'] = 667; 41774 t['C'] = 667; 41775 t['D'] = 722; 41776 t['E'] = 611; 41777 t['F'] = 556; 41778 t['G'] = 722; 41779 t['H'] = 722; 41780 t['I'] = 333; 41781 t['J'] = 389; 41782 t['K'] = 722; 41783 t['L'] = 611; 41784 t['M'] = 889; 41785 t['N'] = 722; 41786 t['O'] = 722; 41787 t['P'] = 556; 41788 t['Q'] = 722; 41789 t['R'] = 667; 41790 t['S'] = 556; 41791 t['T'] = 611; 41792 t['U'] = 722; 41793 t['V'] = 722; 41794 t['W'] = 944; 41795 t['X'] = 722; 41796 t['Y'] = 722; 41797 t['Z'] = 611; 41798 t['bracketleft'] = 333; 41799 t['backslash'] = 278; 41800 t['bracketright'] = 333; 41801 t['asciicircum'] = 469; 41802 t['underscore'] = 500; 41803 t['quoteleft'] = 333; 41804 t['a'] = 444; 41805 t['b'] = 500; 41806 t['c'] = 444; 41807 t['d'] = 500; 41808 t['e'] = 444; 41809 t['f'] = 333; 41810 t['g'] = 500; 41811 t['h'] = 500; 41812 t['i'] = 278; 41813 t['j'] = 278; 41814 t['k'] = 500; 41815 t['l'] = 278; 41816 t['m'] = 778; 41817 t['n'] = 500; 41818 t['o'] = 500; 41819 t['p'] = 500; 41820 t['q'] = 500; 41821 t['r'] = 333; 41822 t['s'] = 389; 41823 t['t'] = 278; 41824 t['u'] = 500; 41825 t['v'] = 500; 41826 t['w'] = 722; 41827 t['x'] = 500; 41828 t['y'] = 500; 41829 t['z'] = 444; 41830 t['braceleft'] = 480; 41831 t['bar'] = 200; 41832 t['braceright'] = 480; 41833 t['asciitilde'] = 541; 41834 t['exclamdown'] = 333; 41835 t['cent'] = 500; 41836 t['sterling'] = 500; 41837 t['fraction'] = 167; 41838 t['yen'] = 500; 41839 t['florin'] = 500; 41840 t['section'] = 500; 41841 t['currency'] = 500; 41842 t['quotesingle'] = 180; 41843 t['quotedblleft'] = 444; 41844 t['guillemotleft'] = 500; 41845 t['guilsinglleft'] = 333; 41846 t['guilsinglright'] = 333; 41847 t['fi'] = 556; 41848 t['fl'] = 556; 41849 t['endash'] = 500; 41850 t['dagger'] = 500; 41851 t['daggerdbl'] = 500;
41852 t['periodcentered'] = 250; 41853 t['paragraph'] = 453; 41854 t['bullet'] = 350; 41855 t['quotesinglbase'] = 333; 41856 t['quotedblbase'] = 444; 41857 t['quotedblright'] = 444; 41858 t['guillemotright'] = 500; 41859 t['ellipsis'] = 1000; 41860 t['perthousand'] = 1000; 41861 t['questiondown'] = 444; 41862 t['grave'] = 333; 41863 t['acute'] = 333; 41864 t['circumflex'] = 333; 41865 t['tilde'] = 333; 41866 t['macron'] = 333; 41867 t['breve'] = 333; 41868 t['dotaccent'] = 333; 41869 t['dieresis'] = 333; 41870 t['ring'] = 333; 41871 t['cedilla'] = 333; 41872 t['hungarumlaut'] = 333; 41873 t['ogonek'] = 333; 41874 t['caron'] = 333; 41875 t['emdash'] = 1000; 41876 t['AE'] = 889; 41877 t['ordfeminine'] = 276; 41878 t['Lslash'] = 611; 41879 t['Oslash'] = 722; 41880 t['OE'] = 889; 41881 t['ordmasculine'] = 310; 41882 t['ae'] = 667; 41883 t['dotlessi'] = 278; 41884 t['lslash'] = 278; 41885 t['oslash'] = 500; 41886 t['oe'] = 722; 41887 t['germandbls'] = 500; 41888 t['Idieresis'] = 333; 41889 t['eacute'] = 444; 41890 t['abreve'] = 444; 41891 t['uhungarumlaut'] = 500; 41892 t['ecaron'] = 444; 41893 t['Ydieresis'] = 722; 41894 t['divide'] = 564; 41895 t['Yacute'] = 722; 41896 t['Acircumflex'] = 722; 41897 t['aacute'] = 444; 41898 t['Ucircumflex'] = 722; 41899 t['yacute'] = 500; 41900 t['scommaaccent'] = 389; 41901 t['ecircumflex'] = 444; 41902 t['Uring'] = 722; 41903 t['Udieresis'] = 722; 41904 t['aogonek'] = 444; 41905 t['Uacute'] = 722; 41906 t['uogonek'] = 500; 41907 t['Edieresis'] = 611; 41908 t['Dcroat'] = 722; 41909 t['commaaccent'] = 250; 41910 t['copyright'] = 760; 41911 t['Emacron'] = 611; 41912 t['ccaron'] = 444; 41913 t['aring'] = 444; 41914 t['Ncommaaccent'] = 722; 41915 t['lacute'] = 278; 41916 t['agrave'] = 444; 41917 t['Tcommaaccent'] = 611; 41918 t['Cacute'] = 667; 41919 t['atilde'] = 444; 41920 t['Edotaccent'] = 611; 41921 t['scaron'] = 389; 41922 t['scedilla'] = 389; 41923 t['iacute'] = 278; 41924 t['lozenge'] = 471; 41925 t['Rcaron'] = 667; 41926 t['Gcommaaccent'] = 722; 41927 t['ucircumflex'] = 500; 41928 t['acircumflex'] = 444; 41929 t['Amacron'] = 722; 41930 t['rcaron'] = 333; 41931 t['ccedilla'] = 444; 41932 t['Zdotaccent'] = 611; 41933 t['Thorn'] = 556; 41934 t['Omacron'] = 722; 41935 t['Racute'] = 667; 41936 t['Sacute'] = 556; 41937 t['dcaron'] = 588; 41938 t['Umacron'] = 722; 41939 t['uring'] = 500; 41940 t['threesuperior'] = 300; 41941 t['Ograve'] = 722; 41942 t['Agrave'] = 722; 41943 t['Abreve'] = 722; 41944 t['multiply'] = 564; 41945 t['uacute'] = 500; 41946 t['Tcaron'] = 611; 41947 t['partialdiff'] = 476; 41948 t['ydieresis'] = 500; 41949 t['Nacute'] = 722; 41950 t['icircumflex'] = 278; 41951 t['Ecircumflex'] = 611; 41952 t['adieresis'] = 444; 41953 t['edieresis'] = 444; 41954 t['cacute'] = 444; 41955 t['nacute'] = 500; 41956 t['umacron'] = 500; 41957 t['Ncaron'] = 722; 41958 t['Iacute'] = 333; 41959 t['plusminus'] = 564; 41960 t['brokenbar'] = 200; 41961 t['registered'] = 760; 41962 t['Gbreve'] = 722; 41963 t['Idotaccent'] = 333; 41964 t['summation'] = 600; 41965 t['Egrave'] = 611; 41966 t['racute'] = 333; 41967 t['omacron'] = 500; 41968 t['Zacute'] = 611; 41969 t['Zcaron'] = 611; 41970 t['greaterequal'] = 549; 41971 t['Eth'] = 722; 41972 t['Ccedilla'] = 667; 41973 t['lcommaaccent'] = 278; 41974 t['tcaron'] = 326; 41975 t['eogonek'] = 444; 41976 t['Uogonek'] = 722; 41977 t['Aacute'] = 722; 41978 t['Adieresis'] = 722; 41979 t['egrave'] = 444; 41980 t['zacute'] = 444; 41981 t['iogonek'] = 278; 41982 t['Oacute'] = 722; 41983 t['oacute'] = 500; 41984 t['amacron'] = 444; 41985 t['sacute'] = 389; 41986 t['idieresis'] = 278; 41987 t['Ocircumflex'] = 722; 41988 t['Ugrave'] = 722; 41989 t['Delta'] = 612; 41990 t['thorn'] = 500; 41991 t['twosuperior'] = 300; 41992 t['Odieresis'] = 722; 41993 t['mu'] = 500; 41994 t['igrave'] = 278; 41995 t['ohungarumlaut'] = 500; 41996 t['Eogonek'] = 611; 41997 t['dcroat'] = 500; 41998 t['threequarters'] = 750; 41999 t['Scedilla'] = 556; 42000 t['lcaron'] = 344; 42001 t['Kcommaaccent'] = 722; 42002 t['Lacute'] = 611; 42003 t['trademark'] = 980; 42004 t['edotaccent'] = 444; 42005 t['Igrave'] = 333; 42006 t['Imacron'] = 333; 42007 t['Lcaron'] = 611; 42008 t['onehalf'] = 750; 42009 t['lessequal'] = 549; 42010 t['ocircumflex'] = 500; 42011 t['ntilde'] = 500; 42012 t['Uhungarumlaut'] = 722; 42013 t['Eacute'] = 611; 42014 t['emacron'] = 444; 42015 t['gbreve'] = 500; 42016 t['onequarter'] = 750; 42017 t['Scaron'] = 556; 42018 t['Scommaaccent'] = 556; 42019 t['Ohungarumlaut'] = 722; 42020 t['degree'] = 400; 42021 t['ograve'] = 500; 42022 t['Ccaron'] = 667; 42023 t['ugrave'] = 500; 42024 t['radical'] = 453; 42025 t['Dcaron'] = 722; 42026 t['rcommaaccent'] = 333; 42027 t['Ntilde'] = 722; 42028 t['otilde'] = 500; 42029 t['Rcommaaccent'] = 667; 42030 t['Lcommaaccent'] = 611; 42031 t['Atilde'] = 722; 42032 t['Aogonek'] = 722; 42033 t['Aring'] = 722; 42034 t['Otilde'] = 722; 42035 t['zdotaccent'] = 444; 42036 t['Ecaron'] = 611; 42037 t['Iogonek'] = 333; 42038 t['kcommaaccent'] = 500; 42039 t['minus'] = 564; 42040 t['Icircumflex'] = 333; 42041 t['ncaron'] = 500; 42042 t['tcommaaccent'] = 278; 42043 t['logicalnot'] = 564; 42044 t['odieresis'] = 500; 42045 t['udieresis'] = 500; 42046 t['notequal'] = 549; 42047 t['gcommaaccent'] = 500; 42048 t['eth'] = 500; 42049 t['zcaron'] = 444; 42050 t['ncommaaccent'] = 500; 42051 t['onesuperior'] = 300; 42052 t['imacron'] = 278; 42053 t['Euro'] = 500; 42054 }); 42055 t['Times-Bold'] = (0, _util.getLookupTableFactory)(function (t) { 42056 t['space'] = 250; 42057 t['exclam'] = 333; 42058 t['quotedbl'] = 555; 42059 t['numbersign'] = 500; 42060 t['dollar'] = 500; 42061 t['percent'] = 1000; 42062 t['ampersand'] = 833; 42063 t['quoteright'] = 333; 42064 t['parenleft'] = 333; 42065 t['parenright'] = 333; 42066 t['asterisk'] = 500; 42067 t['plus'] = 570; 42068 t['comma'] = 250; 42069 t['hyphen'] = 333; 42070 t['period'] = 250; 42071 t['slash'] = 278; 42072 t['zero'] = 500; 42073 t['one'] = 500; 42074 t['two'] = 500; 42075 t['three'] = 500; 42076 t['four'] = 500; 42077 t['five'] = 500; 42078 t['six'] = 500; 42079 t['seven'] = 500; 42080 t['eight'] = 500; 42081 t['nine'] = 500; 42082 t['colon'] = 333; 42083 t['semicolon'] = 333; 42084 t['less'] = 570; 42085 t['equal'] = 570; 42086 t['greater'] = 570; 42087 t['question'] = 500; 42088 t['at'] = 930; 42089 t['A'] = 722; 42090 t['B'] = 667; 42091 t['C'] = 722; 42092 t['D'] = 722; 42093 t['E'] = 667; 42094 t['F'] = 611; 42095 t['G'] = 778; 42096 t['H'] = 778; 42097 t['I'] = 389; 42098 t['J'] = 500; 42099 t['K'] = 778; 42100 t['L'] = 667; 42101 t['M'] = 944; 42102 t['N'] = 722; 42103 t['O'] = 778; 42104 t['P'] = 611; 42105 t['Q'] = 778; 42106 t['R'] = 722; 42107 t['S'] = 556; 42108 t['T'] = 667; 42109 t['U'] = 722; 42110 t['V'] = 722; 42111 t['W'] = 1000; 42112 t['X'] = 722; 42113 t['Y'] = 722; 42114 t['Z'] = 667; 42115 t['bracketleft'] = 333; 42116 t['backslash'] = 278; 42117 t['bracketright'] = 333; 42118 t['asciicircum'] = 581; 42119 t['underscore'] = 500; 42120 t['quoteleft'] = 333; 42121 t['a'] = 500; 42122 t['b'] = 556; 42123 t['c'] = 444; 42124 t['d'] = 556; 42125 t['e'] = 444; 42126 t['f'] = 333; 42127 t['g'] = 500; 42128 t['h'] = 556; 42129 t['i'] = 278; 42130 t['j'] = 333; 42131 t['k'] = 556; 42132 t['l'] = 278; 42133 t['m'] = 833; 42134 t['n'] = 556; 42135 t['o'] = 500; 42136 t['p'] = 556; 42137 t['q'] = 556; 42138 t['r'] = 444; 42139 t['s'] = 389; 42140 t['t'] = 333; 42141 t['u'] = 556; 42142 t['v'] = 500; 42143 t['w'] = 722; 42144 t['x'] = 500; 42145 t['y'] = 500; 42146 t['z'] = 444; 42147 t['braceleft'] = 394; 42148 t['bar'] = 220; 42149 t['braceright'] = 394; 42150 t['asciitilde'] = 520; 42151 t['exclamdown'] = 333; 42152 t['cent'] = 500; 42153 t['sterling'] = 500; 42154 t['fraction'] = 167; 42155 t['yen'] = 500; 42156 t['florin'] = 500; 42157 t['section'] = 500; 42158 t['currency'] = 500; 42159 t['quotesingle'] = 278; 42160 t['quotedblleft'] = 500; 42161 t['guillemotleft'] = 500; 42162 t['guilsinglleft'] = 333; 42163 t['guilsinglright'] = 333; 42164 t['fi'] = 556; 42165 t['fl'] = 556; 42166 t['endash'] = 500; 42167 t['dagger'] = 500; 42168 t['daggerdbl'] = 500;
42169 t['periodcentered'] = 250; 42170 t['paragraph'] = 540; 42171 t['bullet'] = 350; 42172 t['quotesinglbase'] = 333; 42173 t['quotedblbase'] = 500; 42174 t['quotedblright'] = 500; 42175 t['guillemotright'] = 500; 42176 t['ellipsis'] = 1000; 42177 t['perthousand'] = 1000; 42178 t['questiondown'] = 500; 42179 t['grave'] = 333; 42180 t['acute'] = 333; 42181 t['circumflex'] = 333; 42182 t['tilde'] = 333; 42183 t['macron'] = 333; 42184 t['breve'] = 333; 42185 t['dotaccent'] = 333; 42186 t['dieresis'] = 333; 42187 t['ring'] = 333; 42188 t['cedilla'] = 333; 42189 t['hungarumlaut'] = 333; 42190 t['ogonek'] = 333; 42191 t['caron'] = 333; 42192 t['emdash'] = 1000; 42193 t['AE'] = 1000; 42194 t['ordfeminine'] = 300; 42195 t['Lslash'] = 667; 42196 t['Oslash'] = 778; 42197 t['OE'] = 1000; 42198 t['ordmasculine'] = 330; 42199 t['ae'] = 722; 42200 t['dotlessi'] = 278; 42201 t['lslash'] = 278; 42202 t['oslash'] = 500; 42203 t['oe'] = 722; 42204 t['germandbls'] = 556; 42205 t['Idieresis'] = 389; 42206 t['eacute'] = 444; 42207 t['abreve'] = 500; 42208 t['uhungarumlaut'] = 556; 42209 t['ecaron'] = 444; 42210 t['Ydieresis'] = 722; 42211 t['divide'] = 570; 42212 t['Yacute'] = 722; 42213 t['Acircumflex'] = 722; 42214 t['aacute'] = 500; 42215 t['Ucircumflex'] = 722; 42216 t['yacute'] = 500; 42217 t['scommaaccent'] = 389; 42218 t['ecircumflex'] = 444; 42219 t['Uring'] = 722; 42220 t['Udieresis'] = 722; 42221 t['aogonek'] = 500; 42222 t['Uacute'] = 722; 42223 t['uogonek'] = 556; 42224 t['Edieresis'] = 667; 42225 t['Dcroat'] = 722; 42226 t['commaaccent'] = 250; 42227 t['copyright'] = 747; 42228 t['Emacron'] = 667; 42229 t['ccaron'] = 444; 42230 t['aring'] = 500; 42231 t['Ncommaaccent'] = 722; 42232 t['lacute'] = 278; 42233 t['agrave'] = 500; 42234 t['Tcommaaccent'] = 667; 42235 t['Cacute'] = 722; 42236 t['atilde'] = 500; 42237 t['Edotaccent'] = 667; 42238 t['scaron'] = 389; 42239 t['scedilla'] = 389; 42240 t['iacute'] = 278; 42241 t['lozenge'] = 494; 42242 t['Rcaron'] = 722; 42243 t['Gcommaaccent'] = 778; 42244 t['ucircumflex'] = 556; 42245 t['acircumflex'] = 500; 42246 t['Amacron'] = 722; 42247 t['rcaron'] = 444; 42248 t['ccedilla'] = 444; 42249 t['Zdotaccent'] = 667; 42250 t['Thorn'] = 611; 42251 t['Omacron'] = 778; 42252 t['Racute'] = 722; 42253 t['Sacute'] = 556; 42254 t['dcaron'] = 672; 42255 t['Umacron'] = 722; 42256 t['uring'] = 556; 42257 t['threesuperior'] = 300; 42258 t['Ograve'] = 778; 42259 t['Agrave'] = 722; 42260 t['Abreve'] = 722; 42261 t['multiply'] = 570; 42262 t['uacute'] = 556; 42263 t['Tcaron'] = 667; 42264 t['partialdiff'] = 494; 42265 t['ydieresis'] = 500; 42266 t['Nacute'] = 722; 42267 t['icircumflex'] = 278; 42268 t['Ecircumflex'] = 667; 42269 t['adieresis'] = 500; 42270 t['edieresis'] = 444; 42271 t['cacute'] = 444; 42272 t['nacute'] = 556; 42273 t['umacron'] = 556; 42274 t['Ncaron'] = 722; 42275 t['Iacute'] = 389; 42276 t['plusminus'] = 570; 42277 t['brokenbar'] = 220; 42278 t['registered'] = 747; 42279 t['Gbreve'] = 778; 42280 t['Idotaccent'] = 389; 42281 t['summation'] = 600; 42282 t['Egrave'] = 667; 42283 t['racute'] = 444; 42284 t['omacron'] = 500; 42285 t['Zacute'] = 667; 42286 t['Zcaron'] = 667; 42287 t['greaterequal'] = 549; 42288 t['Eth'] = 722; 42289 t['Ccedilla'] = 722; 42290 t['lcommaaccent'] = 278; 42291 t['tcaron'] = 416; 42292 t['eogonek'] = 444; 42293 t['Uogonek'] = 722; 42294 t['Aacute'] = 722; 42295 t['Adieresis'] = 722; 42296 t['egrave'] = 444; 42297 t['zacute'] = 444; 42298 t['iogonek'] = 278; 42299 t['Oacute'] = 778; 42300 t['oacute'] = 500; 42301 t['amacron'] = 500; 42302 t['sacute'] = 389; 42303 t['idieresis'] = 278; 42304 t['Ocircumflex'] = 778; 42305 t['Ugrave'] = 722; 42306 t['Delta'] = 612; 42307 t['thorn'] = 556; 42308 t['twosuperior'] = 300; 42309 t['Odieresis'] = 778; 42310 t['mu'] = 556; 42311 t['igrave'] = 278; 42312 t['ohungarumlaut'] = 500; 42313 t['Eogonek'] = 667; 42314 t['dcroat'] = 556; 42315 t['threequarters'] = 750; 42316 t['Scedilla'] = 556; 42317 t['lcaron'] = 394; 42318 t['Kcommaaccent'] = 778; 42319 t['Lacute'] = 667; 42320 t['trademark'] = 1000; 42321 t['edotaccent'] = 444; 42322 t['Igrave'] = 389; 42323 t['Imacron'] = 389; 42324 t['Lcaron'] = 667; 42325 t['onehalf'] = 750; 42326 t['lessequal'] = 549; 42327 t['ocircumflex'] = 500; 42328 t['ntilde'] = 556; 42329 t['Uhungarumlaut'] = 722; 42330 t['Eacute'] = 667; 42331 t['emacron'] = 444; 42332 t['gbreve'] = 500; 42333 t['onequarter'] = 750; 42334 t['Scaron'] = 556; 42335 t['Scommaaccent'] = 556; 42336 t['Ohungarumlaut'] = 778; 42337 t['degree'] = 400; 42338 t['ograve'] = 500; 42339 t['Ccaron'] = 722; 42340 t['ugrave'] = 556; 42341 t['radical'] = 549; 42342 t['Dcaron'] = 722; 42343 t['rcommaaccent'] = 444; 42344 t['Ntilde'] = 722; 42345 t['otilde'] = 500; 42346 t['Rcommaaccent'] = 722; 42347 t['Lcommaaccent'] = 667; 42348 t['Atilde'] = 722; 42349 t['Aogonek'] = 722; 42350 t['Aring'] = 722; 42351 t['Otilde'] = 778; 42352 t['zdotaccent'] = 444; 42353 t['Ecaron'] = 667; 42354 t['Iogonek'] = 389; 42355 t['kcommaaccent'] = 556; 42356 t['minus'] = 570; 42357 t['Icircumflex'] = 389; 42358 t['ncaron'] = 556; 42359 t['tcommaaccent'] = 333; 42360 t['logicalnot'] = 570; 42361 t['odieresis'] = 500; 42362 t['udieresis'] = 556; 42363 t['notequal'] = 549; 42364 t['gcommaaccent'] = 500; 42365 t['eth'] = 500; 42366 t['zcaron'] = 444; 42367 t['ncommaaccent'] = 556; 42368 t['onesuperior'] = 300; 42369 t['imacron'] = 278; 42370 t['Euro'] = 500; 42371 }); 42372 t['Times-BoldItalic'] = (0, _util.getLookupTableFactory)(function (t) { 42373 t['space'] = 250; 42374 t['exclam'] = 389; 42375 t['quotedbl'] = 555; 42376 t['numbersign'] = 500; 42377 t['dollar'] = 500; 42378 t['percent'] = 833; 42379 t['ampersand'] = 778; 42380 t['quoteright'] = 333; 42381 t['parenleft'] = 333; 42382 t['parenright'] = 333; 42383 t['asterisk'] = 500; 42384 t['plus'] = 570; 42385 t['comma'] = 250; 42386 t['hyphen'] = 333; 42387 t['period'] = 250; 42388 t['slash'] = 278; 42389 t['zero'] = 500; 42390 t['one'] = 500; 42391 t['two'] = 500; 42392 t['three'] = 500; 42393 t['four'] = 500; 42394 t['five'] = 500; 42395 t['six'] = 500; 42396 t['seven'] = 500; 42397 t['eight'] = 500; 42398 t['nine'] = 500; 42399 t['colon'] = 333; 42400 t['semicolon'] = 333; 42401 t['less'] = 570; 42402 t['equal'] = 570; 42403 t['greater'] = 570; 42404 t['question'] = 500; 42405 t['at'] = 832; 42406 t['A'] = 667; 42407 t['B'] = 667; 42408 t['C'] = 667; 42409 t['D'] = 722; 42410 t['E'] = 667; 42411 t['F'] = 667; 42412 t['G'] = 722; 42413 t['H'] = 778; 42414 t['I'] = 389; 42415 t['J'] = 500; 42416 t['K'] = 667; 42417 t['L'] = 611; 42418 t['M'] = 889; 42419 t['N'] = 722; 42420 t['O'] = 722; 42421 t['P'] = 611; 42422 t['Q'] = 722; 42423 t['R'] = 667; 42424 t['S'] = 556; 42425 t['T'] = 611; 42426 t['U'] = 722; 42427 t['V'] = 667; 42428 t['W'] = 889; 42429 t['X'] = 667; 42430 t['Y'] = 611; 42431 t['Z'] = 611; 42432 t['bracketleft'] = 333; 42433 t['backslash'] = 278; 42434 t['bracketright'] = 333; 42435 t['asciicircum'] = 570; 42436 t['underscore'] = 500; 42437 t['quoteleft'] = 333; 42438 t['a'] = 500; 42439 t['b'] = 500; 42440 t['c'] = 444; 42441 t['d'] = 500; 42442 t['e'] = 444; 42443 t['f'] = 333; 42444 t['g'] = 500; 42445 t['h'] = 556; 42446 t['i'] = 278; 42447 t['j'] = 278; 42448 t['k'] = 500; 42449 t['l'] = 278; 42450 t['m'] = 778; 42451 t['n'] = 556; 42452 t['o'] = 500; 42453 t['p'] = 500; 42454 t['q'] = 500; 42455 t['r'] = 389; 42456 t['s'] = 389; 42457 t['t'] = 278; 42458 t['u'] = 556; 42459 t['v'] = 444; 42460 t['w'] = 667; 42461 t['x'] = 500; 42462 t['y'] = 444; 42463 t['z'] = 389; 42464 t['braceleft'] = 348; 42465 t['bar'] = 220; 42466 t['braceright'] = 348; 42467 t['asciitilde'] = 570; 42468 t['exclamdown'] = 389; 42469 t['cent'] = 500; 42470 t['sterling'] = 500; 42471 t['fraction'] = 167; 42472 t['yen'] = 500; 42473 t['florin'] = 500; 42474 t['section'] = 500; 42475 t['currency'] = 500; 42476 t['quotesingle'] = 278; 42477 t['quotedblleft'] = 500; 42478 t['guillemotleft'] = 500; 42479 t['guilsinglleft'] = 333; 42480 t['guilsinglright'] = 333; 42481 t['fi'] = 556; 42482 t['fl'] = 556; 42483 t['endash'] = 500; 42484 t['dagger'] = 500; 42485 t['daggerdbl'] = 500;
42486 t['periodcentered'] = 250; 42487 t['paragraph'] = 500; 42488 t['bullet'] = 350; 42489 t['quotesinglbase'] = 333; 42490 t['quotedblbase'] = 500; 42491 t['quotedblright'] = 500; 42492 t['guillemotright'] = 500; 42493 t['ellipsis'] = 1000; 42494 t['perthousand'] = 1000; 42495 t['questiondown'] = 500; 42496 t['grave'] = 333; 42497 t['acute'] = 333; 42498 t['circumflex'] = 333; 42499 t['tilde'] = 333; 42500 t['macron'] = 333; 42501 t['breve'] = 333; 42502 t['dotaccent'] = 333; 42503 t['dieresis'] = 333; 42504 t['ring'] = 333; 42505 t['cedilla'] = 333; 42506 t['hungarumlaut'] = 333; 42507 t['ogonek'] = 333; 42508 t['caron'] = 333; 42509 t['emdash'] = 1000; 42510 t['AE'] = 944; 42511 t['ordfeminine'] = 266; 42512 t['Lslash'] = 611; 42513 t['Oslash'] = 722; 42514 t['OE'] = 944; 42515 t['ordmasculine'] = 300; 42516 t['ae'] = 722; 42517 t['dotlessi'] = 278; 42518 t['lslash'] = 278; 42519 t['oslash'] = 500; 42520 t['oe'] = 722; 42521 t['germandbls'] = 500; 42522 t['Idieresis'] = 389; 42523 t['eacute'] = 444; 42524 t['abreve'] = 500; 42525 t['uhungarumlaut'] = 556; 42526 t['ecaron'] = 444; 42527 t['Ydieresis'] = 611; 42528 t['divide'] = 570; 42529 t['Yacute'] = 611; 42530 t['Acircumflex'] = 667; 42531 t['aacute'] = 500; 42532 t['Ucircumflex'] = 722; 42533 t['yacute'] = 444; 42534 t['scommaaccent'] = 389; 42535 t['ecircumflex'] = 444; 42536 t['Uring'] = 722; 42537 t['Udieresis'] = 722; 42538 t['aogonek'] = 500; 42539 t['Uacute'] = 722; 42540 t['uogonek'] = 556; 42541 t['Edieresis'] = 667; 42542 t['Dcroat'] = 722; 42543 t['commaaccent'] = 250; 42544 t['copyright'] = 747; 42545 t['Emacron'] = 667; 42546 t['ccaron'] = 444; 42547 t['aring'] = 500; 42548 t['Ncommaaccent'] = 722; 42549 t['lacute'] = 278; 42550 t['agrave'] = 500; 42551 t['Tcommaaccent'] = 611; 42552 t['Cacute'] = 667; 42553 t['atilde'] = 500; 42554 t['Edotaccent'] = 667; 42555 t['scaron'] = 389; 42556 t['scedilla'] = 389; 42557 t['iacute'] = 278; 42558 t['lozenge'] = 494; 42559 t['Rcaron'] = 667; 42560 t['Gcommaaccent'] = 722; 42561 t['ucircumflex'] = 556; 42562 t['acircumflex'] = 500; 42563 t['Amacron'] = 667; 42564 t['rcaron'] = 389; 42565 t['ccedilla'] = 444; 42566 t['Zdotaccent'] = 611; 42567 t['Thorn'] = 611; 42568 t['Omacron'] = 722; 42569 t['Racute'] = 667; 42570 t['Sacute'] = 556; 42571 t['dcaron'] = 608; 42572 t['Umacron'] = 722; 42573 t['uring'] = 556; 42574 t['threesuperior'] = 300; 42575 t['Ograve'] = 722; 42576 t['Agrave'] = 667; 42577 t['Abreve'] = 667; 42578 t['multiply'] = 570; 42579 t['uacute'] = 556; 42580 t['Tcaron'] = 611; 42581 t['partialdiff'] = 494; 42582 t['ydieresis'] = 444; 42583 t['Nacute'] = 722; 42584 t['icircumflex'] = 278; 42585 t['Ecircumflex'] = 667; 42586 t['adieresis'] = 500; 42587 t['edieresis'] = 444; 42588 t['cacute'] = 444; 42589 t['nacute'] = 556; 42590 t['umacron'] = 556; 42591 t['Ncaron'] = 722; 42592 t['Iacute'] = 389; 42593 t['plusminus'] = 570; 42594 t['brokenbar'] = 220; 42595 t['registered'] = 747; 42596 t['Gbreve'] = 722; 42597 t['Idotaccent'] = 389; 42598 t['summation'] = 600; 42599 t['Egrave'] = 667; 42600 t['racute'] = 389; 42601 t['omacron'] = 500; 42602 t['Zacute'] = 611; 42603 t['Zcaron'] = 611; 42604 t['greaterequal'] = 549; 42605 t['Eth'] = 722; 42606 t['Ccedilla'] = 667; 42607 t['lcommaaccent'] = 278; 42608 t['tcaron'] = 366; 42609 t['eogonek'] = 444; 42610 t['Uogonek'] = 722; 42611 t['Aacute'] = 667; 42612 t['Adieresis'] = 667; 42613 t['egrave'] = 444; 42614 t['zacute'] = 389; 42615 t['iogonek'] = 278; 42616 t['Oacute'] = 722; 42617 t['oacute'] = 500; 42618 t['amacron'] = 500; 42619 t['sacute'] = 389; 42620 t['idieresis'] = 278; 42621 t['Ocircumflex'] = 722; 42622 t['Ugrave'] = 722; 42623 t['Delta'] = 612; 42624 t['thorn'] = 500; 42625 t['twosuperior'] = 300; 42626 t['Odieresis'] = 722; 42627 t['mu'] = 576; 42628 t['igrave'] = 278; 42629 t['ohungarumlaut'] = 500; 42630 t['Eogonek'] = 667; 42631 t['dcroat'] = 500; 42632 t['threequarters'] = 750; 42633 t['Scedilla'] = 556; 42634 t['lcaron'] = 382; 42635 t['Kcommaaccent'] = 667; 42636 t['Lacute'] = 611; 42637 t['trademark'] = 1000; 42638 t['edotaccent'] = 444; 42639 t['Igrave'] = 389; 42640 t['Imacron'] = 389; 42641 t['Lcaron'] = 611; 42642 t['onehalf'] = 750; 42643 t['lessequal'] = 549; 42644 t['ocircumflex'] = 500; 42645 t['ntilde'] = 556; 42646 t['Uhungarumlaut'] = 722; 42647 t['Eacute'] = 667; 42648 t['emacron'] = 444; 42649 t['gbreve'] = 500; 42650 t['onequarter'] = 750; 42651 t['Scaron'] = 556; 42652 t['Scommaaccent'] = 556; 42653 t['Ohungarumlaut'] = 722; 42654 t['degree'] = 400; 42655 t['ograve'] = 500; 42656 t['Ccaron'] = 667; 42657 t['ugrave'] = 556; 42658 t['radical'] = 549; 42659 t['Dcaron'] = 722; 42660 t['rcommaaccent'] = 389; 42661 t['Ntilde'] = 722; 42662 t['otilde'] = 500; 42663 t['Rcommaaccent'] = 667; 42664 t['Lcommaaccent'] = 611; 42665 t['Atilde'] = 667; 42666 t['Aogonek'] = 667; 42667 t['Aring'] = 667; 42668 t['Otilde'] = 722; 42669 t['zdotaccent'] = 389; 42670 t['Ecaron'] = 667; 42671 t['Iogonek'] = 389; 42672 t['kcommaaccent'] = 500; 42673 t['minus'] = 606; 42674 t['Icircumflex'] = 389; 42675 t['ncaron'] = 556; 42676 t['tcommaaccent'] = 278; 42677 t['logicalnot'] = 606; 42678 t['odieresis'] = 500; 42679 t['udieresis'] = 556; 42680 t['notequal'] = 549; 42681 t['gcommaaccent'] = 500; 42682 t['eth'] = 500; 42683 t['zcaron'] = 389; 42684 t['ncommaaccent'] = 556; 42685 t['onesuperior'] = 300; 42686 t['imacron'] = 278; 42687 t['Euro'] = 500; 42688 }); 42689 t['Times-Italic'] = (0, _util.getLookupTableFactory)(function (t) { 42690 t['space'] = 250; 42691 t['exclam'] = 333; 42692 t['quotedbl'] = 420; 42693 t['numbersign'] = 500; 42694 t['dollar'] = 500; 42695 t['percent'] = 833; 42696 t['ampersand'] = 778; 42697 t['quoteright'] = 333; 42698 t['parenleft'] = 333; 42699 t['parenright'] = 333; 42700 t['asterisk'] = 500; 42701 t['plus'] = 675; 42702 t['comma'] = 250; 42703 t['hyphen'] = 333; 42704 t['period'] = 250; 42705 t['slash'] = 278; 42706 t['zero'] = 500; 42707 t['one'] = 500; 42708 t['two'] = 500; 42709 t['three'] = 500; 42710 t['four'] = 500; 42711 t['five'] = 500; 42712 t['six'] = 500; 42713 t['seven'] = 500; 42714 t['eight'] = 500; 42715 t['nine'] = 500; 42716 t['colon'] = 333; 42717 t['semicolon'] = 333; 42718 t['less'] = 675; 42719 t['equal'] = 675; 42720 t['greater'] = 675; 42721 t['question'] = 500; 42722 t['at'] = 920; 42723 t['A'] = 611; 42724 t['B'] = 611; 42725 t['C'] = 667; 42726 t['D'] = 722; 42727 t['E'] = 611; 42728 t['F'] = 611; 42729 t['G'] = 722; 42730 t['H'] = 722; 42731 t['I'] = 333; 42732 t['J'] = 444; 42733 t['K'] = 667; 42734 t['L'] = 556; 42735 t['M'] = 833; 42736 t['N'] = 667; 42737 t['O'] = 722; 42738 t['P'] = 611; 42739 t['Q'] = 722; 42740 t['R'] = 611; 42741 t['S'] = 500; 42742 t['T'] = 556; 42743 t['U'] = 722; 42744 t['V'] = 611; 42745 t['W'] = 833; 42746 t['X'] = 611; 42747 t['Y'] = 556; 42748 t['Z'] = 556; 42749 t['bracketleft'] = 389; 42750 t['backslash'] = 278; 42751 t['bracketright'] = 389; 42752 t['asciicircum'] = 422; 42753 t['underscore'] = 500; 42754 t['quoteleft'] = 333; 42755 t['a'] = 500; 42756 t['b'] = 500; 42757 t['c'] = 444; 42758 t['d'] = 500; 42759 t['e'] = 444; 42760 t['f'] = 278; 42761 t['g'] = 500; 42762 t['h'] = 500; 42763 t['i'] = 278; 42764 t['j'] = 278; 42765 t['k'] = 444; 42766 t['l'] = 278; 42767 t['m'] = 722; 42768 t['n'] = 500; 42769 t['o'] = 500; 42770 t['p'] = 500; 42771 t['q'] = 500; 42772 t['r'] = 389; 42773 t['s'] = 389; 42774 t['t'] = 278; 42775 t['u'] = 500; 42776 t['v'] = 444; 42777 t['w'] = 667; 42778 t['x'] = 444; 42779 t['y'] = 444; 42780 t['z'] = 389; 42781 t['braceleft'] = 400; 42782 t['bar'] = 275; 42783 t['braceright'] = 400; 42784 t['asciitilde'] = 541; 42785 t['exclamdown'] = 389; 42786 t['cent'] = 500; 42787 t['sterling'] = 500; 42788 t['fraction'] = 167; 42789 t['yen'] = 500; 42790 t['florin'] = 500; 42791 t['section'] = 500; 42792 t['currency'] = 500; 42793 t['quotesingle'] = 214; 42794 t['quotedblleft'] = 556; 42795 t['guillemotleft'] = 500; 42796 t['guilsinglleft'] = 333; 42797 t['guilsinglright'] = 333; 42798 t['fi'] = 500; 42799 t['fl'] = 500; 42800 t['endash'] = 500; 42801 t['dagger'] = 500; 42802 t['daggerdbl'] = 500;
42803 t['periodcentered'] = 250; 42804 t['paragraph'] = 523; 42805 t['bullet'] = 350; 42806 t['quotesinglbase'] = 333; 42807 t['quotedblbase'] = 556; 42808 t['quotedblright'] = 556; 42809 t['guillemotright'] = 500; 42810 t['ellipsis'] = 889; 42811 t['perthousand'] = 1000; 42812 t['questiondown'] = 500; 42813 t['grave'] = 333; 42814 t['acute'] = 333; 42815 t['circumflex'] = 333; 42816 t['tilde'] = 333; 42817 t['macron'] = 333; 42818 t['breve'] = 333; 42819 t['dotaccent'] = 333; 42820 t['dieresis'] = 333; 42821 t['ring'] = 333; 42822 t['cedilla'] = 333; 42823 t['hungarumlaut'] = 333; 42824 t['ogonek'] = 333; 42825 t['caron'] = 333; 42826 t['emdash'] = 889; 42827 t['AE'] = 889; 42828 t['ordfeminine'] = 276; 42829 t['Lslash'] = 556; 42830 t['Oslash'] = 722; 42831 t['OE'] = 944; 42832 t['ordmasculine'] = 310; 42833 t['ae'] = 667; 42834 t['dotlessi'] = 278; 42835 t['lslash'] = 278; 42836 t['oslash'] = 500; 42837 t['oe'] = 667; 42838 t['germandbls'] = 500; 42839 t['Idieresis'] = 333; 42840 t['eacute'] = 444; 42841 t['abreve'] = 500; 42842 t['uhungarumlaut'] = 500; 42843 t['ecaron'] = 444; 42844 t['Ydieresis'] = 556; 42845 t['divide'] = 675; 42846 t['Yacute'] = 556; 42847 t['Acircumflex'] = 611; 42848 t['aacute'] = 500; 42849 t['Ucircumflex'] = 722; 42850 t['yacute'] = 444; 42851 t['scommaaccent'] = 389; 42852 t['ecircumflex'] = 444; 42853 t['Uring'] = 722; 42854 t['Udieresis'] = 722; 42855 t['aogonek'] = 500; 42856 t['Uacute'] = 722; 42857 t['uogonek'] = 500; 42858 t['Edieresis'] = 611; 42859 t['Dcroat'] = 722; 42860 t['commaaccent'] = 250; 42861 t['copyright'] = 760; 42862 t['Emacron'] = 611; 42863 t['ccaron'] = 444; 42864 t['aring'] = 500; 42865 t['Ncommaaccent'] = 667; 42866 t['lacute'] = 278; 42867 t['agrave'] = 500; 42868 t['Tcommaaccent'] = 556; 42869 t['Cacute'] = 667; 42870 t['atilde'] = 500; 42871 t['Edotaccent'] = 611; 42872 t['scaron'] = 389; 42873 t['scedilla'] = 389; 42874 t['iacute'] = 278; 42875 t['lozenge'] = 471; 42876 t['Rcaron'] = 611; 42877 t['Gcommaaccent'] = 722; 42878 t['ucircumflex'] = 500; 42879 t['acircumflex'] = 500; 42880 t['Amacron'] = 611; 42881 t['rcaron'] = 389; 42882 t['ccedilla'] = 444; 42883 t['Zdotaccent'] = 556; 42884 t['Thorn'] = 611; 42885 t['Omacron'] = 722; 42886 t['Racute'] = 611; 42887 t['Sacute'] = 500; 42888 t['dcaron'] = 544; 42889 t['Umacron'] = 722; 42890 t['uring'] = 500; 42891 t['threesuperior'] = 300; 42892 t['Ograve'] = 722; 42893 t['Agrave'] = 611; 42894 t['Abreve'] = 611; 42895 t['multiply'] = 675; 42896 t['uacute'] = 500; 42897 t['Tcaron'] = 556; 42898 t['partialdiff'] = 476; 42899 t['ydieresis'] = 444; 42900 t['Nacute'] = 667; 42901 t['icircumflex'] = 278; 42902 t['Ecircumflex'] = 611; 42903 t['adieresis'] = 500; 42904 t['edieresis'] = 444; 42905 t['cacute'] = 444; 42906 t['nacute'] = 500; 42907 t['umacron'] = 500; 42908 t['Ncaron'] = 667; 42909 t['Iacute'] = 333; 42910 t['plusminus'] = 675; 42911 t['brokenbar'] = 275; 42912 t['registered'] = 760; 42913 t['Gbreve'] = 722; 42914 t['Idotaccent'] = 333; 42915 t['summation'] = 600; 42916 t['Egrave'] = 611; 42917 t['racute'] = 389; 42918 t['omacron'] = 500; 42919 t['Zacute'] = 556; 42920 t['Zcaron'] = 556; 42921 t['greaterequal'] = 549; 42922 t['Eth'] = 722; 42923 t['Ccedilla'] = 667; 42924 t['lcommaaccent'] = 278; 42925 t['tcaron'] = 300; 42926 t['eogonek'] = 444; 42927 t['Uogonek'] = 722; 42928 t['Aacute'] = 611; 42929 t['Adieresis'] = 611; 42930 t['egrave'] = 444; 42931 t['zacute'] = 389; 42932 t['iogonek'] = 278; 42933 t['Oacute'] = 722; 42934 t['oacute'] = 500; 42935 t['amacron'] = 500; 42936 t['sacute'] = 389; 42937 t['idieresis'] = 278; 42938 t['Ocircumflex'] = 722; 42939 t['Ugrave'] = 722; 42940 t['Delta'] = 612; 42941 t['thorn'] = 500; 42942 t['twosuperior'] = 300; 42943 t['Odieresis'] = 722; 42944 t['mu'] = 500; 42945 t['igrave'] = 278; 42946 t['ohungarumlaut'] = 500; 42947 t['Eogonek'] = 611; 42948 t['dcroat'] = 500; 42949 t['threequarters'] = 750; 42950 t['Scedilla'] = 500; 42951 t['lcaron'] = 300; 42952 t['Kcommaaccent'] = 667; 42953 t['Lacute'] = 556; 42954 t['trademark'] = 980; 42955 t['edotaccent'] = 444; 42956 t['Igrave'] = 333; 42957 t['Imacron'] = 333; 42958 t['Lcaron'] = 611; 42959 t['onehalf'] = 750; 42960 t['lessequal'] = 549; 42961 t['ocircumflex'] = 500; 42962 t['ntilde'] = 500; 42963 t['Uhungarumlaut'] = 722; 42964 t['Eacute'] = 611; 42965 t['emacron'] = 444; 42966 t['gbreve'] = 500; 42967 t['onequarter'] = 750; 42968 t['Scaron'] = 500; 42969 t['Scommaaccent'] = 500; 42970 t['Ohungarumlaut'] = 722; 42971 t['degree'] = 400; 42972 t['ograve'] = 500; 42973 t['Ccaron'] = 667; 42974 t['ugrave'] = 500; 42975 t['radical'] = 453; 42976 t['Dcaron'] = 722; 42977 t['rcommaaccent'] = 389; 42978 t['Ntilde'] = 667; 42979 t['otilde'] = 500; 42980 t['Rcommaaccent'] = 611; 42981 t['Lcommaaccent'] = 556; 42982 t['Atilde'] = 611; 42983 t['Aogonek'] = 611; 42984 t['Aring'] = 611; 42985 t['Otilde'] = 722; 42986 t['zdotaccent'] = 389; 42987 t['Ecaron'] = 611; 42988 t['Iogonek'] = 333; 42989 t['kcommaaccent'] = 444; 42990 t['minus'] = 675; 42991 t['Icircumflex'] = 333; 42992 t['ncaron'] = 500; 42993 t['tcommaaccent'] = 278; 42994 t['logicalnot'] = 675; 42995 t['odieresis'] = 500; 42996 t['udieresis'] = 500; 42997 t['notequal'] = 549; 42998 t['gcommaaccent'] = 500; 42999 t['eth'] = 500; 43000 t['zcaron'] = 389; 43001 t['ncommaaccent'] = 500; 43002 t['onesuperior'] = 300; 43003 t['imacron'] = 278; 43004 t['Euro'] = 500; 43005 }); 43006 t['ZapfDingbats'] = (0, _util.getLookupTableFactory)(function (t) { 43007 t['space'] = 278; 43008 t['a1'] = 974; 43009 t['a2'] = 961; 43010 t['a202'] = 974; 43011 t['a3'] = 980; 43012 t['a4'] = 719; 43013 t['a5'] = 789; 43014 t['a119'] = 790; 43015 t['a118'] = 791; 43016 t['a117'] = 690; 43017 t['a11'] = 960; 43018 t['a12'] = 939; 43019 t['a13'] = 549; 43020 t['a14'] = 855; 43021 t['a15'] = 911; 43022 t['a16'] = 933; 43023 t['a105'] = 911; 43024 t['a17'] = 945; 43025 t['a18'] = 974; 43026 t['a19'] = 755; 43027 t['a20'] = 846; 43028 t['a21'] = 762; 43029 t['a22'] = 761; 43030 t['a23'] = 571; 43031 t['a24'] = 677; 43032 t['a25'] = 763; 43033 t['a26'] = 760; 43034 t['a27'] = 759; 43035 t['a28'] = 754; 43036 t['a6'] = 494; 43037 t['a7'] = 552; 43038 t['a8'] = 537; 43039 t['a9'] = 577; 43040 t['a10'] = 692; 43041 t['a29'] = 786; 43042 t['a30'] = 788; 43043 t['a31'] = 788; 43044 t['a32'] = 790; 43045 t['a33'] = 793; 43046 t['a34'] = 794; 43047 t['a35'] = 816; 43048 t['a36'] = 823; 43049 t['a37'] = 789; 43050 t['a38'] = 841; 43051 t['a39'] = 823; 43052 t['a40'] = 833; 43053 t['a41'] = 816; 43054 t['a42'] = 831; 43055 t['a43'] = 923; 43056 t['a44'] = 744; 43057 t['a45'] = 723; 43058 t['a46'] = 749; 43059 t['a47'] = 790; 43060 t['a48'] = 792; 43061 t['a49'] = 695; 43062 t['a50'] = 776; 43063 t['a51'] = 768; 43064 t['a52'] = 792; 43065 t['a53'] = 759; 43066 t['a54'] = 707; 43067 t['a55'] = 708; 43068 t['a56'] = 682; 43069 t['a57'] = 701; 43070 t['a58'] = 826; 43071 t['a59'] = 815; 43072 t['a60'] = 789; 43073 t['a61'] = 789; 43074 t['a62'] = 707; 43075 t['a63'] = 687; 43076 t['a64'] = 696; 43077 t['a65'] = 689; 43078 t['a66'] = 786; 43079 t['a67'] = 787; 43080 t['a68'] = 713; 43081 t['a69'] = 791; 43082 t['a70'] = 785; 43083 t['a71'] = 791; 43084 t['a72'] = 873; 43085 t['a73'] = 761; 43086 t['a74'] = 762; 43087 t['a203'] = 762; 43088 t['a75'] = 759; 43089 t['a204'] = 759; 43090 t['a76'] = 892; 43091 t['a77'] = 892; 43092 t['a78'] = 788; 43093 t['a79'] = 784; 43094 t['a81'] = 438; 43095 t['a82'] = 138; 43096 t['a83'] = 277; 43097 t['a84'] = 415; 43098 t['a97'] = 392; 43099 t['a98'] = 392; 43100 t['a99'] = 668; 43101 t['a100'] = 668; 43102 t['a89'] = 390; 43103 t['a90'] = 390; 43104 t['a93'] = 317; 43105 t['a94'] = 317; 43106 t['a91'] = 276; 43107 t['a92'] = 276; 43108 t['a205'] = 509;
vendor: 6,261 bytes, lines 43109-43338
43109 t['a85'] = 509; 43110 t['a206'] = 410; 43111 t['a86'] = 410; 43112 t['a87'] = 234; 43113 t['a88'] = 234; 43114 t['a95'] = 334; 43115 t['a96'] = 334; 43116 t['a101'] = 732; 43117 t['a102'] = 544; 43118 t['a103'] = 544; 43119 t['a104'] = 910; 43120 t['a106'] = 667; 43121 t['a107'] = 760; 43122 t['a108'] = 760; 43123 t['a112'] = 776; 43124 t['a111'] = 595; 43125 t['a110'] = 694; 43126 t['a109'] = 626; 43127 t['a120'] = 788; 43128 t['a121'] = 788; 43129 t['a122'] = 788; 43130 t['a123'] = 788; 43131 t['a124'] = 788; 43132 t['a125'] = 788; 43133 t['a126'] = 788; 43134 t['a127'] = 788; 43135 t['a128'] = 788; 43136 t['a129'] = 788; 43137 t['a130'] = 788; 43138 t['a131'] = 788; 43139 t['a132'] = 788; 43140 t['a133'] = 788; 43141 t['a134'] = 788; 43142 t['a135'] = 788; 43143 t['a136'] = 788; 43144 t['a137'] = 788; 43145 t['a138'] = 788; 43146 t['a139'] = 788; 43147 t['a140'] = 788; 43148 t['a141'] = 788; 43149 t['a142'] = 788; 43150 t['a143'] = 788; 43151 t['a144'] = 788; 43152 t['a145'] = 788; 43153 t['a146'] = 788; 43154 t['a147'] = 788; 43155 t['a148'] = 788; 43156 t['a149'] = 788; 43157 t['a150'] = 788; 43158 t['a151'] = 788; 43159 t['a152'] = 788; 43160 t['a153'] = 788; 43161 t['a154'] = 788; 43162 t['a155'] = 788; 43163 t['a156'] = 788; 43164 t['a157'] = 788; 43165 t['a158'] = 788; 43166 t['a159'] = 788; 43167 t['a160'] = 894; 43168 t['a161'] = 838; 43169 t['a163'] = 1016; 43170 t['a164'] = 458; 43171 t['a196'] = 748; 43172 t['a165'] = 924; 43173 t['a192'] = 748; 43174 t['a166'] = 918; 43175 t['a167'] = 927; 43176 t['a168'] = 928; 43177 t['a169'] = 928; 43178 t['a170'] = 834; 43179 t['a171'] = 873; 43180 t['a172'] = 828; 43181 t['a173'] = 924; 43182 t['a162'] = 924; 43183 t['a174'] = 917; 43184 t['a175'] = 930; 43185 t['a176'] = 931; 43186 t['a177'] = 463; 43187 t['a178'] = 883; 43188 t['a179'] = 836; 43189 t['a193'] = 836; 43190 t['a180'] = 867; 43191 t['a199'] = 867; 43192 t['a181'] = 696; 43193 t['a200'] = 696; 43194 t['a182'] = 874; 43195 t['a201'] = 874; 43196 t['a183'] = 760; 43197 t['a184'] = 946; 43198 t['a197'] = 771; 43199 t['a185'] = 865; 43200 t['a194'] = 771; 43201 t['a198'] = 888; 43202 t['a186'] = 967; 43203 t['a195'] = 888; 43204 t['a187'] = 831; 43205 t['a188'] = 873; 43206 t['a189'] = 927; 43207 t['a190'] = 970; 43208 t['a191'] = 918; 43209 }); 43210}); 43211exports.getMetrics = getMetrics; 43212 43213/***/ }), 43214/* 121 */ 43215/***/ (function(module, exports, __w_pdfjs_require__) { 43216 43217"use strict"; 43218 43219 43220Object.defineProperty(exports, "__esModule", { 43221 value: true 43222}); 43223exports.PostScriptParser = exports.PostScriptLexer = undefined; 43224 43225var _util = __w_pdfjs_require__(0); 43226 43227var _primitives = __w_pdfjs_require__(2); 43228 43229var PostScriptParser = function PostScriptParserClosure() { 43230 function PostScriptParser(lexer) { 43231 this.lexer = lexer; 43232 this.operators = []; 43233 this.token = null; 43234 this.prev = null; 43235 } 43236 PostScriptParser.prototype = { 43237 nextToken: function PostScriptParser_nextToken() { 43238 this.prev = this.token; 43239 this.token = this.lexer.getToken(); 43240 }, 43241 accept: function PostScriptParser_accept(type) { 43242 if (this.token.type === type) { 43243 this.nextToken(); 43244 return true; 43245 } 43246 return false; 43247 }, 43248 expect: function PostScriptParser_expect(type) { 43249 if (this.accept(type)) { 43250 return true; 43251 } 43252 throw new _util.FormatError('Unexpected symbol: found ' + this.token.type + ' expected ' + type + '.'); 43253 }, 43254 parse: function PostScriptParser_parse() { 43255 this.nextToken(); 43256 this.expect(PostScriptTokenTypes.LBRACE); 43257 this.parseBlock(); 43258 this.expect(PostScriptTokenTypes.RBRACE); 43259 return this.operators; 43260 }, 43261 parseBlock: function PostScriptParser_parseBlock() { 43262 while (true) { 43263 if (this.accept(PostScriptTokenTypes.NUMBER)) { 43264 this.operators.push(this.prev.value); 43265 } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { 43266 this.operators.push(this.prev.value); 43267 } else if (this.accept(PostScriptTokenTypes.LBRACE)) { 43268 this.parseCondition(); 43269 } else { 43270 return; 43271 } 43272 } 43273 }, 43274 parseCondition: function PostScriptParser_parseCondition() { 43275 var conditionLocation = this.operators.length; 43276 this.operators.push(null, null); 43277 this.parseBlock(); 43278 this.expect(PostScriptTokenTypes.RBRACE); 43279 if (this.accept(PostScriptTokenTypes.IF)) { 43280 this.operators[conditionLocation] = this.operators.length; 43281 this.operators[conditionLocation + 1] = 'jz'; 43282 } else if (this.accept(PostScriptTokenTypes.LBRACE)) { 43283 var jumpLocation = this.operators.length; 43284 this.operators.push(null, null); 43285 var endOfTrue = this.operators.length; 43286 this.parseBlock(); 43287 this.expect(PostScriptTokenTypes.RBRACE); 43288 this.expect(PostScriptTokenTypes.IFELSE); 43289 this.operators[jumpLocation] = this.operators.length; 43290 this.operators[jumpLocation + 1] = 'j'; 43291 this.operators[conditionLocation] = endOfTrue; 43292 this.operators[conditionLocation + 1] = 'jz'; 43293 } else { 43294 throw new _util.FormatError('PS Function: error parsing conditional.'); 43295 } 43296 } 43297 }; 43298 return PostScriptParser; 43299}(); 43300var PostScriptTokenTypes = { 43301 LBRACE: 0, 43302 RBRACE: 1, 43303 NUMBER: 2, 43304 OPERATOR: 3, 43305 IF: 4, 43306 IFELSE: 5 43307}; 43308var PostScriptToken = function PostScriptTokenClosure() { 43309 function PostScriptToken(type, value) { 43310 this.type = type; 43311 this.value = value; 43312 } 43313 var opCache = Object.create(null); 43314 PostScriptToken.getOperator = function PostScriptToken_getOperator(op) { 43315 var opValue = opCache[op]; 43316 if (opValue) { 43317 return opValue; 43318 } 43319 return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); 43320 }; 43321 PostScriptToken.LBRACE = new PostScriptToken(PostScriptTokenTypes.LBRACE, '{'); 43322 PostScriptToken.RBRACE = new PostScriptToken(PostScriptTokenTypes.RBRACE, '}'); 43323 PostScriptToken.IF = new PostScriptToken(PostScriptTokenTypes.IF, 'IF'); 43324 PostScriptToken.IFELSE = new PostScriptToken(PostScriptTokenTypes.IFELSE, 'IFELSE'); 43325 return PostScriptToken; 43326}(); 43327var PostScriptLexer = function PostScriptLexerClosure() { 43328 function PostScriptLexer(stream) { 43329 this.stream = stream; 43330 this.nextChar(); 43331 this.strBuf = []; 43332 } 43333 PostScriptLexer.prototype = { 43334 nextChar: function PostScriptLexer_nextChar() { 43335 return this.currentChar = this.stream.getByte(); 43336 }, 43337 getToken: function PostScriptLexer_getToken() { 43338 var comment = false;
43339 var ch = this.currentChar; 43340 while (true) { 43341 if (ch < 0) { 43342 return _primitives.EOF; 43343 } 43344 if (comment) { 43345 if (ch === 0x0A || ch === 0x0D) { 43346 comment = false; 43347 } 43348 } else if (ch === 0x25) { 43349 comment = true; 43350 } else if (!(0, _util.isSpace)(ch)) { 43351 break; 43352 } 43353 ch = this.nextChar(); 43354 } 43355 switch (ch | 0) { 43356 case 0x30: 43357 case 0x31: 43358 case 0x32: 43359 case 0x33: 43360 case 0x34: 43361 case 0x35: 43362 case 0x36: 43363 case 0x37: 43364 case 0x38: 43365 case 0x39: 43366 case 0x2B: 43367 case 0x2D: 43368 case 0x2E: 43369 return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber()); 43370 case 0x7B: 43371 this.nextChar(); 43372 return PostScriptToken.LBRACE; 43373 case 0x7D: 43374 this.nextChar(); 43375 return PostScriptToken.RBRACE; 43376 } 43377 var strBuf = this.strBuf; 43378 strBuf.length = 0; 43379 strBuf[0] = String.fromCharCode(ch); 43380 while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5A || ch >= 0x61 && ch <= 0x7A)) { 43381 strBuf.push(String.fromCharCode(ch)); 43382 } 43383 var str = strBuf.join(''); 43384 switch (str.toLowerCase()) { 43385 case 'if': 43386 return PostScriptToken.IF; 43387 case 'ifelse': 43388 return PostScriptToken.IFELSE; 43389 default: 43390 return PostScriptToken.getOperator(str); 43391 } 43392 }, 43393 getNumber: function PostScriptLexer_getNumber() { 43394 var ch = this.currentChar; 43395 var strBuf = this.strBuf; 43396 strBuf.length = 0; 43397 strBuf[0] = String.fromCharCode(ch); 43398 while ((ch = this.nextChar()) >= 0) { 43399 if (ch >= 0x30 && ch <= 0x39 || ch === 0x2D || ch === 0x2E) { 43400 strBuf.push(String.fromCharCode(ch)); 43401 } else { 43402 break; 43403 } 43404 } 43405 var value = parseFloat(strBuf.join('')); 43406 if (isNaN(value)) { 43407 throw new _util.FormatError('Invalid floating point number: ' + value); 43408 } 43409 return value; 43410 } 43411 }; 43412 return PostScriptLexer; 43413}(); 43414exports.PostScriptLexer = PostScriptLexer; 43415exports.PostScriptParser = PostScriptParser; 43416 43417/***/ }), 43418/* 122 */ 43419/***/ (function(module, exports, __w_pdfjs_require__) { 43420 43421"use strict"; 43422 43423 43424Object.defineProperty(exports, "__esModule", { 43425 value: true 43426}); 43427 43428var _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; }; 43429 43430var MurmurHash3_64 = function MurmurHash3_64Closure(seed) { 43431 var MASK_HIGH = 0xffff0000; 43432 var MASK_LOW = 0xffff; 43433 function MurmurHash3_64(seed) { 43434 var SEED = 0xc3d2e1f0; 43435 this.h1 = seed ? seed & 0xffffffff : SEED; 43436 this.h2 = seed ? seed & 0xffffffff : SEED; 43437 } 43438 MurmurHash3_64.prototype = { 43439 update: function MurmurHash3_64_update(input) { 43440 var i; 43441 if (typeof input === 'string') { 43442 var data = new Uint8Array(input.length * 2); 43443 var length = 0; 43444 for (i = 0; i < input.length; i++) { 43445 var code = input.charCodeAt(i); 43446 if (code <= 0xff) { 43447 data[length++] = code; 43448 } else { 43449 data[length++] = code >>> 8; 43450 data[length++] = code & 0xff; 43451 } 43452 } 43453 } else if ((typeof input === 'undefined' ? 'undefined' : _typeof(input)) === 'object' && 'byteLength' in input) { 43454 data = input; 43455 length = data.byteLength; 43456 } else { 43457 throw new Error('Wrong data format in MurmurHash3_64_update. ' + 'Input must be a string or array.'); 43458 } 43459 var blockCounts = length >> 2; 43460 var tailLength = length - blockCounts * 4; 43461 var dataUint32 = new Uint32Array(data.buffer, 0, blockCounts); 43462 var k1 = 0; 43463 var k2 = 0; 43464 var h1 = this.h1; 43465 var h2 = this.h2; 43466 var C1 = 0xcc9e2d51; 43467 var C2 = 0x1b873593; 43468 var C1_LOW = C1 & MASK_LOW; 43469 var C2_LOW = C2 & MASK_LOW; 43470 for (i = 0; i < blockCounts; i++) { 43471 if (i & 1) {
vendor: 4,777 bytes, lines 43472-43610
43472 k1 = dataUint32[i]; 43473 k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; 43474 k1 = k1 << 15 | k1 >>> 17; 43475 k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; 43476 h1 ^= k1; 43477 h1 = h1 << 13 | h1 >>> 19; 43478 h1 = h1 * 5 + 0xe6546b64; 43479 } else { 43480 k2 = dataUint32[i]; 43481 k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW; 43482 k2 = k2 << 15 | k2 >>> 17; 43483 k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW; 43484 h2 ^= k2; 43485 h2 = h2 << 13 | h2 >>> 19; 43486 h2 = h2 * 5 + 0xe6546b64; 43487 } 43488 } 43489 k1 = 0; 43490 switch (tailLength) { 43491 case 3: 43492 k1 ^= data[blockCounts * 4 + 2] << 16; 43493 case 2: 43494 k1 ^= data[blockCounts * 4 + 1] << 8; 43495 case 1: 43496 k1 ^= data[blockCounts * 4]; 43497 k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; 43498 k1 = k1 << 15 | k1 >>> 17; 43499 k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; 43500 if (blockCounts & 1) { 43501 h1 ^= k1; 43502 } else { 43503 h2 ^= k1; 43504 } 43505 } 43506 this.h1 = h1; 43507 this.h2 = h2; 43508 return this; 43509 }, 43510 hexdigest: function MurmurHash3_64_hexdigest() { 43511 var h1 = this.h1; 43512 var h2 = this.h2; 43513 h1 ^= h2 >>> 1; 43514 h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW; 43515 h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16; 43516 h1 ^= h2 >>> 1; 43517 h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW; 43518 h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16; 43519 h1 ^= h2 >>> 1; 43520 for (var i = 0, arr = [h1, h2], str = ''; i < arr.length; i++) { 43521 var hex = (arr[i] >>> 0).toString(16); 43522 while (hex.length < 8) { 43523 hex = '0' + hex; 43524 } 43525 str += hex; 43526 } 43527 return str; 43528 } 43529 }; 43530 return MurmurHash3_64; 43531}(); 43532exports.MurmurHash3_64 = MurmurHash3_64; 43533 43534/***/ }), 43535/* 123 */ 43536/***/ (function(module, exports, __w_pdfjs_require__) { 43537 43538"use strict"; 43539 43540 43541Object.defineProperty(exports, "__esModule", { 43542 value: true 43543}); 43544exports.PDFImage = undefined; 43545 43546var _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"); } }; }(); 43547 43548var _util = __w_pdfjs_require__(0); 43549 43550var _stream = __w_pdfjs_require__(5); 43551 43552var _primitives = __w_pdfjs_require__(2); 43553 43554var _colorspace = __w_pdfjs_require__(21); 43555 43556var _jpx = __w_pdfjs_require__(65); 43557 43558var PDFImage = function PDFImageClosure() { 43559 function handleImageData(image, nativeDecoder) { 43560 if (nativeDecoder && nativeDecoder.canDecode(image)) { 43561 return nativeDecoder.decode(image); 43562 } 43563 return Promise.resolve(image); 43564 } 43565 function decodeAndClamp(value, addend, coefficient, max) { 43566 value = addend + value * coefficient; 43567 return value < 0 ? 0 : value > max ? max : value; 43568 } 43569 function resizeImageMask(src, bpc, w1, h1, w2, h2) { 43570 var length = w2 * h2; 43571 var dest = bpc <= 8 ? new Uint8Array(length) : bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length); 43572 var xRatio = w1 / w2; 43573 var yRatio = h1 / h2; 43574 var i, 43575 j, 43576 py, 43577 newIndex = 0, 43578 oldIndex; 43579 var xScaled = new Uint16Array(w2); 43580 var w1Scanline = w1; 43581 for (i = 0; i < w2; i++) { 43582 xScaled[i] = Math.floor(i * xRatio); 43583 } 43584 for (i = 0; i < h2; i++) { 43585 py = Math.floor(i * yRatio) * w1Scanline; 43586 for (j = 0; j < w2; j++) { 43587 oldIndex = py + xScaled[j]; 43588 dest[newIndex++] = src[oldIndex]; 43589 } 43590 } 43591 return dest; 43592 } 43593 function PDFImage(_ref) { 43594 var xref = _ref.xref, 43595 res = _ref.res, 43596 image = _ref.image, 43597 _ref$smask = _ref.smask, 43598 smask = _ref$smask === undefined ? null : _ref$smask, 43599 _ref$mask = _ref.mask, 43600 mask = _ref$mask === undefined ? null : _ref$mask, 43601 _ref$isMask = _ref.isMask, 43602 isMask = _ref$isMask === undefined ? false : _ref$isMask, 43603 pdfFunctionFactory = _ref.pdfFunctionFactory; 43604 43605 this.image = image; 43606 var dict = image.dict; 43607 if (dict.has('Filter')) { 43608 var filter = dict.get('Filter').name; 43609 if (filter === 'JPXDecode') { 43610 var jpxImage = new _jpx.JpxImage();
43611 jpxImage.parseImageProperties(image.stream); 43612 image.stream.reset(); 43613 image.bitsPerComponent = jpxImage.bitsPerComponent; 43614 image.numComps = jpxImage.componentsCount; 43615 } else if (filter === 'JBIG2Decode') { 43616 image.bitsPerComponent = 1; 43617 image.numComps = 1; 43618 } 43619 } 43620 this.width = dict.get('Width', 'W'); 43621 this.height = dict.get('Height', 'H'); 43622 if (this.width < 1 || this.height < 1) { 43623 throw new _util.FormatError('Invalid image width: ' + this.width + ' or ' + ('height: ' + this.height)); 43624 } 43625 this.interpolate = dict.get('Interpolate', 'I') || false; 43626 this.imageMask = dict.get('ImageMask', 'IM') || false; 43627 this.matte = dict.get('Matte') || false; 43628 var bitsPerComponent = image.bitsPerComponent; 43629 if (!bitsPerComponent) { 43630 bitsPerComponent = dict.get('BitsPerComponent', 'BPC'); 43631 if (!bitsPerComponent) { 43632 if (this.imageMask) { 43633 bitsPerComponent = 1; 43634 } else { 43635 throw new _util.FormatError('Bits per component missing in image: ' + this.imageMask); 43636 } 43637 } 43638 } 43639 this.bpc = bitsPerComponent; 43640 if (!this.imageMask) { 43641 var colorSpace = dict.get('ColorSpace', 'CS'); 43642 if (!colorSpace) { 43643 (0, _util.info)('JPX images (which do not require color spaces)'); 43644 switch (image.numComps) { 43645 case 1: 43646 colorSpace = _primitives.Name.get('DeviceGray'); 43647 break; 43648 case 3: 43649 colorSpace = _primitives.Name.get('DeviceRGB'); 43650 break; 43651 case 4: 43652 colorSpace = _primitives.Name.get('DeviceCMYK'); 43653 break; 43654 default: 43655 throw new Error('JPX images with ' + this.numComps + ' ' + 'color components not supported.'); 43656 } 43657 } 43658 this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, res, pdfFunctionFactory); 43659 this.numComps = this.colorSpace.numComps; 43660 } 43661 this.decode = dict.getArray('Decode', 'D'); 43662 this.needsDecode = false; 43663 if (this.decode && (this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode) || isMask && !_colorspace.ColorSpace.isDefaultDecode(this.decode, 1))) { 43664 this.needsDecode = true; 43665 var max = (1 << bitsPerComponent) - 1; 43666 this.decodeCoefficients = []; 43667 this.decodeAddends = []; 43668 for (var i = 0, j = 0; i < this.decode.length; i += 2, ++j) { 43669 var dmin = this.decode[i]; 43670 var dmax = this.decode[i + 1]; 43671 this.decodeCoefficients[j] = dmax - dmin; 43672 this.decodeAddends[j] = max * dmin; 43673 } 43674 } 43675 if (smask) { 43676 this.smask = new PDFImage({ 43677 xref: xref, 43678 res: res, 43679 image: smask, 43680 pdfFunctionFactory: pdfFunctionFactory 43681 }); 43682 } else if (mask) { 43683 if ((0, _primitives.isStream)(mask)) { 43684 var maskDict = mask.dict, 43685 imageMask = maskDict.get('ImageMask', 'IM'); 43686 if (!imageMask) { 43687 (0, _util.warn)('Ignoring /Mask in image without /ImageMask.'); 43688 } else { 43689 this.mask = new PDFImage({ 43690 xref: xref, 43691 res: res, 43692 image: mask, 43693 isMask: true, 43694 pdfFunctionFactory: pdfFunctionFactory 43695 }); 43696 } 43697 } else { 43698 this.mask = mask; 43699 } 43700 } 43701 } 43702 PDFImage.buildImage = function (_ref2) { 43703 var handler = _ref2.handler, 43704 xref = _ref2.xref, 43705 res = _ref2.res, 43706 image = _ref2.image, 43707 _ref2$nativeDecoder = _ref2.nativeDecoder, 43708 nativeDecoder = _ref2$nativeDecoder === undefined ? null : _ref2$nativeDecoder, 43709 pdfFunctionFactory = _ref2.pdfFunctionFactory; 43710 43711 var imagePromise = handleImageData(image, nativeDecoder); 43712 var smaskPromise; 43713 var maskPromise; 43714 var smask = image.dict.get('SMask'); 43715 var mask = image.dict.get('Mask'); 43716 if (smask) { 43717 smaskPromise = handleImageData(smask, nativeDecoder); 43718 maskPromise = Promise.resolve(null); 43719 } else { 43720 smaskPromise = Promise.resolve(null); 43721 if (mask) { 43722 if ((0, _primitives.isStream)(mask)) { 43723 maskPromise = handleImageData(mask, nativeDecoder); 43724 } else if (Array.isArray(mask)) { 43725 maskPromise = Promise.resolve(mask); 43726 } else { 43727 (0, _util.warn)('Unsupported mask format.'); 43728 maskPromise = Promise.resolve(null); 43729 } 43730 } else { 43731 maskPromise = Promise.resolve(null); 43732 } 43733 } 43734 return Promise.all([imagePromise, smaskPromise, maskPromise]).then(function (_ref3) { 43735 var _ref4 = _slicedToArray(_ref3, 3), 43736 imageData = _ref4[0], 43737 smaskData = _ref4[1], 43738 maskData = _ref4[2]; 43739 43740 return new PDFImage({ 43741 xref: xref, 43742 res: res, 43743 image: imageData, 43744 smask: smaskData, 43745 mask: maskData, 43746 pdfFunctionFactory: pdfFunctionFactory 43747 }); 43748 }); 43749 }; 43750 PDFImage.createMask = function (_ref5) { 43751 var imgArray = _ref5.imgArray, 43752 width = _ref5.width, 43753 height = _ref5.height, 43754 imageIsFromDecodeStream = _ref5.imageIsFromDecodeStream, 43755 inverseDecode = _ref5.inverseDecode; 43756 43757 var computedLength = (width + 7 >> 3) * height; 43758 var actualLength = imgArray.byteLength; 43759 var haveFullData = computedLength === actualLength; 43760 var data, i; 43761 if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) { 43762 data = imgArray; 43763 } else if (!inverseDecode) { 43764 data = new Uint8Array(actualLength); 43765 data.set(imgArray); 43766 } else { 43767 data = new Uint8Array(computedLength); 43768 data.set(imgArray); 43769 for (i = actualLength; i < computedLength; i++) { 43770 data[i] = 0xff; 43771 } 43772 } 43773 if (inverseDecode) { 43774 for (i = 0; i < actualLength; i++) { 43775 data[i] ^= 0xFF; 43776 } 43777 } 43778 return { 43779 data: data, 43780 width: width, 43781 height: height 43782 }; 43783 }; 43784 PDFImage.prototype = { 43785 get drawWidth() { 43786 return Math.max(this.width, this.smask && this.smask.width || 0, this.mask && this.mask.width || 0); 43787 }, 43788 get drawHeight() { 43789 return Math.max(this.height, this.smask && this.smask.height || 0, this.mask && this.mask.height || 0
vendor: 5,734 bytes, lines 43789-43959
43789); 43790 }, 43791 decodeBuffer: function decodeBuffer(buffer) { 43792 var bpc = this.bpc; 43793 var numComps = this.numComps; 43794 var decodeAddends = this.decodeAddends; 43795 var decodeCoefficients = this.decodeCoefficients; 43796 var max = (1 << bpc) - 1; 43797 var i, ii; 43798 if (bpc === 1) { 43799 for (i = 0, ii = buffer.length; i < ii; i++) { 43800 buffer[i] = +!buffer[i]; 43801 } 43802 return; 43803 } 43804 var index = 0; 43805 for (i = 0, ii = this.width * this.height; i < ii; i++) { 43806 for (var j = 0; j < numComps; j++) { 43807 buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], decodeCoefficients[j], max); 43808 index++; 43809 } 43810 } 43811 }, 43812 getComponents: function getComponents(buffer) { 43813 var bpc = this.bpc; 43814 if (bpc === 8) { 43815 return buffer; 43816 } 43817 var width = this.width; 43818 var height = this.height; 43819 var numComps = this.numComps; 43820 var length = width * height * numComps; 43821 var bufferPos = 0; 43822 var output = bpc <= 8 ? new Uint8Array(length) : bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length); 43823 var rowComps = width * numComps; 43824 var max = (1 << bpc) - 1; 43825 var i = 0, 43826 ii, 43827 buf; 43828 if (bpc === 1) { 43829 var mask, loop1End, loop2End; 43830 for (var j = 0; j < height; j++) { 43831 loop1End = i + (rowComps & ~7); 43832 loop2End = i + rowComps; 43833 while (i < loop1End) { 43834 buf = buffer[bufferPos++]; 43835 output[i] = buf >> 7 & 1; 43836 output[i + 1] = buf >> 6 & 1; 43837 output[i + 2] = buf >> 5 & 1; 43838 output[i + 3] = buf >> 4 & 1; 43839 output[i + 4] = buf >> 3 & 1; 43840 output[i + 5] = buf >> 2 & 1; 43841 output[i + 6] = buf >> 1 & 1; 43842 output[i + 7] = buf & 1; 43843 i += 8; 43844 } 43845 if (i < loop2End) { 43846 buf = buffer[bufferPos++]; 43847 mask = 128; 43848 while (i < loop2End) { 43849 output[i++] = +!!(buf & mask); 43850 mask >>= 1; 43851 } 43852 } 43853 } 43854 } else { 43855 var bits = 0; 43856 buf = 0; 43857 for (i = 0, ii = length; i < ii; ++i) { 43858 if (i % rowComps === 0) { 43859 buf = 0; 43860 bits = 0; 43861 } 43862 while (bits < bpc) { 43863 buf = buf << 8 | buffer[bufferPos++]; 43864 bits += 8; 43865 } 43866 var remainingBits = bits - bpc; 43867 var value = buf >> remainingBits; 43868 output[i] = value < 0 ? 0 : value > max ? max : value; 43869 buf = buf & (1 << remainingBits) - 1; 43870 bits = remainingBits; 43871 } 43872 } 43873 return output; 43874 }, 43875 fillOpacity: function fillOpacity(rgbaBuf, width, height, actualHeight, image) { 43876 var smask = this.smask; 43877 var mask = this.mask; 43878 var alphaBuf, sw, sh, i, ii, j; 43879 if (smask) { 43880 sw = smask.width; 43881 sh = smask.height; 43882 alphaBuf = new Uint8Array(sw * sh); 43883 smask.fillGrayBuffer(alphaBuf); 43884 if (sw !== width || sh !== height) { 43885 alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height); 43886 } 43887 } else if (mask) { 43888 if (mask instanceof PDFImage) { 43889 sw = mask.width; 43890 sh = mask.height; 43891 alphaBuf = new Uint8Array(sw * sh); 43892 mask.numComps = 1; 43893 mask.fillGrayBuffer(alphaBuf); 43894 for (i = 0, ii = sw * sh; i < ii; ++i) { 43895 alphaBuf[i] = 255 - alphaBuf[i]; 43896 } 43897 if (sw !== width || sh !== height) { 43898 alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height); 43899 } 43900 } else if (Array.isArray(mask)) { 43901 alphaBuf = new Uint8Array(width * height); 43902 var numComps = this.numComps; 43903 for (i = 0, ii = width * height; i < ii; ++i) { 43904 var opacity = 0; 43905 var imageOffset = i * numComps; 43906 for (j = 0; j < numComps; ++j) { 43907 var color = image[imageOffset + j]; 43908 var maskOffset = j * 2; 43909 if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { 43910 opacity = 255; 43911 break; 43912 } 43913 } 43914 alphaBuf[i] = opacity; 43915 } 43916 } else { 43917 throw new _util.FormatError('Unknown mask format.'); 43918 } 43919 } 43920 if (alphaBuf) { 43921 for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { 43922 rgbaBuf[j] = alphaBuf[i]; 43923 } 43924 } else { 43925 for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { 43926 rgbaBuf[j] = 255; 43927 } 43928 } 43929 }, 43930 undoPreblend: function undoPreblend(buffer, width, height) { 43931 var matte = this.smask && this.smask.matte; 43932 if (!matte) { 43933 return; 43934 } 43935 var matteRgb = this.colorSpace.getRgb(matte, 0); 43936 var matteR = matteRgb[0]; 43937 var matteG = matteRgb[1]; 43938 var matteB = matteRgb[2]; 43939 var length = width * height * 4; 43940 var r, g, b; 43941 for (var i = 0; i < length; i += 4) { 43942 var alpha = buffer[i + 3]; 43943 if (alpha === 0) { 43944 buffer[i] = 255; 43945 buffer[i + 1] = 255; 43946 buffer[i + 2] = 255; 43947 continue; 43948 } 43949 var k = 255 / alpha; 43950 r = (buffer[i] - matteR) * k + matteR; 43951 g = (buffer[i + 1] - matteG) * k + matteG; 43952 b = (buffer[i + 2] - matteB) * k + matteB; 43953 buffer[i] = r <= 0 ? 0 : r >= 255 ? 255 : r | 0; 43954 buffer[i + 1] = g <= 0 ? 0 : g >= 255 ? 255 : g | 0; 43955 buffer[i + 2] = b <= 0 ? 0 : b >= 255 ? 255 : b | 0; 43956 } 43957 }, 43958 createImageData: function createImageData() { 43959 var forceRGBA = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
43960 43961 var drawWidth = this.drawWidth; 43962 var drawHeight = this.drawHeight; 43963 var imgData = { 43964 width: drawWidth, 43965 height: drawHeight 43966 }; 43967 var numComps = this.numComps; 43968 var originalWidth = this.width; 43969 var originalHeight = this.height; 43970 var bpc = this.bpc; 43971 var rowBytes = originalWidth * numComps * bpc + 7 >> 3; 43972 var imgArray; 43973 if (!forceRGBA) { 43974 var kind; 43975 if (this.colorSpace.name === 'DeviceGray' && bpc === 1) { 43976 kind = _util.ImageKind.GRAYSCALE_1BPP; 43977 } else if (this.colorSpace.name === 'DeviceRGB' && bpc === 8 && !this.needsDecode) { 43978 kind = _util.ImageKind.RGB_24BPP; 43979 } 43980 if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) { 43981 imgData.kind = kind; 43982 imgArray = this.getImageBytes(originalHeight * rowBytes); 43983 if (this.image instanceof _stream.DecodeStream) { 43984 imgData.data = imgArray; 43985 } else { 43986 var newArray = new Uint8Array(imgArray.length); 43987 newArray.set(imgArray); 43988 imgData.data = newArray; 43989 } 43990 if (this.needsDecode) { 43991 (0, _util.assert)(kind === _util.ImageKind.GRAYSCALE_1BPP); 43992 var buffer = imgData.data; 43993 for (var i = 0, ii = buffer.length; i < ii; i++) { 43994 buffer[i] ^= 0xff; 43995 } 43996 } 43997 return imgData; 43998 } 43999 if (this.image instanceof _stream.JpegStream && !this.smask && !this.mask && (this.colorSpace.name === 'DeviceGray' || this.colorSpace.name === 'DeviceRGB' || this.colorSpace.name === 'DeviceCMYK')) { 44000 imgData.kind = _util.ImageKind.RGB_24BPP; 44001 imgData.data = this.getImageBytes(originalHeight * rowBytes, drawWidth, drawHeight, true); 44002 return imgData; 44003 } 44004 } 44005 imgArray = this.getImageBytes(originalHeight * rowBytes); 44006 var actualHeight = 0 | imgArray.length / rowBytes * drawHeight / originalHeight; 44007 var comps = this.getComponents(imgArray); 44008 var alpha01, maybeUndoPreblend; 44009 if (!forceRGBA && !this.smask && !this.mask) { 44010 imgData.kind = _util.ImageKind.RGB_24BPP; 44011 imgData.data = new Uint8Array(drawWidth * drawHeight * 3); 44012 alpha01 = 0; 44013 maybeUndoPreblend = false; 44014 } else { 44015 imgData.kind = _util.ImageKind.RGBA_32BPP; 44016 imgData.data = new Uint8Array(drawWidth * drawHeight * 4); 44017 alpha01 = 1; 44018 maybeUndoPreblend = true; 44019 this.fillOpacity(imgData.data, drawWidth, drawHeight, actualHeight, comps); 44020 } 44021 if (this.needsDecode) { 44022 this.decodeBuffer(comps); 44023 } 44024 this.colorSpace.fillRgb(imgData.data, originalWidth, originalHeight, drawWidth, drawHeight, actualHeight, bpc, comps, alpha01); 44025 if (maybeUndoPreblend) { 44026 this.undoPreblend(imgData.data, drawWidth, actualHeight); 44027 } 44028 return imgData; 44029 }, 44030 fillGrayBuffer: function fillGrayBuffer(buffer) { 44031 var numComps = this.numComps; 44032 if (numComps !== 1) { 44033 throw new _util.FormatError('Reading gray scale from a color image: ' + numComps); 44034 } 44035 var width = this.width; 44036 var height = this.height; 44037 var bpc = this.bpc; 44038 var rowBytes = width * numComps * bpc + 7 >> 3; 44039 var imgArray = this.getImageBytes(height * rowBytes); 44040 var comps = this.getComponents(imgArray); 44041 var i, length; 44042 if (bpc === 1) { 44043 length = width * height; 44044 if (this.needsDecode) { 44045 for (i = 0; i < length; ++i) { 44046 buffer[i] = comps[i] - 1 & 255; 44047 } 44048 } else { 44049 for (i = 0; i < length; ++i) { 44050 buffer[i] = -comps[i] & 255; 44051 } 44052 } 44053 return; 44054 } 44055 if (this.needsDecode) { 44056 this.decodeBuffer(comps); 44057 } 44058 length = width * height; 44059 var scale = 255 / ((1 << bpc) - 1); 44060 for (i = 0; i < length; ++i) { 44061 buffer[i] = scale * comps[i] | 0; 44062 } 44063 }, 44064 getImageBytes: function getImageBytes(length, drawWidth, drawHeight) { 44065 var forceRGB = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
44066 44067 this.image.reset(); 44068 this.image.drawWidth = drawWidth || this.width; 44069 this.image.drawHeight = drawHeight || this.height; 44070 this.image.forceRGB = !!forceRGB; 44071 return this.image.getBytes(length); 44072 } 44073 }; 44074 return PDFImage; 44075}(); 44076exports.PDFImage = PDFImage; 44077 44078/***/ }), 44079/* 124 */ 44080/***/ (function(module, exports, __w_pdfjs_require__) { 44081 44082"use strict"; 44083 44084 44085Object.defineProperty(exports, "__esModule", { 44086 value: true 44087}); 44088exports.AnnotationFactory = exports.AnnotationBorderStyle = exports.Annotation = undefined; 44089 44090var _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); } }; 44091 44092var _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; }; }(); 44093 44094var _util = __w_pdfjs_require__(0); 44095 44096var _obj = __w_pdfjs_require__(63); 44097 44098var _primitives = __w_pdfjs_require__(2); 44099 44100var _colorspace = __w_pdfjs_require__(21); 44101 44102var _evaluator = __w_pdfjs_require__(67); 44103 44104var _stream = __w_pdfjs_require__(5); 44105 44106function _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; } 44107 44108function _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, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 44109 44110function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 44111 44112var AnnotationFactory = function () { 44113 function AnnotationFactory() { 44114 _classCallCheck(this, AnnotationFactory); 44115 } 44116 44117 _createClass(AnnotationFactory, null, [{ 44118 key: 'create', 44119 value: function create(xref, ref, pdfManager, idFactory) { 44120 var dict = xref.fetchIfRef(ref); 44121 if (!(0, _primitives.isDict)(dict)) { 44122 return; 44123 } 44124 var id = (0, _primitives.isRef)(ref) ? ref.toString() : 'annot_' + idFactory.createObjId(); 44125 var subtype = dict.get('Subtype'); 44126 subtype = (0, _primitives.isName)(subtype) ? subtype.name : null; 44127 var parameters = { 44128 xref: xref, 44129 dict: dict, 44130 ref: (0, _primitives.isRef)(ref) ? ref : null, 44131 subtype: subtype, 44132 id: id, 44133 pdfManager: pdfManager 44134 }; 44135 switch (subtype) { 44136 case 'Link': 44137 return new LinkAnnotation(parameters); 44138 case 'Text': 44139 return new TextAnnotation(parameters); 44140 case 'Widget': 44141 var fieldType = _util.Util.getInheritableProperty(dict, 'FT'); 44142 fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null; 44143 switch (fieldType) { 44144 case 'Tx': 44145 return new TextWidgetAnnotation(parameters); 44146 case 'Btn': 44147 return new ButtonWidgetAnnotation(parameters); 44148 case 'Ch': 44149 return new ChoiceWidgetAnnotation(parameters); 44150 } 44151 (0, _util.warn)('Unimplemented widget field type "' + fieldType + '", ' + 'falling back to base field type.'); 44152 return new WidgetAnnotation(parameters); 44153 case 'Popup': 44154 return new PopupAnnotation(parameters); 44155 case 'Line': 44156 return new LineAnnotation(parameters); 44157 case 'Square': 44158 return new SquareAnnotation(parameters); 44159 case 'Circle': 44160 return new CircleAnnotation(parameters); 44161 case 'PolyLine': 44162 return new PolylineAnnotation(parameters); 44163 case 'Polygon': 44164 return new PolygonAnnotation(parameters); 44165 case 'Highlight': 44166 return new HighlightAnnotation(parameters); 44167 case 'Underline': 44168 return new UnderlineAnnotation(parameters); 44169 case 'Squiggly': 44170 return new SquigglyAnnotation(parameters); 44171 case 'StrikeOut': 44172 return new StrikeOutAnnotation(parameters); 44173 case 'Stamp': 44174 return new StampAnnotation(parameters); 44175 case 'FileAttachment': 44176 return new FileAttachmentAnnotation(parameters); 44177 default: 44178 if (!subtype) { 44179 (0, _util.warn)('Annotation is missing the required /Subtype.'); 44180 } else { 44181 (0, _util.warn)('Unimplemented annotation type "' + subtype + '", ' + 'falling back to base annotation.'); 44182 } 44183 return new Annotation(parameters); 44184 } 44185 } 44186 }]); 44187 44188 return AnnotationFactory; 44189}(); 44190 44191function getTransformMatrix(rect, bbox, matrix) { 44192 var bounds = _util.Util.getAxialAlignedBoundingBox(bbox, matrix); 44193 var minX = bounds[0]; 44194 var minY = bounds[1]; 44195 var maxX = bounds[2]; 44196 var maxY = bounds[3]; 44197 if (minX === maxX || minY === maxY) { 44198 return [1, 0, 0, 1, rect[0], rect[1]]; 44199 } 44200 var xRatio = (rect[2] - rect[0]) / (maxX - minX); 44201 var yRatio = (rect[3] - rect[1]) / (maxY - minY); 44202 return [xRatio, 0, 0, yRatio, rect[0] - minX * xRatio, rect[1] - minY * yRatio]; 44203} 44204 44205var Annotation = function () { 44206 function Annotation(params) { 44207 _classCallCheck(this, Annotation); 44208 44209 var dict = params.dict; 44210 this.setFlags(dict.get('F')); 44211 this.setRectangle(dict.getArray('Rect')); 44212 this.setColor(dict.getArray('C')); 44213 this.setBorderStyle(dict); 44214 this.setAppearance(dict); 44215 this.data = { 44216 annotationFlags: this.flags, 44217 borderStyle: this.borderStyle, 44218 color: this.color, 44219 hasAppearance: !!this.appearance, 44220 id: params.id, 44221 rect: this.rectangle, 44222 subtype: params.subtype 44223 }; 44224 } 44225 44226 _createClass(Annotation, [{ 44227 key: '_hasFlag', 44228 value: function _hasFlag(flags, flag) { 44229 return !!(flags & flag); 44230 } 44231 }, { 44232 key: '_isViewable', 44233 value: function _isViewable(flags) { 44234 return !this._hasFlag(flags, _util.AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, _util.AnnotationFlag.HIDDEN) && !this._hasFlag(flags, _util.AnnotationFlag.NOVIEW); 44235 } 44236 }, { 44237 key: '_isPrintable', 44238 value: function _isPrintable(flags) { 44239 return this._hasFlag(flags, _util.AnnotationFlag.PRINT) && !this._hasFlag(flags, _util.AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, _util.AnnotationFlag.HIDDEN); 44240 } 44241 }, { 44242 key: 'setFlags', 44243 value: function setFlags(flags) { 44244 this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0; 44245 } 44246 }, { 44247 key: 'hasFlag', 44248 value: function hasFlag(flag) { 44249 return this._hasFlag(this.flags, flag); 44250 } 44251 }, { 44252 key: 'setRectangle', 44253 value: function setRectangle(rectangle) { 44254 if (Array.isArray(rectangle) && rectangle.length === 4) { 44255 this.rectangle = _util.Util.normalizeRect(rectangle); 44256 } else { 44257 this.rectangle = [0, 0, 0, 0]; 44258 } 44259 } 44260 }, { 44261 key: 'setColor', 44262 value: function setColor(color) { 44263 var rgbColor = new Uint8Array(3); 44264 if (!Array.isArray(color)) { 44265 this.color = rgbColor; 44266 return; 44267 } 44268 switch (color.length) { 44269 case 0: 44270 this.color = null; 44271 break; 44272 case 1: 44273 _colorspace.ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0); 44274 this.color = rgbColor; 44275 break; 44276 case 3: 44277 _colorspace.ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0); 44278 this.color = rgbColor; 44279 break; 44280 case 4: 44281 _colorspace.ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0); 44282 this.color = rgbColor; 44283 break; 44284 default: 44285 this.color = rgbColor; 44286 break; 44287 } 44288 } 44289 }, { 44290 key: 'setBorderStyle', 44291 value: function setBorderStyle(borderStyle) { 44292 this.borderStyle = new AnnotationBorderStyle(); 44293 if (!(0, _primitives.isDict)(borderStyle)) { 44294 return; 44295 } 44296 if (borderStyle.has('BS')) { 44297 var dict = borderStyle.get('BS'); 44298 var dictType = dict.get('Type'); 44299 if (!dictType || (0, _primitives.isName)(dictType, 'Border')) { 44300 this.borderStyle.setWidth(dict.get('W')); 44301 this.borderStyle.setStyle(dict.get('S')); 44302 this.borderStyle.setDashArray(dict.getArray('D')); 44303 } 44304 } else if (borderStyle.has('Border')) { 44305 var array = borderStyle.getArray('Border'); 44306 if (Array.isArray(array) && array.length >= 3) { 44307 this.borderStyle.setHorizontalCornerRadius(array[0]); 44308 this.borderStyle.setVerticalCornerRadius(array[1]); 44309 this.borderStyle.setWidth(array[2]); 44310 if (array.length === 4) { 44311 this.borderStyle.setDashArray(array[3]); 44312 } 44313 } 44314 } else { 44315 this.borderStyle.setWidth(0); 44316 } 44317 } 44318 }, { 44319 key: 'setAppearance', 44320 value: function setAppearance(dict) { 44321 this.appearance = null; 44322 var appearanceStates = dict.get('AP'); 44323 if (!(0, _primitives.isDict)(appearanceStates)) { 44324 return; 44325 } 44326 var normalAppearanceState = appearanceStates.get('N'); 44327 if ((0, _primitives.isStream)(normalAppearanceState)) { 44328 this.appearance = normalAppearanceState; 44329 return; 44330 } 44331 if (!(0, _primitives.isDict)(normalAppearanceState)) { 44332 return; 44333 } 44334 var as = dict.get('AS'); 44335 if (!(0, _primitives.isName)(as) || !normalAppearanceState.has(as.name)) { 44336 return; 44337 } 44338 this.appearance = normalAppearanceState.get(as.name); 44339 } 44340 }, { 44341 key: '_preparePopup', 44342 value: function _preparePopup(dict) { 44343 if (!dict.has('C')) { 44344 this.data.color = null; 44345 } 44346 this.data.hasPopup = dict.has('Popup'); 44347 this.data.title = (0, _util.stringToPDFString)(dict.get('T') || ''); 44348 this.data.contents = (0, _util.stringToPDFString)(dict.get('Contents') || ''); 44349 } 44350 }, { 44351 key: 'loadResources', 44352 value: function loadResources(keys) { 44353 return this.appearance.dict.getAsync('Resources').then(function (resources) { 44354 if (!resources) { 44355 return; 44356 } 44357 var objectLoader = new _obj.ObjectLoader(resources, keys, resources.xref); 44358 return objectLoader.load().then(function () { 44359 return resources; 44360 }); 44361 }); 44362 } 44363 }, { 44364 key: 'getOperatorList', 44365 value: function getOperatorList(evaluator, task, renderForms) { 44366 var _this = this; 44367 44368 if (!this.appearance) { 44369 return Promise.resolve(new _evaluator.OperatorList()); 44370 } 44371 var data = this.data; 44372 var appearanceDict = this.appearance.dict; 44373 var resourcesPromise = this.loadResources(['ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font']); 44374 var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1]; 44375 var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0, 0]; 44376 var transform = getTransformMatrix(data.rect, bbox, matrix); 44377 return resourcesPromise.then(function (resources) { 44378 var opList = new _evaluator.OperatorList(); 44379 opList.addOp(_util.OPS.beginAnnotation, [data.rect, transform, matrix]); 44380 return evaluator.getOperatorList({ 44381 stream: _this.appearance, 44382 task: task, 44383 resources: resources, 44384 operatorList: opList 44385 }).then(function () { 44386 opList.addOp(_util.OPS.endAnnotation, []); 44387 _this.appearance.reset(); 44388 return opList; 44389 }); 44390 }); 44391 } 44392 }, { 44393 key: 'viewable', 44394 get: function get() { 44395 if (this.flags === 0) { 44396 return true; 44397 } 44398 return this._isViewable(this.flags); 44399 } 44400 }, { 44401 key: 'printable', 44402 get: function get() { 44403 if (this.flags === 0) { 44404 return false;
44405 } 44406 return this._isPrintable(this.flags); 44407 } 44408 }]); 44409 44410 return Annotation; 44411}(); 44412 44413var AnnotationBorderStyle = function () { 44414 function AnnotationBorderStyle() { 44415 _classCallCheck(this, AnnotationBorderStyle); 44416 44417 this.width = 1; 44418 this.style = _util.AnnotationBorderStyleType.SOLID; 44419 this.dashArray = [3]; 44420 this.horizontalCornerRadius = 0; 44421 this.verticalCornerRadius = 0; 44422 } 44423 44424 _createClass(AnnotationBorderStyle, [{ 44425 key: 'setWidth', 44426 value: function setWidth(width) { 44427 if (Number.isInteger(width)) { 44428 this.width = width; 44429 } 44430 } 44431 }, { 44432 key: 'setStyle', 44433 value: function setStyle(style) { 44434 if (!style) { 44435 return; 44436 } 44437 switch (style.name) { 44438 case 'S': 44439 this.style = _util.AnnotationBorderStyleType.SOLID; 44440 break; 44441 case 'D': 44442 this.style = _util.AnnotationBorderStyleType.DASHED; 44443 break; 44444 case 'B': 44445 this.style = _util.AnnotationBorderStyleType.BEVELED; 44446 break; 44447 case 'I': 44448 this.style = _util.AnnotationBorderStyleType.INSET; 44449 break; 44450 case 'U': 44451 this.style = _util.AnnotationBorderStyleType.UNDERLINE; 44452 break; 44453 default: 44454 break; 44455 } 44456 } 44457 }, { 44458 key: 'setDashArray', 44459 value: function setDashArray(dashArray) { 44460 if (Array.isArray(dashArray) && dashArray.length > 0) { 44461 var isValid = true; 44462 var allZeros = true; 44463 for (var i = 0, len = dashArray.length; i < len; i++) { 44464 var element = dashArray[i]; 44465 var validNumber = +element >= 0; 44466 if (!validNumber) { 44467 isValid = false; 44468 break; 44469 } else if (element > 0) { 44470 allZeros = false; 44471 } 44472 } 44473 if (isValid && !allZeros) { 44474 this.dashArray = dashArray; 44475 } else { 44476 this.width = 0; 44477 } 44478 } else if (dashArray) { 44479 this.width = 0; 44480 } 44481 } 44482 }, { 44483 key: 'setHorizontalCornerRadius', 44484 value: function setHorizontalCornerRadius(radius) { 44485 if (Number.isInteger(radius)) { 44486 this.horizontalCornerRadius = radius; 44487 } 44488 } 44489 }, { 44490 key: 'setVerticalCornerRadius', 44491 value: function setVerticalCornerRadius(radius) { 44492 if (Number.isInteger(radius)) { 44493 this.verticalCornerRadius = radius; 44494 } 44495 } 44496 }]); 44497 44498 return AnnotationBorderStyle; 44499}(); 44500 44501var WidgetAnnotation = function (_Annotation) { 44502 _inherits(WidgetAnnotation, _Annotation); 44503 44504 function WidgetAnnotation(params) { 44505 _classCallCheck(this, WidgetAnnotation); 44506 44507 var _this2 = _possibleConstructorReturn(this, (WidgetAnnotation.__proto__ || Object.getPrototypeOf(WidgetAnnotation)).call(this, params)); 44508 44509 var dict = params.dict; 44510 var data = _this2.data; 44511 data.annotationType = _util.AnnotationType.WIDGET; 44512 data.fieldName = _this2._constructFieldName(dict); 44513 data.fieldValue = _util.Util.getInheritableProperty(dict, 'V', true); 44514 data.alternativeText = (0, _util.stringToPDFString)(dict.get('TU') || ''); 44515 data.defaultAppearance = _util.Util.getInheritableProperty(dict, 'DA') || ''; 44516 var fieldType = _util.Util.getInheritableProperty(dict, 'FT'); 44517 data.fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null; 44518 _this2.fieldResources = _util.Util.getInheritableProperty(dict, 'DR') || _primitives.Dict.empty; 44519 data.fieldFlags = _util.Util.getInheritableProperty(dict, 'Ff'); 44520 if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) { 44521 data.fieldFlags = 0; 44522 } 44523 data.readOnly = _this2.hasFieldFlag(_util.AnnotationFieldFlag.READONLY); 44524 if (data.fieldType === 'Sig') { 44525 _this2.setFlags(_util.AnnotationFlag.HIDDEN); 44526 } 44527 return _this2; 44528 } 44529 44530 _createClass(WidgetAnnotation, [{ 44531 key: '_constructFieldName', 44532 value: function _constructFieldName(dict) { 44533 if (!dict.has('T') && !dict.has('Parent')) { 44534 (0, _util.warn)('Unknown field name, falling back to empty field name.'); 44535 return ''; 44536 } 44537 if (!dict.has('Parent')) { 44538 return (0, _util.stringToPDFString)(dict.get('T')); 44539 } 44540 var fieldName = []; 44541 if (dict.has('T')) { 44542 fieldName.unshift((0, _util.stringToPDFString)(dict.get('T'))); 44543 } 44544 var loopDict = dict; 44545 while (loopDict.has('Parent')) { 44546 loopDict = loopDict.get('Parent'); 44547 if (!(0, _primitives.isDict)(loopDict)) { 44548 break; 44549 } 44550 if (loopDict.has('T')) { 44551 fieldName.unshift((0, _util.stringToPDFString)(loopDict.get('T'))); 44552 } 44553 } 44554 return fieldName.join('.'); 44555 } 44556 }, { 44557 key: 'hasFieldFlag', 44558 value: function hasFieldFlag(flag) { 44559 return !!(this.data.fieldFlags & flag); 44560 } 44561 }, { 44562 key: 'getOperatorList', 44563 value: function getOperatorList(evaluator, task, renderForms) { 44564 if (renderForms) { 44565 return Promise.resolve(new _evaluator.OperatorList()); 44566 } 44567 return _get(WidgetAnnotation.prototype.__proto__ || Object.getPrototypeOf(WidgetAnnotation.prototype), 'getOperatorList', this).call(this, evaluator, task, renderForms); 44568 } 44569 }]); 44570 44571 return WidgetAnnotation; 44572}(Annotation); 44573 44574var TextWidgetAnnotation = function (_WidgetAnnotation) { 44575 _inherits(TextWidgetAnnotation, _WidgetAnnotation); 44576 44577 function TextWidgetAnnotation(params) { 44578 _classCallCheck(this, TextWidgetAnnotation); 44579 44580 var _this3 = _possibleConstructorReturn(this, (TextWidgetAnnotation.__proto__ || Object.getPrototypeOf(TextWidgetAnnotation)).call(this, params)); 44581 44582 _this3.data.fieldValue = (0, _util.stringToPDFString)(_this3.data.fieldValue || ''); 44583 var alignment = _util.Util.getInheritableProperty(params.dict, 'Q'); 44584 if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) { 44585 alignment = null; 44586 } 44587 _this3.data.textAlignment = alignment; 44588 var maximumLength = _util.Util.getInheritableProperty(params.dict, 'MaxLen'); 44589 if (!Number.isInteger(maximumLength) || maximumLength < 0) { 44590 maximumLength = null; 44591 } 44592 _this3.data.maxLen = maximumLength; 44593 _this3.data.multiLine = _this3.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE); 44594 _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; 44595 return _this3; 44596 } 44597 44598 _createClass(TextWidgetAnnotation, [{ 44599 key: 'getOperatorList', 44600 value: function getOperatorList(evaluator, task, renderForms) { 44601 if (renderForms || this.appearance) { 44602 return _get(TextWidgetAnnotation.prototype.__proto__ || Object.getPrototypeOf(TextWidgetAnnotation.prototype), 'getOperatorList', this).call(this, evaluator, task, renderForms); 44603 } 44604 var operatorList = new _evaluator.OperatorList(); 44605 if (!this.data.defaultAppearance) { 44606 return Promise.resolve(operatorList); 44607 } 44608 var stream = new _stream.Stream((0, _util.stringToBytes)(this.data.defaultAppearance)); 44609 return evaluator.getOperatorList({ 44610 stream: stream, 44611 task: task, 44612 resources: this.fieldResources, 44613 operatorList: operatorList 44614 }).then(function () { 44615 return operatorList; 44616 }); 44617 } 44618 }]); 44619 44620 return TextWidgetAnnotation; 44621}(WidgetAnnotation); 44622 44623var ButtonWidgetAnnotation = function (_WidgetAnnotation2) { 44624 _inherits(ButtonWidgetAnnotation, _WidgetAnnotation2); 44625 44626 function ButtonWidgetAnnotation(params) { 44627 _classCallCheck(this, ButtonWidgetAnnotation); 44628 44629 var _this4 = _possibleConstructorReturn(this, (ButtonWidgetAnnotation.__proto__ || Object.getPrototypeOf(ButtonWidgetAnnotation)).call(this, params)); 44630 44631 _this4.data.checkBox = !_this4.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); 44632 if (_this4.data.checkBox) { 44633 if (!(0, _primitives.isName)(_this4.data.fieldValue)) { 44634 return _possibleConstructorReturn(_this4); 44635 } 44636 _this4.data.fieldValue = _this4.data.fieldValue.name; 44637 } 44638 _this4.data.radioButton = _this4.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); 44639 if (_this4.data.radioButton) { 44640 _this4.data.fieldValue = _this4.data.buttonValue = null; 44641 var fieldParent = params.dict.get('Parent'); 44642 if ((0, _primitives.isDict)(fieldParent) && fieldParent.has('V')) { 44643 var fieldParentValue = fieldParent.get('V'); 44644 if ((0, _primitives.isName)(fieldParentValue)) { 44645 _this4.data.fieldValue = fieldParentValue.name; 44646 } 44647 } 44648 var appearanceStates = params.dict.get('AP'); 44649 if (!(0, _primitives.isDict)(appearanceStates)) { 44650 return _possibleConstructorReturn(_this4); 44651 } 44652 var normalAppearanceState = appearanceStates.get('N'); 44653 if (!(0, _primitives.isDict)(normalAppearanceState)) { 44654 return _possibleConstructorReturn(_this4); 44655 } 44656 var keys = normalAppearanceState.getKeys(); 44657 for (var i = 0, ii = keys.length; i < ii; i++) { 44658 if (keys[i] !== 'Off') { 44659 _this4.data.buttonValue = keys[i]; 44660 break; 44661 } 44662 } 44663 } 44664 return _this4; 44665 } 44666 44667 return ButtonWidgetAnnotation; 44668}(WidgetAnnotation); 44669 44670var ChoiceWidgetAnnotation = function (_WidgetAnnotation3) { 44671 _inherits(ChoiceWidgetAnnotation, _WidgetAnnotation3); 44672 44673 function ChoiceWidgetAnnotation(params) { 44674 _classCallCheck(this, ChoiceWidgetAnnotation); 44675 44676 var _this5 = _possibleConstructorReturn(this, (ChoiceWidgetAnnotation.__proto__ || Object.getPrototypeOf(ChoiceWidgetAnnotation)).call(this, params)); 44677 44678 _this5.data.options = []; 44679 var options = _util.Util.getInheritableProperty(params.dict, 'Opt'); 44680 if (Array.isArray(options)) { 44681 var xref = params.xref; 44682 for (var i = 0, ii = options.length; i < ii; i++) { 44683 var option = xref.fetchIfRef(options[i]); 44684 var isOptionArray = Array.isArray(option); 44685 _this5.data.options[i] = { 44686 exportValue: isOptionArray ? xref.fetchIfRef(option[0]) : option, 44687 displayValue: isOptionArray ? xref.fetchIfRef(option[1]) : option 44688 }; 44689 } 44690 } 44691 if (!Array.isArray(_this5.data.fieldValue)) { 44692 _this5.data.fieldValue = [_this5.data.fieldValue]; 44693 } 44694 _this5.data.combo = _this5.hasFieldFlag(_util.AnnotationFieldFlag.COMBO); 44695 _this5.data.multiSelect = _this5.hasFieldFlag(_util.AnnotationFieldFlag.MULTISELECT); 44696 return _this5; 44697 } 44698 44699 return ChoiceWidgetAnnotation; 44700}(WidgetAnnotation); 44701 44702var TextAnnotation = function (_Annotation2) { 44703 _inherits(TextAnnotation, _Annotation2); 44704 44705 function TextAnnotation(parameters) { 44706 _classCallCheck(this, TextAnnotation); 44707
44708 var DEFAULT_ICON_SIZE = 22; 44709 44710 var _this6 = _possibleConstructorReturn(this, (TextAnnotation.__proto__ || Object.getPrototypeOf(TextAnnotation)).call(this, parameters)); 44711 44712 _this6.data.annotationType = _util.AnnotationType.TEXT; 44713 if (_this6.data.hasAppearance) { 44714 _this6.data.name = 'NoIcon'; 44715 } else { 44716 _this6.data.rect[1] = _this6.data.rect[3] - DEFAULT_ICON_SIZE; 44717 _this6.data.rect[2] = _this6.data.rect[0] + DEFAULT_ICON_SIZE; 44718 _this6.data.name = parameters.dict.has('Name') ? parameters.dict.get('Name').name : 'Note'; 44719 } 44720 _this6._preparePopup(parameters.dict); 44721 return _this6; 44722 } 44723 44724 return TextAnnotation; 44725}(Annotation); 44726 44727var LinkAnnotation = function (_Annotation3) { 44728 _inherits(LinkAnnotation, _Annotation3); 44729 44730 function LinkAnnotation(params) { 44731 _classCallCheck(this, LinkAnnotation); 44732 44733 var _this7 = _possibleConstructorReturn(this, (LinkAnnotation.__proto__ || Object.getPrototypeOf(LinkAnnotation)).call(this, params)); 44734 44735 _this7.data.annotationType = _util.AnnotationType.LINK; 44736 _obj.Catalog.parseDestDictionary({ 44737 destDict: params.dict, 44738 resultObj: _this7.data, 44739 docBaseUrl: params.pdfManager.docBaseUrl 44740 }); 44741 return _this7; 44742 } 44743 44744 return LinkAnnotation; 44745}(Annotation); 44746 44747var PopupAnnotation = function (_Annotation4) { 44748 _inherits(PopupAnnotation, _Annotation4); 44749 44750 function PopupAnnotation(parameters) { 44751 _classCallCheck(this, PopupAnnotation); 44752 44753 var _this8 = _possibleConstructorReturn(this, (PopupAnnotation.__proto__ || Object.getPrototypeOf(PopupAnnotation)).call(this, parameters)); 44754 44755 _this8.data.annotationType = _util.AnnotationType.POPUP; 44756 var dict = parameters.dict; 44757 var parentItem = dict.get('Parent'); 44758 if (!parentItem) { 44759 (0, _util.warn)('Popup annotation has a missing or invalid parent annotation.'); 44760 return _possibleConstructorReturn(_this8); 44761 } 44762 var parentSubtype = parentItem.get('Subtype'); 44763 _this8.data.parentType = (0, _primitives.isName)(parentSubtype) ? parentSubtype.name : null; 44764 _this8.data.parentId = dict.getRaw('Parent').toString(); 44765 _this8.data.title = (0, _util.stringToPDFString)(parentItem.get('T') || ''); 44766 _this8.data.contents = (0, _util.stringToPDFString)(parentItem.get('Contents') || ''); 44767 if (!parentItem.has('C')) { 44768 _this8.data.color = null; 44769 } else { 44770 _this8.setColor(parentItem.getArray('C')); 44771 _this8.data.color = _this8.color; 44772 } 44773 if (!_this8.viewable) { 44774 var parentFlags = parentItem.get('F'); 44775 if (_this8._isViewable(parentFlags)) { 44776 _this8.setFlags(parentFlags); 44777 } 44778 } 44779 return _this8; 44780 } 44781 44782 return PopupAnnotation; 44783}(Annotation); 44784 44785var LineAnnotation = function (_Annotation5) { 44786 _inherits(LineAnnotation, _Annotation5); 44787 44788 function LineAnnotation(parameters) { 44789 _classCallCheck(this, LineAnnotation); 44790 44791 var _this9 = _possibleConstructorReturn(this, (LineAnnotation.__proto__ || Object.getPrototypeOf(LineAnnotation)).call(this, parameters)); 44792 44793 _this9.data.annotationType = _util.AnnotationType.LINE; 44794 var dict = parameters.dict; 44795 _this9.data.lineCoordinates = _util.Util.normalizeRect(dict.getArray('L')); 44796 _this9._preparePopup(dict); 44797 return _this9; 44798 } 44799 44800 return LineAnnotation; 44801}(Annotation); 44802 44803var SquareAnnotation = function (_Annotation6) { 44804 _inherits(SquareAnnotation, _Annotation6); 44805 44806 function SquareAnnotation(parameters) { 44807 _classCallCheck(this, SquareAnnotation); 44808 44809 var _this10 = _possibleConstructorReturn(this, (SquareAnnotation.__proto__ || Object.getPrototypeOf(SquareAnnotation)).call(this, parameters)); 44810 44811 _this10.data.annotationType = _util.AnnotationType.SQUARE; 44812 _this10._preparePopup(parameters.dict); 44813 return _this10; 44814 } 44815 44816 return SquareAnnotation; 44817}(Annotation); 44818 44819var CircleAnnotation = function (_Annotation7) { 44820 _inherits(CircleAnnotation, _Annotation7); 44821 44822 function CircleAnnotation(parameters) { 44823 _classCallCheck(this, CircleAnnotation); 44824 44825 var _this11 = _possibleConstructorReturn(this, (CircleAnnotation.__proto__ || Object.getPrototypeOf(CircleAnnotation)).call(this, parameters)); 44826 44827 _this11.data.annotationType = _util.AnnotationType.CIRCLE; 44828 _this11._preparePopup(parameters.dict); 44829 return _this11; 44830 } 44831 44832 return CircleAnnotation; 44833}(Annotation); 44834 44835var PolylineAnnotation = function (_Annotation8) { 44836 _inherits(PolylineAnnotation, _Annotation8); 44837 44838 function PolylineAnnotation(parameters) { 44839 _classCallCheck(this, PolylineAnnotation); 44840 44841 var _this12 = _possibleConstructorReturn(this, (PolylineAnnotation.__proto__ || Object.getPrototypeOf(PolylineAnnotation)).call(this, parameters)); 44842 44843 _this12.data.annotationType = _util.AnnotationType.POLYLINE; 44844 var dict = parameters.dict; 44845 var rawVertices = dict.getArray('Vertices'); 44846 _this12.data.vertices = []; 44847 for (var i = 0, ii = rawVertices.length; i < ii; i += 2) { 44848 _this12.data.vertices.push({ 44849 x: rawVertices[i], 44850 y: rawVertices[i + 1] 44851 }); 44852 } 44853 _this12._preparePopup(dict); 44854 return _this12; 44855 } 44856 44857 return PolylineAnnotation; 44858}(Annotation); 44859 44860var PolygonAnnotation = function (_PolylineAnnotation) { 44861 _inherits(PolygonAnnotation, _PolylineAnnotation); 44862 44863 function PolygonAnnotation(parameters) { 44864 _classCallCheck(this, PolygonAnnotation); 44865 44866 var _this13 = _possibleConstructorReturn(this, (PolygonAnnotation.__proto__ || Object.getPrototypeOf(PolygonAnnotation)).call(this, parameters)); 44867 44868 _this13.data.annotationType = _util.AnnotationType.POLYGON; 44869 return _this13; 44870 } 44871 44872 return PolygonAnnotation; 44873}(PolylineAnnotation); 44874 44875var HighlightAnnotation = function (_Annotation9) { 44876 _inherits(HighlightAnnotation, _Annotation9); 44877 44878 function HighlightAnnotation(parameters) { 44879 _classCallCheck(this, HighlightAnnotation); 44880 44881 var _this14 = _possibleConstructorReturn(this, (HighlightAnnotation.__proto__ || Object.getPrototypeOf(HighlightAnnotation)).call(this, parameters)); 44882 44883 _this14.data.annotationType = _util.AnnotationType.HIGHLIGHT; 44884 _this14._preparePopup(parameters.dict); 44885 return _this14; 44886 } 44887 44888 return HighlightAnnotation; 44889}(Annotation); 44890 44891var UnderlineAnnotation = function (_Annotation10) { 44892 _inherits(UnderlineAnnotation, _Annotation10); 44893 44894 function UnderlineAnnotation(parameters) { 44895 _classCallCheck(this, UnderlineAnnotation); 44896 44897 var _this15 = _possibleConstructorReturn(this, (UnderlineAnnotation.__proto__ || Object.getPrototypeOf(UnderlineAnnotation)).call(this, parameters)); 44898 44899 _this15.data.annotationType = _util.AnnotationType.UNDERLINE; 44900 _this15._preparePopup(parameters.dict); 44901 return _this15; 44902 } 44903 44904 return UnderlineAnnotation; 44905}(Annotation); 44906 44907var SquigglyAnnotation = function (_Annotation11) { 44908 _inherits(SquigglyAnnotation, _Annotation11); 44909 44910 function SquigglyAnnotation(parameters) { 44911 _classCallCheck(this, SquigglyAnnotation); 44912 44913 var _this16 = _possibleConstructorReturn(this, (SquigglyAnnotation.__proto__ || Object.getPrototypeOf(SquigglyAnnotation)).call(this, parameters)); 44914 44915 _this16.data.annotationType = _util.AnnotationType.SQUIGGLY; 44916 _this16._preparePopup(parameters.dict); 44917 return _this16; 44918 } 44919 44920 return SquigglyAnnotation; 44921}(Annotation); 44922 44923var StrikeOutAnnotation = function (_Annotation12) { 44924 _inherits(StrikeOutAnnotation, _Annotation12); 44925 44926 function StrikeOutAnnotation(parameters) { 44927 _classCallCheck(this, StrikeOutAnnotation); 44928 44929 var _this17 = _possibleConstructorReturn(this, (StrikeOutAnnotation.__proto__ || Object.getPrototypeOf(StrikeOutAnnotation)).call(this, parameters)); 44930 44931 _this17.data.annotationType = _util.AnnotationType.STRIKEOUT; 44932 _this17._preparePopup(parameters.dict); 44933 return _this17; 44934 } 44935 44936 return StrikeOutAnnotation; 44937}(Annotation); 44938 44939var StampAnnotation = function (_Annotation13) { 44940 _inherits(StampAnnotation, _Annotation13); 44941 44942 function StampAnnotation(parameters) { 44943 _classCallCheck(this, StampAnnotation); 44944 44945 var _this18 = _possibleConstructorReturn(this, (StampAnnotation.__proto__ || Object.getPrototypeOf(StampAnnotation)).call(this, parameters)); 44946 44947 _this18.data.annotationType = _util.AnnotationType.STAMP; 44948 _this18._preparePopup(parameters.dict); 44949 return _this18; 44950 } 44951 44952 return StampAnnotation; 44953}(Annotation); 44954 44955var FileAttachmentAnnotation = function (_Annotation14) { 44956 _inherits(FileAttachmentAnnotation, _Annotation14); 44957 44958 function FileAttachmentAnnotation(parameters) { 44959 _classCallCheck(this, FileAttachmentAnnotation); 44960 44961 var _this19 = _possibleConstructorReturn(this, (FileAttachmentAnnotation.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotation)).call(this, parameters)); 44962 44963 var file = new _obj.FileSpec(parameters.dict.get('FS'), parameters.xref); 44964 _this19.data.annotationType = _util.AnnotationType.FILEATTACHMENT; 44965 _this19.data.file = file.serializable; 44966 _this19._preparePopup(parameters.dict); 44967 return _this19; 44968 } 44969 44970 return FileAttachmentAnnotation; 44971}(Annotation); 44972 44973exports.Annotation = Annotation; 44974exports.AnnotationBorderStyle = AnnotationBorderStyle; 44975exports.AnnotationFactory = AnnotationFactory; 44976 44977/***/ }) 44978/******/ ])
vendor: 44 bytes, lines 44978-44980
44978; 44979}); 44980//# 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.