@superdoc-dev/cli 0.16.0-next.31 → 0.16.0-next.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1487 -1253
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -68373,7 +68373,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
|
|
|
68373
68373
|
emptyOptions2 = {};
|
|
68374
68374
|
});
|
|
68375
68375
|
|
|
68376
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
68376
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-BVWG4qnQ.es.js
|
|
68377
68377
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
68378
68378
|
const fieldValue = extension$1.config[field];
|
|
68379
68379
|
if (typeof fieldValue === "function")
|
|
@@ -102487,6 +102487,315 @@ function translateMark(mark) {
|
|
|
102487
102487
|
}
|
|
102488
102488
|
return markElement;
|
|
102489
102489
|
}
|
|
102490
|
+
function isSettled(status) {
|
|
102491
|
+
return SETTLED_STATUSES.includes(status);
|
|
102492
|
+
}
|
|
102493
|
+
function normalizeFamilyKey$1(family$1) {
|
|
102494
|
+
return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
|
|
102495
|
+
}
|
|
102496
|
+
function sortPairs(pairs) {
|
|
102497
|
+
return pairs.sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
102498
|
+
}
|
|
102499
|
+
function deriveBundledSubstitutes() {
|
|
102500
|
+
const substitutes = {};
|
|
102501
|
+
for (const row of SUBSTITUTION_EVIDENCE)
|
|
102502
|
+
if (row.policyAction === "substitute" && row.physicalFamily)
|
|
102503
|
+
substitutes[normalizeFamilyKey$1(row.logicalFamily)] = row.physicalFamily;
|
|
102504
|
+
return Object.freeze(substitutes);
|
|
102505
|
+
}
|
|
102506
|
+
function deriveCategoryFallbacks() {
|
|
102507
|
+
const fallbacks = {};
|
|
102508
|
+
for (const row of SUBSTITUTION_EVIDENCE)
|
|
102509
|
+
if (row.policyAction === "category_fallback" && row.physicalFamily)
|
|
102510
|
+
fallbacks[normalizeFamilyKey$1(row.logicalFamily)] = row.physicalFamily;
|
|
102511
|
+
return Object.freeze(fallbacks);
|
|
102512
|
+
}
|
|
102513
|
+
function stripFamilyQuotes(family$1) {
|
|
102514
|
+
return family$1.trim().replace(/^["']|["']$/g, "");
|
|
102515
|
+
}
|
|
102516
|
+
function splitStack(cssFontFamily) {
|
|
102517
|
+
return cssFontFamily.split(",").map((part) => part.trim()).filter(Boolean);
|
|
102518
|
+
}
|
|
102519
|
+
function createFontResolver() {
|
|
102520
|
+
return new FontResolver;
|
|
102521
|
+
}
|
|
102522
|
+
function resolveFontFamily(logicalFamily) {
|
|
102523
|
+
return defaultResolver.resolveFontFamily(logicalFamily);
|
|
102524
|
+
}
|
|
102525
|
+
function resolvePhysicalFamily(cssFontFamily) {
|
|
102526
|
+
return defaultResolver.resolvePhysicalFamily(cssFontFamily);
|
|
102527
|
+
}
|
|
102528
|
+
function resolveFace(logicalFamily, face, hasFace) {
|
|
102529
|
+
return defaultResolver.resolveFace(logicalFamily, face, hasFace);
|
|
102530
|
+
}
|
|
102531
|
+
function getFontConfigVersion() {
|
|
102532
|
+
return fontConfigVersion;
|
|
102533
|
+
}
|
|
102534
|
+
function bumpFontConfigVersion() {
|
|
102535
|
+
return fontConfigVersion += 1;
|
|
102536
|
+
}
|
|
102537
|
+
function fourFaces(filePrefix) {
|
|
102538
|
+
return [
|
|
102539
|
+
{
|
|
102540
|
+
weight: "normal",
|
|
102541
|
+
style: "normal",
|
|
102542
|
+
file: `${filePrefix}-Regular.woff2`
|
|
102543
|
+
},
|
|
102544
|
+
{
|
|
102545
|
+
weight: "bold",
|
|
102546
|
+
style: "normal",
|
|
102547
|
+
file: `${filePrefix}-Bold.woff2`
|
|
102548
|
+
},
|
|
102549
|
+
{
|
|
102550
|
+
weight: "normal",
|
|
102551
|
+
style: "italic",
|
|
102552
|
+
file: `${filePrefix}-Italic.woff2`
|
|
102553
|
+
},
|
|
102554
|
+
{
|
|
102555
|
+
weight: "bold",
|
|
102556
|
+
style: "italic",
|
|
102557
|
+
file: `${filePrefix}-BoldItalic.woff2`
|
|
102558
|
+
}
|
|
102559
|
+
];
|
|
102560
|
+
}
|
|
102561
|
+
function family(name, filePrefix, license) {
|
|
102562
|
+
return {
|
|
102563
|
+
family: name,
|
|
102564
|
+
license,
|
|
102565
|
+
faces: fourFaces(filePrefix)
|
|
102566
|
+
};
|
|
102567
|
+
}
|
|
102568
|
+
function withTrailingSlash(base$1) {
|
|
102569
|
+
return base$1.endsWith("/") ? base$1 : `${base$1}/`;
|
|
102570
|
+
}
|
|
102571
|
+
function joinUrl(base$1, file) {
|
|
102572
|
+
return `${withTrailingSlash(base$1)}${file}`;
|
|
102573
|
+
}
|
|
102574
|
+
function weightToken(weight) {
|
|
102575
|
+
return weight === "bold" ? "700" : "400";
|
|
102576
|
+
}
|
|
102577
|
+
function bundledAssetSignature(resolve2) {
|
|
102578
|
+
const family$1 = BUNDLED_MANIFEST[0];
|
|
102579
|
+
const face = family$1?.faces[0];
|
|
102580
|
+
if (!family$1 || !face)
|
|
102581
|
+
return "";
|
|
102582
|
+
return resolve2({
|
|
102583
|
+
file: face.file,
|
|
102584
|
+
family: family$1.family,
|
|
102585
|
+
weight: weightToken(face.weight),
|
|
102586
|
+
style: face.style,
|
|
102587
|
+
source: "bundled-substitute"
|
|
102588
|
+
});
|
|
102589
|
+
}
|
|
102590
|
+
function installBundledSubstitutes(registry, options = {}) {
|
|
102591
|
+
const resolve2 = options.resolveAssetUrl ?? ((context) => joinUrl(options.assetBaseUrl ?? defaultAssetBase, context.file));
|
|
102592
|
+
const signature = bundledAssetSignature(resolve2);
|
|
102593
|
+
const installed = installedRegistries.get(registry);
|
|
102594
|
+
if (installed !== undefined) {
|
|
102595
|
+
if (installed !== signature)
|
|
102596
|
+
console.warn(`[superdoc] bundled fonts are already registered for this document from "${installed}"; a later fonts config resolving to "${signature}" is ignored. Use one fonts.assetBaseUrl / fonts.resolveAssetUrl per document.`);
|
|
102597
|
+
return;
|
|
102598
|
+
}
|
|
102599
|
+
installedRegistries.set(registry, signature);
|
|
102600
|
+
for (const family$1 of BUNDLED_MANIFEST)
|
|
102601
|
+
for (const face of family$1.faces) {
|
|
102602
|
+
const context = {
|
|
102603
|
+
file: face.file,
|
|
102604
|
+
family: family$1.family,
|
|
102605
|
+
weight: weightToken(face.weight),
|
|
102606
|
+
style: face.style,
|
|
102607
|
+
source: "bundled-substitute"
|
|
102608
|
+
};
|
|
102609
|
+
registry.register({
|
|
102610
|
+
family: family$1.family,
|
|
102611
|
+
source: `url(${resolve2(context)})`,
|
|
102612
|
+
descriptors: {
|
|
102613
|
+
weight: face.weight,
|
|
102614
|
+
style: face.style
|
|
102615
|
+
}
|
|
102616
|
+
});
|
|
102617
|
+
}
|
|
102618
|
+
}
|
|
102619
|
+
function buildFontReport(logicalFamilies, registry, resolver$1) {
|
|
102620
|
+
const seen = /* @__PURE__ */ new Set;
|
|
102621
|
+
const report = [];
|
|
102622
|
+
for (const logical of logicalFamilies) {
|
|
102623
|
+
if (!logical || seen.has(logical))
|
|
102624
|
+
continue;
|
|
102625
|
+
seen.add(logical);
|
|
102626
|
+
const { physicalFamily, reason } = resolver$1 ? resolver$1.resolveFontFamily(logical) : resolveFontFamily(logical);
|
|
102627
|
+
const loadStatus = registry.getStatus(physicalFamily);
|
|
102628
|
+
report.push({
|
|
102629
|
+
logicalFamily: logical,
|
|
102630
|
+
physicalFamily,
|
|
102631
|
+
reason,
|
|
102632
|
+
loadStatus,
|
|
102633
|
+
exportFamily: logical,
|
|
102634
|
+
missing: reason === "category_fallback" || isSettled(loadStatus) && loadStatus !== "loaded"
|
|
102635
|
+
});
|
|
102636
|
+
}
|
|
102637
|
+
return report;
|
|
102638
|
+
}
|
|
102639
|
+
function buildFaceReport(usedFaces, registry, resolver$1) {
|
|
102640
|
+
const hasFace = (family$1, weight, style) => registry.hasFace(family$1, weight, style);
|
|
102641
|
+
const seen = /* @__PURE__ */ new Set;
|
|
102642
|
+
const report = [];
|
|
102643
|
+
for (const { logicalFamily, weight, style } of usedFaces) {
|
|
102644
|
+
if (!logicalFamily)
|
|
102645
|
+
continue;
|
|
102646
|
+
const key = `${logicalFamily.toLowerCase()}|${weight}|${style}`;
|
|
102647
|
+
if (seen.has(key))
|
|
102648
|
+
continue;
|
|
102649
|
+
seen.add(key);
|
|
102650
|
+
const face = {
|
|
102651
|
+
weight,
|
|
102652
|
+
style
|
|
102653
|
+
};
|
|
102654
|
+
const { physicalFamily, reason } = resolver$1 ? resolver$1.resolveFace(logicalFamily, face, hasFace) : resolveFace(logicalFamily, face, hasFace);
|
|
102655
|
+
const loadStatus = registry.getFaceStatus({
|
|
102656
|
+
family: physicalFamily,
|
|
102657
|
+
weight,
|
|
102658
|
+
style
|
|
102659
|
+
});
|
|
102660
|
+
const missing = reason === "fallback_face_absent" || reason === "category_fallback" || isSettled(loadStatus) && loadStatus !== "loaded";
|
|
102661
|
+
report.push({
|
|
102662
|
+
logicalFamily,
|
|
102663
|
+
physicalFamily: reason === "registered_face" ? logicalFamily : physicalFamily,
|
|
102664
|
+
reason,
|
|
102665
|
+
loadStatus,
|
|
102666
|
+
exportFamily: logicalFamily,
|
|
102667
|
+
missing,
|
|
102668
|
+
face
|
|
102669
|
+
});
|
|
102670
|
+
}
|
|
102671
|
+
return report;
|
|
102672
|
+
}
|
|
102673
|
+
function parseEmbeddingPolicy(bytes) {
|
|
102674
|
+
const view = bytes instanceof ArrayBuffer ? new DataView(bytes) : new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
102675
|
+
if (view.byteLength < SFNT_TABLE_DIR_OFFSET)
|
|
102676
|
+
return null;
|
|
102677
|
+
const numTables = view.getUint16(4);
|
|
102678
|
+
let os2Offset = -1;
|
|
102679
|
+
for (let i$1 = 0;i$1 < numTables; i$1 += 1) {
|
|
102680
|
+
const record = SFNT_TABLE_DIR_OFFSET + i$1 * SFNT_TABLE_RECORD_SIZE;
|
|
102681
|
+
if (record + SFNT_TABLE_RECORD_SIZE > view.byteLength)
|
|
102682
|
+
return null;
|
|
102683
|
+
if (String.fromCharCode(view.getUint8(record), view.getUint8(record + 1), view.getUint8(record + 2), view.getUint8(record + 3)) === "OS/2") {
|
|
102684
|
+
os2Offset = view.getUint32(record + 8);
|
|
102685
|
+
break;
|
|
102686
|
+
}
|
|
102687
|
+
}
|
|
102688
|
+
if (os2Offset < 0 || os2Offset + OS2_MIN_LENGTH > view.byteLength)
|
|
102689
|
+
return null;
|
|
102690
|
+
const usWeightClass = view.getUint16(os2Offset + OS2_USWEIGHTCLASS);
|
|
102691
|
+
const fsType = view.getUint16(os2Offset + OS2_FSTYPE);
|
|
102692
|
+
const fsSelection = view.getUint16(os2Offset + OS2_FSSELECTION);
|
|
102693
|
+
return {
|
|
102694
|
+
fsType,
|
|
102695
|
+
face: {
|
|
102696
|
+
weight: usWeightClass >= BOLD_WEIGHT_THRESHOLD ? "700" : "400",
|
|
102697
|
+
style: (fsSelection & FS_SELECTION_ITALIC) !== 0 ? "italic" : "normal"
|
|
102698
|
+
},
|
|
102699
|
+
embeddable: (fsType & FS_TYPE_RESTRICTED) === 0
|
|
102700
|
+
};
|
|
102701
|
+
}
|
|
102702
|
+
function quoteFamily(family$1) {
|
|
102703
|
+
return `"${family$1.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"`;
|
|
102704
|
+
}
|
|
102705
|
+
function canonicalizeFontSource(source) {
|
|
102706
|
+
const match = /^\s*url\(\s*([\s\S]*?)\s*\)\s*$/i.exec(source);
|
|
102707
|
+
if (!match)
|
|
102708
|
+
return source;
|
|
102709
|
+
let inner = match[1].trim();
|
|
102710
|
+
if (inner.startsWith('"') && inner.endsWith('"') || inner.startsWith("'") && inner.endsWith("'"))
|
|
102711
|
+
inner = inner.slice(1, -1);
|
|
102712
|
+
return `url(${JSON.stringify(inner)})`;
|
|
102713
|
+
}
|
|
102714
|
+
function normalizeFamilyKey(family$1) {
|
|
102715
|
+
return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
|
|
102716
|
+
}
|
|
102717
|
+
function normalizeWeight(weight) {
|
|
102718
|
+
if (weight === undefined)
|
|
102719
|
+
return "400";
|
|
102720
|
+
const w = String(weight).trim().toLowerCase();
|
|
102721
|
+
if (w === "bold" || w === "bolder")
|
|
102722
|
+
return "700";
|
|
102723
|
+
const n = Number(w);
|
|
102724
|
+
return Number.isFinite(n) && n >= 600 ? "700" : "400";
|
|
102725
|
+
}
|
|
102726
|
+
function normalizeStyle(style) {
|
|
102727
|
+
if (!style)
|
|
102728
|
+
return "normal";
|
|
102729
|
+
const s = style.trim().toLowerCase();
|
|
102730
|
+
return s.startsWith("italic") || s.startsWith("oblique") ? "italic" : "normal";
|
|
102731
|
+
}
|
|
102732
|
+
function faceKeyOf(family$1, weight, style) {
|
|
102733
|
+
return `${normalizeFamilyKey(family$1)}|${weight}|${style}`;
|
|
102734
|
+
}
|
|
102735
|
+
function faceProbe(family$1, weight, style, size2) {
|
|
102736
|
+
return `${style === "italic" ? "italic " : ""}${weight} ${size2} ${quoteFamily(family$1)}`;
|
|
102737
|
+
}
|
|
102738
|
+
function getFontRegistryFor(fontSet, FontFaceCtor) {
|
|
102739
|
+
if (!fontSet) {
|
|
102740
|
+
if (!domlessRegistry)
|
|
102741
|
+
domlessRegistry = new FontRegistry({});
|
|
102742
|
+
return domlessRegistry;
|
|
102743
|
+
}
|
|
102744
|
+
let registry = registriesByFontSet.get(fontSet);
|
|
102745
|
+
if (!registry) {
|
|
102746
|
+
registry = new FontRegistry({
|
|
102747
|
+
fontSet,
|
|
102748
|
+
FontFaceCtor
|
|
102749
|
+
});
|
|
102750
|
+
registriesByFontSet.set(fontSet, registry);
|
|
102751
|
+
}
|
|
102752
|
+
return registry;
|
|
102753
|
+
}
|
|
102754
|
+
function classifyOffering(policyAction, verdict, physicalFamily, bundled) {
|
|
102755
|
+
if (policyAction === "preserve_only")
|
|
102756
|
+
return "preserve_only";
|
|
102757
|
+
if (policyAction === "customer_supplied" || physicalFamily == null)
|
|
102758
|
+
return "customer_supplied";
|
|
102759
|
+
if (policyAction === "category_fallback")
|
|
102760
|
+
return "category_fallback";
|
|
102761
|
+
if (!bundled)
|
|
102762
|
+
return "requires_asset";
|
|
102763
|
+
return verdict === "metric_safe" ? "default" : "qualified";
|
|
102764
|
+
}
|
|
102765
|
+
function deriveOfferings() {
|
|
102766
|
+
const offerings = SUBSTITUTION_EVIDENCE.map((row) => {
|
|
102767
|
+
const bundled = row.physicalFamily != null && BUNDLED_FAMILIES.has(row.physicalFamily);
|
|
102768
|
+
return {
|
|
102769
|
+
logicalFamily: row.logicalFamily,
|
|
102770
|
+
physicalFamily: row.physicalFamily,
|
|
102771
|
+
generic: row.physicalFamily && PHYSICAL_GENERIC[row.physicalFamily] || "sans-serif",
|
|
102772
|
+
offering: classifyOffering(row.policyAction, row.verdict, row.physicalFamily, bundled),
|
|
102773
|
+
bundled,
|
|
102774
|
+
verdict: row.verdict,
|
|
102775
|
+
evidenceId: row.evidenceId
|
|
102776
|
+
};
|
|
102777
|
+
});
|
|
102778
|
+
return Object.freeze(offerings);
|
|
102779
|
+
}
|
|
102780
|
+
function getDefaultFontOfferings() {
|
|
102781
|
+
const rank$1 = (name) => {
|
|
102782
|
+
const i$1 = DEFAULT_FONT_ORDER.indexOf(name);
|
|
102783
|
+
return i$1 === -1 ? DEFAULT_FONT_ORDER.length : i$1;
|
|
102784
|
+
};
|
|
102785
|
+
return FONT_OFFERINGS.filter((o) => o.offering === "default").sort((a, b) => rank$1(a.logicalFamily) - rank$1(b.logicalFamily));
|
|
102786
|
+
}
|
|
102787
|
+
function fontOfferingStack(offering) {
|
|
102788
|
+
return `${offering.logicalFamily}, ${offering.generic}`;
|
|
102789
|
+
}
|
|
102790
|
+
function fontOfferingRenderStack(offering) {
|
|
102791
|
+
return offering.physicalFamily ? `${offering.physicalFamily}, ${offering.generic}` : fontOfferingStack(offering);
|
|
102792
|
+
}
|
|
102793
|
+
function getDefaultFontFamilyOptions() {
|
|
102794
|
+
return getDefaultFontOfferings().map((offering) => ({
|
|
102795
|
+
label: offering.logicalFamily,
|
|
102796
|
+
value: fontOfferingStack(offering)
|
|
102797
|
+
}));
|
|
102798
|
+
}
|
|
102490
102799
|
function writeAppStatistics(convertedXml, stats) {
|
|
102491
102800
|
const elements = ensureElements$1(ensureAppPropertiesRoot(convertedXml));
|
|
102492
102801
|
upsertSimpleElement(elements, "Words", String(stats.words));
|
|
@@ -114911,7 +115220,7 @@ var isRegExp = (value) => {
|
|
|
114911
115220
|
if (encodedAttrs && Object.keys(encodedAttrs).length > 0)
|
|
114912
115221
|
translated.attrs = { ...encodedAttrs };
|
|
114913
115222
|
return translated;
|
|
114914
|
-
}, config$35, translator$4, EAST_ASIAN_CHARACTER_REGEX, containsEastAsianCharacters = (text$2) => EAST_ASIAN_CHARACTER_REGEX.test(text$2), resolveFontFamily = (textStyleAttrs, text$2) => {
|
|
115223
|
+
}, config$35, translator$4, EAST_ASIAN_CHARACTER_REGEX, containsEastAsianCharacters = (text$2) => EAST_ASIAN_CHARACTER_REGEX.test(text$2), resolveFontFamily$1 = (textStyleAttrs, text$2) => {
|
|
114915
115224
|
if (!text$2)
|
|
114916
115225
|
return textStyleAttrs;
|
|
114917
115226
|
const eastAsiaFont = textStyleAttrs?.eastAsiaFontFamily;
|
|
@@ -115724,7 +116033,7 @@ var isRegExp = (value) => {
|
|
|
115724
116033
|
...textStyleMark.attrs || {},
|
|
115725
116034
|
...mark.attrs || {}
|
|
115726
116035
|
};
|
|
115727
|
-
textStyleMark.attrs = resolveFontFamily(textStyleMark.attrs, child?.text);
|
|
116036
|
+
textStyleMark.attrs = resolveFontFamily$1(textStyleMark.attrs, child?.text);
|
|
115728
116037
|
}
|
|
115729
116038
|
return false;
|
|
115730
116039
|
}
|
|
@@ -129218,7 +129527,537 @@ var isRegExp = (value) => {
|
|
|
129218
129527
|
tags.push(`</${name}>`);
|
|
129219
129528
|
return tags;
|
|
129220
129529
|
}
|
|
129221
|
-
},
|
|
129530
|
+
}, SETTLED_STATUSES, SUBSTITUTION_EVIDENCE, BUNDLED_SUBSTITUTES, CATEGORY_FALLBACKS, FontResolver = class {
|
|
129531
|
+
#overrides = /* @__PURE__ */ new Map;
|
|
129532
|
+
#embedded = /* @__PURE__ */ new Map;
|
|
129533
|
+
#version = 0;
|
|
129534
|
+
#cachedSignature = null;
|
|
129535
|
+
map(logicalFamily, physicalFamily) {
|
|
129536
|
+
const key = normalizeFamilyKey$1(logicalFamily);
|
|
129537
|
+
const physical = physicalFamily?.trim();
|
|
129538
|
+
if (!key || !physical)
|
|
129539
|
+
return;
|
|
129540
|
+
if (this.#overrides.get(key) === physical)
|
|
129541
|
+
return;
|
|
129542
|
+
if (key === normalizeFamilyKey$1(physical)) {
|
|
129543
|
+
if (this.#overrides.delete(key)) {
|
|
129544
|
+
this.#version += 1;
|
|
129545
|
+
this.#cachedSignature = null;
|
|
129546
|
+
}
|
|
129547
|
+
return;
|
|
129548
|
+
}
|
|
129549
|
+
this.#overrides.set(key, physical);
|
|
129550
|
+
this.#version += 1;
|
|
129551
|
+
this.#cachedSignature = null;
|
|
129552
|
+
}
|
|
129553
|
+
unmap(logicalFamily) {
|
|
129554
|
+
if (this.#overrides.delete(normalizeFamilyKey$1(logicalFamily))) {
|
|
129555
|
+
this.#version += 1;
|
|
129556
|
+
this.#cachedSignature = null;
|
|
129557
|
+
}
|
|
129558
|
+
}
|
|
129559
|
+
mapEmbedded(logicalFamily, physicalFamily) {
|
|
129560
|
+
const key = normalizeFamilyKey$1(logicalFamily);
|
|
129561
|
+
const physical = physicalFamily?.trim();
|
|
129562
|
+
if (!key || !physical)
|
|
129563
|
+
return;
|
|
129564
|
+
if (this.#embedded.get(key) === physical)
|
|
129565
|
+
return;
|
|
129566
|
+
this.#embedded.set(key, physical);
|
|
129567
|
+
this.#version += 1;
|
|
129568
|
+
this.#cachedSignature = null;
|
|
129569
|
+
}
|
|
129570
|
+
clearEmbedded() {
|
|
129571
|
+
if (this.#embedded.size === 0)
|
|
129572
|
+
return;
|
|
129573
|
+
this.#embedded.clear();
|
|
129574
|
+
this.#version += 1;
|
|
129575
|
+
this.#cachedSignature = null;
|
|
129576
|
+
}
|
|
129577
|
+
reset() {
|
|
129578
|
+
if (this.#overrides.size === 0 && this.#embedded.size === 0)
|
|
129579
|
+
return;
|
|
129580
|
+
this.#overrides.clear();
|
|
129581
|
+
this.#embedded.clear();
|
|
129582
|
+
this.#version += 1;
|
|
129583
|
+
this.#cachedSignature = null;
|
|
129584
|
+
}
|
|
129585
|
+
get version() {
|
|
129586
|
+
return this.#version;
|
|
129587
|
+
}
|
|
129588
|
+
get signature() {
|
|
129589
|
+
if (this.#cachedSignature !== null)
|
|
129590
|
+
return this.#cachedSignature;
|
|
129591
|
+
if (this.#overrides.size === 0 && this.#embedded.size === 0)
|
|
129592
|
+
this.#cachedSignature = "";
|
|
129593
|
+
else {
|
|
129594
|
+
const overridePairs = sortPairs([...this.#overrides.entries()]);
|
|
129595
|
+
this.#cachedSignature = this.#embedded.size === 0 ? JSON.stringify(overridePairs) : JSON.stringify({
|
|
129596
|
+
o: overridePairs,
|
|
129597
|
+
e: sortPairs([...this.#embedded.entries()])
|
|
129598
|
+
});
|
|
129599
|
+
}
|
|
129600
|
+
return this.#cachedSignature;
|
|
129601
|
+
}
|
|
129602
|
+
#physicalFor(bareFamily) {
|
|
129603
|
+
const key = normalizeFamilyKey$1(bareFamily);
|
|
129604
|
+
const override = this.#overrides.get(key);
|
|
129605
|
+
if (override)
|
|
129606
|
+
return {
|
|
129607
|
+
physical: override,
|
|
129608
|
+
reason: "custom_mapping"
|
|
129609
|
+
};
|
|
129610
|
+
const bundled = BUNDLED_SUBSTITUTES[key];
|
|
129611
|
+
if (bundled)
|
|
129612
|
+
return {
|
|
129613
|
+
physical: bundled,
|
|
129614
|
+
reason: "bundled_substitute"
|
|
129615
|
+
};
|
|
129616
|
+
const category = CATEGORY_FALLBACKS[key];
|
|
129617
|
+
if (category)
|
|
129618
|
+
return {
|
|
129619
|
+
physical: category,
|
|
129620
|
+
reason: "category_fallback"
|
|
129621
|
+
};
|
|
129622
|
+
return {
|
|
129623
|
+
physical: bareFamily,
|
|
129624
|
+
reason: "as_requested"
|
|
129625
|
+
};
|
|
129626
|
+
}
|
|
129627
|
+
#resolveFaceLadder(primary, face, hasFace) {
|
|
129628
|
+
const key = normalizeFamilyKey$1(primary);
|
|
129629
|
+
const override = this.#overrides.get(key);
|
|
129630
|
+
if (override && hasFace(override, face.weight, face.style))
|
|
129631
|
+
return {
|
|
129632
|
+
physical: override,
|
|
129633
|
+
reason: "custom_mapping"
|
|
129634
|
+
};
|
|
129635
|
+
const embedded = this.#embedded.get(key);
|
|
129636
|
+
if (embedded && hasFace(embedded, face.weight, face.style))
|
|
129637
|
+
return {
|
|
129638
|
+
physical: embedded,
|
|
129639
|
+
reason: "registered_face"
|
|
129640
|
+
};
|
|
129641
|
+
if (hasFace(primary, face.weight, face.style))
|
|
129642
|
+
return {
|
|
129643
|
+
physical: primary,
|
|
129644
|
+
reason: "registered_face"
|
|
129645
|
+
};
|
|
129646
|
+
const bundled = BUNDLED_SUBSTITUTES[key];
|
|
129647
|
+
if (bundled && hasFace(bundled, face.weight, face.style))
|
|
129648
|
+
return {
|
|
129649
|
+
physical: bundled,
|
|
129650
|
+
reason: "bundled_substitute"
|
|
129651
|
+
};
|
|
129652
|
+
const category = CATEGORY_FALLBACKS[key];
|
|
129653
|
+
if (category && hasFace(category, face.weight, face.style))
|
|
129654
|
+
return {
|
|
129655
|
+
physical: category,
|
|
129656
|
+
reason: "category_fallback"
|
|
129657
|
+
};
|
|
129658
|
+
if (override || bundled)
|
|
129659
|
+
return {
|
|
129660
|
+
physical: primary,
|
|
129661
|
+
reason: "fallback_face_absent"
|
|
129662
|
+
};
|
|
129663
|
+
return {
|
|
129664
|
+
physical: primary,
|
|
129665
|
+
reason: "as_requested"
|
|
129666
|
+
};
|
|
129667
|
+
}
|
|
129668
|
+
resolveFontFamily(logicalFamily) {
|
|
129669
|
+
const primary = splitStack(logicalFamily)[0] ?? logicalFamily;
|
|
129670
|
+
const { physical, reason } = this.#physicalFor(primary);
|
|
129671
|
+
return {
|
|
129672
|
+
logicalFamily,
|
|
129673
|
+
physicalFamily: stripFamilyQuotes(physical),
|
|
129674
|
+
reason
|
|
129675
|
+
};
|
|
129676
|
+
}
|
|
129677
|
+
resolvePhysicalFamily(cssFontFamily) {
|
|
129678
|
+
if (!cssFontFamily)
|
|
129679
|
+
return cssFontFamily;
|
|
129680
|
+
const parts = splitStack(cssFontFamily);
|
|
129681
|
+
if (parts.length === 0)
|
|
129682
|
+
return cssFontFamily;
|
|
129683
|
+
const { physical, reason } = this.#physicalFor(parts[0]);
|
|
129684
|
+
if (reason === "as_requested")
|
|
129685
|
+
return cssFontFamily;
|
|
129686
|
+
return [physical, ...parts.slice(1)].join(", ");
|
|
129687
|
+
}
|
|
129688
|
+
resolveFace(logicalFamily, face, hasFace) {
|
|
129689
|
+
const primary = splitStack(logicalFamily)[0] ?? logicalFamily;
|
|
129690
|
+
const { physical, reason } = this.#resolveFaceLadder(primary, face, hasFace);
|
|
129691
|
+
return {
|
|
129692
|
+
logicalFamily,
|
|
129693
|
+
physicalFamily: stripFamilyQuotes(physical),
|
|
129694
|
+
reason
|
|
129695
|
+
};
|
|
129696
|
+
}
|
|
129697
|
+
resolvePhysicalFamilyForFace(cssFontFamily, face, hasFace) {
|
|
129698
|
+
if (!cssFontFamily)
|
|
129699
|
+
return cssFontFamily;
|
|
129700
|
+
const parts = splitStack(cssFontFamily);
|
|
129701
|
+
if (parts.length === 0)
|
|
129702
|
+
return cssFontFamily;
|
|
129703
|
+
const { physical } = this.#resolveFaceLadder(parts[0], face, hasFace);
|
|
129704
|
+
if (normalizeFamilyKey$1(physical) !== normalizeFamilyKey$1(parts[0]))
|
|
129705
|
+
return [physical, ...parts.slice(1)].join(", ");
|
|
129706
|
+
return cssFontFamily;
|
|
129707
|
+
}
|
|
129708
|
+
resolvePrimaryPhysicalFamily(family$1) {
|
|
129709
|
+
const primary = splitStack(family$1)[0] ?? family$1;
|
|
129710
|
+
return this.#physicalFor(primary).physical;
|
|
129711
|
+
}
|
|
129712
|
+
resolvePhysicalFamilies(families) {
|
|
129713
|
+
const out = /* @__PURE__ */ new Set;
|
|
129714
|
+
for (const family$1 of families)
|
|
129715
|
+
if (family$1)
|
|
129716
|
+
out.add(this.resolvePrimaryPhysicalFamily(family$1));
|
|
129717
|
+
return [...out];
|
|
129718
|
+
}
|
|
129719
|
+
}, defaultResolver, DEFAULT_FONT_MEASURE_CONTEXT, fontConfigVersion = 0, BUNDLED_MANIFEST, defaultAssetBase = "/fonts/", installedRegistries, FS_TYPE_RESTRICTED = 2, FS_SELECTION_ITALIC = 1, BOLD_WEIGHT_THRESHOLD = 600, SFNT_TABLE_DIR_OFFSET = 12, SFNT_TABLE_RECORD_SIZE = 16, OS2_USWEIGHTCLASS = 4, OS2_FSTYPE = 8, OS2_FSSELECTION = 62, OS2_MIN_LENGTH, DEFAULT_FONT_LOAD_TIMEOUT_MS = 3000, DEFAULT_PROBE_SIZE = "16px", FontRegistry = class {
|
|
129720
|
+
#fontSet;
|
|
129721
|
+
#FontFaceCtor;
|
|
129722
|
+
#probeSize;
|
|
129723
|
+
#scheduleTimeout;
|
|
129724
|
+
#cancelTimeout;
|
|
129725
|
+
#managed = /* @__PURE__ */ new Map;
|
|
129726
|
+
#facesByKey = /* @__PURE__ */ new Map;
|
|
129727
|
+
#status = /* @__PURE__ */ new Map;
|
|
129728
|
+
#sources = /* @__PURE__ */ new Map;
|
|
129729
|
+
#warnedFailures = /* @__PURE__ */ new Set;
|
|
129730
|
+
#inflight = /* @__PURE__ */ new Map;
|
|
129731
|
+
#faceStatus = /* @__PURE__ */ new Map;
|
|
129732
|
+
#faceInflight = /* @__PURE__ */ new Map;
|
|
129733
|
+
#faceSources = /* @__PURE__ */ new Map;
|
|
129734
|
+
#facesByFamily = /* @__PURE__ */ new Map;
|
|
129735
|
+
#providerFaceKeys = /* @__PURE__ */ new Set;
|
|
129736
|
+
#warnedFaceFailures = /* @__PURE__ */ new Set;
|
|
129737
|
+
constructor(options = {}) {
|
|
129738
|
+
this.#fontSet = options.fontSet ?? null;
|
|
129739
|
+
this.#FontFaceCtor = options.FontFaceCtor ?? null;
|
|
129740
|
+
this.#probeSize = options.probeSize ?? DEFAULT_PROBE_SIZE;
|
|
129741
|
+
this.#scheduleTimeout = options.scheduleTimeout ?? ((cb, ms) => globalThis.setTimeout(cb, ms));
|
|
129742
|
+
this.#cancelTimeout = options.cancelTimeout ?? ((handle2) => globalThis.clearTimeout(handle2));
|
|
129743
|
+
}
|
|
129744
|
+
register(descriptor) {
|
|
129745
|
+
const { family: family$1, source, descriptors: descriptors$1 } = descriptor;
|
|
129746
|
+
const identitySource = typeof source === "string" ? canonicalizeFontSource(source) : source;
|
|
129747
|
+
const weight = normalizeWeight(descriptors$1?.weight);
|
|
129748
|
+
const style = normalizeStyle(descriptors$1?.style);
|
|
129749
|
+
const key = faceKeyOf(family$1, weight, style);
|
|
129750
|
+
if (typeof identitySource === "string") {
|
|
129751
|
+
const existingSource = this.#faceSources.get(key);
|
|
129752
|
+
if (existingSource === identitySource)
|
|
129753
|
+
return {
|
|
129754
|
+
family: family$1,
|
|
129755
|
+
status: this.getStatus(family$1),
|
|
129756
|
+
changed: false
|
|
129757
|
+
};
|
|
129758
|
+
if (existingSource !== undefined)
|
|
129759
|
+
throw new Error(`[superdoc] font face "${key}" is already registered from a different source ("${existingSource}"); a registered face's source cannot be replaced`);
|
|
129760
|
+
}
|
|
129761
|
+
if (this.#FontFaceCtor && this.#fontSet) {
|
|
129762
|
+
const face = new this.#FontFaceCtor(family$1, source, {
|
|
129763
|
+
...descriptors$1,
|
|
129764
|
+
weight,
|
|
129765
|
+
style
|
|
129766
|
+
});
|
|
129767
|
+
this.#fontSet.add(face);
|
|
129768
|
+
this.#addManagedFace(family$1, key, face);
|
|
129769
|
+
}
|
|
129770
|
+
if (typeof source === "string") {
|
|
129771
|
+
const list$1 = this.#sources.get(family$1) ?? [];
|
|
129772
|
+
if (!list$1.includes(source))
|
|
129773
|
+
list$1.push(source);
|
|
129774
|
+
this.#sources.set(family$1, list$1);
|
|
129775
|
+
}
|
|
129776
|
+
if (!this.#status.has(family$1))
|
|
129777
|
+
this.#status.set(family$1, "unloaded");
|
|
129778
|
+
this.#providerFaceKeys.add(key);
|
|
129779
|
+
this.#trackFace(family$1, key);
|
|
129780
|
+
if (!this.#faceStatus.has(key))
|
|
129781
|
+
this.#faceStatus.set(key, "unloaded");
|
|
129782
|
+
if (typeof identitySource === "string" && !this.#faceSources.has(key))
|
|
129783
|
+
this.#faceSources.set(key, identitySource);
|
|
129784
|
+
return {
|
|
129785
|
+
family: family$1,
|
|
129786
|
+
status: this.getStatus(family$1),
|
|
129787
|
+
changed: true
|
|
129788
|
+
};
|
|
129789
|
+
}
|
|
129790
|
+
#trackFace(family$1, key) {
|
|
129791
|
+
const fam = normalizeFamilyKey(family$1);
|
|
129792
|
+
const set = this.#facesByFamily.get(fam) ?? /* @__PURE__ */ new Set;
|
|
129793
|
+
set.add(key);
|
|
129794
|
+
this.#facesByFamily.set(fam, set);
|
|
129795
|
+
}
|
|
129796
|
+
isManaged(family$1) {
|
|
129797
|
+
return this.#managed.has(family$1);
|
|
129798
|
+
}
|
|
129799
|
+
registerOwnedFace(descriptor) {
|
|
129800
|
+
const { family: family$1, source, weight, style } = descriptor;
|
|
129801
|
+
if (!this.#FontFaceCtor || !this.#fontSet)
|
|
129802
|
+
return null;
|
|
129803
|
+
const key = faceKeyOf(family$1, weight, style);
|
|
129804
|
+
const face = new this.#FontFaceCtor(family$1, source, {
|
|
129805
|
+
weight,
|
|
129806
|
+
style
|
|
129807
|
+
});
|
|
129808
|
+
this.#fontSet.add(face);
|
|
129809
|
+
this.#addManagedFace(family$1, key, face);
|
|
129810
|
+
this.#providerFaceKeys.add(key);
|
|
129811
|
+
if (!this.#status.has(family$1))
|
|
129812
|
+
this.#status.set(family$1, "unloaded");
|
|
129813
|
+
this.#trackFace(family$1, key);
|
|
129814
|
+
if (!this.#faceStatus.has(key))
|
|
129815
|
+
this.#faceStatus.set(key, "unloaded");
|
|
129816
|
+
let released = false;
|
|
129817
|
+
return () => {
|
|
129818
|
+
if (released)
|
|
129819
|
+
return false;
|
|
129820
|
+
released = true;
|
|
129821
|
+
return this.#removeManagedFace(family$1, key, face);
|
|
129822
|
+
};
|
|
129823
|
+
}
|
|
129824
|
+
#addManagedFace(family$1, key, face) {
|
|
129825
|
+
this.#managed.set(family$1, face);
|
|
129826
|
+
let set = this.#facesByKey.get(key);
|
|
129827
|
+
if (!set) {
|
|
129828
|
+
set = /* @__PURE__ */ new Set;
|
|
129829
|
+
this.#facesByKey.set(key, set);
|
|
129830
|
+
}
|
|
129831
|
+
set.add(face);
|
|
129832
|
+
}
|
|
129833
|
+
#removeManagedFace(family$1, key, face) {
|
|
129834
|
+
const set = this.#facesByKey.get(key);
|
|
129835
|
+
if (!set || !set.delete(face))
|
|
129836
|
+
return false;
|
|
129837
|
+
if (typeof this.#fontSet?.delete === "function")
|
|
129838
|
+
this.#fontSet.delete(face);
|
|
129839
|
+
if (set.size > 0)
|
|
129840
|
+
return true;
|
|
129841
|
+
this.#facesByKey.delete(key);
|
|
129842
|
+
this.#providerFaceKeys.delete(key);
|
|
129843
|
+
this.#faceStatus.delete(key);
|
|
129844
|
+
this.#faceSources.delete(key);
|
|
129845
|
+
const fam = normalizeFamilyKey(family$1);
|
|
129846
|
+
const keys$1 = this.#facesByFamily.get(fam);
|
|
129847
|
+
if (keys$1) {
|
|
129848
|
+
keys$1.delete(key);
|
|
129849
|
+
if (keys$1.size === 0) {
|
|
129850
|
+
this.#facesByFamily.delete(fam);
|
|
129851
|
+
this.#managed.delete(family$1);
|
|
129852
|
+
this.#status.delete(family$1);
|
|
129853
|
+
this.#sources.delete(family$1);
|
|
129854
|
+
}
|
|
129855
|
+
}
|
|
129856
|
+
return true;
|
|
129857
|
+
}
|
|
129858
|
+
getStatus(family$1) {
|
|
129859
|
+
const statuses = [];
|
|
129860
|
+
const faceKeys = this.#facesByFamily.get(normalizeFamilyKey(family$1));
|
|
129861
|
+
if (faceKeys)
|
|
129862
|
+
for (const k of faceKeys)
|
|
129863
|
+
statuses.push(this.#faceStatus.get(k) ?? "unloaded");
|
|
129864
|
+
const legacy = this.#status.get(family$1);
|
|
129865
|
+
if (legacy)
|
|
129866
|
+
statuses.push(legacy);
|
|
129867
|
+
if (statuses.length === 0)
|
|
129868
|
+
return "unloaded";
|
|
129869
|
+
for (const s of [
|
|
129870
|
+
"failed",
|
|
129871
|
+
"timed_out",
|
|
129872
|
+
"fallback_used",
|
|
129873
|
+
"loaded",
|
|
129874
|
+
"loading",
|
|
129875
|
+
"unloaded"
|
|
129876
|
+
])
|
|
129877
|
+
if (statuses.includes(s))
|
|
129878
|
+
return s;
|
|
129879
|
+
return "unloaded";
|
|
129880
|
+
}
|
|
129881
|
+
hasFace(family$1, weight, style) {
|
|
129882
|
+
const key = faceKeyOf(family$1, weight, style);
|
|
129883
|
+
return this.#providerFaceKeys.has(key) && this.#faceStatus.get(key) !== "failed";
|
|
129884
|
+
}
|
|
129885
|
+
isAvailable(family$1) {
|
|
129886
|
+
if (!this.#fontSet)
|
|
129887
|
+
return false;
|
|
129888
|
+
try {
|
|
129889
|
+
return this.#fontSet.check(`${this.#probeSize} ${quoteFamily(family$1)}`);
|
|
129890
|
+
} catch {
|
|
129891
|
+
return false;
|
|
129892
|
+
}
|
|
129893
|
+
}
|
|
129894
|
+
awaitFace(family$1, timeoutMs = DEFAULT_FONT_LOAD_TIMEOUT_MS) {
|
|
129895
|
+
if (this.#status.get(family$1) === "loaded")
|
|
129896
|
+
return Promise.resolve({
|
|
129897
|
+
family: family$1,
|
|
129898
|
+
status: "loaded"
|
|
129899
|
+
});
|
|
129900
|
+
const existing = this.#inflight.get(family$1);
|
|
129901
|
+
if (existing)
|
|
129902
|
+
return existing;
|
|
129903
|
+
const probe = this.#loadOne(family$1, timeoutMs).finally(() => {
|
|
129904
|
+
this.#inflight.delete(family$1);
|
|
129905
|
+
});
|
|
129906
|
+
this.#inflight.set(family$1, probe);
|
|
129907
|
+
return probe;
|
|
129908
|
+
}
|
|
129909
|
+
async awaitFaces(families, options = {}) {
|
|
129910
|
+
const unique = [...new Set(families)];
|
|
129911
|
+
const timeoutMs = options.timeoutMs ?? 3000;
|
|
129912
|
+
return Promise.all(unique.map((family$1) => this.awaitFace(family$1, timeoutMs)));
|
|
129913
|
+
}
|
|
129914
|
+
getRequiredFaces(families, timeoutMs = DEFAULT_FONT_LOAD_TIMEOUT_MS) {
|
|
129915
|
+
return [...new Set(families)].map((family$1) => ({
|
|
129916
|
+
family: family$1,
|
|
129917
|
+
status: this.getStatus(family$1),
|
|
129918
|
+
ready: this.awaitFace(family$1, timeoutMs)
|
|
129919
|
+
}));
|
|
129920
|
+
}
|
|
129921
|
+
getStates() {
|
|
129922
|
+
return [...this.#status.entries()].map(([family$1, status]) => ({
|
|
129923
|
+
family: family$1,
|
|
129924
|
+
status
|
|
129925
|
+
}));
|
|
129926
|
+
}
|
|
129927
|
+
getFaceStatus(request) {
|
|
129928
|
+
return this.#faceStatus.get(faceKeyOf(request.family, request.weight, request.style)) ?? "unloaded";
|
|
129929
|
+
}
|
|
129930
|
+
awaitFaceRequest(request, timeoutMs = DEFAULT_FONT_LOAD_TIMEOUT_MS) {
|
|
129931
|
+
const key = faceKeyOf(request.family, request.weight, request.style);
|
|
129932
|
+
if (this.#faceStatus.get(key) === "loaded")
|
|
129933
|
+
return Promise.resolve({
|
|
129934
|
+
request,
|
|
129935
|
+
status: "loaded"
|
|
129936
|
+
});
|
|
129937
|
+
const existing = this.#faceInflight.get(key);
|
|
129938
|
+
if (existing)
|
|
129939
|
+
return existing;
|
|
129940
|
+
const probe = this.#loadOneFace(request, key, timeoutMs).finally(() => {
|
|
129941
|
+
this.#faceInflight.delete(key);
|
|
129942
|
+
});
|
|
129943
|
+
this.#faceInflight.set(key, probe);
|
|
129944
|
+
return probe;
|
|
129945
|
+
}
|
|
129946
|
+
async awaitFaceRequests(requests, options = {}) {
|
|
129947
|
+
const timeoutMs = options.timeoutMs ?? 3000;
|
|
129948
|
+
const seen = /* @__PURE__ */ new Set;
|
|
129949
|
+
const unique = [];
|
|
129950
|
+
for (const r of requests) {
|
|
129951
|
+
const key = faceKeyOf(r.family, r.weight, r.style);
|
|
129952
|
+
if (seen.has(key))
|
|
129953
|
+
continue;
|
|
129954
|
+
seen.add(key);
|
|
129955
|
+
unique.push(r);
|
|
129956
|
+
}
|
|
129957
|
+
return Promise.all(unique.map((r) => this.awaitFaceRequest(r, timeoutMs)));
|
|
129958
|
+
}
|
|
129959
|
+
async#loadOneFace(request, key, timeoutMs) {
|
|
129960
|
+
this.#trackFace(request.family, key);
|
|
129961
|
+
const fontSet = this.#fontSet;
|
|
129962
|
+
if (!fontSet) {
|
|
129963
|
+
this.#faceStatus.set(key, "fallback_used");
|
|
129964
|
+
return {
|
|
129965
|
+
request,
|
|
129966
|
+
status: "fallback_used"
|
|
129967
|
+
};
|
|
129968
|
+
}
|
|
129969
|
+
this.#faceStatus.set(key, "loading");
|
|
129970
|
+
const probe = faceProbe(request.family, request.weight, request.style, this.#probeSize);
|
|
129971
|
+
const TIMEOUT = Symbol("timeout");
|
|
129972
|
+
let handle2;
|
|
129973
|
+
const timeout = new Promise((resolve2) => {
|
|
129974
|
+
handle2 = this.#scheduleTimeout(() => resolve2(TIMEOUT), timeoutMs);
|
|
129975
|
+
});
|
|
129976
|
+
try {
|
|
129977
|
+
const settled = await Promise.race([fontSet.load(probe), timeout]);
|
|
129978
|
+
if (settled === TIMEOUT) {
|
|
129979
|
+
this.#faceStatus.set(key, "timed_out");
|
|
129980
|
+
return {
|
|
129981
|
+
request,
|
|
129982
|
+
status: "timed_out"
|
|
129983
|
+
};
|
|
129984
|
+
}
|
|
129985
|
+
const status = settled.length > 0 ? "loaded" : "fallback_used";
|
|
129986
|
+
this.#faceStatus.set(key, status);
|
|
129987
|
+
return {
|
|
129988
|
+
request,
|
|
129989
|
+
status
|
|
129990
|
+
};
|
|
129991
|
+
} catch {
|
|
129992
|
+
this.#faceStatus.set(key, "failed");
|
|
129993
|
+
this.#warnFaceFailureOnce(request, key);
|
|
129994
|
+
return {
|
|
129995
|
+
request,
|
|
129996
|
+
status: "failed"
|
|
129997
|
+
};
|
|
129998
|
+
} finally {
|
|
129999
|
+
this.#cancelTimeout(handle2);
|
|
130000
|
+
}
|
|
130001
|
+
}
|
|
130002
|
+
#warnFaceFailureOnce(request, key) {
|
|
130003
|
+
if (this.#warnedFaceFailures.has(key))
|
|
130004
|
+
return;
|
|
130005
|
+
this.#warnedFaceFailures.add(key);
|
|
130006
|
+
const src = this.#faceSources.get(key);
|
|
130007
|
+
const detail = src ? ` from ${src}` : "";
|
|
130008
|
+
console.warn(`[superdoc] font face failed to load: "${request.family}" ${request.weight} ${request.style}${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
|
|
130009
|
+
}
|
|
130010
|
+
async#loadOne(family$1, timeoutMs) {
|
|
130011
|
+
const fontSet = this.#fontSet;
|
|
130012
|
+
if (!fontSet) {
|
|
130013
|
+
this.#status.set(family$1, "fallback_used");
|
|
130014
|
+
return {
|
|
130015
|
+
family: family$1,
|
|
130016
|
+
status: "fallback_used"
|
|
130017
|
+
};
|
|
130018
|
+
}
|
|
130019
|
+
this.#status.set(family$1, "loading");
|
|
130020
|
+
const probe = `${this.#probeSize} ${quoteFamily(family$1)}`;
|
|
130021
|
+
const TIMEOUT = Symbol("timeout");
|
|
130022
|
+
let handle2;
|
|
130023
|
+
const timeout = new Promise((resolve2) => {
|
|
130024
|
+
handle2 = this.#scheduleTimeout(() => resolve2(TIMEOUT), timeoutMs);
|
|
130025
|
+
});
|
|
130026
|
+
try {
|
|
130027
|
+
const settled = await Promise.race([fontSet.load(probe), timeout]);
|
|
130028
|
+
if (settled === TIMEOUT) {
|
|
130029
|
+
this.#status.set(family$1, "timed_out");
|
|
130030
|
+
return {
|
|
130031
|
+
family: family$1,
|
|
130032
|
+
status: "timed_out"
|
|
130033
|
+
};
|
|
130034
|
+
}
|
|
130035
|
+
const status = settled.length > 0 ? "loaded" : "fallback_used";
|
|
130036
|
+
this.#status.set(family$1, status);
|
|
130037
|
+
return {
|
|
130038
|
+
family: family$1,
|
|
130039
|
+
status
|
|
130040
|
+
};
|
|
130041
|
+
} catch {
|
|
130042
|
+
this.#status.set(family$1, "failed");
|
|
130043
|
+
this.#warnLoadFailureOnce(family$1);
|
|
130044
|
+
return {
|
|
130045
|
+
family: family$1,
|
|
130046
|
+
status: "failed"
|
|
130047
|
+
};
|
|
130048
|
+
} finally {
|
|
130049
|
+
this.#cancelTimeout(handle2);
|
|
130050
|
+
}
|
|
130051
|
+
}
|
|
130052
|
+
#warnLoadFailureOnce(family$1) {
|
|
130053
|
+
if (this.#warnedFailures.has(family$1))
|
|
130054
|
+
return;
|
|
130055
|
+
this.#warnedFailures.add(family$1);
|
|
130056
|
+
const sources = this.#sources.get(family$1);
|
|
130057
|
+
const detail = sources && sources.length ? ` from ${sources.join(", ")}` : "";
|
|
130058
|
+
console.warn(`[superdoc] font asset failed to load for "${family$1}"${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
|
|
130059
|
+
}
|
|
130060
|
+
}, registriesByFontSet, domlessRegistry = null, PHYSICAL_GENERIC, BUNDLED_FAMILIES, FONT_OFFERINGS, DEFAULT_FONT_ORDER, prepareCommentParaIds = (comment) => {
|
|
129222
130061
|
return {
|
|
129223
130062
|
...comment,
|
|
129224
130063
|
commentParaId: generateDocxRandomId()
|
|
@@ -133194,7 +134033,7 @@ var isRegExp = (value) => {
|
|
|
133194
134033
|
state.kern = kernNode.attributes["w:val"];
|
|
133195
134034
|
}
|
|
133196
134035
|
}, SuperConverter;
|
|
133197
|
-
var
|
|
134036
|
+
var init_SuperConverter_BVWG4qnQ_es = __esm(() => {
|
|
133198
134037
|
init_rolldown_runtime_Bg48TavK_es();
|
|
133199
134038
|
init_jszip_C49i9kUs_es();
|
|
133200
134039
|
init_xml_js_CqGKpaft_es();
|
|
@@ -170513,6 +171352,246 @@ var init_SuperConverter_bEQ45IUD_es = __esm(() => {
|
|
|
170513
171352
|
gutter: "0"
|
|
170514
171353
|
})
|
|
170515
171354
|
});
|
|
171355
|
+
SETTLED_STATUSES = [
|
|
171356
|
+
"loaded",
|
|
171357
|
+
"failed",
|
|
171358
|
+
"timed_out",
|
|
171359
|
+
"fallback_used"
|
|
171360
|
+
];
|
|
171361
|
+
SUBSTITUTION_EVIDENCE = Object.freeze([
|
|
171362
|
+
{
|
|
171363
|
+
evidenceId: "calibri",
|
|
171364
|
+
logicalFamily: "Calibri",
|
|
171365
|
+
physicalFamily: "Carlito",
|
|
171366
|
+
verdict: "metric_safe",
|
|
171367
|
+
faces: {
|
|
171368
|
+
regular: true,
|
|
171369
|
+
bold: true,
|
|
171370
|
+
italic: true,
|
|
171371
|
+
boldItalic: true
|
|
171372
|
+
},
|
|
171373
|
+
advance: {
|
|
171374
|
+
meanDelta: 0,
|
|
171375
|
+
maxDelta: 0
|
|
171376
|
+
},
|
|
171377
|
+
gates: {
|
|
171378
|
+
static: "pass",
|
|
171379
|
+
metric: "pass",
|
|
171380
|
+
layout: "pass",
|
|
171381
|
+
ship: "pass"
|
|
171382
|
+
},
|
|
171383
|
+
policyAction: "substitute",
|
|
171384
|
+
measurementRefs: ["calibri__carlito#analytic_advance#2026-06-03", "calibri__carlito#face_aggregate#2026-06-03"],
|
|
171385
|
+
candidateLicense: "OFL-1.1",
|
|
171386
|
+
exportRule: "preserve_original_name"
|
|
171387
|
+
},
|
|
171388
|
+
{
|
|
171389
|
+
evidenceId: "cambria",
|
|
171390
|
+
logicalFamily: "Cambria",
|
|
171391
|
+
physicalFamily: "Caladea",
|
|
171392
|
+
verdict: "visual_only",
|
|
171393
|
+
faceVerdicts: {
|
|
171394
|
+
regular: "metric_safe",
|
|
171395
|
+
bold: "metric_safe",
|
|
171396
|
+
italic: "metric_safe",
|
|
171397
|
+
boldItalic: "visual_only"
|
|
171398
|
+
},
|
|
171399
|
+
glyphExceptions: [{
|
|
171400
|
+
slot: "boldItalic",
|
|
171401
|
+
codepoint: 96,
|
|
171402
|
+
advanceDelta: 0.231,
|
|
171403
|
+
note: "Caladea Bold Italic grave accent (U+0060) advance diverges ~23% from Cambria; lines containing it reflow."
|
|
171404
|
+
}],
|
|
171405
|
+
faces: {
|
|
171406
|
+
regular: true,
|
|
171407
|
+
bold: true,
|
|
171408
|
+
italic: true,
|
|
171409
|
+
boldItalic: true
|
|
171410
|
+
},
|
|
171411
|
+
advance: {
|
|
171412
|
+
meanDelta: 0.0002378,
|
|
171413
|
+
maxDelta: 0.2310758
|
|
171414
|
+
},
|
|
171415
|
+
gates: {
|
|
171416
|
+
static: "pass",
|
|
171417
|
+
metric: "pass",
|
|
171418
|
+
layout: "not_run",
|
|
171419
|
+
ship: "pass"
|
|
171420
|
+
},
|
|
171421
|
+
policyAction: "substitute",
|
|
171422
|
+
measurementRefs: [
|
|
171423
|
+
"cambria_regular__caladea#regular#w400#d2f6cad3#analytic_advance#2026-06-04",
|
|
171424
|
+
"cambria_bold__caladea#bold#w700#74eda4fc#analytic_advance#2026-06-04",
|
|
171425
|
+
"cambria_italic__caladea#italic#w400#9c968bf6#analytic_advance#2026-06-04",
|
|
171426
|
+
"cambria_boldItalic__caladea#boldItalic#w700#f47a35ad#analytic_advance#2026-06-04"
|
|
171427
|
+
],
|
|
171428
|
+
candidateLicense: "Apache-2.0",
|
|
171429
|
+
exportRule: "preserve_original_name"
|
|
171430
|
+
},
|
|
171431
|
+
{
|
|
171432
|
+
evidenceId: "arial",
|
|
171433
|
+
logicalFamily: "Arial",
|
|
171434
|
+
physicalFamily: "Liberation Sans",
|
|
171435
|
+
verdict: "metric_safe",
|
|
171436
|
+
faces: {
|
|
171437
|
+
regular: true,
|
|
171438
|
+
bold: true,
|
|
171439
|
+
italic: true,
|
|
171440
|
+
boldItalic: true
|
|
171441
|
+
},
|
|
171442
|
+
advance: {
|
|
171443
|
+
meanDelta: 0,
|
|
171444
|
+
maxDelta: 0
|
|
171445
|
+
},
|
|
171446
|
+
gates: {
|
|
171447
|
+
static: "pass",
|
|
171448
|
+
metric: "pass",
|
|
171449
|
+
layout: "not_run",
|
|
171450
|
+
ship: "pass"
|
|
171451
|
+
},
|
|
171452
|
+
policyAction: "substitute",
|
|
171453
|
+
measurementRefs: ["arial__liberation-sans#analytic_advance#2026-06-03"],
|
|
171454
|
+
candidateLicense: "OFL-1.1",
|
|
171455
|
+
exportRule: "preserve_original_name"
|
|
171456
|
+
},
|
|
171457
|
+
{
|
|
171458
|
+
evidenceId: "times-new-roman",
|
|
171459
|
+
logicalFamily: "Times New Roman",
|
|
171460
|
+
physicalFamily: "Liberation Serif",
|
|
171461
|
+
verdict: "metric_safe",
|
|
171462
|
+
faces: {
|
|
171463
|
+
regular: true,
|
|
171464
|
+
bold: true,
|
|
171465
|
+
italic: true,
|
|
171466
|
+
boldItalic: true
|
|
171467
|
+
},
|
|
171468
|
+
advance: {
|
|
171469
|
+
meanDelta: 0,
|
|
171470
|
+
maxDelta: 0
|
|
171471
|
+
},
|
|
171472
|
+
gates: {
|
|
171473
|
+
static: "pass",
|
|
171474
|
+
metric: "pass",
|
|
171475
|
+
layout: "not_run",
|
|
171476
|
+
ship: "pass"
|
|
171477
|
+
},
|
|
171478
|
+
policyAction: "substitute",
|
|
171479
|
+
measurementRefs: ["times-new-roman__liberation-serif#analytic_advance#2026-06-03"],
|
|
171480
|
+
candidateLicense: "OFL-1.1",
|
|
171481
|
+
exportRule: "preserve_original_name"
|
|
171482
|
+
},
|
|
171483
|
+
{
|
|
171484
|
+
evidenceId: "courier-new",
|
|
171485
|
+
logicalFamily: "Courier New",
|
|
171486
|
+
physicalFamily: "Liberation Mono",
|
|
171487
|
+
verdict: "metric_safe",
|
|
171488
|
+
faces: {
|
|
171489
|
+
regular: true,
|
|
171490
|
+
bold: true,
|
|
171491
|
+
italic: true,
|
|
171492
|
+
boldItalic: true
|
|
171493
|
+
},
|
|
171494
|
+
advance: {
|
|
171495
|
+
meanDelta: 0,
|
|
171496
|
+
maxDelta: 0
|
|
171497
|
+
},
|
|
171498
|
+
gates: {
|
|
171499
|
+
static: "pass",
|
|
171500
|
+
metric: "pass",
|
|
171501
|
+
layout: "not_run",
|
|
171502
|
+
ship: "pass"
|
|
171503
|
+
},
|
|
171504
|
+
policyAction: "substitute",
|
|
171505
|
+
measurementRefs: ["courier-new__liberation-mono#analytic_advance#2026-06-03"],
|
|
171506
|
+
candidateLicense: "OFL-1.1",
|
|
171507
|
+
exportRule: "preserve_original_name"
|
|
171508
|
+
},
|
|
171509
|
+
{
|
|
171510
|
+
evidenceId: "helvetica",
|
|
171511
|
+
logicalFamily: "Helvetica",
|
|
171512
|
+
physicalFamily: "Liberation Sans",
|
|
171513
|
+
verdict: "metric_safe",
|
|
171514
|
+
faces: {
|
|
171515
|
+
regular: true,
|
|
171516
|
+
bold: true,
|
|
171517
|
+
italic: true,
|
|
171518
|
+
boldItalic: true
|
|
171519
|
+
},
|
|
171520
|
+
advance: {
|
|
171521
|
+
meanDelta: 0,
|
|
171522
|
+
maxDelta: 0
|
|
171523
|
+
},
|
|
171524
|
+
gates: {
|
|
171525
|
+
static: "not_run",
|
|
171526
|
+
metric: "pass",
|
|
171527
|
+
layout: "not_run",
|
|
171528
|
+
ship: "fail"
|
|
171529
|
+
},
|
|
171530
|
+
policyAction: "substitute",
|
|
171531
|
+
measurementRefs: ["helvetica__liberation-sans#analytic_advance#2026-06-03"],
|
|
171532
|
+
candidateLicense: "OFL-1.1",
|
|
171533
|
+
exportRule: "preserve_original_name"
|
|
171534
|
+
},
|
|
171535
|
+
{
|
|
171536
|
+
evidenceId: "calibri-light",
|
|
171537
|
+
logicalFamily: "Calibri Light",
|
|
171538
|
+
physicalFamily: "Carlito",
|
|
171539
|
+
verdict: "visual_only",
|
|
171540
|
+
faces: {
|
|
171541
|
+
regular: false,
|
|
171542
|
+
bold: false,
|
|
171543
|
+
italic: false,
|
|
171544
|
+
boldItalic: false
|
|
171545
|
+
},
|
|
171546
|
+
advance: {
|
|
171547
|
+
meanDelta: 0.0148,
|
|
171548
|
+
maxDelta: 0.066
|
|
171549
|
+
},
|
|
171550
|
+
gates: {
|
|
171551
|
+
static: "not_run",
|
|
171552
|
+
metric: "fail",
|
|
171553
|
+
layout: "not_run",
|
|
171554
|
+
ship: "fail"
|
|
171555
|
+
},
|
|
171556
|
+
policyAction: "category_fallback",
|
|
171557
|
+
measurementRefs: ["calibri-light__carlito#analytic_advance#2026-06-05"],
|
|
171558
|
+
candidateLicense: "OFL-1.1",
|
|
171559
|
+
exportRule: "preserve_original_name"
|
|
171560
|
+
}
|
|
171561
|
+
]);
|
|
171562
|
+
BUNDLED_SUBSTITUTES = deriveBundledSubstitutes();
|
|
171563
|
+
CATEGORY_FALLBACKS = deriveCategoryFallbacks();
|
|
171564
|
+
defaultResolver = new FontResolver;
|
|
171565
|
+
DEFAULT_FONT_MEASURE_CONTEXT = Object.freeze({
|
|
171566
|
+
resolvePhysical: (cssFontFamily, _face) => resolvePhysicalFamily(cssFontFamily),
|
|
171567
|
+
fontSignature: ""
|
|
171568
|
+
});
|
|
171569
|
+
BUNDLED_MANIFEST = Object.freeze([
|
|
171570
|
+
family("Carlito", "Carlito", "OFL-1.1"),
|
|
171571
|
+
family("Caladea", "Caladea", "Apache-2.0"),
|
|
171572
|
+
family("Liberation Sans", "LiberationSans", "OFL-1.1"),
|
|
171573
|
+
family("Liberation Serif", "LiberationSerif", "OFL-1.1"),
|
|
171574
|
+
family("Liberation Mono", "LiberationMono", "OFL-1.1")
|
|
171575
|
+
]);
|
|
171576
|
+
installedRegistries = /* @__PURE__ */ new WeakMap;
|
|
171577
|
+
OS2_MIN_LENGTH = OS2_FSSELECTION + 2;
|
|
171578
|
+
registriesByFontSet = /* @__PURE__ */ new WeakMap;
|
|
171579
|
+
PHYSICAL_GENERIC = Object.freeze({
|
|
171580
|
+
Carlito: "sans-serif",
|
|
171581
|
+
Caladea: "serif",
|
|
171582
|
+
"Liberation Sans": "sans-serif",
|
|
171583
|
+
"Liberation Serif": "serif",
|
|
171584
|
+
"Liberation Mono": "monospace"
|
|
171585
|
+
});
|
|
171586
|
+
BUNDLED_FAMILIES = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
|
|
171587
|
+
FONT_OFFERINGS = deriveOfferings();
|
|
171588
|
+
DEFAULT_FONT_ORDER = [
|
|
171589
|
+
"Calibri",
|
|
171590
|
+
"Arial",
|
|
171591
|
+
"Courier New",
|
|
171592
|
+
"Times New Roman",
|
|
171593
|
+
"Helvetica"
|
|
171594
|
+
];
|
|
170516
171595
|
ALL_COMMENT_TARGETS = COMMENT_FILE_BASENAMES;
|
|
170517
171596
|
REL_ID_NUMERIC_PATTERN = /rId|mi/g;
|
|
170518
171597
|
FOOTNOTES_CONFIG$1 = {
|
|
@@ -171329,10 +172408,10 @@ var init_SuperConverter_bEQ45IUD_es = __esm(() => {
|
|
|
171329
172408
|
return fontsNode.elements.find((el) => el?.attributes?.["w:name"] === fontName) || null;
|
|
171330
172409
|
}
|
|
171331
172410
|
static getFallbackFromFontTable(docx, fontName) {
|
|
171332
|
-
const family = SuperConverter2.getFontTableEntry(docx, fontName)?.elements?.find((child) => child.name === "w:family")?.attributes?.["w:val"];
|
|
171333
|
-
if (!family)
|
|
172411
|
+
const family$1 = SuperConverter2.getFontTableEntry(docx, fontName)?.elements?.find((child) => child.name === "w:family")?.attributes?.["w:val"];
|
|
172412
|
+
if (!family$1)
|
|
171334
172413
|
return null;
|
|
171335
|
-
return FONT_FAMILY_FALLBACKS[family.toLowerCase()] || DEFAULT_GENERIC_FALLBACK;
|
|
172414
|
+
return FONT_FAMILY_FALLBACKS[family$1.toLowerCase()] || DEFAULT_GENERIC_FALLBACK;
|
|
171336
172415
|
}
|
|
171337
172416
|
static toCssFontFamily(fontName, docx) {
|
|
171338
172417
|
if (!fontName)
|
|
@@ -171762,13 +172841,16 @@ var init_SuperConverter_bEQ45IUD_es = __esm(() => {
|
|
|
171762
172841
|
for (const font of fontsToInclude) {
|
|
171763
172842
|
const filePath = elements.find((el) => el.attributes.Id === font.attributes["r:id"])?.attributes?.Target;
|
|
171764
172843
|
if (!filePath)
|
|
171765
|
-
|
|
171766
|
-
const
|
|
171767
|
-
if (!
|
|
171768
|
-
|
|
171769
|
-
const ttfBuffer = deobfuscateFont(
|
|
172844
|
+
continue;
|
|
172845
|
+
const fontUint8Array = this.fonts[`word/${filePath}`];
|
|
172846
|
+
if (!fontUint8Array?.buffer)
|
|
172847
|
+
continue;
|
|
172848
|
+
const ttfBuffer = deobfuscateFont(fontUint8Array.buffer.slice(fontUint8Array.byteOffset, fontUint8Array.byteOffset + fontUint8Array.byteLength), font.attributes["w:fontKey"]);
|
|
171770
172849
|
if (!ttfBuffer)
|
|
171771
|
-
|
|
172850
|
+
continue;
|
|
172851
|
+
const policy = parseEmbeddingPolicy(ttfBuffer);
|
|
172852
|
+
if (!(policy ? policy.embeddable : false))
|
|
172853
|
+
continue;
|
|
171772
172854
|
const blob = new Blob([ttfBuffer], { type: "font/ttf" });
|
|
171773
172855
|
const fontUrl = URL.createObjectURL(blob);
|
|
171774
172856
|
const isNormal = font.name.includes("Regular");
|
|
@@ -171793,6 +172875,48 @@ var init_SuperConverter_bEQ45IUD_es = __esm(() => {
|
|
|
171793
172875
|
fontsImported
|
|
171794
172876
|
};
|
|
171795
172877
|
}
|
|
172878
|
+
getEmbeddedFontFaces() {
|
|
172879
|
+
const fontTable = this.convertedXml["word/fontTable.xml"];
|
|
172880
|
+
if (!fontTable || !Object.keys(this.fonts).length)
|
|
172881
|
+
return [];
|
|
172882
|
+
const embedElements = (fontTable.elements?.find((el) => el.name === "w:fonts")?.elements?.filter((el) => el.elements?.some((nested) => nested?.attributes?.["r:id"] && nested?.attributes?.["w:fontKey"])) ?? []).flatMap((entry) => (entry.elements ?? []).filter((el) => el.name?.startsWith("w:embed")).map((el) => ({
|
|
172883
|
+
embed: el,
|
|
172884
|
+
family: entry.attributes?.["w:name"]
|
|
172885
|
+
})));
|
|
172886
|
+
const relElements = this.convertedXml["word/_rels/fontTable.xml.rels"]?.elements?.find((el) => el.name === "Relationships")?.elements ?? [];
|
|
172887
|
+
const faceFromEmbedName = (name = "") => ({
|
|
172888
|
+
weight: /bold/i.test(name) ? "700" : "400",
|
|
172889
|
+
style: /italic/i.test(name) ? "italic" : "normal"
|
|
172890
|
+
});
|
|
172891
|
+
const faces = [];
|
|
172892
|
+
for (const { embed, family: family$1 } of embedElements) {
|
|
172893
|
+
const relationshipId = embed.attributes?.["r:id"];
|
|
172894
|
+
const fontKey = embed.attributes?.["w:fontKey"];
|
|
172895
|
+
if (!family$1 || !relationshipId || !fontKey)
|
|
172896
|
+
continue;
|
|
172897
|
+
const filePath = relElements.find((el) => el.attributes?.Id === relationshipId)?.attributes?.Target;
|
|
172898
|
+
if (!filePath)
|
|
172899
|
+
continue;
|
|
172900
|
+
const fontUint8Array = this.fonts[`word/${filePath}`];
|
|
172901
|
+
if (!fontUint8Array?.buffer)
|
|
172902
|
+
continue;
|
|
172903
|
+
const ttf = deobfuscateFont(fontUint8Array.buffer.slice(fontUint8Array.byteOffset, fontUint8Array.byteOffset + fontUint8Array.byteLength), fontKey);
|
|
172904
|
+
if (!ttf)
|
|
172905
|
+
continue;
|
|
172906
|
+
const policy = parseEmbeddingPolicy(ttf);
|
|
172907
|
+
const fallback = faceFromEmbedName(embed.name);
|
|
172908
|
+
faces.push({
|
|
172909
|
+
family: family$1,
|
|
172910
|
+
source: ttf,
|
|
172911
|
+
weight: policy?.face.weight ?? fallback.weight,
|
|
172912
|
+
style: policy?.face.style ?? fallback.style,
|
|
172913
|
+
fsType: policy?.fsType ?? null,
|
|
172914
|
+
embeddable: policy ? policy.embeddable : false,
|
|
172915
|
+
relationshipId
|
|
172916
|
+
});
|
|
172917
|
+
}
|
|
172918
|
+
return faces;
|
|
172919
|
+
}
|
|
171796
172920
|
getDocumentInternalId() {
|
|
171797
172921
|
const settingsLocation = "word/settings.xml";
|
|
171798
172922
|
if (!this.convertedXml[settingsLocation])
|
|
@@ -172254,7 +173378,7 @@ var init_SuperConverter_bEQ45IUD_es = __esm(() => {
|
|
|
172254
173378
|
};
|
|
172255
173379
|
});
|
|
172256
173380
|
|
|
172257
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
173381
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-JvWvpCga.es.js
|
|
172258
173382
|
function parseSizeUnit(val = "0") {
|
|
172259
173383
|
const length3 = val.toString() || "0";
|
|
172260
173384
|
const value = Number.parseFloat(length3);
|
|
@@ -182587,8 +183711,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
|
|
|
182587
183711
|
}
|
|
182588
183712
|
};
|
|
182589
183713
|
};
|
|
182590
|
-
var
|
|
182591
|
-
|
|
183714
|
+
var init_create_headless_toolbar_JvWvpCga_es = __esm(() => {
|
|
183715
|
+
init_SuperConverter_BVWG4qnQ_es();
|
|
182592
183716
|
init_uuid_qzgm05fK_es();
|
|
182593
183717
|
init_constants_D9qj59G2_es();
|
|
182594
183718
|
init_dist_B8HfvhaK_es();
|
|
@@ -185235,1231 +186359,6 @@ var __plugin_vue_export_helper_default = (sfc, props) => {
|
|
|
185235
186359
|
};
|
|
185236
186360
|
var init__plugin_vue_export_helper_5t5P5NuM_es = () => {};
|
|
185237
186361
|
|
|
185238
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-tVaowTvG.es.js
|
|
185239
|
-
function isSettled(status) {
|
|
185240
|
-
return SETTLED_STATUSES.includes(status);
|
|
185241
|
-
}
|
|
185242
|
-
function normalizeFamilyKey$1(family$1) {
|
|
185243
|
-
return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
|
|
185244
|
-
}
|
|
185245
|
-
function deriveBundledSubstitutes() {
|
|
185246
|
-
const substitutes = {};
|
|
185247
|
-
for (const row of SUBSTITUTION_EVIDENCE)
|
|
185248
|
-
if (row.policyAction === "substitute" && row.physicalFamily)
|
|
185249
|
-
substitutes[normalizeFamilyKey$1(row.logicalFamily)] = row.physicalFamily;
|
|
185250
|
-
return Object.freeze(substitutes);
|
|
185251
|
-
}
|
|
185252
|
-
function deriveCategoryFallbacks() {
|
|
185253
|
-
const fallbacks = {};
|
|
185254
|
-
for (const row of SUBSTITUTION_EVIDENCE)
|
|
185255
|
-
if (row.policyAction === "category_fallback" && row.physicalFamily)
|
|
185256
|
-
fallbacks[normalizeFamilyKey$1(row.logicalFamily)] = row.physicalFamily;
|
|
185257
|
-
return Object.freeze(fallbacks);
|
|
185258
|
-
}
|
|
185259
|
-
function stripFamilyQuotes(family$1) {
|
|
185260
|
-
return family$1.trim().replace(/^["']|["']$/g, "");
|
|
185261
|
-
}
|
|
185262
|
-
function splitStack(cssFontFamily) {
|
|
185263
|
-
return cssFontFamily.split(",").map((part) => part.trim()).filter(Boolean);
|
|
185264
|
-
}
|
|
185265
|
-
function createFontResolver() {
|
|
185266
|
-
return new FontResolver;
|
|
185267
|
-
}
|
|
185268
|
-
function resolveFontFamily2(logicalFamily) {
|
|
185269
|
-
return defaultResolver.resolveFontFamily(logicalFamily);
|
|
185270
|
-
}
|
|
185271
|
-
function resolvePhysicalFamily(cssFontFamily) {
|
|
185272
|
-
return defaultResolver.resolvePhysicalFamily(cssFontFamily);
|
|
185273
|
-
}
|
|
185274
|
-
function resolveFace(logicalFamily, face, hasFace) {
|
|
185275
|
-
return defaultResolver.resolveFace(logicalFamily, face, hasFace);
|
|
185276
|
-
}
|
|
185277
|
-
function getFontConfigVersion() {
|
|
185278
|
-
return fontConfigVersion;
|
|
185279
|
-
}
|
|
185280
|
-
function bumpFontConfigVersion() {
|
|
185281
|
-
return fontConfigVersion += 1;
|
|
185282
|
-
}
|
|
185283
|
-
function fourFaces(filePrefix) {
|
|
185284
|
-
return [
|
|
185285
|
-
{
|
|
185286
|
-
weight: "normal",
|
|
185287
|
-
style: "normal",
|
|
185288
|
-
file: `${filePrefix}-Regular.woff2`
|
|
185289
|
-
},
|
|
185290
|
-
{
|
|
185291
|
-
weight: "bold",
|
|
185292
|
-
style: "normal",
|
|
185293
|
-
file: `${filePrefix}-Bold.woff2`
|
|
185294
|
-
},
|
|
185295
|
-
{
|
|
185296
|
-
weight: "normal",
|
|
185297
|
-
style: "italic",
|
|
185298
|
-
file: `${filePrefix}-Italic.woff2`
|
|
185299
|
-
},
|
|
185300
|
-
{
|
|
185301
|
-
weight: "bold",
|
|
185302
|
-
style: "italic",
|
|
185303
|
-
file: `${filePrefix}-BoldItalic.woff2`
|
|
185304
|
-
}
|
|
185305
|
-
];
|
|
185306
|
-
}
|
|
185307
|
-
function family(name, filePrefix, license) {
|
|
185308
|
-
return {
|
|
185309
|
-
family: name,
|
|
185310
|
-
license,
|
|
185311
|
-
faces: fourFaces(filePrefix)
|
|
185312
|
-
};
|
|
185313
|
-
}
|
|
185314
|
-
function withTrailingSlash(base3) {
|
|
185315
|
-
return base3.endsWith("/") ? base3 : `${base3}/`;
|
|
185316
|
-
}
|
|
185317
|
-
function joinUrl(base3, file) {
|
|
185318
|
-
return `${withTrailingSlash(base3)}${file}`;
|
|
185319
|
-
}
|
|
185320
|
-
function weightToken(weight) {
|
|
185321
|
-
return weight === "bold" ? "700" : "400";
|
|
185322
|
-
}
|
|
185323
|
-
function bundledAssetSignature(resolve2) {
|
|
185324
|
-
const family$1 = BUNDLED_MANIFEST[0];
|
|
185325
|
-
const face = family$1?.faces[0];
|
|
185326
|
-
if (!family$1 || !face)
|
|
185327
|
-
return "";
|
|
185328
|
-
return resolve2({
|
|
185329
|
-
file: face.file,
|
|
185330
|
-
family: family$1.family,
|
|
185331
|
-
weight: weightToken(face.weight),
|
|
185332
|
-
style: face.style,
|
|
185333
|
-
source: "bundled-substitute"
|
|
185334
|
-
});
|
|
185335
|
-
}
|
|
185336
|
-
function installBundledSubstitutes(registry2, options = {}) {
|
|
185337
|
-
const resolve2 = options.resolveAssetUrl ?? ((context) => joinUrl(options.assetBaseUrl ?? defaultAssetBase, context.file));
|
|
185338
|
-
const signature = bundledAssetSignature(resolve2);
|
|
185339
|
-
const installed = installedRegistries.get(registry2);
|
|
185340
|
-
if (installed !== undefined) {
|
|
185341
|
-
if (installed !== signature)
|
|
185342
|
-
console.warn(`[superdoc] bundled fonts are already registered for this document from "${installed}"; a later fonts config resolving to "${signature}" is ignored. Use one fonts.assetBaseUrl / fonts.resolveAssetUrl per document.`);
|
|
185343
|
-
return;
|
|
185344
|
-
}
|
|
185345
|
-
installedRegistries.set(registry2, signature);
|
|
185346
|
-
for (const family$1 of BUNDLED_MANIFEST)
|
|
185347
|
-
for (const face of family$1.faces) {
|
|
185348
|
-
const context = {
|
|
185349
|
-
file: face.file,
|
|
185350
|
-
family: family$1.family,
|
|
185351
|
-
weight: weightToken(face.weight),
|
|
185352
|
-
style: face.style,
|
|
185353
|
-
source: "bundled-substitute"
|
|
185354
|
-
};
|
|
185355
|
-
registry2.register({
|
|
185356
|
-
family: family$1.family,
|
|
185357
|
-
source: `url(${resolve2(context)})`,
|
|
185358
|
-
descriptors: {
|
|
185359
|
-
weight: face.weight,
|
|
185360
|
-
style: face.style
|
|
185361
|
-
}
|
|
185362
|
-
});
|
|
185363
|
-
}
|
|
185364
|
-
}
|
|
185365
|
-
function buildFontReport(logicalFamilies, registry2, resolver2) {
|
|
185366
|
-
const seen = /* @__PURE__ */ new Set;
|
|
185367
|
-
const report = [];
|
|
185368
|
-
for (const logical of logicalFamilies) {
|
|
185369
|
-
if (!logical || seen.has(logical))
|
|
185370
|
-
continue;
|
|
185371
|
-
seen.add(logical);
|
|
185372
|
-
const { physicalFamily, reason } = resolver2 ? resolver2.resolveFontFamily(logical) : resolveFontFamily2(logical);
|
|
185373
|
-
const loadStatus = registry2.getStatus(physicalFamily);
|
|
185374
|
-
report.push({
|
|
185375
|
-
logicalFamily: logical,
|
|
185376
|
-
physicalFamily,
|
|
185377
|
-
reason,
|
|
185378
|
-
loadStatus,
|
|
185379
|
-
exportFamily: logical,
|
|
185380
|
-
missing: reason === "category_fallback" || isSettled(loadStatus) && loadStatus !== "loaded"
|
|
185381
|
-
});
|
|
185382
|
-
}
|
|
185383
|
-
return report;
|
|
185384
|
-
}
|
|
185385
|
-
function buildFaceReport(usedFaces, registry2, resolver2) {
|
|
185386
|
-
const hasFace = (family$1, weight, style) => registry2.hasFace(family$1, weight, style);
|
|
185387
|
-
const seen = /* @__PURE__ */ new Set;
|
|
185388
|
-
const report = [];
|
|
185389
|
-
for (const { logicalFamily, weight, style } of usedFaces) {
|
|
185390
|
-
if (!logicalFamily)
|
|
185391
|
-
continue;
|
|
185392
|
-
const key2 = `${logicalFamily.toLowerCase()}|${weight}|${style}`;
|
|
185393
|
-
if (seen.has(key2))
|
|
185394
|
-
continue;
|
|
185395
|
-
seen.add(key2);
|
|
185396
|
-
const face = {
|
|
185397
|
-
weight,
|
|
185398
|
-
style
|
|
185399
|
-
};
|
|
185400
|
-
const { physicalFamily, reason } = resolver2 ? resolver2.resolveFace(logicalFamily, face, hasFace) : resolveFace(logicalFamily, face, hasFace);
|
|
185401
|
-
const loadStatus = registry2.getFaceStatus({
|
|
185402
|
-
family: physicalFamily,
|
|
185403
|
-
weight,
|
|
185404
|
-
style
|
|
185405
|
-
});
|
|
185406
|
-
const missing = reason === "fallback_face_absent" || reason === "category_fallback" || isSettled(loadStatus) && loadStatus !== "loaded";
|
|
185407
|
-
report.push({
|
|
185408
|
-
logicalFamily,
|
|
185409
|
-
physicalFamily,
|
|
185410
|
-
reason,
|
|
185411
|
-
loadStatus,
|
|
185412
|
-
exportFamily: logicalFamily,
|
|
185413
|
-
missing,
|
|
185414
|
-
face
|
|
185415
|
-
});
|
|
185416
|
-
}
|
|
185417
|
-
return report;
|
|
185418
|
-
}
|
|
185419
|
-
function quoteFamily(family$1) {
|
|
185420
|
-
return `"${family$1.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"`;
|
|
185421
|
-
}
|
|
185422
|
-
function canonicalizeFontSource(source) {
|
|
185423
|
-
const match = /^\s*url\(\s*([\s\S]*?)\s*\)\s*$/i.exec(source);
|
|
185424
|
-
if (!match)
|
|
185425
|
-
return source;
|
|
185426
|
-
let inner = match[1].trim();
|
|
185427
|
-
if (inner.startsWith('"') && inner.endsWith('"') || inner.startsWith("'") && inner.endsWith("'"))
|
|
185428
|
-
inner = inner.slice(1, -1);
|
|
185429
|
-
return `url(${JSON.stringify(inner)})`;
|
|
185430
|
-
}
|
|
185431
|
-
function normalizeFamilyKey(family$1) {
|
|
185432
|
-
return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
|
|
185433
|
-
}
|
|
185434
|
-
function normalizeWeight(weight) {
|
|
185435
|
-
if (weight === undefined)
|
|
185436
|
-
return "400";
|
|
185437
|
-
const w = String(weight).trim().toLowerCase();
|
|
185438
|
-
if (w === "bold" || w === "bolder")
|
|
185439
|
-
return "700";
|
|
185440
|
-
const n = Number(w);
|
|
185441
|
-
return Number.isFinite(n) && n >= 600 ? "700" : "400";
|
|
185442
|
-
}
|
|
185443
|
-
function normalizeStyle(style) {
|
|
185444
|
-
if (!style)
|
|
185445
|
-
return "normal";
|
|
185446
|
-
const s = style.trim().toLowerCase();
|
|
185447
|
-
return s.startsWith("italic") || s.startsWith("oblique") ? "italic" : "normal";
|
|
185448
|
-
}
|
|
185449
|
-
function faceKeyOf(family$1, weight, style) {
|
|
185450
|
-
return `${normalizeFamilyKey(family$1)}|${weight}|${style}`;
|
|
185451
|
-
}
|
|
185452
|
-
function faceProbe(family$1, weight, style, size2) {
|
|
185453
|
-
return `${style === "italic" ? "italic " : ""}${weight} ${size2} ${quoteFamily(family$1)}`;
|
|
185454
|
-
}
|
|
185455
|
-
function getFontRegistryFor(fontSet, FontFaceCtor) {
|
|
185456
|
-
if (!fontSet) {
|
|
185457
|
-
if (!domlessRegistry)
|
|
185458
|
-
domlessRegistry = new FontRegistry({});
|
|
185459
|
-
return domlessRegistry;
|
|
185460
|
-
}
|
|
185461
|
-
let registry2 = registriesByFontSet.get(fontSet);
|
|
185462
|
-
if (!registry2) {
|
|
185463
|
-
registry2 = new FontRegistry({
|
|
185464
|
-
fontSet,
|
|
185465
|
-
FontFaceCtor
|
|
185466
|
-
});
|
|
185467
|
-
registriesByFontSet.set(fontSet, registry2);
|
|
185468
|
-
}
|
|
185469
|
-
return registry2;
|
|
185470
|
-
}
|
|
185471
|
-
function classifyOffering(policyAction, verdict, physicalFamily, bundled) {
|
|
185472
|
-
if (policyAction === "preserve_only")
|
|
185473
|
-
return "preserve_only";
|
|
185474
|
-
if (policyAction === "customer_supplied" || physicalFamily == null)
|
|
185475
|
-
return "customer_supplied";
|
|
185476
|
-
if (policyAction === "category_fallback")
|
|
185477
|
-
return "category_fallback";
|
|
185478
|
-
if (!bundled)
|
|
185479
|
-
return "requires_asset";
|
|
185480
|
-
return verdict === "metric_safe" ? "default" : "qualified";
|
|
185481
|
-
}
|
|
185482
|
-
function deriveOfferings() {
|
|
185483
|
-
const offerings = SUBSTITUTION_EVIDENCE.map((row) => {
|
|
185484
|
-
const bundled = row.physicalFamily != null && BUNDLED_FAMILIES.has(row.physicalFamily);
|
|
185485
|
-
return {
|
|
185486
|
-
logicalFamily: row.logicalFamily,
|
|
185487
|
-
physicalFamily: row.physicalFamily,
|
|
185488
|
-
generic: row.physicalFamily && PHYSICAL_GENERIC[row.physicalFamily] || "sans-serif",
|
|
185489
|
-
offering: classifyOffering(row.policyAction, row.verdict, row.physicalFamily, bundled),
|
|
185490
|
-
bundled,
|
|
185491
|
-
verdict: row.verdict,
|
|
185492
|
-
evidenceId: row.evidenceId
|
|
185493
|
-
};
|
|
185494
|
-
});
|
|
185495
|
-
return Object.freeze(offerings);
|
|
185496
|
-
}
|
|
185497
|
-
function getDefaultFontOfferings() {
|
|
185498
|
-
const rank = (name) => {
|
|
185499
|
-
const i4 = DEFAULT_FONT_ORDER.indexOf(name);
|
|
185500
|
-
return i4 === -1 ? DEFAULT_FONT_ORDER.length : i4;
|
|
185501
|
-
};
|
|
185502
|
-
return FONT_OFFERINGS.filter((o) => o.offering === "default").sort((a, b) => rank(a.logicalFamily) - rank(b.logicalFamily));
|
|
185503
|
-
}
|
|
185504
|
-
function fontOfferingStack(offering) {
|
|
185505
|
-
return `${offering.logicalFamily}, ${offering.generic}`;
|
|
185506
|
-
}
|
|
185507
|
-
function fontOfferingRenderStack(offering) {
|
|
185508
|
-
return offering.physicalFamily ? `${offering.physicalFamily}, ${offering.generic}` : fontOfferingStack(offering);
|
|
185509
|
-
}
|
|
185510
|
-
function getDefaultFontFamilyOptions() {
|
|
185511
|
-
return getDefaultFontOfferings().map((offering) => ({
|
|
185512
|
-
label: offering.logicalFamily,
|
|
185513
|
-
value: fontOfferingStack(offering)
|
|
185514
|
-
}));
|
|
185515
|
-
}
|
|
185516
|
-
var SETTLED_STATUSES, SUBSTITUTION_EVIDENCE, BUNDLED_SUBSTITUTES, CATEGORY_FALLBACKS, FontResolver = class {
|
|
185517
|
-
#overrides = /* @__PURE__ */ new Map;
|
|
185518
|
-
#version = 0;
|
|
185519
|
-
#cachedSignature = null;
|
|
185520
|
-
map(logicalFamily, physicalFamily) {
|
|
185521
|
-
const key2 = normalizeFamilyKey$1(logicalFamily);
|
|
185522
|
-
const physical = physicalFamily?.trim();
|
|
185523
|
-
if (!key2 || !physical)
|
|
185524
|
-
return;
|
|
185525
|
-
if (this.#overrides.get(key2) === physical)
|
|
185526
|
-
return;
|
|
185527
|
-
if (key2 === normalizeFamilyKey$1(physical)) {
|
|
185528
|
-
if (this.#overrides.delete(key2)) {
|
|
185529
|
-
this.#version += 1;
|
|
185530
|
-
this.#cachedSignature = null;
|
|
185531
|
-
}
|
|
185532
|
-
return;
|
|
185533
|
-
}
|
|
185534
|
-
this.#overrides.set(key2, physical);
|
|
185535
|
-
this.#version += 1;
|
|
185536
|
-
this.#cachedSignature = null;
|
|
185537
|
-
}
|
|
185538
|
-
unmap(logicalFamily) {
|
|
185539
|
-
if (this.#overrides.delete(normalizeFamilyKey$1(logicalFamily))) {
|
|
185540
|
-
this.#version += 1;
|
|
185541
|
-
this.#cachedSignature = null;
|
|
185542
|
-
}
|
|
185543
|
-
}
|
|
185544
|
-
reset() {
|
|
185545
|
-
if (this.#overrides.size === 0)
|
|
185546
|
-
return;
|
|
185547
|
-
this.#overrides.clear();
|
|
185548
|
-
this.#version += 1;
|
|
185549
|
-
this.#cachedSignature = null;
|
|
185550
|
-
}
|
|
185551
|
-
get version() {
|
|
185552
|
-
return this.#version;
|
|
185553
|
-
}
|
|
185554
|
-
get signature() {
|
|
185555
|
-
if (this.#cachedSignature !== null)
|
|
185556
|
-
return this.#cachedSignature;
|
|
185557
|
-
this.#cachedSignature = this.#overrides.size === 0 ? "" : JSON.stringify([...this.#overrides.entries()].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0));
|
|
185558
|
-
return this.#cachedSignature;
|
|
185559
|
-
}
|
|
185560
|
-
#physicalFor(bareFamily) {
|
|
185561
|
-
const key2 = normalizeFamilyKey$1(bareFamily);
|
|
185562
|
-
const override = this.#overrides.get(key2);
|
|
185563
|
-
if (override)
|
|
185564
|
-
return {
|
|
185565
|
-
physical: override,
|
|
185566
|
-
reason: "custom_mapping"
|
|
185567
|
-
};
|
|
185568
|
-
const bundled = BUNDLED_SUBSTITUTES[key2];
|
|
185569
|
-
if (bundled)
|
|
185570
|
-
return {
|
|
185571
|
-
physical: bundled,
|
|
185572
|
-
reason: "bundled_substitute"
|
|
185573
|
-
};
|
|
185574
|
-
const category = CATEGORY_FALLBACKS[key2];
|
|
185575
|
-
if (category)
|
|
185576
|
-
return {
|
|
185577
|
-
physical: category,
|
|
185578
|
-
reason: "category_fallback"
|
|
185579
|
-
};
|
|
185580
|
-
return {
|
|
185581
|
-
physical: bareFamily,
|
|
185582
|
-
reason: "as_requested"
|
|
185583
|
-
};
|
|
185584
|
-
}
|
|
185585
|
-
#resolveFaceLadder(primary, face, hasFace) {
|
|
185586
|
-
const key2 = normalizeFamilyKey$1(primary);
|
|
185587
|
-
const override = this.#overrides.get(key2);
|
|
185588
|
-
if (override && hasFace(override, face.weight, face.style))
|
|
185589
|
-
return {
|
|
185590
|
-
physical: override,
|
|
185591
|
-
reason: "custom_mapping"
|
|
185592
|
-
};
|
|
185593
|
-
if (hasFace(primary, face.weight, face.style))
|
|
185594
|
-
return {
|
|
185595
|
-
physical: primary,
|
|
185596
|
-
reason: "registered_face"
|
|
185597
|
-
};
|
|
185598
|
-
const bundled = BUNDLED_SUBSTITUTES[key2];
|
|
185599
|
-
if (bundled && hasFace(bundled, face.weight, face.style))
|
|
185600
|
-
return {
|
|
185601
|
-
physical: bundled,
|
|
185602
|
-
reason: "bundled_substitute"
|
|
185603
|
-
};
|
|
185604
|
-
const category = CATEGORY_FALLBACKS[key2];
|
|
185605
|
-
if (category && hasFace(category, face.weight, face.style))
|
|
185606
|
-
return {
|
|
185607
|
-
physical: category,
|
|
185608
|
-
reason: "category_fallback"
|
|
185609
|
-
};
|
|
185610
|
-
if (override || bundled)
|
|
185611
|
-
return {
|
|
185612
|
-
physical: primary,
|
|
185613
|
-
reason: "fallback_face_absent"
|
|
185614
|
-
};
|
|
185615
|
-
return {
|
|
185616
|
-
physical: primary,
|
|
185617
|
-
reason: "as_requested"
|
|
185618
|
-
};
|
|
185619
|
-
}
|
|
185620
|
-
resolveFontFamily(logicalFamily) {
|
|
185621
|
-
const primary = splitStack(logicalFamily)[0] ?? logicalFamily;
|
|
185622
|
-
const { physical, reason } = this.#physicalFor(primary);
|
|
185623
|
-
return {
|
|
185624
|
-
logicalFamily,
|
|
185625
|
-
physicalFamily: stripFamilyQuotes(physical),
|
|
185626
|
-
reason
|
|
185627
|
-
};
|
|
185628
|
-
}
|
|
185629
|
-
resolvePhysicalFamily(cssFontFamily) {
|
|
185630
|
-
if (!cssFontFamily)
|
|
185631
|
-
return cssFontFamily;
|
|
185632
|
-
const parts = splitStack(cssFontFamily);
|
|
185633
|
-
if (parts.length === 0)
|
|
185634
|
-
return cssFontFamily;
|
|
185635
|
-
const { physical, reason } = this.#physicalFor(parts[0]);
|
|
185636
|
-
if (reason === "as_requested")
|
|
185637
|
-
return cssFontFamily;
|
|
185638
|
-
return [physical, ...parts.slice(1)].join(", ");
|
|
185639
|
-
}
|
|
185640
|
-
resolveFace(logicalFamily, face, hasFace) {
|
|
185641
|
-
const primary = splitStack(logicalFamily)[0] ?? logicalFamily;
|
|
185642
|
-
const { physical, reason } = this.#resolveFaceLadder(primary, face, hasFace);
|
|
185643
|
-
return {
|
|
185644
|
-
logicalFamily,
|
|
185645
|
-
physicalFamily: stripFamilyQuotes(physical),
|
|
185646
|
-
reason
|
|
185647
|
-
};
|
|
185648
|
-
}
|
|
185649
|
-
resolvePhysicalFamilyForFace(cssFontFamily, face, hasFace) {
|
|
185650
|
-
if (!cssFontFamily)
|
|
185651
|
-
return cssFontFamily;
|
|
185652
|
-
const parts = splitStack(cssFontFamily);
|
|
185653
|
-
if (parts.length === 0)
|
|
185654
|
-
return cssFontFamily;
|
|
185655
|
-
const { physical } = this.#resolveFaceLadder(parts[0], face, hasFace);
|
|
185656
|
-
if (normalizeFamilyKey$1(physical) !== normalizeFamilyKey$1(parts[0]))
|
|
185657
|
-
return [physical, ...parts.slice(1)].join(", ");
|
|
185658
|
-
return cssFontFamily;
|
|
185659
|
-
}
|
|
185660
|
-
resolvePrimaryPhysicalFamily(family$1) {
|
|
185661
|
-
const primary = splitStack(family$1)[0] ?? family$1;
|
|
185662
|
-
return this.#physicalFor(primary).physical;
|
|
185663
|
-
}
|
|
185664
|
-
resolvePhysicalFamilies(families) {
|
|
185665
|
-
const out = /* @__PURE__ */ new Set;
|
|
185666
|
-
for (const family$1 of families)
|
|
185667
|
-
if (family$1)
|
|
185668
|
-
out.add(this.resolvePrimaryPhysicalFamily(family$1));
|
|
185669
|
-
return [...out];
|
|
185670
|
-
}
|
|
185671
|
-
}, defaultResolver, DEFAULT_FONT_MEASURE_CONTEXT, fontConfigVersion = 0, BUNDLED_MANIFEST, defaultAssetBase = "/fonts/", installedRegistries, DEFAULT_FONT_LOAD_TIMEOUT_MS = 3000, DEFAULT_PROBE_SIZE = "16px", FontRegistry = class {
|
|
185672
|
-
#fontSet;
|
|
185673
|
-
#FontFaceCtor;
|
|
185674
|
-
#probeSize;
|
|
185675
|
-
#scheduleTimeout;
|
|
185676
|
-
#cancelTimeout;
|
|
185677
|
-
#managed = /* @__PURE__ */ new Map;
|
|
185678
|
-
#status = /* @__PURE__ */ new Map;
|
|
185679
|
-
#sources = /* @__PURE__ */ new Map;
|
|
185680
|
-
#warnedFailures = /* @__PURE__ */ new Set;
|
|
185681
|
-
#inflight = /* @__PURE__ */ new Map;
|
|
185682
|
-
#faceStatus = /* @__PURE__ */ new Map;
|
|
185683
|
-
#faceInflight = /* @__PURE__ */ new Map;
|
|
185684
|
-
#faceSources = /* @__PURE__ */ new Map;
|
|
185685
|
-
#facesByFamily = /* @__PURE__ */ new Map;
|
|
185686
|
-
#providerFaceKeys = /* @__PURE__ */ new Set;
|
|
185687
|
-
#warnedFaceFailures = /* @__PURE__ */ new Set;
|
|
185688
|
-
constructor(options = {}) {
|
|
185689
|
-
this.#fontSet = options.fontSet ?? null;
|
|
185690
|
-
this.#FontFaceCtor = options.FontFaceCtor ?? null;
|
|
185691
|
-
this.#probeSize = options.probeSize ?? DEFAULT_PROBE_SIZE;
|
|
185692
|
-
this.#scheduleTimeout = options.scheduleTimeout ?? ((cb, ms) => globalThis.setTimeout(cb, ms));
|
|
185693
|
-
this.#cancelTimeout = options.cancelTimeout ?? ((handle2) => globalThis.clearTimeout(handle2));
|
|
185694
|
-
}
|
|
185695
|
-
register(descriptor) {
|
|
185696
|
-
const { family: family$1, source, descriptors: descriptors2 } = descriptor;
|
|
185697
|
-
const identitySource = typeof source === "string" ? canonicalizeFontSource(source) : source;
|
|
185698
|
-
const weight = normalizeWeight(descriptors2?.weight);
|
|
185699
|
-
const style = normalizeStyle(descriptors2?.style);
|
|
185700
|
-
const key2 = faceKeyOf(family$1, weight, style);
|
|
185701
|
-
if (typeof identitySource === "string") {
|
|
185702
|
-
const existingSource = this.#faceSources.get(key2);
|
|
185703
|
-
if (existingSource === identitySource)
|
|
185704
|
-
return {
|
|
185705
|
-
family: family$1,
|
|
185706
|
-
status: this.getStatus(family$1),
|
|
185707
|
-
changed: false
|
|
185708
|
-
};
|
|
185709
|
-
if (existingSource !== undefined)
|
|
185710
|
-
throw new Error(`[superdoc] font face "${key2}" is already registered from a different source ("${existingSource}"); a registered face's source cannot be replaced`);
|
|
185711
|
-
}
|
|
185712
|
-
if (this.#FontFaceCtor && this.#fontSet) {
|
|
185713
|
-
const face = new this.#FontFaceCtor(family$1, source, {
|
|
185714
|
-
...descriptors2,
|
|
185715
|
-
weight,
|
|
185716
|
-
style
|
|
185717
|
-
});
|
|
185718
|
-
this.#fontSet.add(face);
|
|
185719
|
-
this.#managed.set(family$1, face);
|
|
185720
|
-
}
|
|
185721
|
-
if (typeof source === "string") {
|
|
185722
|
-
const list4 = this.#sources.get(family$1) ?? [];
|
|
185723
|
-
if (!list4.includes(source))
|
|
185724
|
-
list4.push(source);
|
|
185725
|
-
this.#sources.set(family$1, list4);
|
|
185726
|
-
}
|
|
185727
|
-
if (!this.#status.has(family$1))
|
|
185728
|
-
this.#status.set(family$1, "unloaded");
|
|
185729
|
-
this.#providerFaceKeys.add(key2);
|
|
185730
|
-
this.#trackFace(family$1, key2);
|
|
185731
|
-
if (!this.#faceStatus.has(key2))
|
|
185732
|
-
this.#faceStatus.set(key2, "unloaded");
|
|
185733
|
-
if (typeof identitySource === "string" && !this.#faceSources.has(key2))
|
|
185734
|
-
this.#faceSources.set(key2, identitySource);
|
|
185735
|
-
return {
|
|
185736
|
-
family: family$1,
|
|
185737
|
-
status: this.getStatus(family$1),
|
|
185738
|
-
changed: true
|
|
185739
|
-
};
|
|
185740
|
-
}
|
|
185741
|
-
#trackFace(family$1, key2) {
|
|
185742
|
-
const fam = normalizeFamilyKey(family$1);
|
|
185743
|
-
const set = this.#facesByFamily.get(fam) ?? /* @__PURE__ */ new Set;
|
|
185744
|
-
set.add(key2);
|
|
185745
|
-
this.#facesByFamily.set(fam, set);
|
|
185746
|
-
}
|
|
185747
|
-
isManaged(family$1) {
|
|
185748
|
-
return this.#managed.has(family$1);
|
|
185749
|
-
}
|
|
185750
|
-
getStatus(family$1) {
|
|
185751
|
-
const statuses = [];
|
|
185752
|
-
const faceKeys = this.#facesByFamily.get(normalizeFamilyKey(family$1));
|
|
185753
|
-
if (faceKeys)
|
|
185754
|
-
for (const k of faceKeys)
|
|
185755
|
-
statuses.push(this.#faceStatus.get(k) ?? "unloaded");
|
|
185756
|
-
const legacy = this.#status.get(family$1);
|
|
185757
|
-
if (legacy)
|
|
185758
|
-
statuses.push(legacy);
|
|
185759
|
-
if (statuses.length === 0)
|
|
185760
|
-
return "unloaded";
|
|
185761
|
-
for (const s of [
|
|
185762
|
-
"failed",
|
|
185763
|
-
"timed_out",
|
|
185764
|
-
"fallback_used",
|
|
185765
|
-
"loaded",
|
|
185766
|
-
"loading",
|
|
185767
|
-
"unloaded"
|
|
185768
|
-
])
|
|
185769
|
-
if (statuses.includes(s))
|
|
185770
|
-
return s;
|
|
185771
|
-
return "unloaded";
|
|
185772
|
-
}
|
|
185773
|
-
hasFace(family$1, weight, style) {
|
|
185774
|
-
const key2 = faceKeyOf(family$1, weight, style);
|
|
185775
|
-
return this.#providerFaceKeys.has(key2) && this.#faceStatus.get(key2) !== "failed";
|
|
185776
|
-
}
|
|
185777
|
-
isAvailable(family$1) {
|
|
185778
|
-
if (!this.#fontSet)
|
|
185779
|
-
return false;
|
|
185780
|
-
try {
|
|
185781
|
-
return this.#fontSet.check(`${this.#probeSize} ${quoteFamily(family$1)}`);
|
|
185782
|
-
} catch {
|
|
185783
|
-
return false;
|
|
185784
|
-
}
|
|
185785
|
-
}
|
|
185786
|
-
awaitFace(family$1, timeoutMs = DEFAULT_FONT_LOAD_TIMEOUT_MS) {
|
|
185787
|
-
if (this.#status.get(family$1) === "loaded")
|
|
185788
|
-
return Promise.resolve({
|
|
185789
|
-
family: family$1,
|
|
185790
|
-
status: "loaded"
|
|
185791
|
-
});
|
|
185792
|
-
const existing = this.#inflight.get(family$1);
|
|
185793
|
-
if (existing)
|
|
185794
|
-
return existing;
|
|
185795
|
-
const probe = this.#loadOne(family$1, timeoutMs).finally(() => {
|
|
185796
|
-
this.#inflight.delete(family$1);
|
|
185797
|
-
});
|
|
185798
|
-
this.#inflight.set(family$1, probe);
|
|
185799
|
-
return probe;
|
|
185800
|
-
}
|
|
185801
|
-
async awaitFaces(families, options = {}) {
|
|
185802
|
-
const unique = [...new Set(families)];
|
|
185803
|
-
const timeoutMs = options.timeoutMs ?? 3000;
|
|
185804
|
-
return Promise.all(unique.map((family$1) => this.awaitFace(family$1, timeoutMs)));
|
|
185805
|
-
}
|
|
185806
|
-
getRequiredFaces(families, timeoutMs = DEFAULT_FONT_LOAD_TIMEOUT_MS) {
|
|
185807
|
-
return [...new Set(families)].map((family$1) => ({
|
|
185808
|
-
family: family$1,
|
|
185809
|
-
status: this.getStatus(family$1),
|
|
185810
|
-
ready: this.awaitFace(family$1, timeoutMs)
|
|
185811
|
-
}));
|
|
185812
|
-
}
|
|
185813
|
-
getStates() {
|
|
185814
|
-
return [...this.#status.entries()].map(([family$1, status]) => ({
|
|
185815
|
-
family: family$1,
|
|
185816
|
-
status
|
|
185817
|
-
}));
|
|
185818
|
-
}
|
|
185819
|
-
getFaceStatus(request) {
|
|
185820
|
-
return this.#faceStatus.get(faceKeyOf(request.family, request.weight, request.style)) ?? "unloaded";
|
|
185821
|
-
}
|
|
185822
|
-
awaitFaceRequest(request, timeoutMs = DEFAULT_FONT_LOAD_TIMEOUT_MS) {
|
|
185823
|
-
const key2 = faceKeyOf(request.family, request.weight, request.style);
|
|
185824
|
-
if (this.#faceStatus.get(key2) === "loaded")
|
|
185825
|
-
return Promise.resolve({
|
|
185826
|
-
request,
|
|
185827
|
-
status: "loaded"
|
|
185828
|
-
});
|
|
185829
|
-
const existing = this.#faceInflight.get(key2);
|
|
185830
|
-
if (existing)
|
|
185831
|
-
return existing;
|
|
185832
|
-
const probe = this.#loadOneFace(request, key2, timeoutMs).finally(() => {
|
|
185833
|
-
this.#faceInflight.delete(key2);
|
|
185834
|
-
});
|
|
185835
|
-
this.#faceInflight.set(key2, probe);
|
|
185836
|
-
return probe;
|
|
185837
|
-
}
|
|
185838
|
-
async awaitFaceRequests(requests, options = {}) {
|
|
185839
|
-
const timeoutMs = options.timeoutMs ?? 3000;
|
|
185840
|
-
const seen = /* @__PURE__ */ new Set;
|
|
185841
|
-
const unique = [];
|
|
185842
|
-
for (const r of requests) {
|
|
185843
|
-
const key2 = faceKeyOf(r.family, r.weight, r.style);
|
|
185844
|
-
if (seen.has(key2))
|
|
185845
|
-
continue;
|
|
185846
|
-
seen.add(key2);
|
|
185847
|
-
unique.push(r);
|
|
185848
|
-
}
|
|
185849
|
-
return Promise.all(unique.map((r) => this.awaitFaceRequest(r, timeoutMs)));
|
|
185850
|
-
}
|
|
185851
|
-
async#loadOneFace(request, key2, timeoutMs) {
|
|
185852
|
-
this.#trackFace(request.family, key2);
|
|
185853
|
-
const fontSet = this.#fontSet;
|
|
185854
|
-
if (!fontSet) {
|
|
185855
|
-
this.#faceStatus.set(key2, "fallback_used");
|
|
185856
|
-
return {
|
|
185857
|
-
request,
|
|
185858
|
-
status: "fallback_used"
|
|
185859
|
-
};
|
|
185860
|
-
}
|
|
185861
|
-
this.#faceStatus.set(key2, "loading");
|
|
185862
|
-
const probe = faceProbe(request.family, request.weight, request.style, this.#probeSize);
|
|
185863
|
-
const TIMEOUT = Symbol("timeout");
|
|
185864
|
-
let handle2;
|
|
185865
|
-
const timeout = new Promise((resolve2) => {
|
|
185866
|
-
handle2 = this.#scheduleTimeout(() => resolve2(TIMEOUT), timeoutMs);
|
|
185867
|
-
});
|
|
185868
|
-
try {
|
|
185869
|
-
const settled = await Promise.race([fontSet.load(probe), timeout]);
|
|
185870
|
-
if (settled === TIMEOUT) {
|
|
185871
|
-
this.#faceStatus.set(key2, "timed_out");
|
|
185872
|
-
return {
|
|
185873
|
-
request,
|
|
185874
|
-
status: "timed_out"
|
|
185875
|
-
};
|
|
185876
|
-
}
|
|
185877
|
-
const status = settled.length > 0 ? "loaded" : "fallback_used";
|
|
185878
|
-
this.#faceStatus.set(key2, status);
|
|
185879
|
-
return {
|
|
185880
|
-
request,
|
|
185881
|
-
status
|
|
185882
|
-
};
|
|
185883
|
-
} catch {
|
|
185884
|
-
this.#faceStatus.set(key2, "failed");
|
|
185885
|
-
this.#warnFaceFailureOnce(request, key2);
|
|
185886
|
-
return {
|
|
185887
|
-
request,
|
|
185888
|
-
status: "failed"
|
|
185889
|
-
};
|
|
185890
|
-
} finally {
|
|
185891
|
-
this.#cancelTimeout(handle2);
|
|
185892
|
-
}
|
|
185893
|
-
}
|
|
185894
|
-
#warnFaceFailureOnce(request, key2) {
|
|
185895
|
-
if (this.#warnedFaceFailures.has(key2))
|
|
185896
|
-
return;
|
|
185897
|
-
this.#warnedFaceFailures.add(key2);
|
|
185898
|
-
const src = this.#faceSources.get(key2);
|
|
185899
|
-
const detail = src ? ` from ${src}` : "";
|
|
185900
|
-
console.warn(`[superdoc] font face failed to load: "${request.family}" ${request.weight} ${request.style}${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
|
|
185901
|
-
}
|
|
185902
|
-
async#loadOne(family$1, timeoutMs) {
|
|
185903
|
-
const fontSet = this.#fontSet;
|
|
185904
|
-
if (!fontSet) {
|
|
185905
|
-
this.#status.set(family$1, "fallback_used");
|
|
185906
|
-
return {
|
|
185907
|
-
family: family$1,
|
|
185908
|
-
status: "fallback_used"
|
|
185909
|
-
};
|
|
185910
|
-
}
|
|
185911
|
-
this.#status.set(family$1, "loading");
|
|
185912
|
-
const probe = `${this.#probeSize} ${quoteFamily(family$1)}`;
|
|
185913
|
-
const TIMEOUT = Symbol("timeout");
|
|
185914
|
-
let handle2;
|
|
185915
|
-
const timeout = new Promise((resolve2) => {
|
|
185916
|
-
handle2 = this.#scheduleTimeout(() => resolve2(TIMEOUT), timeoutMs);
|
|
185917
|
-
});
|
|
185918
|
-
try {
|
|
185919
|
-
const settled = await Promise.race([fontSet.load(probe), timeout]);
|
|
185920
|
-
if (settled === TIMEOUT) {
|
|
185921
|
-
this.#status.set(family$1, "timed_out");
|
|
185922
|
-
return {
|
|
185923
|
-
family: family$1,
|
|
185924
|
-
status: "timed_out"
|
|
185925
|
-
};
|
|
185926
|
-
}
|
|
185927
|
-
const status = settled.length > 0 ? "loaded" : "fallback_used";
|
|
185928
|
-
this.#status.set(family$1, status);
|
|
185929
|
-
return {
|
|
185930
|
-
family: family$1,
|
|
185931
|
-
status
|
|
185932
|
-
};
|
|
185933
|
-
} catch {
|
|
185934
|
-
this.#status.set(family$1, "failed");
|
|
185935
|
-
this.#warnLoadFailureOnce(family$1);
|
|
185936
|
-
return {
|
|
185937
|
-
family: family$1,
|
|
185938
|
-
status: "failed"
|
|
185939
|
-
};
|
|
185940
|
-
} finally {
|
|
185941
|
-
this.#cancelTimeout(handle2);
|
|
185942
|
-
}
|
|
185943
|
-
}
|
|
185944
|
-
#warnLoadFailureOnce(family$1) {
|
|
185945
|
-
if (this.#warnedFailures.has(family$1))
|
|
185946
|
-
return;
|
|
185947
|
-
this.#warnedFailures.add(family$1);
|
|
185948
|
-
const sources = this.#sources.get(family$1);
|
|
185949
|
-
const detail = sources && sources.length ? ` from ${sources.join(", ")}` : "";
|
|
185950
|
-
console.warn(`[superdoc] font asset failed to load for "${family$1}"${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
|
|
185951
|
-
}
|
|
185952
|
-
}, registriesByFontSet, domlessRegistry = null, PHYSICAL_GENERIC, BUNDLED_FAMILIES, FONT_OFFERINGS, DEFAULT_FONT_ORDER, headlessToolbarConstants, MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
|
|
185953
|
-
var init_create_super_doc_ui_tVaowTvG_es = __esm(() => {
|
|
185954
|
-
init_SuperConverter_bEQ45IUD_es();
|
|
185955
|
-
init_create_headless_toolbar_BmFWtej0_es();
|
|
185956
|
-
SETTLED_STATUSES = [
|
|
185957
|
-
"loaded",
|
|
185958
|
-
"failed",
|
|
185959
|
-
"timed_out",
|
|
185960
|
-
"fallback_used"
|
|
185961
|
-
];
|
|
185962
|
-
SUBSTITUTION_EVIDENCE = Object.freeze([
|
|
185963
|
-
{
|
|
185964
|
-
evidenceId: "calibri",
|
|
185965
|
-
logicalFamily: "Calibri",
|
|
185966
|
-
physicalFamily: "Carlito",
|
|
185967
|
-
verdict: "metric_safe",
|
|
185968
|
-
faces: {
|
|
185969
|
-
regular: true,
|
|
185970
|
-
bold: true,
|
|
185971
|
-
italic: true,
|
|
185972
|
-
boldItalic: true
|
|
185973
|
-
},
|
|
185974
|
-
advance: {
|
|
185975
|
-
meanDelta: 0,
|
|
185976
|
-
maxDelta: 0
|
|
185977
|
-
},
|
|
185978
|
-
gates: {
|
|
185979
|
-
static: "pass",
|
|
185980
|
-
metric: "pass",
|
|
185981
|
-
layout: "pass",
|
|
185982
|
-
ship: "pass"
|
|
185983
|
-
},
|
|
185984
|
-
policyAction: "substitute",
|
|
185985
|
-
measurementRefs: ["calibri__carlito#analytic_advance#2026-06-03", "calibri__carlito#face_aggregate#2026-06-03"],
|
|
185986
|
-
candidateLicense: "OFL-1.1",
|
|
185987
|
-
exportRule: "preserve_original_name"
|
|
185988
|
-
},
|
|
185989
|
-
{
|
|
185990
|
-
evidenceId: "cambria",
|
|
185991
|
-
logicalFamily: "Cambria",
|
|
185992
|
-
physicalFamily: "Caladea",
|
|
185993
|
-
verdict: "visual_only",
|
|
185994
|
-
faceVerdicts: {
|
|
185995
|
-
regular: "metric_safe",
|
|
185996
|
-
bold: "metric_safe",
|
|
185997
|
-
italic: "metric_safe",
|
|
185998
|
-
boldItalic: "visual_only"
|
|
185999
|
-
},
|
|
186000
|
-
glyphExceptions: [{
|
|
186001
|
-
slot: "boldItalic",
|
|
186002
|
-
codepoint: 96,
|
|
186003
|
-
advanceDelta: 0.231,
|
|
186004
|
-
note: "Caladea Bold Italic grave accent (U+0060) advance diverges ~23% from Cambria; lines containing it reflow."
|
|
186005
|
-
}],
|
|
186006
|
-
faces: {
|
|
186007
|
-
regular: true,
|
|
186008
|
-
bold: true,
|
|
186009
|
-
italic: true,
|
|
186010
|
-
boldItalic: true
|
|
186011
|
-
},
|
|
186012
|
-
advance: {
|
|
186013
|
-
meanDelta: 0.0002378,
|
|
186014
|
-
maxDelta: 0.2310758
|
|
186015
|
-
},
|
|
186016
|
-
gates: {
|
|
186017
|
-
static: "pass",
|
|
186018
|
-
metric: "pass",
|
|
186019
|
-
layout: "not_run",
|
|
186020
|
-
ship: "pass"
|
|
186021
|
-
},
|
|
186022
|
-
policyAction: "substitute",
|
|
186023
|
-
measurementRefs: [
|
|
186024
|
-
"cambria_regular__caladea#regular#w400#d2f6cad3#analytic_advance#2026-06-04",
|
|
186025
|
-
"cambria_bold__caladea#bold#w700#74eda4fc#analytic_advance#2026-06-04",
|
|
186026
|
-
"cambria_italic__caladea#italic#w400#9c968bf6#analytic_advance#2026-06-04",
|
|
186027
|
-
"cambria_boldItalic__caladea#boldItalic#w700#f47a35ad#analytic_advance#2026-06-04"
|
|
186028
|
-
],
|
|
186029
|
-
candidateLicense: "Apache-2.0",
|
|
186030
|
-
exportRule: "preserve_original_name"
|
|
186031
|
-
},
|
|
186032
|
-
{
|
|
186033
|
-
evidenceId: "arial",
|
|
186034
|
-
logicalFamily: "Arial",
|
|
186035
|
-
physicalFamily: "Liberation Sans",
|
|
186036
|
-
verdict: "metric_safe",
|
|
186037
|
-
faces: {
|
|
186038
|
-
regular: true,
|
|
186039
|
-
bold: true,
|
|
186040
|
-
italic: true,
|
|
186041
|
-
boldItalic: true
|
|
186042
|
-
},
|
|
186043
|
-
advance: {
|
|
186044
|
-
meanDelta: 0,
|
|
186045
|
-
maxDelta: 0
|
|
186046
|
-
},
|
|
186047
|
-
gates: {
|
|
186048
|
-
static: "pass",
|
|
186049
|
-
metric: "pass",
|
|
186050
|
-
layout: "not_run",
|
|
186051
|
-
ship: "pass"
|
|
186052
|
-
},
|
|
186053
|
-
policyAction: "substitute",
|
|
186054
|
-
measurementRefs: ["arial__liberation-sans#analytic_advance#2026-06-03"],
|
|
186055
|
-
candidateLicense: "OFL-1.1",
|
|
186056
|
-
exportRule: "preserve_original_name"
|
|
186057
|
-
},
|
|
186058
|
-
{
|
|
186059
|
-
evidenceId: "times-new-roman",
|
|
186060
|
-
logicalFamily: "Times New Roman",
|
|
186061
|
-
physicalFamily: "Liberation Serif",
|
|
186062
|
-
verdict: "metric_safe",
|
|
186063
|
-
faces: {
|
|
186064
|
-
regular: true,
|
|
186065
|
-
bold: true,
|
|
186066
|
-
italic: true,
|
|
186067
|
-
boldItalic: true
|
|
186068
|
-
},
|
|
186069
|
-
advance: {
|
|
186070
|
-
meanDelta: 0,
|
|
186071
|
-
maxDelta: 0
|
|
186072
|
-
},
|
|
186073
|
-
gates: {
|
|
186074
|
-
static: "pass",
|
|
186075
|
-
metric: "pass",
|
|
186076
|
-
layout: "not_run",
|
|
186077
|
-
ship: "pass"
|
|
186078
|
-
},
|
|
186079
|
-
policyAction: "substitute",
|
|
186080
|
-
measurementRefs: ["times-new-roman__liberation-serif#analytic_advance#2026-06-03"],
|
|
186081
|
-
candidateLicense: "OFL-1.1",
|
|
186082
|
-
exportRule: "preserve_original_name"
|
|
186083
|
-
},
|
|
186084
|
-
{
|
|
186085
|
-
evidenceId: "courier-new",
|
|
186086
|
-
logicalFamily: "Courier New",
|
|
186087
|
-
physicalFamily: "Liberation Mono",
|
|
186088
|
-
verdict: "metric_safe",
|
|
186089
|
-
faces: {
|
|
186090
|
-
regular: true,
|
|
186091
|
-
bold: true,
|
|
186092
|
-
italic: true,
|
|
186093
|
-
boldItalic: true
|
|
186094
|
-
},
|
|
186095
|
-
advance: {
|
|
186096
|
-
meanDelta: 0,
|
|
186097
|
-
maxDelta: 0
|
|
186098
|
-
},
|
|
186099
|
-
gates: {
|
|
186100
|
-
static: "pass",
|
|
186101
|
-
metric: "pass",
|
|
186102
|
-
layout: "not_run",
|
|
186103
|
-
ship: "pass"
|
|
186104
|
-
},
|
|
186105
|
-
policyAction: "substitute",
|
|
186106
|
-
measurementRefs: ["courier-new__liberation-mono#analytic_advance#2026-06-03"],
|
|
186107
|
-
candidateLicense: "OFL-1.1",
|
|
186108
|
-
exportRule: "preserve_original_name"
|
|
186109
|
-
},
|
|
186110
|
-
{
|
|
186111
|
-
evidenceId: "helvetica",
|
|
186112
|
-
logicalFamily: "Helvetica",
|
|
186113
|
-
physicalFamily: "Liberation Sans",
|
|
186114
|
-
verdict: "metric_safe",
|
|
186115
|
-
faces: {
|
|
186116
|
-
regular: true,
|
|
186117
|
-
bold: true,
|
|
186118
|
-
italic: true,
|
|
186119
|
-
boldItalic: true
|
|
186120
|
-
},
|
|
186121
|
-
advance: {
|
|
186122
|
-
meanDelta: 0,
|
|
186123
|
-
maxDelta: 0
|
|
186124
|
-
},
|
|
186125
|
-
gates: {
|
|
186126
|
-
static: "not_run",
|
|
186127
|
-
metric: "pass",
|
|
186128
|
-
layout: "not_run",
|
|
186129
|
-
ship: "fail"
|
|
186130
|
-
},
|
|
186131
|
-
policyAction: "substitute",
|
|
186132
|
-
measurementRefs: ["helvetica__liberation-sans#analytic_advance#2026-06-03"],
|
|
186133
|
-
candidateLicense: "OFL-1.1",
|
|
186134
|
-
exportRule: "preserve_original_name"
|
|
186135
|
-
},
|
|
186136
|
-
{
|
|
186137
|
-
evidenceId: "calibri-light",
|
|
186138
|
-
logicalFamily: "Calibri Light",
|
|
186139
|
-
physicalFamily: "Carlito",
|
|
186140
|
-
verdict: "visual_only",
|
|
186141
|
-
faces: {
|
|
186142
|
-
regular: false,
|
|
186143
|
-
bold: false,
|
|
186144
|
-
italic: false,
|
|
186145
|
-
boldItalic: false
|
|
186146
|
-
},
|
|
186147
|
-
advance: {
|
|
186148
|
-
meanDelta: 0.0148,
|
|
186149
|
-
maxDelta: 0.066
|
|
186150
|
-
},
|
|
186151
|
-
gates: {
|
|
186152
|
-
static: "not_run",
|
|
186153
|
-
metric: "fail",
|
|
186154
|
-
layout: "not_run",
|
|
186155
|
-
ship: "fail"
|
|
186156
|
-
},
|
|
186157
|
-
policyAction: "category_fallback",
|
|
186158
|
-
measurementRefs: ["calibri-light__carlito#analytic_advance#2026-06-05"],
|
|
186159
|
-
candidateLicense: "OFL-1.1",
|
|
186160
|
-
exportRule: "preserve_original_name"
|
|
186161
|
-
}
|
|
186162
|
-
]);
|
|
186163
|
-
BUNDLED_SUBSTITUTES = deriveBundledSubstitutes();
|
|
186164
|
-
CATEGORY_FALLBACKS = deriveCategoryFallbacks();
|
|
186165
|
-
defaultResolver = new FontResolver;
|
|
186166
|
-
DEFAULT_FONT_MEASURE_CONTEXT = Object.freeze({
|
|
186167
|
-
resolvePhysical: (cssFontFamily, _face) => resolvePhysicalFamily(cssFontFamily),
|
|
186168
|
-
fontSignature: ""
|
|
186169
|
-
});
|
|
186170
|
-
BUNDLED_MANIFEST = Object.freeze([
|
|
186171
|
-
family("Carlito", "Carlito", "OFL-1.1"),
|
|
186172
|
-
family("Caladea", "Caladea", "Apache-2.0"),
|
|
186173
|
-
family("Liberation Sans", "LiberationSans", "OFL-1.1"),
|
|
186174
|
-
family("Liberation Serif", "LiberationSerif", "OFL-1.1"),
|
|
186175
|
-
family("Liberation Mono", "LiberationMono", "OFL-1.1")
|
|
186176
|
-
]);
|
|
186177
|
-
installedRegistries = /* @__PURE__ */ new WeakMap;
|
|
186178
|
-
registriesByFontSet = /* @__PURE__ */ new WeakMap;
|
|
186179
|
-
PHYSICAL_GENERIC = Object.freeze({
|
|
186180
|
-
Carlito: "sans-serif",
|
|
186181
|
-
Caladea: "serif",
|
|
186182
|
-
"Liberation Sans": "sans-serif",
|
|
186183
|
-
"Liberation Serif": "serif",
|
|
186184
|
-
"Liberation Mono": "monospace"
|
|
186185
|
-
});
|
|
186186
|
-
BUNDLED_FAMILIES = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
|
|
186187
|
-
FONT_OFFERINGS = deriveOfferings();
|
|
186188
|
-
DEFAULT_FONT_ORDER = [
|
|
186189
|
-
"Calibri",
|
|
186190
|
-
"Arial",
|
|
186191
|
-
"Courier New",
|
|
186192
|
-
"Times New Roman",
|
|
186193
|
-
"Helvetica"
|
|
186194
|
-
];
|
|
186195
|
-
headlessToolbarConstants = {
|
|
186196
|
-
DEFAULT_TEXT_ALIGN_OPTIONS: [
|
|
186197
|
-
{
|
|
186198
|
-
label: "Left",
|
|
186199
|
-
value: "left"
|
|
186200
|
-
},
|
|
186201
|
-
{
|
|
186202
|
-
label: "Center",
|
|
186203
|
-
value: "center"
|
|
186204
|
-
},
|
|
186205
|
-
{
|
|
186206
|
-
label: "Right",
|
|
186207
|
-
value: "right"
|
|
186208
|
-
},
|
|
186209
|
-
{
|
|
186210
|
-
label: "Justify",
|
|
186211
|
-
value: "justify"
|
|
186212
|
-
}
|
|
186213
|
-
],
|
|
186214
|
-
DEFAULT_LINE_HEIGHT_OPTIONS: [
|
|
186215
|
-
{
|
|
186216
|
-
label: "1.00",
|
|
186217
|
-
value: 1
|
|
186218
|
-
},
|
|
186219
|
-
{
|
|
186220
|
-
label: "1.15",
|
|
186221
|
-
value: 1.15
|
|
186222
|
-
},
|
|
186223
|
-
{
|
|
186224
|
-
label: "1.50",
|
|
186225
|
-
value: 1.5
|
|
186226
|
-
},
|
|
186227
|
-
{
|
|
186228
|
-
label: "2.00",
|
|
186229
|
-
value: 2
|
|
186230
|
-
},
|
|
186231
|
-
{
|
|
186232
|
-
label: "2.50",
|
|
186233
|
-
value: 2.5
|
|
186234
|
-
},
|
|
186235
|
-
{
|
|
186236
|
-
label: "3.00",
|
|
186237
|
-
value: 3
|
|
186238
|
-
}
|
|
186239
|
-
],
|
|
186240
|
-
DEFAULT_ZOOM_OPTIONS: [
|
|
186241
|
-
{
|
|
186242
|
-
label: "50%",
|
|
186243
|
-
value: 50
|
|
186244
|
-
},
|
|
186245
|
-
{
|
|
186246
|
-
label: "75%",
|
|
186247
|
-
value: 75
|
|
186248
|
-
},
|
|
186249
|
-
{
|
|
186250
|
-
label: "90%",
|
|
186251
|
-
value: 90
|
|
186252
|
-
},
|
|
186253
|
-
{
|
|
186254
|
-
label: "100%",
|
|
186255
|
-
value: 100
|
|
186256
|
-
},
|
|
186257
|
-
{
|
|
186258
|
-
label: "125%",
|
|
186259
|
-
value: 125
|
|
186260
|
-
},
|
|
186261
|
-
{
|
|
186262
|
-
label: "150%",
|
|
186263
|
-
value: 150
|
|
186264
|
-
},
|
|
186265
|
-
{
|
|
186266
|
-
label: "200%",
|
|
186267
|
-
value: 200
|
|
186268
|
-
}
|
|
186269
|
-
],
|
|
186270
|
-
DEFAULT_DOCUMENT_MODE_OPTIONS: [
|
|
186271
|
-
{
|
|
186272
|
-
label: "Editing",
|
|
186273
|
-
value: "editing",
|
|
186274
|
-
description: "Edit document directly"
|
|
186275
|
-
},
|
|
186276
|
-
{
|
|
186277
|
-
label: "Suggesting",
|
|
186278
|
-
value: "suggesting",
|
|
186279
|
-
description: "Edits become suggestions"
|
|
186280
|
-
},
|
|
186281
|
-
{
|
|
186282
|
-
label: "Viewing",
|
|
186283
|
-
value: "viewing",
|
|
186284
|
-
description: "View clean version of document only"
|
|
186285
|
-
}
|
|
186286
|
-
],
|
|
186287
|
-
DEFAULT_FONT_SIZE_OPTIONS: [
|
|
186288
|
-
{
|
|
186289
|
-
label: "8",
|
|
186290
|
-
value: "8pt"
|
|
186291
|
-
},
|
|
186292
|
-
{
|
|
186293
|
-
label: "9",
|
|
186294
|
-
value: "9pt"
|
|
186295
|
-
},
|
|
186296
|
-
{
|
|
186297
|
-
label: "10",
|
|
186298
|
-
value: "10pt"
|
|
186299
|
-
},
|
|
186300
|
-
{
|
|
186301
|
-
label: "11",
|
|
186302
|
-
value: "11pt"
|
|
186303
|
-
},
|
|
186304
|
-
{
|
|
186305
|
-
label: "12",
|
|
186306
|
-
value: "12pt"
|
|
186307
|
-
},
|
|
186308
|
-
{
|
|
186309
|
-
label: "14",
|
|
186310
|
-
value: "14pt"
|
|
186311
|
-
},
|
|
186312
|
-
{
|
|
186313
|
-
label: "18",
|
|
186314
|
-
value: "18pt"
|
|
186315
|
-
},
|
|
186316
|
-
{
|
|
186317
|
-
label: "24",
|
|
186318
|
-
value: "24pt"
|
|
186319
|
-
},
|
|
186320
|
-
{
|
|
186321
|
-
label: "30",
|
|
186322
|
-
value: "30pt"
|
|
186323
|
-
},
|
|
186324
|
-
{
|
|
186325
|
-
label: "36",
|
|
186326
|
-
value: "36pt"
|
|
186327
|
-
},
|
|
186328
|
-
{
|
|
186329
|
-
label: "48",
|
|
186330
|
-
value: "48pt"
|
|
186331
|
-
},
|
|
186332
|
-
{
|
|
186333
|
-
label: "60",
|
|
186334
|
-
value: "60pt"
|
|
186335
|
-
},
|
|
186336
|
-
{
|
|
186337
|
-
label: "72",
|
|
186338
|
-
value: "72pt"
|
|
186339
|
-
},
|
|
186340
|
-
{
|
|
186341
|
-
label: "96",
|
|
186342
|
-
value: "96pt"
|
|
186343
|
-
}
|
|
186344
|
-
],
|
|
186345
|
-
DEFAULT_FONT_FAMILY_OPTIONS: getDefaultFontFamilyOptions(),
|
|
186346
|
-
DEFAULT_TEXT_COLOR_OPTIONS: [
|
|
186347
|
-
{
|
|
186348
|
-
label: "Black",
|
|
186349
|
-
value: "#000000"
|
|
186350
|
-
},
|
|
186351
|
-
{
|
|
186352
|
-
label: "Dark Gray",
|
|
186353
|
-
value: "#434343"
|
|
186354
|
-
},
|
|
186355
|
-
{
|
|
186356
|
-
label: "Gray",
|
|
186357
|
-
value: "#666666"
|
|
186358
|
-
},
|
|
186359
|
-
{
|
|
186360
|
-
label: "Light Gray",
|
|
186361
|
-
value: "#999999"
|
|
186362
|
-
},
|
|
186363
|
-
{
|
|
186364
|
-
label: "Red",
|
|
186365
|
-
value: "#ff0000"
|
|
186366
|
-
},
|
|
186367
|
-
{
|
|
186368
|
-
label: "Orange",
|
|
186369
|
-
value: "#ff9900"
|
|
186370
|
-
},
|
|
186371
|
-
{
|
|
186372
|
-
label: "Yellow",
|
|
186373
|
-
value: "#ffff00"
|
|
186374
|
-
},
|
|
186375
|
-
{
|
|
186376
|
-
label: "Green",
|
|
186377
|
-
value: "#00ff00"
|
|
186378
|
-
},
|
|
186379
|
-
{
|
|
186380
|
-
label: "Cyan",
|
|
186381
|
-
value: "#00ffff"
|
|
186382
|
-
},
|
|
186383
|
-
{
|
|
186384
|
-
label: "Blue",
|
|
186385
|
-
value: "#0000ff"
|
|
186386
|
-
},
|
|
186387
|
-
{
|
|
186388
|
-
label: "Purple",
|
|
186389
|
-
value: "#9900ff"
|
|
186390
|
-
},
|
|
186391
|
-
{
|
|
186392
|
-
label: "Magenta",
|
|
186393
|
-
value: "#ff00ff"
|
|
186394
|
-
},
|
|
186395
|
-
{
|
|
186396
|
-
label: "None",
|
|
186397
|
-
value: "none"
|
|
186398
|
-
}
|
|
186399
|
-
],
|
|
186400
|
-
DEFAULT_HIGHLIGHT_COLOR_OPTIONS: [
|
|
186401
|
-
{
|
|
186402
|
-
label: "Yellow",
|
|
186403
|
-
value: "#ffff00"
|
|
186404
|
-
},
|
|
186405
|
-
{
|
|
186406
|
-
label: "Green",
|
|
186407
|
-
value: "#00ff00"
|
|
186408
|
-
},
|
|
186409
|
-
{
|
|
186410
|
-
label: "Cyan",
|
|
186411
|
-
value: "#00ffff"
|
|
186412
|
-
},
|
|
186413
|
-
{
|
|
186414
|
-
label: "Pink",
|
|
186415
|
-
value: "#ff00ff"
|
|
186416
|
-
},
|
|
186417
|
-
{
|
|
186418
|
-
label: "Blue",
|
|
186419
|
-
value: "#0000ff"
|
|
186420
|
-
},
|
|
186421
|
-
{
|
|
186422
|
-
label: "Red",
|
|
186423
|
-
value: "#ff0000"
|
|
186424
|
-
},
|
|
186425
|
-
{
|
|
186426
|
-
label: "Orange",
|
|
186427
|
-
value: "#ff9900"
|
|
186428
|
-
},
|
|
186429
|
-
{
|
|
186430
|
-
label: "None",
|
|
186431
|
-
value: "none"
|
|
186432
|
-
}
|
|
186433
|
-
]
|
|
186434
|
-
};
|
|
186435
|
-
MOD_ALIASES = new Set([
|
|
186436
|
-
"Mod",
|
|
186437
|
-
"Meta",
|
|
186438
|
-
"Cmd",
|
|
186439
|
-
"Command"
|
|
186440
|
-
]);
|
|
186441
|
-
ALT_ALIASES = new Set(["Alt", "Option"]);
|
|
186442
|
-
CTRL_ALIASES = new Set(["Control", "Ctrl"]);
|
|
186443
|
-
SHIFT_ALIASES = new Set(["Shift"]);
|
|
186444
|
-
BUILTIN_CONTEXT_MENU_GROUPS = [
|
|
186445
|
-
"format",
|
|
186446
|
-
"clipboard",
|
|
186447
|
-
"review",
|
|
186448
|
-
"comment",
|
|
186449
|
-
"link"
|
|
186450
|
-
];
|
|
186451
|
-
BUILTIN_GROUP_ORDER = new Map(BUILTIN_CONTEXT_MENU_GROUPS.map((g2, i4) => [g2, i4]));
|
|
186452
|
-
RESERVED_PROXY_PROPERTY_NAMES = new Set([
|
|
186453
|
-
"register",
|
|
186454
|
-
"get",
|
|
186455
|
-
"has",
|
|
186456
|
-
"require",
|
|
186457
|
-
"getContextMenuItems"
|
|
186458
|
-
]);
|
|
186459
|
-
ALL_TOOLBAR_COMMAND_IDS = Object.keys(createToolbarRegistry());
|
|
186460
|
-
EMPTY_ACTIVE_IDS = Object.freeze([]);
|
|
186461
|
-
});
|
|
186462
|
-
|
|
186463
186362
|
// ../../packages/superdoc/dist/chunks/eventemitter3-BnGqBE-Q.es.js
|
|
186464
186363
|
var import_eventemitter3;
|
|
186465
186364
|
var init_eventemitter3_BnGqBE_Q_es = __esm(() => {
|
|
@@ -232976,7 +232875,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
232976
232875
|
init_remark_gfm_BhnWr3yf_es();
|
|
232977
232876
|
});
|
|
232978
232877
|
|
|
232979
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
232878
|
+
// ../../packages/superdoc/dist/chunks/src-x_i3LADL.es.js
|
|
232980
232879
|
function deleteProps(obj, propOrProps) {
|
|
232981
232880
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
232982
232881
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -292368,6 +292267,13 @@ function defaultInvalidate() {
|
|
|
292368
292267
|
function toCssFontSource(url2) {
|
|
292369
292268
|
return /^\s*url\(/i.test(url2) ? url2 : `url(${JSON.stringify(url2)})`;
|
|
292370
292269
|
}
|
|
292270
|
+
function nextEmbeddedNamespace() {
|
|
292271
|
+
embeddedDocumentCounter += 1;
|
|
292272
|
+
return `__superdoc_embedded_${embeddedDocumentCounter}__`;
|
|
292273
|
+
}
|
|
292274
|
+
function sanitizeFamilyToken(family2) {
|
|
292275
|
+
return family2.replace(/[^A-Za-z0-9]+/g, "_").replace(/^_+|_+$/g, "") || "font";
|
|
292276
|
+
}
|
|
292371
292277
|
function defaultScheduleMicrotask(callback) {
|
|
292372
292278
|
if (typeof queueMicrotask === "function") {
|
|
292373
292279
|
queueMicrotask(callback);
|
|
@@ -292397,7 +292303,7 @@ function makeResolveFace(resolver2, hasFace) {
|
|
|
292397
292303
|
};
|
|
292398
292304
|
};
|
|
292399
292305
|
return (logical) => {
|
|
292400
|
-
const r$1 =
|
|
292306
|
+
const r$1 = resolveFontFamily(logical);
|
|
292401
292307
|
return {
|
|
292402
292308
|
physicalFamily: r$1.physicalFamily,
|
|
292403
292309
|
reason: r$1.reason
|
|
@@ -329942,7 +329848,7 @@ menclose::after {
|
|
|
329942
329848
|
#flushLateFontLoads() {
|
|
329943
329849
|
this.#requestReflow();
|
|
329944
329850
|
}
|
|
329945
|
-
}, FACE_STATUS_PRIORITY, DocumentFontController = class {
|
|
329851
|
+
}, FACE_STATUS_PRIORITY, embeddedDocumentCounter = 0, DocumentFontController = class {
|
|
329946
329852
|
#resolver;
|
|
329947
329853
|
#getGate;
|
|
329948
329854
|
#onDocumentFontConfigApplied;
|
|
@@ -329950,6 +329856,10 @@ menclose::after {
|
|
|
329950
329856
|
#runtimeReflowQueued = false;
|
|
329951
329857
|
#runtimeReflowToken = 0;
|
|
329952
329858
|
#runtimeAvailabilityChanged = false;
|
|
329859
|
+
#embeddedDisposers = [];
|
|
329860
|
+
#embeddedNamespace = nextEmbeddedNamespace();
|
|
329861
|
+
#embeddedPhysical = /* @__PURE__ */ new Map;
|
|
329862
|
+
#embeddedGeneration = 0;
|
|
329953
329863
|
constructor(deps) {
|
|
329954
329864
|
this.#resolver = deps.resolver;
|
|
329955
329865
|
this.#getGate = deps.getGate;
|
|
@@ -329968,10 +329878,12 @@ menclose::after {
|
|
|
329968
329878
|
}
|
|
329969
329879
|
reset() {
|
|
329970
329880
|
this.#cancelPendingRuntimeReflow();
|
|
329881
|
+
this.#releaseEmbeddedFaces();
|
|
329971
329882
|
this.#resolver.reset();
|
|
329972
329883
|
}
|
|
329973
329884
|
dispose() {
|
|
329974
329885
|
this.#cancelPendingRuntimeReflow();
|
|
329886
|
+
this.#releaseEmbeddedFaces();
|
|
329975
329887
|
}
|
|
329976
329888
|
applyInitialConfig(config2) {
|
|
329977
329889
|
this.#cancelPendingRuntimeReflow();
|
|
@@ -329982,6 +329894,43 @@ menclose::after {
|
|
|
329982
329894
|
if (registered$1)
|
|
329983
329895
|
this.#getGate()?.invalidateCachesForConfigRegistration();
|
|
329984
329896
|
}
|
|
329897
|
+
applyEmbeddedFaces(faces) {
|
|
329898
|
+
this.#releaseEmbeddedFaces();
|
|
329899
|
+
if (!faces?.length)
|
|
329900
|
+
return;
|
|
329901
|
+
const registry2 = this.#getGate()?.resolveRegistry();
|
|
329902
|
+
if (!registry2)
|
|
329903
|
+
return;
|
|
329904
|
+
this.#embeddedGeneration += 1;
|
|
329905
|
+
let registered$1 = false;
|
|
329906
|
+
for (const face of faces) {
|
|
329907
|
+
if (!face?.embeddable)
|
|
329908
|
+
continue;
|
|
329909
|
+
const physicalFamily = this.#physicalFamilyFor(face.family);
|
|
329910
|
+
const release = registry2.registerOwnedFace({
|
|
329911
|
+
family: physicalFamily,
|
|
329912
|
+
source: face.source,
|
|
329913
|
+
weight: face.weight,
|
|
329914
|
+
style: face.style
|
|
329915
|
+
});
|
|
329916
|
+
if (release) {
|
|
329917
|
+
this.#embeddedDisposers.push(release);
|
|
329918
|
+
this.#resolver.mapEmbedded(face.family, physicalFamily);
|
|
329919
|
+
registered$1 = true;
|
|
329920
|
+
}
|
|
329921
|
+
}
|
|
329922
|
+
if (registered$1)
|
|
329923
|
+
this.#getGate()?.invalidateCachesForConfigRegistration();
|
|
329924
|
+
}
|
|
329925
|
+
#physicalFamilyFor(logicalFamily) {
|
|
329926
|
+
const key2 = logicalFamily.trim().toLowerCase();
|
|
329927
|
+
let physical = this.#embeddedPhysical.get(key2);
|
|
329928
|
+
if (!physical) {
|
|
329929
|
+
physical = `${this.#embeddedNamespace}${this.#embeddedGeneration}_${this.#embeddedPhysical.size}_${sanitizeFamilyToken(logicalFamily)}`;
|
|
329930
|
+
this.#embeddedPhysical.set(key2, physical);
|
|
329931
|
+
}
|
|
329932
|
+
return physical;
|
|
329933
|
+
}
|
|
329985
329934
|
add(families) {
|
|
329986
329935
|
let committed = false;
|
|
329987
329936
|
try {
|
|
@@ -330079,6 +330028,13 @@ menclose::after {
|
|
|
330079
330028
|
this.#runtimeReflowQueued = false;
|
|
330080
330029
|
this.#runtimeReflowToken += 1;
|
|
330081
330030
|
}
|
|
330031
|
+
#releaseEmbeddedFaces() {
|
|
330032
|
+
for (const release of this.#embeddedDisposers)
|
|
330033
|
+
release();
|
|
330034
|
+
this.#embeddedDisposers.length = 0;
|
|
330035
|
+
this.#embeddedPhysical.clear();
|
|
330036
|
+
this.#resolver.clearEmbedded();
|
|
330037
|
+
}
|
|
330082
330038
|
}, DEFAULT_SEMANTIC_FOOTNOTE_HEADING_STYLE, NATIVE_SELECTION_STYLES = `
|
|
330083
330039
|
/* Hide native browser selection on layout engine content.
|
|
330084
330040
|
* We render our own selection overlay via PresentationEditor's #localSelectionLayer
|
|
@@ -330156,13 +330112,13 @@ menclose::after {
|
|
|
330156
330112
|
return;
|
|
330157
330113
|
console.log(...args$1);
|
|
330158
330114
|
}, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions, TRACKED_MARK_NAMES;
|
|
330159
|
-
var
|
|
330115
|
+
var init_src_x_i3LADL_es = __esm(() => {
|
|
330160
330116
|
init_rolldown_runtime_Bg48TavK_es();
|
|
330161
|
-
|
|
330117
|
+
init_SuperConverter_BVWG4qnQ_es();
|
|
330162
330118
|
init_jszip_C49i9kUs_es();
|
|
330163
330119
|
init_xml_js_CqGKpaft_es();
|
|
330164
330120
|
init_uuid_qzgm05fK_es();
|
|
330165
|
-
|
|
330121
|
+
init_create_headless_toolbar_JvWvpCga_es();
|
|
330166
330122
|
init_constants_D9qj59G2_es();
|
|
330167
330123
|
init_dist_B8HfvhaK_es();
|
|
330168
330124
|
init_unified_Dsuw2be5_es();
|
|
@@ -330170,7 +330126,6 @@ var init_src_BjtupAUl_es = __esm(() => {
|
|
|
330170
330126
|
init_remark_stringify_6MMJfY0k_es();
|
|
330171
330127
|
init_DocxZipper_Bu2Fhqkw_es();
|
|
330172
330128
|
init__plugin_vue_export_helper_5t5P5NuM_es();
|
|
330173
|
-
init_create_super_doc_ui_tVaowTvG_es();
|
|
330174
330129
|
init_eventemitter3_BnGqBE_Q_es();
|
|
330175
330130
|
init_errors_CNaD6vcg_es();
|
|
330176
330131
|
init_blank_docx_1Y_uWgjm_es();
|
|
@@ -358722,6 +358677,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
358722
358677
|
}
|
|
358723
358678
|
});
|
|
358724
358679
|
this.#fontController.applyInitialConfig(this.#options.fontAssets);
|
|
358680
|
+
this.#applyEmbeddedDocumentFonts();
|
|
358725
358681
|
if (typeof this.#options.disableContextMenu === "boolean")
|
|
358726
358682
|
this.setContextMenuDisabled(this.#options.disableContextMenu);
|
|
358727
358683
|
this.#setupHeaderFooterSession();
|
|
@@ -359727,6 +359683,10 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
359727
359683
|
async preloadFonts(families) {
|
|
359728
359684
|
await this.#fontController.preload(families);
|
|
359729
359685
|
}
|
|
359686
|
+
#applyEmbeddedDocumentFonts() {
|
|
359687
|
+
const converter = this.#editor.converter;
|
|
359688
|
+
this.#fontController.applyEmbeddedFaces(converter?.getEmbeddedFontFaces?.());
|
|
359689
|
+
}
|
|
359730
359690
|
#requestFontReflow() {
|
|
359731
359691
|
this.#layoutState = {
|
|
359732
359692
|
...this.#layoutState,
|
|
@@ -361022,6 +360982,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
361022
360982
|
this.#fontController.reset();
|
|
361023
360983
|
this.#layoutFontSignature = "";
|
|
361024
360984
|
this.#fontController.applyInitialConfig(this.#options.fontAssets);
|
|
360985
|
+
this.#applyEmbeddedDocumentFonts();
|
|
361025
360986
|
this.#resetFontReportStateForDocumentChange();
|
|
361026
360987
|
this.#refreshHeaderFooterStructureThenRerender({ purgeCachedEditors: true });
|
|
361027
360988
|
};
|
|
@@ -364991,6 +364952,279 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
364991
364952
|
]);
|
|
364992
364953
|
});
|
|
364993
364954
|
|
|
364955
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-B66Edat2.es.js
|
|
364956
|
+
var headlessToolbarConstants, MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
|
|
364957
|
+
var init_create_super_doc_ui_B66Edat2_es = __esm(() => {
|
|
364958
|
+
init_SuperConverter_BVWG4qnQ_es();
|
|
364959
|
+
init_create_headless_toolbar_JvWvpCga_es();
|
|
364960
|
+
headlessToolbarConstants = {
|
|
364961
|
+
DEFAULT_TEXT_ALIGN_OPTIONS: [
|
|
364962
|
+
{
|
|
364963
|
+
label: "Left",
|
|
364964
|
+
value: "left"
|
|
364965
|
+
},
|
|
364966
|
+
{
|
|
364967
|
+
label: "Center",
|
|
364968
|
+
value: "center"
|
|
364969
|
+
},
|
|
364970
|
+
{
|
|
364971
|
+
label: "Right",
|
|
364972
|
+
value: "right"
|
|
364973
|
+
},
|
|
364974
|
+
{
|
|
364975
|
+
label: "Justify",
|
|
364976
|
+
value: "justify"
|
|
364977
|
+
}
|
|
364978
|
+
],
|
|
364979
|
+
DEFAULT_LINE_HEIGHT_OPTIONS: [
|
|
364980
|
+
{
|
|
364981
|
+
label: "1.00",
|
|
364982
|
+
value: 1
|
|
364983
|
+
},
|
|
364984
|
+
{
|
|
364985
|
+
label: "1.15",
|
|
364986
|
+
value: 1.15
|
|
364987
|
+
},
|
|
364988
|
+
{
|
|
364989
|
+
label: "1.50",
|
|
364990
|
+
value: 1.5
|
|
364991
|
+
},
|
|
364992
|
+
{
|
|
364993
|
+
label: "2.00",
|
|
364994
|
+
value: 2
|
|
364995
|
+
},
|
|
364996
|
+
{
|
|
364997
|
+
label: "2.50",
|
|
364998
|
+
value: 2.5
|
|
364999
|
+
},
|
|
365000
|
+
{
|
|
365001
|
+
label: "3.00",
|
|
365002
|
+
value: 3
|
|
365003
|
+
}
|
|
365004
|
+
],
|
|
365005
|
+
DEFAULT_ZOOM_OPTIONS: [
|
|
365006
|
+
{
|
|
365007
|
+
label: "50%",
|
|
365008
|
+
value: 50
|
|
365009
|
+
},
|
|
365010
|
+
{
|
|
365011
|
+
label: "75%",
|
|
365012
|
+
value: 75
|
|
365013
|
+
},
|
|
365014
|
+
{
|
|
365015
|
+
label: "90%",
|
|
365016
|
+
value: 90
|
|
365017
|
+
},
|
|
365018
|
+
{
|
|
365019
|
+
label: "100%",
|
|
365020
|
+
value: 100
|
|
365021
|
+
},
|
|
365022
|
+
{
|
|
365023
|
+
label: "125%",
|
|
365024
|
+
value: 125
|
|
365025
|
+
},
|
|
365026
|
+
{
|
|
365027
|
+
label: "150%",
|
|
365028
|
+
value: 150
|
|
365029
|
+
},
|
|
365030
|
+
{
|
|
365031
|
+
label: "200%",
|
|
365032
|
+
value: 200
|
|
365033
|
+
}
|
|
365034
|
+
],
|
|
365035
|
+
DEFAULT_DOCUMENT_MODE_OPTIONS: [
|
|
365036
|
+
{
|
|
365037
|
+
label: "Editing",
|
|
365038
|
+
value: "editing",
|
|
365039
|
+
description: "Edit document directly"
|
|
365040
|
+
},
|
|
365041
|
+
{
|
|
365042
|
+
label: "Suggesting",
|
|
365043
|
+
value: "suggesting",
|
|
365044
|
+
description: "Edits become suggestions"
|
|
365045
|
+
},
|
|
365046
|
+
{
|
|
365047
|
+
label: "Viewing",
|
|
365048
|
+
value: "viewing",
|
|
365049
|
+
description: "View clean version of document only"
|
|
365050
|
+
}
|
|
365051
|
+
],
|
|
365052
|
+
DEFAULT_FONT_SIZE_OPTIONS: [
|
|
365053
|
+
{
|
|
365054
|
+
label: "8",
|
|
365055
|
+
value: "8pt"
|
|
365056
|
+
},
|
|
365057
|
+
{
|
|
365058
|
+
label: "9",
|
|
365059
|
+
value: "9pt"
|
|
365060
|
+
},
|
|
365061
|
+
{
|
|
365062
|
+
label: "10",
|
|
365063
|
+
value: "10pt"
|
|
365064
|
+
},
|
|
365065
|
+
{
|
|
365066
|
+
label: "11",
|
|
365067
|
+
value: "11pt"
|
|
365068
|
+
},
|
|
365069
|
+
{
|
|
365070
|
+
label: "12",
|
|
365071
|
+
value: "12pt"
|
|
365072
|
+
},
|
|
365073
|
+
{
|
|
365074
|
+
label: "14",
|
|
365075
|
+
value: "14pt"
|
|
365076
|
+
},
|
|
365077
|
+
{
|
|
365078
|
+
label: "18",
|
|
365079
|
+
value: "18pt"
|
|
365080
|
+
},
|
|
365081
|
+
{
|
|
365082
|
+
label: "24",
|
|
365083
|
+
value: "24pt"
|
|
365084
|
+
},
|
|
365085
|
+
{
|
|
365086
|
+
label: "30",
|
|
365087
|
+
value: "30pt"
|
|
365088
|
+
},
|
|
365089
|
+
{
|
|
365090
|
+
label: "36",
|
|
365091
|
+
value: "36pt"
|
|
365092
|
+
},
|
|
365093
|
+
{
|
|
365094
|
+
label: "48",
|
|
365095
|
+
value: "48pt"
|
|
365096
|
+
},
|
|
365097
|
+
{
|
|
365098
|
+
label: "60",
|
|
365099
|
+
value: "60pt"
|
|
365100
|
+
},
|
|
365101
|
+
{
|
|
365102
|
+
label: "72",
|
|
365103
|
+
value: "72pt"
|
|
365104
|
+
},
|
|
365105
|
+
{
|
|
365106
|
+
label: "96",
|
|
365107
|
+
value: "96pt"
|
|
365108
|
+
}
|
|
365109
|
+
],
|
|
365110
|
+
DEFAULT_FONT_FAMILY_OPTIONS: getDefaultFontFamilyOptions(),
|
|
365111
|
+
DEFAULT_TEXT_COLOR_OPTIONS: [
|
|
365112
|
+
{
|
|
365113
|
+
label: "Black",
|
|
365114
|
+
value: "#000000"
|
|
365115
|
+
},
|
|
365116
|
+
{
|
|
365117
|
+
label: "Dark Gray",
|
|
365118
|
+
value: "#434343"
|
|
365119
|
+
},
|
|
365120
|
+
{
|
|
365121
|
+
label: "Gray",
|
|
365122
|
+
value: "#666666"
|
|
365123
|
+
},
|
|
365124
|
+
{
|
|
365125
|
+
label: "Light Gray",
|
|
365126
|
+
value: "#999999"
|
|
365127
|
+
},
|
|
365128
|
+
{
|
|
365129
|
+
label: "Red",
|
|
365130
|
+
value: "#ff0000"
|
|
365131
|
+
},
|
|
365132
|
+
{
|
|
365133
|
+
label: "Orange",
|
|
365134
|
+
value: "#ff9900"
|
|
365135
|
+
},
|
|
365136
|
+
{
|
|
365137
|
+
label: "Yellow",
|
|
365138
|
+
value: "#ffff00"
|
|
365139
|
+
},
|
|
365140
|
+
{
|
|
365141
|
+
label: "Green",
|
|
365142
|
+
value: "#00ff00"
|
|
365143
|
+
},
|
|
365144
|
+
{
|
|
365145
|
+
label: "Cyan",
|
|
365146
|
+
value: "#00ffff"
|
|
365147
|
+
},
|
|
365148
|
+
{
|
|
365149
|
+
label: "Blue",
|
|
365150
|
+
value: "#0000ff"
|
|
365151
|
+
},
|
|
365152
|
+
{
|
|
365153
|
+
label: "Purple",
|
|
365154
|
+
value: "#9900ff"
|
|
365155
|
+
},
|
|
365156
|
+
{
|
|
365157
|
+
label: "Magenta",
|
|
365158
|
+
value: "#ff00ff"
|
|
365159
|
+
},
|
|
365160
|
+
{
|
|
365161
|
+
label: "None",
|
|
365162
|
+
value: "none"
|
|
365163
|
+
}
|
|
365164
|
+
],
|
|
365165
|
+
DEFAULT_HIGHLIGHT_COLOR_OPTIONS: [
|
|
365166
|
+
{
|
|
365167
|
+
label: "Yellow",
|
|
365168
|
+
value: "#ffff00"
|
|
365169
|
+
},
|
|
365170
|
+
{
|
|
365171
|
+
label: "Green",
|
|
365172
|
+
value: "#00ff00"
|
|
365173
|
+
},
|
|
365174
|
+
{
|
|
365175
|
+
label: "Cyan",
|
|
365176
|
+
value: "#00ffff"
|
|
365177
|
+
},
|
|
365178
|
+
{
|
|
365179
|
+
label: "Pink",
|
|
365180
|
+
value: "#ff00ff"
|
|
365181
|
+
},
|
|
365182
|
+
{
|
|
365183
|
+
label: "Blue",
|
|
365184
|
+
value: "#0000ff"
|
|
365185
|
+
},
|
|
365186
|
+
{
|
|
365187
|
+
label: "Red",
|
|
365188
|
+
value: "#ff0000"
|
|
365189
|
+
},
|
|
365190
|
+
{
|
|
365191
|
+
label: "Orange",
|
|
365192
|
+
value: "#ff9900"
|
|
365193
|
+
},
|
|
365194
|
+
{
|
|
365195
|
+
label: "None",
|
|
365196
|
+
value: "none"
|
|
365197
|
+
}
|
|
365198
|
+
]
|
|
365199
|
+
};
|
|
365200
|
+
MOD_ALIASES = new Set([
|
|
365201
|
+
"Mod",
|
|
365202
|
+
"Meta",
|
|
365203
|
+
"Cmd",
|
|
365204
|
+
"Command"
|
|
365205
|
+
]);
|
|
365206
|
+
ALT_ALIASES = new Set(["Alt", "Option"]);
|
|
365207
|
+
CTRL_ALIASES = new Set(["Control", "Ctrl"]);
|
|
365208
|
+
SHIFT_ALIASES = new Set(["Shift"]);
|
|
365209
|
+
BUILTIN_CONTEXT_MENU_GROUPS = [
|
|
365210
|
+
"format",
|
|
365211
|
+
"clipboard",
|
|
365212
|
+
"review",
|
|
365213
|
+
"comment",
|
|
365214
|
+
"link"
|
|
365215
|
+
];
|
|
365216
|
+
BUILTIN_GROUP_ORDER = new Map(BUILTIN_CONTEXT_MENU_GROUPS.map((g3, i4) => [g3, i4]));
|
|
365217
|
+
RESERVED_PROXY_PROPERTY_NAMES = new Set([
|
|
365218
|
+
"register",
|
|
365219
|
+
"get",
|
|
365220
|
+
"has",
|
|
365221
|
+
"require",
|
|
365222
|
+
"getContextMenuItems"
|
|
365223
|
+
]);
|
|
365224
|
+
ALL_TOOLBAR_COMMAND_IDS = Object.keys(createToolbarRegistry());
|
|
365225
|
+
EMPTY_ACTIVE_IDS = Object.freeze([]);
|
|
365226
|
+
});
|
|
365227
|
+
|
|
364994
365228
|
// ../../packages/superdoc/dist/chunks/ui-C5PAS9hY.es.js
|
|
364995
365229
|
var init_ui_C5PAS9hY_es = () => {};
|
|
364996
365230
|
|
|
@@ -365004,16 +365238,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
|
|
|
365004
365238
|
|
|
365005
365239
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
365006
365240
|
var init_super_editor_es = __esm(() => {
|
|
365007
|
-
|
|
365008
|
-
|
|
365241
|
+
init_src_x_i3LADL_es();
|
|
365242
|
+
init_SuperConverter_BVWG4qnQ_es();
|
|
365009
365243
|
init_jszip_C49i9kUs_es();
|
|
365010
365244
|
init_xml_js_CqGKpaft_es();
|
|
365011
|
-
|
|
365245
|
+
init_create_headless_toolbar_JvWvpCga_es();
|
|
365012
365246
|
init_constants_D9qj59G2_es();
|
|
365013
365247
|
init_dist_B8HfvhaK_es();
|
|
365014
365248
|
init_unified_Dsuw2be5_es();
|
|
365015
365249
|
init_DocxZipper_Bu2Fhqkw_es();
|
|
365016
|
-
|
|
365250
|
+
init_create_super_doc_ui_B66Edat2_es();
|
|
365017
365251
|
init_ui_C5PAS9hY_es();
|
|
365018
365252
|
init_eventemitter3_BnGqBE_Q_es();
|
|
365019
365253
|
init_errors_CNaD6vcg_es();
|