Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/embedpre.../assets/pdf/build
File: pdf.worker.js
function bytesToString(bytes) {
[5000] Fix | Delete
if (typeof bytes !== "object" || bytes?.length === undefined) {
[5001] Fix | Delete
unreachable("Invalid argument for bytesToString");
[5002] Fix | Delete
}
[5003] Fix | Delete
const length = bytes.length;
[5004] Fix | Delete
const MAX_ARGUMENT_COUNT = 8192;
[5005] Fix | Delete
if (length < MAX_ARGUMENT_COUNT) {
[5006] Fix | Delete
return String.fromCharCode.apply(null, bytes);
[5007] Fix | Delete
}
[5008] Fix | Delete
const strBuf = [];
[5009] Fix | Delete
for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {
[5010] Fix | Delete
const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);
[5011] Fix | Delete
const chunk = bytes.subarray(i, chunkEnd);
[5012] Fix | Delete
strBuf.push(String.fromCharCode.apply(null, chunk));
[5013] Fix | Delete
}
[5014] Fix | Delete
return strBuf.join("");
[5015] Fix | Delete
}
[5016] Fix | Delete
function stringToBytes(str) {
[5017] Fix | Delete
if (typeof str !== "string") {
[5018] Fix | Delete
unreachable("Invalid argument for stringToBytes");
[5019] Fix | Delete
}
[5020] Fix | Delete
const length = str.length;
[5021] Fix | Delete
const bytes = new Uint8Array(length);
[5022] Fix | Delete
for (let i = 0; i < length; ++i) {
[5023] Fix | Delete
bytes[i] = str.charCodeAt(i) & 0xff;
[5024] Fix | Delete
}
[5025] Fix | Delete
return bytes;
[5026] Fix | Delete
}
[5027] Fix | Delete
function string32(value) {
[5028] Fix | Delete
return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff);
[5029] Fix | Delete
}
[5030] Fix | Delete
function objectSize(obj) {
[5031] Fix | Delete
return Object.keys(obj).length;
[5032] Fix | Delete
}
[5033] Fix | Delete
function objectFromMap(map) {
[5034] Fix | Delete
const obj = Object.create(null);
[5035] Fix | Delete
for (const [key, value] of map) {
[5036] Fix | Delete
obj[key] = value;
[5037] Fix | Delete
}
[5038] Fix | Delete
return obj;
[5039] Fix | Delete
}
[5040] Fix | Delete
function isLittleEndian() {
[5041] Fix | Delete
const buffer8 = new Uint8Array(4);
[5042] Fix | Delete
buffer8[0] = 1;
[5043] Fix | Delete
const view32 = new Uint32Array(buffer8.buffer, 0, 1);
[5044] Fix | Delete
return view32[0] === 1;
[5045] Fix | Delete
}
[5046] Fix | Delete
function isEvalSupported() {
[5047] Fix | Delete
try {
[5048] Fix | Delete
new Function("");
[5049] Fix | Delete
return true;
[5050] Fix | Delete
} catch {
[5051] Fix | Delete
return false;
[5052] Fix | Delete
}
[5053] Fix | Delete
}
[5054] Fix | Delete
class FeatureTest {
[5055] Fix | Delete
static get isLittleEndian() {
[5056] Fix | Delete
return shadow(this, "isLittleEndian", isLittleEndian());
[5057] Fix | Delete
}
[5058] Fix | Delete
static get isEvalSupported() {
[5059] Fix | Delete
return shadow(this, "isEvalSupported", isEvalSupported());
[5060] Fix | Delete
}
[5061] Fix | Delete
static get isOffscreenCanvasSupported() {
[5062] Fix | Delete
return shadow(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas !== "undefined");
[5063] Fix | Delete
}
[5064] Fix | Delete
static get platform() {
[5065] Fix | Delete
if (typeof navigator !== "undefined" && typeof navigator?.platform === "string") {
[5066] Fix | Delete
return shadow(this, "platform", {
[5067] Fix | Delete
isMac: navigator.platform.includes("Mac")
[5068] Fix | Delete
});
[5069] Fix | Delete
}
[5070] Fix | Delete
return shadow(this, "platform", {
[5071] Fix | Delete
isMac: false
[5072] Fix | Delete
});
[5073] Fix | Delete
}
[5074] Fix | Delete
static get isCSSRoundSupported() {
[5075] Fix | Delete
return shadow(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)"));
[5076] Fix | Delete
}
[5077] Fix | Delete
}
[5078] Fix | Delete
const hexNumbers = Array.from(Array(256).keys(), n => n.toString(16).padStart(2, "0"));
[5079] Fix | Delete
class Util {
[5080] Fix | Delete
static makeHexColor(r, g, b) {
[5081] Fix | Delete
return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;
[5082] Fix | Delete
}
[5083] Fix | Delete
static scaleMinMax(transform, minMax) {
[5084] Fix | Delete
let temp;
[5085] Fix | Delete
if (transform[0]) {
[5086] Fix | Delete
if (transform[0] < 0) {
[5087] Fix | Delete
temp = minMax[0];
[5088] Fix | Delete
minMax[0] = minMax[2];
[5089] Fix | Delete
minMax[2] = temp;
[5090] Fix | Delete
}
[5091] Fix | Delete
minMax[0] *= transform[0];
[5092] Fix | Delete
minMax[2] *= transform[0];
[5093] Fix | Delete
if (transform[3] < 0) {
[5094] Fix | Delete
temp = minMax[1];
[5095] Fix | Delete
minMax[1] = minMax[3];
[5096] Fix | Delete
minMax[3] = temp;
[5097] Fix | Delete
}
[5098] Fix | Delete
minMax[1] *= transform[3];
[5099] Fix | Delete
minMax[3] *= transform[3];
[5100] Fix | Delete
} else {
[5101] Fix | Delete
temp = minMax[0];
[5102] Fix | Delete
minMax[0] = minMax[1];
[5103] Fix | Delete
minMax[1] = temp;
[5104] Fix | Delete
temp = minMax[2];
[5105] Fix | Delete
minMax[2] = minMax[3];
[5106] Fix | Delete
minMax[3] = temp;
[5107] Fix | Delete
if (transform[1] < 0) {
[5108] Fix | Delete
temp = minMax[1];
[5109] Fix | Delete
minMax[1] = minMax[3];
[5110] Fix | Delete
minMax[3] = temp;
[5111] Fix | Delete
}
[5112] Fix | Delete
minMax[1] *= transform[1];
[5113] Fix | Delete
minMax[3] *= transform[1];
[5114] Fix | Delete
if (transform[2] < 0) {
[5115] Fix | Delete
temp = minMax[0];
[5116] Fix | Delete
minMax[0] = minMax[2];
[5117] Fix | Delete
minMax[2] = temp;
[5118] Fix | Delete
}
[5119] Fix | Delete
minMax[0] *= transform[2];
[5120] Fix | Delete
minMax[2] *= transform[2];
[5121] Fix | Delete
}
[5122] Fix | Delete
minMax[0] += transform[4];
[5123] Fix | Delete
minMax[1] += transform[5];
[5124] Fix | Delete
minMax[2] += transform[4];
[5125] Fix | Delete
minMax[3] += transform[5];
[5126] Fix | Delete
}
[5127] Fix | Delete
static transform(m1, m2) {
[5128] Fix | Delete
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]];
[5129] Fix | Delete
}
[5130] Fix | Delete
static applyTransform(p, m) {
[5131] Fix | Delete
const xt = p[0] * m[0] + p[1] * m[2] + m[4];
[5132] Fix | Delete
const yt = p[0] * m[1] + p[1] * m[3] + m[5];
[5133] Fix | Delete
return [xt, yt];
[5134] Fix | Delete
}
[5135] Fix | Delete
static applyInverseTransform(p, m) {
[5136] Fix | Delete
const d = m[0] * m[3] - m[1] * m[2];
[5137] Fix | Delete
const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;
[5138] Fix | Delete
const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;
[5139] Fix | Delete
return [xt, yt];
[5140] Fix | Delete
}
[5141] Fix | Delete
static getAxialAlignedBoundingBox(r, m) {
[5142] Fix | Delete
const p1 = this.applyTransform(r, m);
[5143] Fix | Delete
const p2 = this.applyTransform(r.slice(2, 4), m);
[5144] Fix | Delete
const p3 = this.applyTransform([r[0], r[3]], m);
[5145] Fix | Delete
const p4 = this.applyTransform([r[2], r[1]], m);
[5146] Fix | Delete
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])];
[5147] Fix | Delete
}
[5148] Fix | Delete
static inverseTransform(m) {
[5149] Fix | Delete
const d = m[0] * m[3] - m[1] * m[2];
[5150] Fix | Delete
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];
[5151] Fix | Delete
}
[5152] Fix | Delete
static singularValueDecompose2dScale(m) {
[5153] Fix | Delete
const transpose = [m[0], m[2], m[1], m[3]];
[5154] Fix | Delete
const a = m[0] * transpose[0] + m[1] * transpose[2];
[5155] Fix | Delete
const b = m[0] * transpose[1] + m[1] * transpose[3];
[5156] Fix | Delete
const c = m[2] * transpose[0] + m[3] * transpose[2];
[5157] Fix | Delete
const d = m[2] * transpose[1] + m[3] * transpose[3];
[5158] Fix | Delete
const first = (a + d) / 2;
[5159] Fix | Delete
const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2;
[5160] Fix | Delete
const sx = first + second || 1;
[5161] Fix | Delete
const sy = first - second || 1;
[5162] Fix | Delete
return [Math.sqrt(sx), Math.sqrt(sy)];
[5163] Fix | Delete
}
[5164] Fix | Delete
static normalizeRect(rect) {
[5165] Fix | Delete
const r = rect.slice(0);
[5166] Fix | Delete
if (rect[0] > rect[2]) {
[5167] Fix | Delete
r[0] = rect[2];
[5168] Fix | Delete
r[2] = rect[0];
[5169] Fix | Delete
}
[5170] Fix | Delete
if (rect[1] > rect[3]) {
[5171] Fix | Delete
r[1] = rect[3];
[5172] Fix | Delete
r[3] = rect[1];
[5173] Fix | Delete
}
[5174] Fix | Delete
return r;
[5175] Fix | Delete
}
[5176] Fix | Delete
static intersect(rect1, rect2) {
[5177] Fix | Delete
const xLow = Math.max(Math.min(rect1[0], rect1[2]), Math.min(rect2[0], rect2[2]));
[5178] Fix | Delete
const xHigh = Math.min(Math.max(rect1[0], rect1[2]), Math.max(rect2[0], rect2[2]));
[5179] Fix | Delete
if (xLow > xHigh) {
[5180] Fix | Delete
return null;
[5181] Fix | Delete
}
[5182] Fix | Delete
const yLow = Math.max(Math.min(rect1[1], rect1[3]), Math.min(rect2[1], rect2[3]));
[5183] Fix | Delete
const yHigh = Math.min(Math.max(rect1[1], rect1[3]), Math.max(rect2[1], rect2[3]));
[5184] Fix | Delete
if (yLow > yHigh) {
[5185] Fix | Delete
return null;
[5186] Fix | Delete
}
[5187] Fix | Delete
return [xLow, yLow, xHigh, yHigh];
[5188] Fix | Delete
}
[5189] Fix | Delete
static #getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) {
[5190] Fix | Delete
if (t <= 0 || t >= 1) {
[5191] Fix | Delete
return;
[5192] Fix | Delete
}
[5193] Fix | Delete
const mt = 1 - t;
[5194] Fix | Delete
const tt = t * t;
[5195] Fix | Delete
const ttt = tt * t;
[5196] Fix | Delete
const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3;
[5197] Fix | Delete
const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3;
[5198] Fix | Delete
minMax[0] = Math.min(minMax[0], x);
[5199] Fix | Delete
minMax[1] = Math.min(minMax[1], y);
[5200] Fix | Delete
minMax[2] = Math.max(minMax[2], x);
[5201] Fix | Delete
minMax[3] = Math.max(minMax[3], y);
[5202] Fix | Delete
}
[5203] Fix | Delete
static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) {
[5204] Fix | Delete
if (Math.abs(a) < 1e-12) {
[5205] Fix | Delete
if (Math.abs(b) >= 1e-12) {
[5206] Fix | Delete
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, -c / b, minMax);
[5207] Fix | Delete
}
[5208] Fix | Delete
return;
[5209] Fix | Delete
}
[5210] Fix | Delete
const delta = b ** 2 - 4 * c * a;
[5211] Fix | Delete
if (delta < 0) {
[5212] Fix | Delete
return;
[5213] Fix | Delete
}
[5214] Fix | Delete
const sqrtDelta = Math.sqrt(delta);
[5215] Fix | Delete
const a2 = 2 * a;
[5216] Fix | Delete
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b + sqrtDelta) / a2, minMax);
[5217] Fix | Delete
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b - sqrtDelta) / a2, minMax);
[5218] Fix | Delete
}
[5219] Fix | Delete
static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) {
[5220] Fix | Delete
if (minMax) {
[5221] Fix | Delete
minMax[0] = Math.min(minMax[0], x0, x3);
[5222] Fix | Delete
minMax[1] = Math.min(minMax[1], y0, y3);
[5223] Fix | Delete
minMax[2] = Math.max(minMax[2], x0, x3);
[5224] Fix | Delete
minMax[3] = Math.max(minMax[3], y0, y3);
[5225] Fix | Delete
} else {
[5226] Fix | Delete
minMax = [Math.min(x0, x3), Math.min(y0, y3), Math.max(x0, x3), Math.max(y0, y3)];
[5227] Fix | Delete
}
[5228] Fix | Delete
this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-x0 + 3 * (x1 - x2) + x3), 6 * (x0 - 2 * x1 + x2), 3 * (x1 - x0), minMax);
[5229] Fix | Delete
this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-y0 + 3 * (y1 - y2) + y3), 6 * (y0 - 2 * y1 + y2), 3 * (y1 - y0), minMax);
[5230] Fix | Delete
return minMax;
[5231] Fix | Delete
}
[5232] Fix | Delete
}
[5233] Fix | Delete
const 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];
[5234] Fix | Delete
function stringToPDFString(str) {
[5235] Fix | Delete
if (str[0] >= "\xEF") {
[5236] Fix | Delete
let encoding;
[5237] Fix | Delete
if (str[0] === "\xFE" && str[1] === "\xFF") {
[5238] Fix | Delete
encoding = "utf-16be";
[5239] Fix | Delete
if (str.length % 2 === 1) {
[5240] Fix | Delete
str = str.slice(0, -1);
[5241] Fix | Delete
}
[5242] Fix | Delete
} else if (str[0] === "\xFF" && str[1] === "\xFE") {
[5243] Fix | Delete
encoding = "utf-16le";
[5244] Fix | Delete
if (str.length % 2 === 1) {
[5245] Fix | Delete
str = str.slice(0, -1);
[5246] Fix | Delete
}
[5247] Fix | Delete
} else if (str[0] === "\xEF" && str[1] === "\xBB" && str[2] === "\xBF") {
[5248] Fix | Delete
encoding = "utf-8";
[5249] Fix | Delete
}
[5250] Fix | Delete
if (encoding) {
[5251] Fix | Delete
try {
[5252] Fix | Delete
const decoder = new TextDecoder(encoding, {
[5253] Fix | Delete
fatal: true
[5254] Fix | Delete
});
[5255] Fix | Delete
const buffer = stringToBytes(str);
[5256] Fix | Delete
const decoded = decoder.decode(buffer);
[5257] Fix | Delete
if (!decoded.includes("\x1b")) {
[5258] Fix | Delete
return decoded;
[5259] Fix | Delete
}
[5260] Fix | Delete
return decoded.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g, "");
[5261] Fix | Delete
} catch (ex) {
[5262] Fix | Delete
warn(`stringToPDFString: "${ex}".`);
[5263] Fix | Delete
}
[5264] Fix | Delete
}
[5265] Fix | Delete
}
[5266] Fix | Delete
const strBuf = [];
[5267] Fix | Delete
for (let i = 0, ii = str.length; i < ii; i++) {
[5268] Fix | Delete
const charCode = str.charCodeAt(i);
[5269] Fix | Delete
if (charCode === 0x1b) {
[5270] Fix | Delete
while (++i < ii && str.charCodeAt(i) !== 0x1b) {}
[5271] Fix | Delete
continue;
[5272] Fix | Delete
}
[5273] Fix | Delete
const code = PDFStringTranslateTable[charCode];
[5274] Fix | Delete
strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));
[5275] Fix | Delete
}
[5276] Fix | Delete
return strBuf.join("");
[5277] Fix | Delete
}
[5278] Fix | Delete
function stringToUTF8String(str) {
[5279] Fix | Delete
return decodeURIComponent(escape(str));
[5280] Fix | Delete
}
[5281] Fix | Delete
function utf8StringToString(str) {
[5282] Fix | Delete
return unescape(encodeURIComponent(str));
[5283] Fix | Delete
}
[5284] Fix | Delete
function isArrayEqual(arr1, arr2) {
[5285] Fix | Delete
if (arr1.length !== arr2.length) {
[5286] Fix | Delete
return false;
[5287] Fix | Delete
}
[5288] Fix | Delete
for (let i = 0, ii = arr1.length; i < ii; i++) {
[5289] Fix | Delete
if (arr1[i] !== arr2[i]) {
[5290] Fix | Delete
return false;
[5291] Fix | Delete
}
[5292] Fix | Delete
}
[5293] Fix | Delete
return true;
[5294] Fix | Delete
}
[5295] Fix | Delete
function getModificationDate(date = new Date()) {
[5296] Fix | Delete
const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), date.getUTCDate().toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")];
[5297] Fix | Delete
return buffer.join("");
[5298] Fix | Delete
}
[5299] Fix | Delete
let NormalizeRegex = null;
[5300] Fix | Delete
let NormalizationMap = null;
[5301] Fix | Delete
function normalizeUnicode(str) {
[5302] Fix | Delete
if (!NormalizeRegex) {
[5303] Fix | Delete
NormalizeRegex = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu;
[5304] Fix | Delete
NormalizationMap = new Map([["ſt", "ſt"]]);
[5305] Fix | Delete
}
[5306] Fix | Delete
return str.replaceAll(NormalizeRegex, (_, p1, p2) => p1 ? p1.normalize("NFKC") : NormalizationMap.get(p2));
[5307] Fix | Delete
}
[5308] Fix | Delete
function getUuid() {
[5309] Fix | Delete
if (typeof crypto !== "undefined" && typeof crypto?.randomUUID === "function") {
[5310] Fix | Delete
return crypto.randomUUID();
[5311] Fix | Delete
}
[5312] Fix | Delete
const buf = new Uint8Array(32);
[5313] Fix | Delete
if (typeof crypto !== "undefined" && typeof crypto?.getRandomValues === "function") {
[5314] Fix | Delete
crypto.getRandomValues(buf);
[5315] Fix | Delete
} else {
[5316] Fix | Delete
for (let i = 0; i < 32; i++) {
[5317] Fix | Delete
buf[i] = Math.floor(Math.random() * 255);
[5318] Fix | Delete
}
[5319] Fix | Delete
}
[5320] Fix | Delete
return bytesToString(buf);
[5321] Fix | Delete
}
[5322] Fix | Delete
const AnnotationPrefix = "pdfjs_internal_id_";
[5323] Fix | Delete
const FontRenderOps = {
[5324] Fix | Delete
BEZIER_CURVE_TO: 0,
[5325] Fix | Delete
MOVE_TO: 1,
[5326] Fix | Delete
LINE_TO: 2,
[5327] Fix | Delete
QUADRATIC_CURVE_TO: 3,
[5328] Fix | Delete
RESTORE: 4,
[5329] Fix | Delete
SAVE: 5,
[5330] Fix | Delete
SCALE: 6,
[5331] Fix | Delete
TRANSFORM: 7,
[5332] Fix | Delete
TRANSLATE: 8
[5333] Fix | Delete
};
[5334] Fix | Delete
[5335] Fix | Delete
// EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.every.js
[5336] Fix | Delete
var esnext_iterator_every = __webpack_require__(3215);
[5337] Fix | Delete
;// CONCATENATED MODULE: ./src/core/primitives.js
[5338] Fix | Delete
[5339] Fix | Delete
[5340] Fix | Delete
[5341] Fix | Delete
[5342] Fix | Delete
[5343] Fix | Delete
[5344] Fix | Delete
[5345] Fix | Delete
[5346] Fix | Delete
[5347] Fix | Delete
const CIRCULAR_REF = Symbol("CIRCULAR_REF");
[5348] Fix | Delete
const EOF = Symbol("EOF");
[5349] Fix | Delete
let CmdCache = Object.create(null);
[5350] Fix | Delete
let NameCache = Object.create(null);
[5351] Fix | Delete
let RefCache = Object.create(null);
[5352] Fix | Delete
function clearPrimitiveCaches() {
[5353] Fix | Delete
CmdCache = Object.create(null);
[5354] Fix | Delete
NameCache = Object.create(null);
[5355] Fix | Delete
RefCache = Object.create(null);
[5356] Fix | Delete
}
[5357] Fix | Delete
class Name {
[5358] Fix | Delete
constructor(name) {
[5359] Fix | Delete
this.name = name;
[5360] Fix | Delete
}
[5361] Fix | Delete
static get(name) {
[5362] Fix | Delete
return NameCache[name] ||= new Name(name);
[5363] Fix | Delete
}
[5364] Fix | Delete
}
[5365] Fix | Delete
class Cmd {
[5366] Fix | Delete
constructor(cmd) {
[5367] Fix | Delete
this.cmd = cmd;
[5368] Fix | Delete
}
[5369] Fix | Delete
static get(cmd) {
[5370] Fix | Delete
return CmdCache[cmd] ||= new Cmd(cmd);
[5371] Fix | Delete
}
[5372] Fix | Delete
}
[5373] Fix | Delete
const nonSerializable = function nonSerializableClosure() {
[5374] Fix | Delete
return nonSerializable;
[5375] Fix | Delete
};
[5376] Fix | Delete
class Dict {
[5377] Fix | Delete
constructor(xref = null) {
[5378] Fix | Delete
this._map = Object.create(null);
[5379] Fix | Delete
this.xref = xref;
[5380] Fix | Delete
this.objId = null;
[5381] Fix | Delete
this.suppressEncryption = false;
[5382] Fix | Delete
this.__nonSerializable__ = nonSerializable;
[5383] Fix | Delete
}
[5384] Fix | Delete
assignXref(newXref) {
[5385] Fix | Delete
this.xref = newXref;
[5386] Fix | Delete
}
[5387] Fix | Delete
get size() {
[5388] Fix | Delete
return Object.keys(this._map).length;
[5389] Fix | Delete
}
[5390] Fix | Delete
get(key1, key2, key3) {
[5391] Fix | Delete
let value = this._map[key1];
[5392] Fix | Delete
if (value === undefined && key2 !== undefined) {
[5393] Fix | Delete
value = this._map[key2];
[5394] Fix | Delete
if (value === undefined && key3 !== undefined) {
[5395] Fix | Delete
value = this._map[key3];
[5396] Fix | Delete
}
[5397] Fix | Delete
}
[5398] Fix | Delete
if (value instanceof Ref && this.xref) {
[5399] Fix | Delete
return this.xref.fetch(value, this.suppressEncryption);
[5400] Fix | Delete
}
[5401] Fix | Delete
return value;
[5402] Fix | Delete
}
[5403] Fix | Delete
async getAsync(key1, key2, key3) {
[5404] Fix | Delete
let value = this._map[key1];
[5405] Fix | Delete
if (value === undefined && key2 !== undefined) {
[5406] Fix | Delete
value = this._map[key2];
[5407] Fix | Delete
if (value === undefined && key3 !== undefined) {
[5408] Fix | Delete
value = this._map[key3];
[5409] Fix | Delete
}
[5410] Fix | Delete
}
[5411] Fix | Delete
if (value instanceof Ref && this.xref) {
[5412] Fix | Delete
return this.xref.fetchAsync(value, this.suppressEncryption);
[5413] Fix | Delete
}
[5414] Fix | Delete
return value;
[5415] Fix | Delete
}
[5416] Fix | Delete
getArray(key1, key2, key3) {
[5417] Fix | Delete
let value = this._map[key1];
[5418] Fix | Delete
if (value === undefined && key2 !== undefined) {
[5419] Fix | Delete
value = this._map[key2];
[5420] Fix | Delete
if (value === undefined && key3 !== undefined) {
[5421] Fix | Delete
value = this._map[key3];
[5422] Fix | Delete
}
[5423] Fix | Delete
}
[5424] Fix | Delete
if (value instanceof Ref && this.xref) {
[5425] Fix | Delete
value = this.xref.fetch(value, this.suppressEncryption);
[5426] Fix | Delete
}
[5427] Fix | Delete
if (Array.isArray(value)) {
[5428] Fix | Delete
value = value.slice();
[5429] Fix | Delete
for (let i = 0, ii = value.length; i < ii; i++) {
[5430] Fix | Delete
if (value[i] instanceof Ref && this.xref) {
[5431] Fix | Delete
value[i] = this.xref.fetch(value[i], this.suppressEncryption);
[5432] Fix | Delete
}
[5433] Fix | Delete
}
[5434] Fix | Delete
}
[5435] Fix | Delete
return value;
[5436] Fix | Delete
}
[5437] Fix | Delete
getRaw(key) {
[5438] Fix | Delete
return this._map[key];
[5439] Fix | Delete
}
[5440] Fix | Delete
getKeys() {
[5441] Fix | Delete
return Object.keys(this._map);
[5442] Fix | Delete
}
[5443] Fix | Delete
getRawValues() {
[5444] Fix | Delete
return Object.values(this._map);
[5445] Fix | Delete
}
[5446] Fix | Delete
set(key, value) {
[5447] Fix | Delete
this._map[key] = value;
[5448] Fix | Delete
}
[5449] Fix | Delete
has(key) {
[5450] Fix | Delete
return this._map[key] !== undefined;
[5451] Fix | Delete
}
[5452] Fix | Delete
forEach(callback) {
[5453] Fix | Delete
for (const key in this._map) {
[5454] Fix | Delete
callback(key, this.get(key));
[5455] Fix | Delete
}
[5456] Fix | Delete
}
[5457] Fix | Delete
static get empty() {
[5458] Fix | Delete
const emptyDict = new Dict(null);
[5459] Fix | Delete
emptyDict.set = (key, value) => {
[5460] Fix | Delete
unreachable("Should not call `set` on the empty dictionary.");
[5461] Fix | Delete
};
[5462] Fix | Delete
return shadow(this, "empty", emptyDict);
[5463] Fix | Delete
}
[5464] Fix | Delete
static merge({
[5465] Fix | Delete
xref,
[5466] Fix | Delete
dictArray,
[5467] Fix | Delete
mergeSubDicts = false
[5468] Fix | Delete
}) {
[5469] Fix | Delete
const mergedDict = new Dict(xref),
[5470] Fix | Delete
properties = new Map();
[5471] Fix | Delete
for (const dict of dictArray) {
[5472] Fix | Delete
if (!(dict instanceof Dict)) {
[5473] Fix | Delete
continue;
[5474] Fix | Delete
}
[5475] Fix | Delete
for (const [key, value] of Object.entries(dict._map)) {
[5476] Fix | Delete
let property = properties.get(key);
[5477] Fix | Delete
if (property === undefined) {
[5478] Fix | Delete
property = [];
[5479] Fix | Delete
properties.set(key, property);
[5480] Fix | Delete
} else if (!mergeSubDicts || !(value instanceof Dict)) {
[5481] Fix | Delete
continue;
[5482] Fix | Delete
}
[5483] Fix | Delete
property.push(value);
[5484] Fix | Delete
}
[5485] Fix | Delete
}
[5486] Fix | Delete
for (const [name, values] of properties) {
[5487] Fix | Delete
if (values.length === 1 || !(values[0] instanceof Dict)) {
[5488] Fix | Delete
mergedDict._map[name] = values[0];
[5489] Fix | Delete
continue;
[5490] Fix | Delete
}
[5491] Fix | Delete
const subDict = new Dict(xref);
[5492] Fix | Delete
for (const dict of values) {
[5493] Fix | Delete
for (const [key, value] of Object.entries(dict._map)) {
[5494] Fix | Delete
if (subDict._map[key] === undefined) {
[5495] Fix | Delete
subDict._map[key] = value;
[5496] Fix | Delete
}
[5497] Fix | Delete
}
[5498] Fix | Delete
}
[5499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function