@taloswork/ose-shared 0.1.12 → 0.1.14

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.
Files changed (71) hide show
  1. package/package.json +3 -3
  2. package/skills/document/SKILL.md +33 -45
  3. package/skills/document/bin/deck-build.cjs +10482 -272
  4. package/skills/document/bin/deck-chart.cjs +21 -12
  5. package/skills/document/bin/deck-plan.cjs +11654 -42
  6. package/skills/document/bin/deck-qa.cjs +107 -23
  7. package/skills/document/bin/deck-scenario.cjs +20 -3
  8. package/skills/document/bin/deck-styles.cjs +1604 -0
  9. package/skills/document/bin/doc-convert.cjs +200 -260
  10. package/skills/document/bin/doc-fill.cjs +140 -19
  11. package/skills/document/bin/doc-gen.cjs +1909 -282
  12. package/skills/document/bin/doc-scan.cjs +6 -1
  13. package/skills/document/bin/doc-text.cjs +6 -1
  14. package/skills/document/bin/doc-validate.cjs +139 -54
  15. package/skills/document/bin/docx-defaults.cjs +9907 -0
  16. package/skills/document/bin/html2pptx.cjs +35960 -31973
  17. package/skills/document/bin/pdf-form.cjs +14 -1
  18. package/skills/document/bin/pdf-images.cjs +6 -1
  19. package/skills/document/bin/pdf-ops.cjs +14 -1
  20. package/skills/document/bin/pdf-render.cjs +6 -1
  21. package/skills/document/bin/pdf-tables.cjs +6 -1
  22. package/skills/document/bin/pptx-notes.cjs +10038 -0
  23. package/skills/document/bin/pptx-tokenize.cjs +19 -4
  24. package/skills/document/bin/template-skin.cjs +10915 -0
  25. package/skills/document/bin-reference.md +15 -10
  26. package/skills/document/catalog.json +33 -32
  27. package/skills/document/content-pipeline.md +79 -44
  28. package/skills/document/deck-design.md +55 -32
  29. package/skills/document/generated-visuals.md +99 -0
  30. package/skills/document/layouts/MAINTAINERS.md +33 -0
  31. package/skills/document/layouts/README.md +20 -20
  32. package/skills/document/layouts/big-stat.tpl +1 -1
  33. package/skills/document/layouts/capacity.json +1 -1
  34. package/skills/document/layouts/cards-3.tpl +1 -1
  35. package/skills/document/layouts/chart-full.tpl +1 -1
  36. package/skills/document/layouts/chart-kpi.tpl +1 -1
  37. package/skills/document/layouts/comparison.tpl +1 -1
  38. package/skills/document/layouts/data-table.tpl +1 -1
  39. package/skills/document/layouts/funnel.tpl +1 -1
  40. package/skills/document/layouts/gantt.tpl +1 -1
  41. package/skills/document/layouts/hub-flow.tpl +4 -0
  42. package/skills/document/layouts/icon-row.tpl +1 -1
  43. package/skills/document/layouts/image-grid.tpl +1 -1
  44. package/skills/document/layouts/matrix-2x2.tpl +1 -1
  45. package/skills/document/layouts/mock-qa.tpl +4 -0
  46. package/skills/document/layouts/profiles.json +2 -2
  47. package/skills/document/layouts/pyramid.tpl +1 -1
  48. package/skills/document/layouts/radar.tpl +1 -1
  49. package/skills/document/layouts/ring-progress.tpl +1 -1
  50. package/skills/document/layouts/slots.json +1 -1
  51. package/skills/document/layouts/steps-vertical.tpl +1 -1
  52. package/skills/document/layouts/steps.tpl +1 -1
  53. package/skills/document/layouts/three-kpi.tpl +1 -1
  54. package/skills/document/layouts/timeline.tpl +1 -1
  55. package/skills/document/layouts/toc-panel.tpl +1 -1
  56. package/skills/document/layouts/two-kpi.tpl +2 -2
  57. package/skills/document/layouts/versus.tpl +1 -1
  58. package/skills/document/packs/README.md +1 -1
  59. package/skills/document/pdf.md +13 -0
  60. package/skills/document/rewrite.md +23 -8
  61. package/skills/document/scenarios.json +19 -2
  62. package/skills/document/scenarios.schema.json +1 -0
  63. package/skills/document/styles/_backdrops/rimlight.html +3 -2
  64. package/skills/document/styles/_contract-defaults.css +6 -1
  65. package/skills/document/styles/_samples/_groups/biz-premium.webp +0 -0
  66. package/skills/document/styles/_samples/mckinsey.webp +0 -0
  67. package/skills/document/styles/mckinsey/backdrop.html +7 -5
  68. package/skills/grill-me/SKILL.md +6 -0
  69. package/skills/grill-me/agents/openai.yaml +5 -0
  70. package/skills/grilling/SKILL.md +28 -0
  71. package/skills/grilling/agents/openai.yaml +3 -0
@@ -4320,7 +4320,7 @@ var require_BufferList = __commonJS({
4320
4320
  this.head = this.tail = null;
4321
4321
  this.length = 0;
4322
4322
  };
4323
- BufferList.prototype.join = function join5(s) {
4323
+ BufferList.prototype.join = function join6(s) {
4324
4324
  if (this.length === 0) return "";
4325
4325
  var p = this.head;
4326
4326
  var ret2 = "" + p.data;
@@ -13795,9 +13795,9 @@ var require_load = __commonJS({
13795
13795
  var require_lib3 = __commonJS({
13796
13796
  "node_modules/jszip/lib/index.js"(exports2, module2) {
13797
13797
  "use strict";
13798
- function JSZip2() {
13799
- if (!(this instanceof JSZip2)) {
13800
- return new JSZip2();
13798
+ function JSZip4() {
13799
+ if (!(this instanceof JSZip4)) {
13800
+ return new JSZip4();
13801
13801
  }
13802
13802
  if (arguments.length) {
13803
13803
  throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
@@ -13806,7 +13806,7 @@ var require_lib3 = __commonJS({
13806
13806
  this.comment = null;
13807
13807
  this.root = "";
13808
13808
  this.clone = function() {
13809
- var newObj = new JSZip2();
13809
+ var newObj = new JSZip4();
13810
13810
  for (var i in this) {
13811
13811
  if (typeof this[i] !== "function") {
13812
13812
  newObj[i] = this[i];
@@ -13815,16 +13815,16 @@ var require_lib3 = __commonJS({
13815
13815
  return newObj;
13816
13816
  };
13817
13817
  }
13818
- JSZip2.prototype = require_object();
13819
- JSZip2.prototype.loadAsync = require_load();
13820
- JSZip2.support = require_support();
13821
- JSZip2.defaults = require_defaults();
13822
- JSZip2.version = "3.10.1";
13823
- JSZip2.loadAsync = function(content, options) {
13824
- return new JSZip2().loadAsync(content, options);
13818
+ JSZip4.prototype = require_object();
13819
+ JSZip4.prototype.loadAsync = require_load();
13820
+ JSZip4.support = require_support();
13821
+ JSZip4.defaults = require_defaults();
13822
+ JSZip4.version = "3.10.1";
13823
+ JSZip4.loadAsync = function(content, options) {
13824
+ return new JSZip4().loadAsync(content, options);
13825
13825
  };
13826
- JSZip2.external = require_external();
13827
- module2.exports = JSZip2;
13826
+ JSZip4.external = require_external();
13827
+ module2.exports = JSZip4;
13828
13828
  }
13829
13829
  });
13830
13830
 
@@ -13959,7 +13959,7 @@ var require_buffer_list2 = __commonJS({
13959
13959
  }
13960
13960
  }, {
13961
13961
  key: "join",
13962
- value: function join5(s) {
13962
+ value: function join6(s) {
13963
13963
  if (this.length === 0) return "";
13964
13964
  var p = this.head;
13965
13965
  var ret2 = "" + p.data;
@@ -16738,7 +16738,7 @@ var require_browser_buffer_encode = __commonJS({
16738
16738
  var require_zip_stream = __commonJS({
16739
16739
  "node_modules/exceljs/lib/utils/zip-stream.js"(exports2, module2) {
16740
16740
  var events = require("events");
16741
- var JSZip2 = require_lib3();
16741
+ var JSZip4 = require_lib3();
16742
16742
  var StreamBuf = require_stream_buf();
16743
16743
  var { stringToBuffer } = require_browser_buffer_encode();
16744
16744
  var ZipWriter = class extends events.EventEmitter {
@@ -16751,7 +16751,7 @@ var require_zip_stream = __commonJS({
16751
16751
  },
16752
16752
  options
16753
16753
  );
16754
- this.zip = new JSZip2();
16754
+ this.zip = new JSZip4();
16755
16755
  this.stream = new StreamBuf();
16756
16756
  }
16757
16757
  append(data, options) {
@@ -28431,7 +28431,7 @@ var require_theme1 = __commonJS({
28431
28431
  var require_xlsx = __commonJS({
28432
28432
  "node_modules/exceljs/lib/xlsx/xlsx.js"(exports2, module2) {
28433
28433
  var fs = require("fs");
28434
- var JSZip2 = require_lib3();
28434
+ var JSZip4 = require_lib3();
28435
28435
  var { PassThrough } = require_readable2();
28436
28436
  var ZipStream = require_zip_stream();
28437
28437
  var StreamBuf = require_stream_buf();
@@ -28670,7 +28670,7 @@ var require_xlsx = __commonJS({
28670
28670
  tables: {},
28671
28671
  vmlDrawings: {}
28672
28672
  };
28673
- const zip = await JSZip2.loadAsync(buffer);
28673
+ const zip = await JSZip4.loadAsync(buffer);
28674
28674
  for (const entry of Object.values(zip.files)) {
28675
28675
  if (!entry.dir) {
28676
28676
  let entryName = entry.name;
@@ -36902,8 +36902,8 @@ var require_graceful_fs = __commonJS({
36902
36902
  fs2.createReadStream = createReadStream;
36903
36903
  fs2.createWriteStream = createWriteStream;
36904
36904
  var fs$readFile = fs2.readFile;
36905
- fs2.readFile = readFile3;
36906
- function readFile3(path, options, cb) {
36905
+ fs2.readFile = readFile4;
36906
+ function readFile4(path, options, cb) {
36907
36907
  if (typeof options === "function")
36908
36908
  cb = options, options = null;
36909
36909
  return go$readFile(path, options, cb);
@@ -41204,7 +41204,7 @@ var require_buffer_list3 = __commonJS({
41204
41204
  }
41205
41205
  }, {
41206
41206
  key: "join",
41207
- value: function join5(s) {
41207
+ value: function join6(s) {
41208
41208
  if (this.length === 0) return "";
41209
41209
  var p = this.head;
41210
41210
  var ret2 = "" + p.data;
@@ -44570,7 +44570,7 @@ var require_buffer_list4 = __commonJS({
44570
44570
  }
44571
44571
  }, {
44572
44572
  key: "join",
44573
- value: function join5(s) {
44573
+ value: function join6(s) {
44574
44574
  if (this.length === 0) return "";
44575
44575
  var p = this.head;
44576
44576
  var ret2 = "" + p.data;
@@ -47366,7 +47366,7 @@ var require_buffer_list5 = __commonJS({
47366
47366
  }
47367
47367
  }, {
47368
47368
  key: "join",
47369
- value: function join5(s) {
47369
+ value: function join6(s) {
47370
47370
  if (this.length === 0) return "";
47371
47371
  var p = this.head;
47372
47372
  var ret2 = "" + p.data;
@@ -50236,7 +50236,7 @@ var require_buffer_list6 = __commonJS({
50236
50236
  }
50237
50237
  }, {
50238
50238
  key: "join",
50239
- value: function join5(s) {
50239
+ value: function join6(s) {
50240
50240
  if (this.length === 0) return "";
50241
50241
  var p = this.head;
50242
50242
  var ret2 = "" + p.data;
@@ -53025,7 +53025,7 @@ var require_buffer_list7 = __commonJS({
53025
53025
  }
53026
53026
  }, {
53027
53027
  key: "join",
53028
- value: function join5(s) {
53028
+ value: function join6(s) {
53029
53029
  if (this.length === 0) return "";
53030
53030
  var p = this.head;
53031
53031
  var ret2 = "" + p.data;
@@ -56015,7 +56015,7 @@ var require_buffer_list8 = __commonJS({
56015
56015
  }
56016
56016
  }, {
56017
56017
  key: "join",
56018
- value: function join5(s) {
56018
+ value: function join6(s) {
56019
56019
  if (this.length === 0) return "";
56020
56020
  var p = this.head;
56021
56021
  var ret2 = "" + p.data;
@@ -66273,7 +66273,7 @@ var require_BufferList3 = __commonJS({
66273
66273
  this.head = this.tail = null;
66274
66274
  this.length = 0;
66275
66275
  };
66276
- BufferList.prototype.join = function join5(s) {
66276
+ BufferList.prototype.join = function join6(s) {
66277
66277
  if (this.length === 0) return "";
66278
66278
  var p = this.head;
66279
66279
  var ret2 = "" + p.data;
@@ -73638,31 +73638,31 @@ var require_unicode = __commonJS({
73638
73638
  if (byteOrderMark)
73639
73639
  encoded.push(239, 187, 191);
73640
73640
  for (var idx = 0, len = input.length; idx < len; ) {
73641
- var codePoint = input.codePointAt(idx);
73642
- if (codePoint < 128) {
73643
- var byte1 = codePoint & 127;
73641
+ var codePoint2 = input.codePointAt(idx);
73642
+ if (codePoint2 < 128) {
73643
+ var byte1 = codePoint2 & 127;
73644
73644
  encoded.push(byte1);
73645
73645
  idx += 1;
73646
- } else if (codePoint < 2048) {
73647
- var byte1 = codePoint >> 6 & 31 | 192;
73648
- var byte2 = codePoint & 63 | 128;
73646
+ } else if (codePoint2 < 2048) {
73647
+ var byte1 = codePoint2 >> 6 & 31 | 192;
73648
+ var byte2 = codePoint2 & 63 | 128;
73649
73649
  encoded.push(byte1, byte2);
73650
73650
  idx += 1;
73651
- } else if (codePoint < 65536) {
73652
- var byte1 = codePoint >> 12 & 15 | 224;
73653
- var byte2 = codePoint >> 6 & 63 | 128;
73654
- var byte3 = codePoint & 63 | 128;
73651
+ } else if (codePoint2 < 65536) {
73652
+ var byte1 = codePoint2 >> 12 & 15 | 224;
73653
+ var byte2 = codePoint2 >> 6 & 63 | 128;
73654
+ var byte3 = codePoint2 & 63 | 128;
73655
73655
  encoded.push(byte1, byte2, byte3);
73656
73656
  idx += 1;
73657
- } else if (codePoint < 1114112) {
73658
- var byte1 = codePoint >> 18 & 7 | 240;
73659
- var byte2 = codePoint >> 12 & 63 | 128;
73660
- var byte3 = codePoint >> 6 & 63 | 128;
73661
- var byte4 = codePoint >> 0 & 63 | 128;
73657
+ } else if (codePoint2 < 1114112) {
73658
+ var byte1 = codePoint2 >> 18 & 7 | 240;
73659
+ var byte2 = codePoint2 >> 12 & 63 | 128;
73660
+ var byte3 = codePoint2 >> 6 & 63 | 128;
73661
+ var byte4 = codePoint2 >> 0 & 63 | 128;
73662
73662
  encoded.push(byte1, byte2, byte3, byte4);
73663
73663
  idx += 2;
73664
73664
  } else
73665
- throw new Error("Invalid code point: 0x" + strings_1.toHexString(codePoint));
73665
+ throw new Error("Invalid code point: 0x" + strings_1.toHexString(codePoint2));
73666
73666
  }
73667
73667
  return new Uint8Array(encoded);
73668
73668
  };
@@ -73674,29 +73674,29 @@ var require_unicode = __commonJS({
73674
73674
  if (byteOrderMark)
73675
73675
  encoded.push(65279);
73676
73676
  for (var idx = 0, len = input.length; idx < len; ) {
73677
- var codePoint = input.codePointAt(idx);
73678
- if (codePoint < 65536) {
73679
- encoded.push(codePoint);
73677
+ var codePoint2 = input.codePointAt(idx);
73678
+ if (codePoint2 < 65536) {
73679
+ encoded.push(codePoint2);
73680
73680
  idx += 1;
73681
- } else if (codePoint < 1114112) {
73682
- encoded.push(exports2.highSurrogate(codePoint), exports2.lowSurrogate(codePoint));
73681
+ } else if (codePoint2 < 1114112) {
73682
+ encoded.push(exports2.highSurrogate(codePoint2), exports2.lowSurrogate(codePoint2));
73683
73683
  idx += 2;
73684
73684
  } else
73685
- throw new Error("Invalid code point: 0x" + strings_1.toHexString(codePoint));
73685
+ throw new Error("Invalid code point: 0x" + strings_1.toHexString(codePoint2));
73686
73686
  }
73687
73687
  return new Uint16Array(encoded);
73688
73688
  };
73689
- exports2.isWithinBMP = function(codePoint) {
73690
- return codePoint >= 0 && codePoint <= 65535;
73689
+ exports2.isWithinBMP = function(codePoint2) {
73690
+ return codePoint2 >= 0 && codePoint2 <= 65535;
73691
73691
  };
73692
- exports2.hasSurrogates = function(codePoint) {
73693
- return codePoint >= 65536 && codePoint <= 1114111;
73692
+ exports2.hasSurrogates = function(codePoint2) {
73693
+ return codePoint2 >= 65536 && codePoint2 <= 1114111;
73694
73694
  };
73695
- exports2.highSurrogate = function(codePoint) {
73696
- return Math.floor((codePoint - 65536) / 1024) + 55296;
73695
+ exports2.highSurrogate = function(codePoint2) {
73696
+ return Math.floor((codePoint2 - 65536) / 1024) + 55296;
73697
73697
  };
73698
- exports2.lowSurrogate = function(codePoint) {
73699
- return (codePoint - 65536) % 1024 + 56320;
73698
+ exports2.lowSurrogate = function(codePoint2) {
73699
+ return (codePoint2 - 65536) % 1024 + 56320;
73700
73700
  };
73701
73701
  var ByteOrder;
73702
73702
  (function(ByteOrder2) {
@@ -73737,11 +73737,11 @@ var require_unicode = __commonJS({
73737
73737
  codePoints.push(REPLACEMENT);
73738
73738
  return String.fromCodePoint.apply(String, codePoints);
73739
73739
  };
73740
- var isHighSurrogate = function(codePoint) {
73741
- return codePoint >= 55296 && codePoint <= 56319;
73740
+ var isHighSurrogate = function(codePoint2) {
73741
+ return codePoint2 >= 55296 && codePoint2 <= 56319;
73742
73742
  };
73743
- var isLowSurrogate = function(codePoint) {
73744
- return codePoint >= 56320 && codePoint <= 57343;
73743
+ var isLowSurrogate = function(codePoint2) {
73744
+ return codePoint2 >= 56320 && codePoint2 <= 57343;
73745
73745
  };
73746
73746
  var decodeValues = function(first, second, byteOrder) {
73747
73747
  if (byteOrder === ByteOrder.LittleEndian)
@@ -74099,14 +74099,14 @@ var require_Encoding = __commonJS({
74099
74099
  /* @__PURE__ */ (function() {
74100
74100
  function Encoding2(name, unicodeMappings) {
74101
74101
  var _this = this;
74102
- this.canEncodeUnicodeCodePoint = function(codePoint) {
74103
- return codePoint in _this.unicodeMappings;
74102
+ this.canEncodeUnicodeCodePoint = function(codePoint2) {
74103
+ return codePoint2 in _this.unicodeMappings;
74104
74104
  };
74105
- this.encodeUnicodeCodePoint = function(codePoint) {
74106
- var mapped = _this.unicodeMappings[codePoint];
74105
+ this.encodeUnicodeCodePoint = function(codePoint2) {
74106
+ var mapped = _this.unicodeMappings[codePoint2];
74107
74107
  if (!mapped) {
74108
- var str = String.fromCharCode(codePoint);
74109
- var hexCode = "0x" + utils_1.padStart(codePoint.toString(16), 4, "0");
74108
+ var str = String.fromCharCode(codePoint2);
74109
+ var hexCode = "0x" + utils_1.padStart(codePoint2.toString(16), 4, "0");
74110
74110
  var msg = _this.name + ' cannot encode "' + str + '" (' + hexCode + ")";
74111
74111
  throw new Error(msg);
74112
74112
  }
@@ -77536,16 +77536,16 @@ var require_StandardFontEmbedder = __commonJS({
77536
77536
  var standard_fonts_1 = require_lib5();
77537
77537
  var PDFHexString_1 = tslib_1.__importDefault(require_PDFHexString());
77538
77538
  var utils_1 = require_utils5();
77539
- var StandardFontEmbedder = (
77539
+ var StandardFontEmbedder2 = (
77540
77540
  /** @class */
77541
77541
  (function() {
77542
- function StandardFontEmbedder2(fontName, customName) {
77542
+ function StandardFontEmbedder3(fontName, customName) {
77543
77543
  this.encoding = fontName === standard_fonts_1.FontNames.ZapfDingbats ? standard_fonts_1.Encodings.ZapfDingbats : fontName === standard_fonts_1.FontNames.Symbol ? standard_fonts_1.Encodings.Symbol : standard_fonts_1.Encodings.WinAnsi;
77544
77544
  this.font = standard_fonts_1.Font.load(fontName);
77545
77545
  this.fontName = this.font.FontName;
77546
77546
  this.customName = customName;
77547
77547
  }
77548
- StandardFontEmbedder2.prototype.encodeText = function(text) {
77548
+ StandardFontEmbedder3.prototype.encodeText = function(text) {
77549
77549
  var glyphs = this.encodeTextAsGlyphs(text);
77550
77550
  var hexCodes = new Array(glyphs.length);
77551
77551
  for (var idx = 0, len = glyphs.length; idx < len; idx++) {
@@ -77553,7 +77553,7 @@ var require_StandardFontEmbedder = __commonJS({
77553
77553
  }
77554
77554
  return PDFHexString_1.default.of(hexCodes.join(""));
77555
77555
  };
77556
- StandardFontEmbedder2.prototype.widthOfTextAtSize = function(text, size) {
77556
+ StandardFontEmbedder3.prototype.widthOfTextAtSize = function(text, size) {
77557
77557
  var glyphs = this.encodeTextAsGlyphs(text);
77558
77558
  var totalWidth = 0;
77559
77559
  for (var idx = 0, len = glyphs.length; idx < len; idx++) {
@@ -77565,7 +77565,7 @@ var require_StandardFontEmbedder = __commonJS({
77565
77565
  var scale = size / 1e3;
77566
77566
  return totalWidth * scale;
77567
77567
  };
77568
- StandardFontEmbedder2.prototype.heightOfFontAtSize = function(size, options) {
77568
+ StandardFontEmbedder3.prototype.heightOfFontAtSize = function(size, options) {
77569
77569
  if (options === void 0) {
77570
77570
  options = {};
77571
77571
  }
@@ -77578,13 +77578,13 @@ var require_StandardFontEmbedder = __commonJS({
77578
77578
  height += Descender || 0;
77579
77579
  return height / 1e3 * size;
77580
77580
  };
77581
- StandardFontEmbedder2.prototype.sizeOfFontAtHeight = function(height) {
77581
+ StandardFontEmbedder3.prototype.sizeOfFontAtHeight = function(height) {
77582
77582
  var _a = this.font, Ascender = _a.Ascender, Descender = _a.Descender, FontBBox = _a.FontBBox;
77583
77583
  var yTop = Ascender || FontBBox[3];
77584
77584
  var yBottom = Descender || FontBBox[1];
77585
77585
  return 1e3 * height / (yTop - yBottom);
77586
77586
  };
77587
- StandardFontEmbedder2.prototype.embedIntoContext = function(context, ref) {
77587
+ StandardFontEmbedder3.prototype.embedIntoContext = function(context, ref) {
77588
77588
  var fontDict = context.obj({
77589
77589
  Type: "Font",
77590
77590
  Subtype: "Type1",
@@ -77598,25 +77598,25 @@ var require_StandardFontEmbedder = __commonJS({
77598
77598
  return context.register(fontDict);
77599
77599
  }
77600
77600
  };
77601
- StandardFontEmbedder2.prototype.widthOfGlyph = function(glyphName) {
77601
+ StandardFontEmbedder3.prototype.widthOfGlyph = function(glyphName) {
77602
77602
  return this.font.getWidthOfGlyph(glyphName) || 250;
77603
77603
  };
77604
- StandardFontEmbedder2.prototype.encodeTextAsGlyphs = function(text) {
77604
+ StandardFontEmbedder3.prototype.encodeTextAsGlyphs = function(text) {
77605
77605
  var codePoints = Array.from(text);
77606
77606
  var glyphs = new Array(codePoints.length);
77607
77607
  for (var idx = 0, len = codePoints.length; idx < len; idx++) {
77608
- var codePoint = utils_1.toCodePoint(codePoints[idx]);
77609
- glyphs[idx] = this.encoding.encodeUnicodeCodePoint(codePoint);
77608
+ var codePoint2 = utils_1.toCodePoint(codePoints[idx]);
77609
+ glyphs[idx] = this.encoding.encodeUnicodeCodePoint(codePoint2);
77610
77610
  }
77611
77611
  return glyphs;
77612
77612
  };
77613
- StandardFontEmbedder2.for = function(fontName, customName) {
77614
- return new StandardFontEmbedder2(fontName, customName);
77613
+ StandardFontEmbedder3.for = function(fontName, customName) {
77614
+ return new StandardFontEmbedder3(fontName, customName);
77615
77615
  };
77616
- return StandardFontEmbedder2;
77616
+ return StandardFontEmbedder3;
77617
77617
  })()
77618
77618
  );
77619
- exports2.default = StandardFontEmbedder;
77619
+ exports2.default = StandardFontEmbedder2;
77620
77620
  }
77621
77621
  });
77622
77622
 
@@ -77640,8 +77640,8 @@ var require_CMap = __commonJS({
77640
77640
  };
77641
77641
  var fillCmapTemplate = function(bfChars) {
77642
77642
  return "/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange\n" + bfChars.length + " beginbfchar\n" + bfChars.map(function(_a) {
77643
- var glyphId = _a[0], codePoint = _a[1];
77644
- return glyphId + " " + codePoint;
77643
+ var glyphId = _a[0], codePoint2 = _a[1];
77644
+ return glyphId + " " + codePoint2;
77645
77645
  }).join("\n") + "\nendbfchar\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend";
77646
77646
  };
77647
77647
  var cmapHexFormat = function() {
@@ -77654,15 +77654,15 @@ var require_CMap = __commonJS({
77654
77654
  var cmapHexString = function(value) {
77655
77655
  return utils_1.toHexStringOfMinLength(value, 4);
77656
77656
  };
77657
- var cmapCodePointFormat = function(codePoint) {
77658
- if (unicode_1.isWithinBMP(codePoint))
77659
- return cmapHexString(codePoint);
77660
- if (unicode_1.hasSurrogates(codePoint)) {
77661
- var hs = unicode_1.highSurrogate(codePoint);
77662
- var ls = unicode_1.lowSurrogate(codePoint);
77657
+ var cmapCodePointFormat = function(codePoint2) {
77658
+ if (unicode_1.isWithinBMP(codePoint2))
77659
+ return cmapHexString(codePoint2);
77660
+ if (unicode_1.hasSurrogates(codePoint2)) {
77661
+ var hs = unicode_1.highSurrogate(codePoint2);
77662
+ var ls = unicode_1.lowSurrogate(codePoint2);
77663
77663
  return "" + cmapHexString(hs) + cmapHexString(ls);
77664
77664
  }
77665
- var hex = utils_1.toHexString(codePoint);
77665
+ var hex = utils_1.toHexString(codePoint2);
77666
77666
  var msg = "0x" + hex + " is not a valid UTF-8 or UTF-16 codepoint.";
77667
77667
  throw new Error(msg);
77668
77668
  };
@@ -77854,8 +77854,8 @@ var require_CustomFontEmbedder = __commonJS({
77854
77854
  this.allGlyphsInFontSortedById = function() {
77855
77855
  var glyphs = new Array(_this.font.characterSet.length);
77856
77856
  for (var idx = 0, len = glyphs.length; idx < len; idx++) {
77857
- var codePoint = _this.font.characterSet[idx];
77858
- glyphs[idx] = _this.font.glyphForCodePoint(codePoint);
77857
+ var codePoint2 = _this.font.characterSet[idx];
77858
+ glyphs[idx] = _this.font.glyphForCodePoint(codePoint2);
77859
77859
  }
77860
77860
  return utils_1.sortedUniq(glyphs.sort(utils_1.byAscendingId), function(g) {
77861
77861
  return g.id;
@@ -86129,20 +86129,20 @@ var require_errors11 = __commonJS({
86129
86129
  Object.defineProperty(exports2, "__esModule", { value: true });
86130
86130
  exports2.InvalidMaxLengthError = exports2.ExceededMaxLengthError = exports2.CombedTextLayoutError = exports2.RichTextFieldReadError = exports2.FieldExistsAsNonTerminalError = exports2.InvalidFieldNamePartError = exports2.FieldAlreadyExistsError = exports2.MissingOnValueCheckError = exports2.UnexpectedFieldTypeError = exports2.NoSuchFieldError = exports2.RemovePageFromEmptyDocumentError = exports2.ForeignPageError = exports2.FontkitNotRegisteredError = exports2.EncryptedPDFError = void 0;
86131
86131
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
86132
- var EncryptedPDFError = (
86132
+ var EncryptedPDFError2 = (
86133
86133
  /** @class */
86134
86134
  (function(_super) {
86135
- tslib_1.__extends(EncryptedPDFError2, _super);
86136
- function EncryptedPDFError2() {
86135
+ tslib_1.__extends(EncryptedPDFError3, _super);
86136
+ function EncryptedPDFError3() {
86137
86137
  var _this = this;
86138
86138
  var msg = "Input document to `PDFDocument.load` is encrypted. You can use `PDFDocument.load(..., { ignoreEncryption: true })` if you wish to load the document anyways.";
86139
86139
  _this = _super.call(this, msg) || this;
86140
86140
  return _this;
86141
86141
  }
86142
- return EncryptedPDFError2;
86142
+ return EncryptedPDFError3;
86143
86143
  })(Error)
86144
86144
  );
86145
- exports2.EncryptedPDFError = EncryptedPDFError;
86145
+ exports2.EncryptedPDFError = EncryptedPDFError2;
86146
86146
  var FontkitNotRegisteredError = (
86147
86147
  /** @class */
86148
86148
  (function(_super) {
@@ -88401,23 +88401,23 @@ var require_StandardFonts = __commonJS({
88401
88401
  "use strict";
88402
88402
  Object.defineProperty(exports2, "__esModule", { value: true });
88403
88403
  exports2.StandardFonts = void 0;
88404
- var StandardFonts;
88405
- (function(StandardFonts2) {
88406
- StandardFonts2["Courier"] = "Courier";
88407
- StandardFonts2["CourierBold"] = "Courier-Bold";
88408
- StandardFonts2["CourierOblique"] = "Courier-Oblique";
88409
- StandardFonts2["CourierBoldOblique"] = "Courier-BoldOblique";
88410
- StandardFonts2["Helvetica"] = "Helvetica";
88411
- StandardFonts2["HelveticaBold"] = "Helvetica-Bold";
88412
- StandardFonts2["HelveticaOblique"] = "Helvetica-Oblique";
88413
- StandardFonts2["HelveticaBoldOblique"] = "Helvetica-BoldOblique";
88414
- StandardFonts2["TimesRoman"] = "Times-Roman";
88415
- StandardFonts2["TimesRomanBold"] = "Times-Bold";
88416
- StandardFonts2["TimesRomanItalic"] = "Times-Italic";
88417
- StandardFonts2["TimesRomanBoldItalic"] = "Times-BoldItalic";
88418
- StandardFonts2["Symbol"] = "Symbol";
88419
- StandardFonts2["ZapfDingbats"] = "ZapfDingbats";
88420
- })(StandardFonts = exports2.StandardFonts || (exports2.StandardFonts = {}));
88404
+ var StandardFonts2;
88405
+ (function(StandardFonts3) {
88406
+ StandardFonts3["Courier"] = "Courier";
88407
+ StandardFonts3["CourierBold"] = "Courier-Bold";
88408
+ StandardFonts3["CourierOblique"] = "Courier-Oblique";
88409
+ StandardFonts3["CourierBoldOblique"] = "Courier-BoldOblique";
88410
+ StandardFonts3["Helvetica"] = "Helvetica";
88411
+ StandardFonts3["HelveticaBold"] = "Helvetica-Bold";
88412
+ StandardFonts3["HelveticaOblique"] = "Helvetica-Oblique";
88413
+ StandardFonts3["HelveticaBoldOblique"] = "Helvetica-BoldOblique";
88414
+ StandardFonts3["TimesRoman"] = "Times-Roman";
88415
+ StandardFonts3["TimesRomanBold"] = "Times-Bold";
88416
+ StandardFonts3["TimesRomanItalic"] = "Times-Italic";
88417
+ StandardFonts3["TimesRomanBoldItalic"] = "Times-BoldItalic";
88418
+ StandardFonts3["Symbol"] = "Symbol";
88419
+ StandardFonts3["ZapfDingbats"] = "ZapfDingbats";
88420
+ })(StandardFonts2 = exports2.StandardFonts || (exports2.StandardFonts = {}));
88421
88421
  }
88422
88422
  });
88423
88423
 
@@ -89071,10 +89071,10 @@ var require_PDFDocument = __commonJS({
89071
89071
  var PDFEmbeddedFile_1 = tslib_1.__importDefault(require_PDFEmbeddedFile());
89072
89072
  var PDFJavaScript_1 = tslib_1.__importDefault(require_PDFJavaScript());
89073
89073
  var JavaScriptEmbedder_1 = tslib_1.__importDefault(require_JavaScriptEmbedder());
89074
- var PDFDocument2 = (
89074
+ var PDFDocument3 = (
89075
89075
  /** @class */
89076
89076
  (function() {
89077
- function PDFDocument3(context, ignoreEncryption, updateMetadata) {
89077
+ function PDFDocument4(context, ignoreEncryption, updateMetadata) {
89078
89078
  var _this = this;
89079
89079
  this.defaultWordBreaks = [" "];
89080
89080
  this.computePages = function() {
@@ -89113,7 +89113,7 @@ var require_PDFDocument = __commonJS({
89113
89113
  if (updateMetadata)
89114
89114
  this.updateInfoDict();
89115
89115
  }
89116
- PDFDocument3.load = function(pdf, options) {
89116
+ PDFDocument4.load = function(pdf, options) {
89117
89117
  if (options === void 0) {
89118
89118
  options = {};
89119
89119
  }
@@ -89131,12 +89131,12 @@ var require_PDFDocument = __commonJS({
89131
89131
  return [4, core_1.PDFParser.forBytesWithOptions(bytes, parseSpeed, throwOnInvalidObject, capNumbers).parseDocument()];
89132
89132
  case 1:
89133
89133
  context = _f.sent();
89134
- return [2, new PDFDocument3(context, ignoreEncryption, updateMetadata)];
89134
+ return [2, new PDFDocument4(context, ignoreEncryption, updateMetadata)];
89135
89135
  }
89136
89136
  });
89137
89137
  });
89138
89138
  };
89139
- PDFDocument3.create = function(options) {
89139
+ PDFDocument4.create = function(options) {
89140
89140
  if (options === void 0) {
89141
89141
  options = {};
89142
89142
  }
@@ -89149,14 +89149,14 @@ var require_PDFDocument = __commonJS({
89149
89149
  pageTreeRef = context.register(pageTree);
89150
89150
  catalog = core_1.PDFCatalog.withContextAndPages(context, pageTreeRef);
89151
89151
  context.trailerInfo.Root = context.register(catalog);
89152
- return [2, new PDFDocument3(context, false, updateMetadata)];
89152
+ return [2, new PDFDocument4(context, false, updateMetadata)];
89153
89153
  });
89154
89154
  });
89155
89155
  };
89156
- PDFDocument3.prototype.registerFontkit = function(fontkit) {
89156
+ PDFDocument4.prototype.registerFontkit = function(fontkit) {
89157
89157
  this.fontkit = fontkit;
89158
89158
  };
89159
- PDFDocument3.prototype.getForm = function() {
89159
+ PDFDocument4.prototype.getForm = function() {
89160
89160
  var form = this.formCache.access();
89161
89161
  if (form.hasXFA()) {
89162
89162
  console.warn("Removing XFA form data as pdf-lib does not support reading or writing XFA");
@@ -89164,63 +89164,63 @@ var require_PDFDocument = __commonJS({
89164
89164
  }
89165
89165
  return form;
89166
89166
  };
89167
- PDFDocument3.prototype.getTitle = function() {
89167
+ PDFDocument4.prototype.getTitle = function() {
89168
89168
  var title = this.getInfoDict().lookup(core_1.PDFName.Title);
89169
89169
  if (!title)
89170
89170
  return void 0;
89171
89171
  assertIsLiteralOrHexString(title);
89172
89172
  return title.decodeText();
89173
89173
  };
89174
- PDFDocument3.prototype.getAuthor = function() {
89174
+ PDFDocument4.prototype.getAuthor = function() {
89175
89175
  var author = this.getInfoDict().lookup(core_1.PDFName.Author);
89176
89176
  if (!author)
89177
89177
  return void 0;
89178
89178
  assertIsLiteralOrHexString(author);
89179
89179
  return author.decodeText();
89180
89180
  };
89181
- PDFDocument3.prototype.getSubject = function() {
89181
+ PDFDocument4.prototype.getSubject = function() {
89182
89182
  var subject = this.getInfoDict().lookup(core_1.PDFName.Subject);
89183
89183
  if (!subject)
89184
89184
  return void 0;
89185
89185
  assertIsLiteralOrHexString(subject);
89186
89186
  return subject.decodeText();
89187
89187
  };
89188
- PDFDocument3.prototype.getKeywords = function() {
89188
+ PDFDocument4.prototype.getKeywords = function() {
89189
89189
  var keywords = this.getInfoDict().lookup(core_1.PDFName.Keywords);
89190
89190
  if (!keywords)
89191
89191
  return void 0;
89192
89192
  assertIsLiteralOrHexString(keywords);
89193
89193
  return keywords.decodeText();
89194
89194
  };
89195
- PDFDocument3.prototype.getCreator = function() {
89195
+ PDFDocument4.prototype.getCreator = function() {
89196
89196
  var creator = this.getInfoDict().lookup(core_1.PDFName.Creator);
89197
89197
  if (!creator)
89198
89198
  return void 0;
89199
89199
  assertIsLiteralOrHexString(creator);
89200
89200
  return creator.decodeText();
89201
89201
  };
89202
- PDFDocument3.prototype.getProducer = function() {
89202
+ PDFDocument4.prototype.getProducer = function() {
89203
89203
  var producer = this.getInfoDict().lookup(core_1.PDFName.Producer);
89204
89204
  if (!producer)
89205
89205
  return void 0;
89206
89206
  assertIsLiteralOrHexString(producer);
89207
89207
  return producer.decodeText();
89208
89208
  };
89209
- PDFDocument3.prototype.getCreationDate = function() {
89209
+ PDFDocument4.prototype.getCreationDate = function() {
89210
89210
  var creationDate = this.getInfoDict().lookup(core_1.PDFName.CreationDate);
89211
89211
  if (!creationDate)
89212
89212
  return void 0;
89213
89213
  assertIsLiteralOrHexString(creationDate);
89214
89214
  return creationDate.decodeDate();
89215
89215
  };
89216
- PDFDocument3.prototype.getModificationDate = function() {
89216
+ PDFDocument4.prototype.getModificationDate = function() {
89217
89217
  var modificationDate = this.getInfoDict().lookup(core_1.PDFName.ModDate);
89218
89218
  if (!modificationDate)
89219
89219
  return void 0;
89220
89220
  assertIsLiteralOrHexString(modificationDate);
89221
89221
  return modificationDate.decodeDate();
89222
89222
  };
89223
- PDFDocument3.prototype.setTitle = function(title, options) {
89223
+ PDFDocument4.prototype.setTitle = function(title, options) {
89224
89224
  utils_1.assertIs(title, "title", ["string"]);
89225
89225
  var key = core_1.PDFName.of("Title");
89226
89226
  this.getInfoDict().set(key, core_1.PDFHexString.fromText(title));
@@ -89229,63 +89229,63 @@ var require_PDFDocument = __commonJS({
89229
89229
  prefs.setDisplayDocTitle(true);
89230
89230
  }
89231
89231
  };
89232
- PDFDocument3.prototype.setAuthor = function(author) {
89232
+ PDFDocument4.prototype.setAuthor = function(author) {
89233
89233
  utils_1.assertIs(author, "author", ["string"]);
89234
89234
  var key = core_1.PDFName.of("Author");
89235
89235
  this.getInfoDict().set(key, core_1.PDFHexString.fromText(author));
89236
89236
  };
89237
- PDFDocument3.prototype.setSubject = function(subject) {
89237
+ PDFDocument4.prototype.setSubject = function(subject) {
89238
89238
  utils_1.assertIs(subject, "author", ["string"]);
89239
89239
  var key = core_1.PDFName.of("Subject");
89240
89240
  this.getInfoDict().set(key, core_1.PDFHexString.fromText(subject));
89241
89241
  };
89242
- PDFDocument3.prototype.setKeywords = function(keywords) {
89242
+ PDFDocument4.prototype.setKeywords = function(keywords) {
89243
89243
  utils_1.assertIs(keywords, "keywords", [Array]);
89244
89244
  var key = core_1.PDFName.of("Keywords");
89245
89245
  this.getInfoDict().set(key, core_1.PDFHexString.fromText(keywords.join(" ")));
89246
89246
  };
89247
- PDFDocument3.prototype.setCreator = function(creator) {
89247
+ PDFDocument4.prototype.setCreator = function(creator) {
89248
89248
  utils_1.assertIs(creator, "creator", ["string"]);
89249
89249
  var key = core_1.PDFName.of("Creator");
89250
89250
  this.getInfoDict().set(key, core_1.PDFHexString.fromText(creator));
89251
89251
  };
89252
- PDFDocument3.prototype.setProducer = function(producer) {
89252
+ PDFDocument4.prototype.setProducer = function(producer) {
89253
89253
  utils_1.assertIs(producer, "creator", ["string"]);
89254
89254
  var key = core_1.PDFName.of("Producer");
89255
89255
  this.getInfoDict().set(key, core_1.PDFHexString.fromText(producer));
89256
89256
  };
89257
- PDFDocument3.prototype.setLanguage = function(language) {
89257
+ PDFDocument4.prototype.setLanguage = function(language) {
89258
89258
  utils_1.assertIs(language, "language", ["string"]);
89259
89259
  var key = core_1.PDFName.of("Lang");
89260
89260
  this.catalog.set(key, core_1.PDFString.of(language));
89261
89261
  };
89262
- PDFDocument3.prototype.setCreationDate = function(creationDate) {
89262
+ PDFDocument4.prototype.setCreationDate = function(creationDate) {
89263
89263
  utils_1.assertIs(creationDate, "creationDate", [[Date, "Date"]]);
89264
89264
  var key = core_1.PDFName.of("CreationDate");
89265
89265
  this.getInfoDict().set(key, core_1.PDFString.fromDate(creationDate));
89266
89266
  };
89267
- PDFDocument3.prototype.setModificationDate = function(modificationDate) {
89267
+ PDFDocument4.prototype.setModificationDate = function(modificationDate) {
89268
89268
  utils_1.assertIs(modificationDate, "modificationDate", [[Date, "Date"]]);
89269
89269
  var key = core_1.PDFName.of("ModDate");
89270
89270
  this.getInfoDict().set(key, core_1.PDFString.fromDate(modificationDate));
89271
89271
  };
89272
- PDFDocument3.prototype.getPageCount = function() {
89272
+ PDFDocument4.prototype.getPageCount = function() {
89273
89273
  if (this.pageCount === void 0)
89274
89274
  this.pageCount = this.getPages().length;
89275
89275
  return this.pageCount;
89276
89276
  };
89277
- PDFDocument3.prototype.getPages = function() {
89277
+ PDFDocument4.prototype.getPages = function() {
89278
89278
  return this.pageCache.access();
89279
89279
  };
89280
- PDFDocument3.prototype.getPage = function(index) {
89280
+ PDFDocument4.prototype.getPage = function(index) {
89281
89281
  var pages = this.getPages();
89282
89282
  utils_1.assertRange(index, "index", 0, pages.length - 1);
89283
89283
  return pages[index];
89284
89284
  };
89285
- PDFDocument3.prototype.getPageIndices = function() {
89285
+ PDFDocument4.prototype.getPageIndices = function() {
89286
89286
  return utils_1.range(0, this.getPageCount());
89287
89287
  };
89288
- PDFDocument3.prototype.removePage = function(index) {
89288
+ PDFDocument4.prototype.removePage = function(index) {
89289
89289
  var pageCount = this.getPageCount();
89290
89290
  if (this.pageCount === 0)
89291
89291
  throw new errors_1.RemovePageFromEmptyDocumentError();
@@ -89293,11 +89293,11 @@ var require_PDFDocument = __commonJS({
89293
89293
  this.catalog.removeLeafNode(index);
89294
89294
  this.pageCount = pageCount - 1;
89295
89295
  };
89296
- PDFDocument3.prototype.addPage = function(page) {
89296
+ PDFDocument4.prototype.addPage = function(page) {
89297
89297
  utils_1.assertIs(page, "page", ["undefined", [PDFPage_1.default, "PDFPage"], Array]);
89298
89298
  return this.insertPage(this.getPageCount(), page);
89299
89299
  };
89300
- PDFDocument3.prototype.insertPage = function(index, page) {
89300
+ PDFDocument4.prototype.insertPage = function(index, page) {
89301
89301
  var pageCount = this.getPageCount();
89302
89302
  utils_1.assertRange(index, "index", 0, pageCount);
89303
89303
  utils_1.assertIs(page, "page", ["undefined", [PDFPage_1.default, "PDFPage"], Array]);
@@ -89315,13 +89315,13 @@ var require_PDFDocument = __commonJS({
89315
89315
  this.pageCount = pageCount + 1;
89316
89316
  return page;
89317
89317
  };
89318
- PDFDocument3.prototype.copyPages = function(srcDoc, indices) {
89318
+ PDFDocument4.prototype.copyPages = function(srcDoc, indices) {
89319
89319
  return tslib_1.__awaiter(this, void 0, void 0, function() {
89320
89320
  var copier, srcPages, copiedPages, idx, len, srcPage, copiedPage, ref;
89321
89321
  return tslib_1.__generator(this, function(_a) {
89322
89322
  switch (_a.label) {
89323
89323
  case 0:
89324
- utils_1.assertIs(srcDoc, "srcDoc", [[PDFDocument3, "PDFDocument"]]);
89324
+ utils_1.assertIs(srcDoc, "srcDoc", [[PDFDocument4, "PDFDocument"]]);
89325
89325
  utils_1.assertIs(indices, "indices", [Array]);
89326
89326
  return [4, srcDoc.flush()];
89327
89327
  case 1:
@@ -89340,13 +89340,13 @@ var require_PDFDocument = __commonJS({
89340
89340
  });
89341
89341
  });
89342
89342
  };
89343
- PDFDocument3.prototype.copy = function() {
89343
+ PDFDocument4.prototype.copy = function() {
89344
89344
  return tslib_1.__awaiter(this, void 0, void 0, function() {
89345
89345
  var pdfCopy, contentPages, idx, len;
89346
89346
  return tslib_1.__generator(this, function(_a) {
89347
89347
  switch (_a.label) {
89348
89348
  case 0:
89349
- return [4, PDFDocument3.create()];
89349
+ return [4, PDFDocument4.create()];
89350
89350
  case 1:
89351
89351
  pdfCopy = _a.sent();
89352
89352
  return [4, pdfCopy.copyPages(this, this.getPageIndices())];
@@ -89382,7 +89382,7 @@ var require_PDFDocument = __commonJS({
89382
89382
  });
89383
89383
  });
89384
89384
  };
89385
- PDFDocument3.prototype.addJavaScript = function(name, script) {
89385
+ PDFDocument4.prototype.addJavaScript = function(name, script) {
89386
89386
  utils_1.assertIs(name, "name", ["string"]);
89387
89387
  utils_1.assertIs(script, "script", ["string"]);
89388
89388
  var embedder = JavaScriptEmbedder_1.default.for(script, name);
@@ -89390,7 +89390,7 @@ var require_PDFDocument = __commonJS({
89390
89390
  var javaScript = PDFJavaScript_1.default.of(ref, this, embedder);
89391
89391
  this.javaScripts.push(javaScript);
89392
89392
  };
89393
- PDFDocument3.prototype.attach = function(attachment, name, options) {
89393
+ PDFDocument4.prototype.attach = function(attachment, name, options) {
89394
89394
  if (options === void 0) {
89395
89395
  options = {};
89396
89396
  }
@@ -89418,7 +89418,7 @@ var require_PDFDocument = __commonJS({
89418
89418
  });
89419
89419
  });
89420
89420
  };
89421
- PDFDocument3.prototype.embedFont = function(font, options) {
89421
+ PDFDocument4.prototype.embedFont = function(font, options) {
89422
89422
  if (options === void 0) {
89423
89423
  options = {};
89424
89424
  }
@@ -89461,7 +89461,7 @@ var require_PDFDocument = __commonJS({
89461
89461
  });
89462
89462
  });
89463
89463
  };
89464
- PDFDocument3.prototype.embedStandardFont = function(font, customName) {
89464
+ PDFDocument4.prototype.embedStandardFont = function(font, customName) {
89465
89465
  utils_1.assertIs(font, "font", ["string"]);
89466
89466
  if (!utils_1.isStandardFont(font)) {
89467
89467
  throw new TypeError("`font` must be one of type `StandardFonts`");
@@ -89472,7 +89472,7 @@ var require_PDFDocument = __commonJS({
89472
89472
  this.fonts.push(pdfFont);
89473
89473
  return pdfFont;
89474
89474
  };
89475
- PDFDocument3.prototype.embedJpg = function(jpg) {
89475
+ PDFDocument4.prototype.embedJpg = function(jpg) {
89476
89476
  return tslib_1.__awaiter(this, void 0, void 0, function() {
89477
89477
  var bytes, embedder, ref, pdfImage;
89478
89478
  return tslib_1.__generator(this, function(_a) {
@@ -89491,7 +89491,7 @@ var require_PDFDocument = __commonJS({
89491
89491
  });
89492
89492
  });
89493
89493
  };
89494
- PDFDocument3.prototype.embedPng = function(png) {
89494
+ PDFDocument4.prototype.embedPng = function(png) {
89495
89495
  return tslib_1.__awaiter(this, void 0, void 0, function() {
89496
89496
  var bytes, embedder, ref, pdfImage;
89497
89497
  return tslib_1.__generator(this, function(_a) {
@@ -89510,7 +89510,7 @@ var require_PDFDocument = __commonJS({
89510
89510
  });
89511
89511
  });
89512
89512
  };
89513
- PDFDocument3.prototype.embedPdf = function(pdf, indices) {
89513
+ PDFDocument4.prototype.embedPdf = function(pdf, indices) {
89514
89514
  if (indices === void 0) {
89515
89515
  indices = [0];
89516
89516
  }
@@ -89523,14 +89523,14 @@ var require_PDFDocument = __commonJS({
89523
89523
  "string",
89524
89524
  Uint8Array,
89525
89525
  ArrayBuffer,
89526
- [PDFDocument3, "PDFDocument"]
89526
+ [PDFDocument4, "PDFDocument"]
89527
89527
  ]);
89528
89528
  utils_1.assertIs(indices, "indices", [Array]);
89529
- if (!(pdf instanceof PDFDocument3)) return [3, 1];
89529
+ if (!(pdf instanceof PDFDocument4)) return [3, 1];
89530
89530
  _a = pdf;
89531
89531
  return [3, 3];
89532
89532
  case 1:
89533
- return [4, PDFDocument3.load(pdf)];
89533
+ return [4, PDFDocument4.load(pdf)];
89534
89534
  case 2:
89535
89535
  _a = _b.sent();
89536
89536
  _b.label = 3;
@@ -89542,7 +89542,7 @@ var require_PDFDocument = __commonJS({
89542
89542
  });
89543
89543
  });
89544
89544
  };
89545
- PDFDocument3.prototype.embedPage = function(page, boundingBox, transformationMatrix) {
89545
+ PDFDocument4.prototype.embedPage = function(page, boundingBox, transformationMatrix) {
89546
89546
  return tslib_1.__awaiter(this, void 0, void 0, function() {
89547
89547
  var embeddedPage;
89548
89548
  return tslib_1.__generator(this, function(_a) {
@@ -89557,7 +89557,7 @@ var require_PDFDocument = __commonJS({
89557
89557
  });
89558
89558
  });
89559
89559
  };
89560
- PDFDocument3.prototype.embedPages = function(pages, boundingBoxes, transformationMatrices) {
89560
+ PDFDocument4.prototype.embedPages = function(pages, boundingBoxes, transformationMatrices) {
89561
89561
  if (boundingBoxes === void 0) {
89562
89562
  boundingBoxes = [];
89563
89563
  }
@@ -89607,7 +89607,7 @@ var require_PDFDocument = __commonJS({
89607
89607
  });
89608
89608
  });
89609
89609
  };
89610
- PDFDocument3.prototype.flush = function() {
89610
+ PDFDocument4.prototype.flush = function() {
89611
89611
  return tslib_1.__awaiter(this, void 0, void 0, function() {
89612
89612
  return tslib_1.__generator(this, function(_a) {
89613
89613
  switch (_a.label) {
@@ -89635,7 +89635,7 @@ var require_PDFDocument = __commonJS({
89635
89635
  });
89636
89636
  });
89637
89637
  };
89638
- PDFDocument3.prototype.save = function(options) {
89638
+ PDFDocument4.prototype.save = function(options) {
89639
89639
  if (options === void 0) {
89640
89640
  options = {};
89641
89641
  }
@@ -89665,7 +89665,7 @@ var require_PDFDocument = __commonJS({
89665
89665
  });
89666
89666
  });
89667
89667
  };
89668
- PDFDocument3.prototype.saveAsBase64 = function(options) {
89668
+ PDFDocument4.prototype.saveAsBase64 = function(options) {
89669
89669
  if (options === void 0) {
89670
89670
  options = {};
89671
89671
  }
@@ -89685,7 +89685,7 @@ var require_PDFDocument = __commonJS({
89685
89685
  });
89686
89686
  });
89687
89687
  };
89688
- PDFDocument3.prototype.findPageForAnnotationRef = function(ref) {
89688
+ PDFDocument4.prototype.findPageForAnnotationRef = function(ref) {
89689
89689
  var pages = this.getPages();
89690
89690
  for (var idx = 0, len = pages.length; idx < len; idx++) {
89691
89691
  var page = pages[idx];
@@ -89696,7 +89696,7 @@ var require_PDFDocument = __commonJS({
89696
89696
  }
89697
89697
  return void 0;
89698
89698
  };
89699
- PDFDocument3.prototype.embedAll = function(embeddables) {
89699
+ PDFDocument4.prototype.embedAll = function(embeddables) {
89700
89700
  return tslib_1.__awaiter(this, void 0, void 0, function() {
89701
89701
  var idx, len;
89702
89702
  return tslib_1.__generator(this, function(_a) {
@@ -89722,7 +89722,7 @@ var require_PDFDocument = __commonJS({
89722
89722
  });
89723
89723
  });
89724
89724
  };
89725
- PDFDocument3.prototype.updateInfoDict = function() {
89725
+ PDFDocument4.prototype.updateInfoDict = function() {
89726
89726
  var pdfLib = "pdf-lib (https://github.com/Hopding/pdf-lib)";
89727
89727
  var now = /* @__PURE__ */ new Date();
89728
89728
  var info = this.getInfoDict();
@@ -89733,7 +89733,7 @@ var require_PDFDocument = __commonJS({
89733
89733
  if (!info.get(core_1.PDFName.of("CreationDate")))
89734
89734
  this.setCreationDate(now);
89735
89735
  };
89736
- PDFDocument3.prototype.getInfoDict = function() {
89736
+ PDFDocument4.prototype.getInfoDict = function() {
89737
89737
  var existingInfo = this.context.lookup(this.context.trailerInfo.Info);
89738
89738
  if (existingInfo instanceof core_1.PDFDict)
89739
89739
  return existingInfo;
@@ -89741,15 +89741,15 @@ var require_PDFDocument = __commonJS({
89741
89741
  this.context.trailerInfo.Info = this.context.register(newInfo);
89742
89742
  return newInfo;
89743
89743
  };
89744
- PDFDocument3.prototype.assertFontkit = function() {
89744
+ PDFDocument4.prototype.assertFontkit = function() {
89745
89745
  if (!this.fontkit)
89746
89746
  throw new errors_1.FontkitNotRegisteredError();
89747
89747
  return this.fontkit;
89748
89748
  };
89749
- return PDFDocument3;
89749
+ return PDFDocument4;
89750
89750
  })()
89751
89751
  );
89752
- exports2.default = PDFDocument2;
89752
+ exports2.default = PDFDocument3;
89753
89753
  function assertIsLiteralOrHexString(pdfObject) {
89754
89754
  if (!(pdfObject instanceof core_1.PDFHexString) && !(pdfObject instanceof core_1.PDFString)) {
89755
89755
  throw new core_1.UnexpectedObjectTypeError([core_1.PDFHexString, core_1.PDFString], pdfObject);
@@ -90688,11 +90688,12 @@ var require_cjs = __commonJS({
90688
90688
  });
90689
90689
 
90690
90690
  // packages/core/dist/document/pdf-encrypted.js
90691
- var ENCRYPTED_PDF_MESSAGE, PdfEncryptedError;
90691
+ var ENCRYPTED_PDF_MESSAGE, OWNER_ONLY_PDF_MESSAGE, PdfEncryptedError;
90692
90692
  var init_pdf_encrypted = __esm({
90693
90693
  "packages/core/dist/document/pdf-encrypted.js"() {
90694
90694
  "use strict";
90695
90695
  ENCRYPTED_PDF_MESSAGE = "PDF is password-protected (encrypted); decrypt first: pdf-ops decrypt <in> <password> <out>";
90696
+ OWNER_ONLY_PDF_MESSAGE = 'PDF is encrypted with an owner password only (it opens without a password, but cannot be edited encrypted); remove the encryption first: pdf-ops decrypt <in> "" <out>';
90696
90697
  PdfEncryptedError = class extends Error {
90697
90698
  constructor() {
90698
90699
  super(ENCRYPTED_PDF_MESSAGE);
@@ -90714,6 +90715,7 @@ __export(pdf_extract_exports, {
90714
90715
  extractPdfText: () => extractPdfText,
90715
90716
  extractPdfTextLines: () => extractPdfTextLines,
90716
90717
  pdfNeedsPassword: () => pdfNeedsPassword,
90718
+ pngPixels: () => pngPixels,
90717
90719
  renderPdfPages: () => renderPdfPages,
90718
90720
  scanPdfSignals: () => scanPdfSignals,
90719
90721
  textMathHint: () => textMathHint,
@@ -90723,7 +90725,12 @@ function loadMupdf() {
90723
90725
  if (!_mupdf) {
90724
90726
  const deps = process.env.TALOS_SKILL_DEPS;
90725
90727
  const spec = deps ? (0, import_node_url.pathToFileURL)((0, import_node_path.join)(deps, "mupdf", "dist", "mupdf.js")).href : "mupdf";
90726
- _mupdf = import(spec);
90728
+ const loading = import(spec);
90729
+ _mupdf = loading;
90730
+ loading.catch(() => {
90731
+ if (_mupdf === loading)
90732
+ _mupdf = null;
90733
+ });
90727
90734
  }
90728
90735
  return _mupdf;
90729
90736
  }
@@ -91007,6 +91014,13 @@ async function renderPdfPages(bytes, pages, scale = 2, maxEdge) {
91007
91014
  }
91008
91015
  return out;
91009
91016
  }
91017
+ async function pngPixels(png) {
91018
+ const mupdf = await loadMupdf();
91019
+ const pix = new mupdf.Image(png).toPixmap();
91020
+ const width = pix.getWidth(), height = pix.getHeight();
91021
+ const channels = pix.getStride() / width;
91022
+ return { width, height, channels, data: pix.getPixels() };
91023
+ }
91010
91024
  async function extractPdfImages(bytes, pages) {
91011
91025
  const { doc } = await openDoc(bytes);
91012
91026
  const total = doc.countPages();
@@ -91075,7 +91089,7 @@ var init_pdf_extract = __esm({
91075
91089
  });
91076
91090
 
91077
91091
  // apps/admin/data/skills.lib/document/bin-src/doc-gen.mjs
91078
- var import_promises2 = require("node:fs/promises");
91092
+ var import_promises3 = require("node:fs/promises");
91079
91093
 
91080
91094
  // node_modules/docx/dist/index.mjs
91081
91095
  var __create2 = Object.create;
@@ -92482,19 +92496,19 @@ var require_buffer = /* @__PURE__ */ __commonJSMin(((exports2) => {
92482
92496
  var i = start;
92483
92497
  while (i < end) {
92484
92498
  var firstByte = buf[i];
92485
- var codePoint = null;
92499
+ var codePoint2 = null;
92486
92500
  var bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
92487
92501
  if (i + bytesPerSequence <= end) {
92488
92502
  var secondByte, thirdByte, fourthByte, tempCodePoint;
92489
92503
  switch (bytesPerSequence) {
92490
92504
  case 1:
92491
- if (firstByte < 128) codePoint = firstByte;
92505
+ if (firstByte < 128) codePoint2 = firstByte;
92492
92506
  break;
92493
92507
  case 2:
92494
92508
  secondByte = buf[i + 1];
92495
92509
  if ((secondByte & 192) === 128) {
92496
92510
  tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
92497
- if (tempCodePoint > 127) codePoint = tempCodePoint;
92511
+ if (tempCodePoint > 127) codePoint2 = tempCodePoint;
92498
92512
  }
92499
92513
  break;
92500
92514
  case 3:
@@ -92502,7 +92516,7 @@ var require_buffer = /* @__PURE__ */ __commonJSMin(((exports2) => {
92502
92516
  thirdByte = buf[i + 2];
92503
92517
  if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
92504
92518
  tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
92505
- if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) codePoint = tempCodePoint;
92519
+ if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) codePoint2 = tempCodePoint;
92506
92520
  }
92507
92521
  break;
92508
92522
  case 4:
@@ -92511,19 +92525,19 @@ var require_buffer = /* @__PURE__ */ __commonJSMin(((exports2) => {
92511
92525
  fourthByte = buf[i + 3];
92512
92526
  if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
92513
92527
  tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
92514
- if (tempCodePoint > 65535 && tempCodePoint < 1114112) codePoint = tempCodePoint;
92528
+ if (tempCodePoint > 65535 && tempCodePoint < 1114112) codePoint2 = tempCodePoint;
92515
92529
  }
92516
92530
  }
92517
92531
  }
92518
- if (codePoint === null) {
92519
- codePoint = 65533;
92532
+ if (codePoint2 === null) {
92533
+ codePoint2 = 65533;
92520
92534
  bytesPerSequence = 1;
92521
- } else if (codePoint > 65535) {
92522
- codePoint -= 65536;
92523
- res.push(codePoint >>> 10 & 1023 | 55296);
92524
- codePoint = 56320 | codePoint & 1023;
92535
+ } else if (codePoint2 > 65535) {
92536
+ codePoint2 -= 65536;
92537
+ res.push(codePoint2 >>> 10 & 1023 | 55296);
92538
+ codePoint2 = 56320 | codePoint2 & 1023;
92525
92539
  }
92526
- res.push(codePoint);
92540
+ res.push(codePoint2);
92527
92541
  i += bytesPerSequence;
92528
92542
  }
92529
92543
  return decodeCodePointsArray(res);
@@ -92947,46 +92961,46 @@ var require_buffer = /* @__PURE__ */ __commonJSMin(((exports2) => {
92947
92961
  }
92948
92962
  function utf8ToBytes(string, units) {
92949
92963
  units = units || Infinity;
92950
- var codePoint;
92964
+ var codePoint2;
92951
92965
  var length = string.length;
92952
92966
  var leadSurrogate = null;
92953
92967
  var bytes = [];
92954
92968
  for (var i = 0; i < length; ++i) {
92955
- codePoint = string.charCodeAt(i);
92956
- if (codePoint > 55295 && codePoint < 57344) {
92969
+ codePoint2 = string.charCodeAt(i);
92970
+ if (codePoint2 > 55295 && codePoint2 < 57344) {
92957
92971
  if (!leadSurrogate) {
92958
- if (codePoint > 56319) {
92972
+ if (codePoint2 > 56319) {
92959
92973
  if ((units -= 3) > -1) bytes.push(239, 191, 189);
92960
92974
  continue;
92961
92975
  } else if (i + 1 === length) {
92962
92976
  if ((units -= 3) > -1) bytes.push(239, 191, 189);
92963
92977
  continue;
92964
92978
  }
92965
- leadSurrogate = codePoint;
92979
+ leadSurrogate = codePoint2;
92966
92980
  continue;
92967
92981
  }
92968
- if (codePoint < 56320) {
92982
+ if (codePoint2 < 56320) {
92969
92983
  if ((units -= 3) > -1) bytes.push(239, 191, 189);
92970
- leadSurrogate = codePoint;
92984
+ leadSurrogate = codePoint2;
92971
92985
  continue;
92972
92986
  }
92973
- codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;
92987
+ codePoint2 = (leadSurrogate - 55296 << 10 | codePoint2 - 56320) + 65536;
92974
92988
  } else if (leadSurrogate) {
92975
92989
  if ((units -= 3) > -1) bytes.push(239, 191, 189);
92976
92990
  }
92977
92991
  leadSurrogate = null;
92978
- if (codePoint < 128) {
92992
+ if (codePoint2 < 128) {
92979
92993
  if ((units -= 1) < 0) break;
92980
- bytes.push(codePoint);
92981
- } else if (codePoint < 2048) {
92994
+ bytes.push(codePoint2);
92995
+ } else if (codePoint2 < 2048) {
92982
92996
  if ((units -= 2) < 0) break;
92983
- bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128);
92984
- } else if (codePoint < 65536) {
92997
+ bytes.push(codePoint2 >> 6 | 192, codePoint2 & 63 | 128);
92998
+ } else if (codePoint2 < 65536) {
92985
92999
  if ((units -= 3) < 0) break;
92986
- bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
92987
- } else if (codePoint < 1114112) {
93000
+ bytes.push(codePoint2 >> 12 | 224, codePoint2 >> 6 & 63 | 128, codePoint2 & 63 | 128);
93001
+ } else if (codePoint2 < 1114112) {
92988
93002
  if ((units -= 4) < 0) break;
92989
- bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
93003
+ bytes.push(codePoint2 >> 18 | 240, codePoint2 >> 12 & 63 | 128, codePoint2 >> 6 & 63 | 128, codePoint2 & 63 | 128);
92990
93004
  } else throw new Error("Invalid code point");
92991
93005
  }
92992
93006
  return bytes;
@@ -94698,7 +94712,7 @@ var require_buffer_list = /* @__PURE__ */ __commonJSMin(((exports2, module2) =>
94698
94712
  },
94699
94713
  {
94700
94714
  key: "join",
94701
- value: function join5(s) {
94715
+ value: function join6(s) {
94702
94716
  if (this.length === 0) return "";
94703
94717
  var p = this.head;
94704
94718
  var ret2 = "" + p.data;
@@ -98078,13 +98092,13 @@ var require_sax = /* @__PURE__ */ __commonJSMin(((exports2) => {
98078
98092
  if (!length) return "";
98079
98093
  var result = "";
98080
98094
  while (++index < length) {
98081
- var codePoint = Number(arguments[index]);
98082
- if (!isFinite(codePoint) || codePoint < 0 || codePoint > 1114111 || floor(codePoint) !== codePoint) throw RangeError("Invalid code point: " + codePoint);
98083
- if (codePoint <= 65535) codeUnits.push(codePoint);
98095
+ var codePoint2 = Number(arguments[index]);
98096
+ if (!isFinite(codePoint2) || codePoint2 < 0 || codePoint2 > 1114111 || floor(codePoint2) !== codePoint2) throw RangeError("Invalid code point: " + codePoint2);
98097
+ if (codePoint2 <= 65535) codeUnits.push(codePoint2);
98084
98098
  else {
98085
- codePoint -= 65536;
98086
- highSurrogate = (codePoint >> 10) + 55296;
98087
- lowSurrogate = codePoint % 1024 + 56320;
98099
+ codePoint2 -= 65536;
98100
+ highSurrogate = (codePoint2 >> 10) + 55296;
98101
+ lowSurrogate = codePoint2 % 1024 + 56320;
98088
98102
  codeUnits.push(highSurrogate, lowSurrogate);
98089
98103
  }
98090
98104
  if (index + 1 === length || codeUnits.length > MAX_SIZE) {
@@ -110356,6 +110370,67 @@ function accentOnlyTheme(accent) {
110356
110370
  };
110357
110371
  }
110358
110372
 
110373
+ // packages/core/dist/document/docx-defaults.js
110374
+ var import_jszip = __toESM(require_lib3(), 1);
110375
+ var DEFAULT_PARAGRAPH = { lineHeight: 1.5, spaceAfterPt: 6, justify: true };
110376
+ function hasDefaultParagraphStyle(stylesXml) {
110377
+ return [...stylesXml.matchAll(/<w:style\b[^>]*>/g)].some(([tag]) => /\bw:type="paragraph"/.test(tag) && /\bw:default="(1|true|on)"/.test(tag));
110378
+ }
110379
+ function emptyParagraphDefaults(stylesXml) {
110380
+ const m = /<w:pPrDefault\b[^>]*?(\/>|>([\s\S]*?)<\/w:pPrDefault>)/.exec(stylesXml);
110381
+ return !m || m[1] === "/>" || !/<w:pPr\b/.test(m[2] ?? "");
110382
+ }
110383
+ function pPr(d) {
110384
+ return `<w:pPr><w:spacing w:after="${Math.round(d.spaceAfterPt * 20)}" w:line="${Math.round(d.lineHeight * 240)}" w:lineRule="auto"/>${d.justify ? '<w:jc w:val="both"/>' : ""}</w:pPr>`;
110385
+ }
110386
+ function ensureDefaultStyles(stylesXml, d = DEFAULT_PARAGRAPH) {
110387
+ let xml = stylesXml;
110388
+ const changed = [];
110389
+ if (emptyParagraphDefaults(xml)) {
110390
+ const block = `<w:pPrDefault>${pPr(d)}</w:pPrDefault>`;
110391
+ if (/<w:pPrDefault\b[^>]*\/>/.test(xml))
110392
+ xml = xml.replace(/<w:pPrDefault\b[^>]*\/>/, block);
110393
+ else if (/<w:pPrDefault\b[\s\S]*?<\/w:pPrDefault>/.test(xml))
110394
+ xml = xml.replace(/<w:pPrDefault\b[\s\S]*?<\/w:pPrDefault>/, block);
110395
+ else if (/<\/w:rPrDefault>/.test(xml))
110396
+ xml = xml.replace(/<\/w:rPrDefault>/, `</w:rPrDefault>${block}`);
110397
+ else if (/<w:docDefaults\s*\/>/.test(xml))
110398
+ xml = xml.replace(/<w:docDefaults\s*\/>/, `<w:docDefaults>${block}</w:docDefaults>`);
110399
+ else if (/<\/w:docDefaults>/.test(xml))
110400
+ xml = xml.replace(/<\/w:docDefaults>/, `${block}</w:docDefaults>`);
110401
+ else
110402
+ xml = xml.replace(/(<w:styles\b[^>]*>)/, `$1<w:docDefaults>${block}</w:docDefaults>`);
110403
+ changed.push("paragraph defaults");
110404
+ }
110405
+ if (!hasDefaultParagraphStyle(xml)) {
110406
+ const normal = /<w:style\b(?=[^>]*\bw:type="paragraph")(?=[^>]*\bw:styleId="Normal")[^>]*>/.exec(xml);
110407
+ if (normal) {
110408
+ xml = xml.replace(normal[0], normal[0].replace(/<w:style\b/, '<w:style w:default="1"'));
110409
+ } else {
110410
+ const style = '<w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/></w:style>';
110411
+ if (/<\/w:latentStyles>/.test(xml))
110412
+ xml = xml.replace(/<\/w:latentStyles>/, `</w:latentStyles>${style}`);
110413
+ else if (/<\/w:docDefaults>/.test(xml))
110414
+ xml = xml.replace(/<\/w:docDefaults>/, `</w:docDefaults>${style}`);
110415
+ else
110416
+ xml = xml.replace(/(<w:styles\b[^>]*>)/, `$1${style}`);
110417
+ }
110418
+ changed.push("default paragraph style");
110419
+ }
110420
+ return { xml, changed };
110421
+ }
110422
+ async function ensureDocxDefaults(bytes, d = DEFAULT_PARAGRAPH) {
110423
+ const zip = await import_jszip.default.loadAsync(bytes);
110424
+ const part = zip.file("word/styles.xml");
110425
+ if (!part)
110426
+ return { bytes, changed: [] };
110427
+ const { xml, changed } = ensureDefaultStyles(await part.async("string"), d);
110428
+ if (!changed.length)
110429
+ return { bytes, changed };
110430
+ zip.file("word/styles.xml", xml);
110431
+ return { bytes: await zip.generateAsync({ type: "uint8array", compression: "DEFLATE" }), changed };
110432
+ }
110433
+
110359
110434
  // packages/core/dist/document/doc-gen.js
110360
110435
  function bareHex(c) {
110361
110436
  return c.replace("#", "").toUpperCase();
@@ -110776,7 +110851,12 @@ async function generateDocx(spec, themeInput) {
110776
110851
  }
110777
110852
  ]
110778
110853
  });
110779
- return new Uint8Array(await Packer.toBuffer(doc));
110854
+ const { bytes } = await ensureDocxDefaults(new Uint8Array(await Packer.toBuffer(doc)), {
110855
+ lineHeight: theme.body.lineHeight,
110856
+ spaceAfterPt: 6,
110857
+ justify: theme.body.justify
110858
+ });
110859
+ return bytes;
110780
110860
  }
110781
110861
  function isRichSheet(v) {
110782
110862
  return !!v && !Array.isArray(v) && typeof v === "object" && Array.isArray(v.rows);
@@ -110839,8 +110919,37 @@ async function generateDocument(kind, spec, theme) {
110839
110919
  }
110840
110920
 
110841
110921
  // packages/core/dist/document/doc-validate.js
110842
- var import_jszip = __toESM(require_lib3(), 1);
110922
+ var import_jszip3 = __toESM(require_lib3(), 1);
110843
110923
  var import_pdf_lib = __toESM(require_cjs(), 1);
110924
+
110925
+ // packages/core/dist/document/pptx-notes.js
110926
+ var import_jszip2 = __toESM(require_lib3(), 1);
110927
+ var REL_NS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
110928
+ var NOTES_SLIDE_REL = `${REL_NS}/notesSlide`;
110929
+ var NOTES_MASTER_REL = `${REL_NS}/notesMaster`;
110930
+ var SLIDE_REL = `${REL_NS}/slide`;
110931
+ async function notesKeynoteIssues(zip) {
110932
+ const out = [];
110933
+ for (const p of Object.keys(zip.files).filter((p2) => /^ppt\/notesSlides\/notesSlide\d+\.xml$/.test(p2)).sort()) {
110934
+ const xml = await zip.file(p).async("string");
110935
+ if (!/<p:clrMapOvr\b/.test(xml))
110936
+ out.push(p);
110937
+ }
110938
+ return out;
110939
+ }
110940
+ async function unlistedNotesMaster(zip) {
110941
+ const relsFile = zip.file("ppt/_rels/presentation.xml.rels");
110942
+ const presFile = zip.file("ppt/presentation.xml");
110943
+ if (!relsFile || !presFile)
110944
+ return null;
110945
+ const rel = new RegExp(`<Relationship\\b[^>]*Type="${NOTES_MASTER_REL}"[^>]*>`).exec(await relsFile.async("string"))?.[0];
110946
+ const rid = rel ? /\bId="([^"]+)"/.exec(rel)?.[1] : void 0;
110947
+ if (!rid)
110948
+ return null;
110949
+ return /<p:notesMasterId\b/.test(await presFile.async("string")) ? null : rid;
110950
+ }
110951
+
110952
+ // packages/core/dist/document/doc-validate.js
110844
110953
  function looksLikePdf(bytes) {
110845
110954
  const head = Buffer.from(bytes.subarray(0, 1024)).toString("latin1");
110846
110955
  return head.includes("%PDF-");
@@ -111020,7 +111129,7 @@ async function validateOoxml(bytes) {
111020
111129
  const result = (kind) => ({ ok: errors.length === 0, kind, errors, warnings });
111021
111130
  let zip;
111022
111131
  try {
111023
- zip = await import_jszip.default.loadAsync(Buffer.from(bytes));
111132
+ zip = await import_jszip3.default.loadAsync(Buffer.from(bytes));
111024
111133
  } catch (e) {
111025
111134
  errors.push({ code: "zip-unreadable", message: `not a readable OOXML zip: ${e.message}` });
111026
111135
  return result("unknown");
@@ -111088,9 +111197,165 @@ async function validateOoxml(bytes) {
111088
111197
  }
111089
111198
  }
111090
111199
  }
111200
+ if (root.kind === "pptx") {
111201
+ const bad = await notesKeynoteIssues(zip);
111202
+ if (bad.length) {
111203
+ errors.push({
111204
+ code: "notes-keynote",
111205
+ part: bad[0],
111206
+ message: `${bad.length} notes slide(s) lack <p:clrMapOvr> (${bad.slice(0, 3).join(", ")}${bad.length > 3 ? ", \u2026" : ""}) \u2014 Keynote refuses the whole file ("\u6587\u4EF6\u683C\u5F0F\u65E0\u6548"). Repair with \`pptx-notes <in.pptx> {} <out.pptx>\`; write notes with pptx-notes, never by hand`
111207
+ });
111208
+ }
111209
+ }
111210
+ if (root.kind === "pptx" && await unlistedNotesMaster(zip)) {
111211
+ errors.push({
111212
+ code: "notes-keynote",
111213
+ part: "ppt/presentation.xml",
111214
+ message: 'the notes master is not listed in <p:notesMasterIdLst> (python-pptx leaves it out) \u2014 Keynote refuses the whole file ("\u6587\u4EF6\u683C\u5F0F\u65E0\u6548"). Repair with `pptx-notes <in.pptx> {} <out.pptx>`'
111215
+ });
111216
+ }
111217
+ if (root.kind === "docx" && has("word/styles.xml") && !hasDefaultParagraphStyle(await text("word/styles.xml"))) {
111218
+ errors.push({
111219
+ code: "docx-default-style",
111220
+ part: "word/styles.xml",
111221
+ message: 'no default paragraph style (w:default="1", usually "Normal") \u2014 Word fills the gap, but Pages lays every unstyled paragraph out like the one before it (a centred title turns the whole body huge and centred). Repair with `docx-defaults <in.docx> <out.docx>`; docx from doc-gen already has it'
111222
+ });
111223
+ }
111091
111224
  return result(root.kind);
111092
111225
  }
111093
111226
 
111227
+ // packages/core/dist/document/pdf-page-labels.js
111228
+ var import_pdf_lib4 = __toESM(require_cjs(), 1);
111229
+
111230
+ // packages/core/dist/document/pdf-lib-load.js
111231
+ var import_pdf_lib2 = __toESM(require_cjs(), 1);
111232
+ init_pdf_encrypted();
111233
+ var isEncryptedError = (e) => e instanceof import_pdf_lib2.EncryptedPDFError || /PDFDocument\.load` is encrypted/.test(String(e?.message));
111234
+ async function loadEditablePdf(bytes) {
111235
+ try {
111236
+ return await import_pdf_lib2.PDFDocument.load(bytes);
111237
+ } catch (e) {
111238
+ if (!isEncryptedError(e))
111239
+ throw e;
111240
+ const { pdfNeedsPassword: pdfNeedsPassword2 } = await Promise.resolve().then(() => (init_pdf_extract(), pdf_extract_exports));
111241
+ const needsPassword = await pdfNeedsPassword2(bytes).catch(() => true);
111242
+ throw needsPassword ? new PdfEncryptedError() : new Error(OWNER_ONLY_PDF_MESSAGE);
111243
+ }
111244
+ }
111245
+
111246
+ // packages/core/dist/document/pdf-text-font.js
111247
+ var import_promises = require("node:fs/promises");
111248
+ var import_node_path2 = require("node:path");
111249
+ var import_pdf_lib3 = __toESM(require_cjs(), 1);
111250
+ async function loadFontkit() {
111251
+ const mod = await import("./fontkit.cjs");
111252
+ return mod.default?.create ? mod.default : mod;
111253
+ }
111254
+ var PDF_CJK_FONT_FILES = {
111255
+ regular: "NotoSansSC-PDF-Regular.ttf",
111256
+ bold: "NotoSansSC-PDF-Bold.ttf"
111257
+ };
111258
+ var LINE_BREAK = /\r\n|[\n\f\r\u000B\u0085\u2028\u2029]/;
111259
+ function encodableAs(std, text) {
111260
+ const enc = import_pdf_lib3.StandardFontEmbedder.for(std);
111261
+ try {
111262
+ for (const line of text.replace(/\t/g, " ").split(LINE_BREAK))
111263
+ enc.encodeText(line);
111264
+ return true;
111265
+ } catch {
111266
+ return false;
111267
+ }
111268
+ }
111269
+ var codePoint = (cp) => `"${String.fromCodePoint(cp)}" (U+${cp.toString(16).toUpperCase().padStart(4, "0")})`;
111270
+ async function embedTextFont(doc, texts, opts = {}) {
111271
+ const bold = opts.weight === "bold";
111272
+ const std = bold ? import_pdf_lib3.StandardFonts.HelveticaBold : import_pdf_lib3.StandardFonts.Helvetica;
111273
+ if (texts.every((t) => encodableAs(std, t)))
111274
+ return doc.embedFont(std);
111275
+ if (!opts.fontDir) {
111276
+ const sample = [...texts.join("")].find((ch) => ch !== " " && !LINE_BREAK.test(ch) && !encodableAs(std, ch)) ?? "";
111277
+ throw new Error(`text has characters Helvetica cannot draw (e.g. ${codePoint(sample.codePointAt(0) ?? 0)}) and no CJK font directory was given`);
111278
+ }
111279
+ const used = /* @__PURE__ */ new Set();
111280
+ for (const t of texts) {
111281
+ for (const ch of t) {
111282
+ const cp = ch.codePointAt(0);
111283
+ if (cp >= 32 && !LINE_BREAK.test(ch) && cp !== 127)
111284
+ used.add(cp);
111285
+ }
111286
+ }
111287
+ const fontkit = await loadFontkit();
111288
+ const regularBytes = await (0, import_promises.readFile)((0, import_node_path2.join)(opts.fontDir, PDF_CJK_FONT_FILES.regular));
111289
+ const regular = fontkit.create(regularBytes);
111290
+ const missing = [...used].filter((cp) => !regular.hasGlyphForCodePoint(cp));
111291
+ if (missing.length) {
111292
+ const shown = missing.slice(0, 8).map(codePoint).join(", ");
111293
+ throw new Error(`the bundled CJK font has no glyph for ${shown}${missing.length > 8 ? ` and ${missing.length - 8} more` : ""} \u2014 remove or replace those characters (it covers Chinese \u2014 all CJK Unified Ideographs \u2014 plus Latin, punctuation and full-width forms; emoji and rare extension characters are not included)`);
111294
+ }
111295
+ let bytes = regularBytes;
111296
+ if (bold) {
111297
+ const boldBytes = await (0, import_promises.readFile)((0, import_node_path2.join)(opts.fontDir, PDF_CJK_FONT_FILES.bold));
111298
+ const boldFont = fontkit.create(boldBytes);
111299
+ if ([...used].every((cp) => boldFont.hasGlyphForCodePoint(cp)))
111300
+ bytes = boldBytes;
111301
+ }
111302
+ doc.registerFontkit(fontkit);
111303
+ return doc.embedFont(bytes, { subset: true });
111304
+ }
111305
+
111306
+ // packages/core/dist/document/pdf-page-layout.js
111307
+ var PDF_LABEL_SIZE = 8;
111308
+ function pdfPageLayout(theme) {
111309
+ const match = /^(\d+(?:\.\d+)?)(mm|cm|in|pt|px)$/.exec(theme.page.margin);
111310
+ if (!match)
111311
+ throw new Error("invalid PDF page margin");
111312
+ const scales = { mm: 72 / 25.4, cm: 72 / 2.54, in: 72, pt: 1, px: 0.75 };
111313
+ const side = Number(match[1]) * scales[match[2]];
111314
+ if (!Number.isFinite(side))
111315
+ throw new Error("invalid PDF page margin");
111316
+ const top = theme.page.header ? Math.max(side, 24) : side;
111317
+ const bottom = theme.page.footer ? Math.max(side, 24) : side;
111318
+ return { top, bottom, side, inset: Math.max(side, 12), cssMargin: theme.page.header || theme.page.footer ? `${top}pt ${side}pt ${bottom}pt ${side}pt` : theme.page.margin };
111319
+ }
111320
+
111321
+ // packages/core/dist/document/pdf-page-labels.js
111322
+ async function addPdfPageLabels(bytes, theme, title, options = {}) {
111323
+ if (!theme.page.header && !theme.page.footer)
111324
+ return bytes;
111325
+ const doc = await loadEditablePdf(bytes);
111326
+ const pages = doc.getPages();
111327
+ if (!pages.length)
111328
+ throw new Error("PDF page labels require at least one page");
111329
+ const layout = pdfPageLayout(theme);
111330
+ const labels = pages.flatMap((page, index) => ["header", "footer"].flatMap((kind) => {
111331
+ if (!theme.page[kind])
111332
+ return [];
111333
+ const text = theme.page[kind].replace(/\{(title|page|pages)\}/g, (_2, token) => token === "title" ? title ?? "" : String(token === "page" ? index + 1 : pages.length)).replace(/\t/g, " ");
111334
+ if (/[\x00-\x1f\x7f\x85\u2028\u2029]/.test(text))
111335
+ throw new Error(`PDF ${kind} must be a single line without control characters`);
111336
+ return [{ page, index, kind, text }];
111337
+ }));
111338
+ const font = await embedTextFont(doc, labels.map((label) => label.text), options);
111339
+ const ascent = font.heightAtSize(PDF_LABEL_SIZE, { descender: false });
111340
+ const descent = font.heightAtSize(PDF_LABEL_SIZE) - ascent;
111341
+ const hex = theme.colors.muted.replace("#", "");
111342
+ const color = (0, import_pdf_lib4.rgb)(parseInt(hex.slice(0, 2), 16) / 255, parseInt(hex.slice(2, 4), 16) / 255, parseInt(hex.slice(4, 6), 16) / 255);
111343
+ for (const { page, index, kind, text } of labels) {
111344
+ const { width, height } = page.getSize();
111345
+ const crop = page.getCropBox();
111346
+ if (page.getRotation().angle !== 0 || crop.x !== 0 || crop.y !== 0 || crop.width !== width || crop.height !== height)
111347
+ throw new Error("PDF page labels require unrotated, uncropped pages");
111348
+ if (height <= layout.top + layout.bottom || width <= layout.inset * 2)
111349
+ throw new Error(`PDF page ${index + 1} has no space inside its margins`);
111350
+ const textWidth = font.widthOfTextAtSize(text, PDF_LABEL_SIZE);
111351
+ if (textWidth > width - 2 * layout.inset)
111352
+ throw new Error(`PDF ${kind} on page ${index + 1} exceeds the available width; shorten the text or reduce page margins`);
111353
+ const centerY = kind === "header" ? height - layout.top / 2 : layout.bottom / 2;
111354
+ page.drawText(text, { x: (width - textWidth) / 2, y: centerY - (ascent - descent) / 2, size: PDF_LABEL_SIZE, font, color });
111355
+ }
111356
+ return doc.save();
111357
+ }
111358
+
111094
111359
  // apps/admin/data/skills.lib/document/bin-src/doc-gen.mjs
111095
111360
  init_pdf_extract();
111096
111361
 
@@ -111107,7 +111372,7 @@ function stackWith(font) {
111107
111372
  function themeStyle(t) {
111108
111373
  const h = (lvl, extra = "") => `${lvl} { font-size: ${t.heading[lvl].size}pt; font-weight: ${t.heading[lvl].bold ? 700 : 400}; color: ${resolveColor(t, t.heading[lvl].color)}; margin: ${lvl === "h1" ? "0" : "1em"} 0 ${t.heading[lvl].spaceAfter}pt; ${extra}}`;
111109
111374
  return `
111110
- @page { size: ${t.page.size}; margin: ${t.page.margin}; }
111375
+ @page { size: ${t.page.size}; margin: ${pdfPageLayout(t).cssMargin}; }
111111
111376
  * { box-sizing: border-box; }
111112
111377
  html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
111113
111378
  body { font-family: ${stackWith(t.fonts.body)}; font-size: ${t.body.size}pt; line-height: ${t.body.lineHeight}; color: ${t.colors.text}; margin: 0; }
@@ -111207,26 +111472,48 @@ function specToHtml(spec, themeInput) {
111207
111472
  body.push(blockHtml(b));
111208
111473
  return `<!doctype html><html lang="zh"><head><meta charset="utf-8"><style>${themeStyle(theme)}</style></head><body>${body.join("\n")}</body></html>`;
111209
111474
  }
111210
- function themePrintOptions(themeInput, title) {
111211
- const theme = themeInput && typeof themeInput === "object" && "warnings" in themeInput ? themeInput : resolveTheme(themeInput);
111212
- if (!theme.page.header && !theme.page.footer)
111213
- return void 0;
111214
- const line = (tpl) => {
111215
- const withTitle = norm(interpolateTitle(tpl, title));
111216
- const withPages = withTitle.replaceAll("{page}", '<span class="pageNumber"></span>').replaceAll("{pages}", '<span class="totalPages"></span>');
111217
- return `<div style="font-size:8pt;width:100%;text-align:center;color:${theme.colors.muted};font-family:${stackWith(theme.fonts.body).replace(/"/g, "&quot;")};">${withPages}</div>`;
111218
- };
111219
- return {
111220
- headerTemplate: theme.page.header ? line(theme.page.header) : "<span></span>",
111221
- footerTemplate: theme.page.footer ? line(theme.page.footer) : "<span></span>"
111475
+
111476
+ // apps/admin/data/skills.lib/document/bin-src/lib/headless-chromium.mjs
111477
+ var import_promises2 = require("node:fs/promises");
111478
+ var import_node_module = require("node:module");
111479
+ var import_node_path3 = require("node:path");
111480
+
111481
+ // packages/core/dist/document/pdf-print.js
111482
+ var CJK_TEXT_RE = /[\u2E80-\u30FF\u3200-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF]/;
111483
+ var PREPARE_FONTS = String.raw`async (fallbackFamily) => {
111484
+ const cjk = new RegExp(${JSON.stringify(CJK_TEXT_RE.source)});
111485
+ const normalize = (family) => family.trim().replace(/^['"]|['"]$/g, '').toLowerCase();
111486
+ const check = async () => {
111487
+ await document.fonts.ready;
111488
+ const failed = [...document.fonts].filter(face => face.status === 'error');
111489
+ if (failed.length) throw new Error('PDF font failed to load: ' + failed.map(face => face.family).join(', '));
111222
111490
  };
111491
+ await check();
111492
+ if (fallbackFamily && cjk.test(document.body.innerText)) {
111493
+ const faces = [...document.fonts];
111494
+ if (!faces.some(face => normalize(face.family) === normalize(fallbackFamily))) {
111495
+ throw new Error('PDF CJK fallback font is unavailable: ' + fallbackFamily);
111496
+ }
111497
+ const embedded = new Set(faces.filter(face => face.status === 'loaded' && normalize(face.family) !== normalize(fallbackFamily)).map(face => normalize(face.family)));
111498
+ const updates = [...document.body.querySelectorAll('*'), document.body]
111499
+ .filter(element => element.style && !['SCRIPT', 'STYLE', 'TEMPLATE', 'NOSCRIPT'].includes(element.tagName))
111500
+ .map(element => {
111501
+ const families = getComputedStyle(element).fontFamily.match(/(?:[^,"']+|"[^"]*"|'[^']*')+/g) || [];
111502
+ const authored = families.filter(family => normalize(family) !== normalize(fallbackFamily));
111503
+ return [element, [...authored.filter(family => embedded.has(normalize(family))), fallbackFamily,
111504
+ ...authored.filter(family => !embedded.has(normalize(family)))].join(', ')];
111505
+ });
111506
+ for (const [element, family] of updates) element.style.setProperty('font-family', family, 'important');
111507
+ // Force layout before fonts.ready: newly selected fallback faces load lazily.
111508
+ document.body.getBoundingClientRect();
111509
+ await check();
111510
+ }
111511
+ }`;
111512
+ function pdfFontPreparationScript(fallbackFamily) {
111513
+ return `(${PREPARE_FONTS})(${JSON.stringify(fallbackFamily ?? null)})`;
111223
111514
  }
111224
111515
 
111225
111516
  // apps/admin/data/skills.lib/document/bin-src/lib/headless-chromium.mjs
111226
- var import_node_fs = require("node:fs");
111227
- var import_promises = require("node:fs/promises");
111228
- var import_node_module = require("node:module");
111229
- var import_node_path2 = require("node:path");
111230
111517
  var NO_BROWSER_ADVICE = "Do not install packages or download a browser to work around this. Tell the user the file could not be produced here.";
111231
111518
  function headlessBrowserDisabled() {
111232
111519
  const v = (process.env.TALOS_HEADLESS_BROWSER ?? "").trim().toLowerCase();
@@ -111235,7 +111522,7 @@ function headlessBrowserDisabled() {
111235
111522
  async function loadPlaywright() {
111236
111523
  const deps = process.env.TALOS_SKILL_DEPS;
111237
111524
  if (deps) {
111238
- const req = (0, import_node_module.createRequire)((0, import_node_path2.join)(deps, "_resolve.js"));
111525
+ const req = (0, import_node_module.createRequire)((0, import_node_path3.join)(deps, "_resolve.js"));
111239
111526
  for (const name of ["playwright", "playwright-core"]) {
111240
111527
  try {
111241
111528
  return req(name);
@@ -111264,22 +111551,32 @@ async function launchHeadlessChromium() {
111264
111551
  return null;
111265
111552
  }
111266
111553
  }
111267
- var CJK_RE = /[\u2E80-\u2FFF\u3000-\u303F\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF\uFF00-\uFFEF]/;
111268
111554
  var _fontManifest;
111269
111555
  async function fontManifest() {
111270
111556
  if (_fontManifest !== void 0) return _fontManifest;
111271
- const dir = process.env.TALOS_CJK_FONT_DIR || (0, import_node_path2.join)((0, import_node_path2.dirname)(process.argv[1]), "..", "assets", "fonts");
111272
- const file = (0, import_node_path2.join)(dir, "fonts.json");
111557
+ const dir = process.env.TALOS_CJK_FONT_DIR || (0, import_node_path3.join)((0, import_node_path3.dirname)(process.argv[1]), "..", "assets", "fonts");
111558
+ const file = (0, import_node_path3.join)(dir, "fonts.json");
111559
+ let manifest;
111273
111560
  try {
111274
- _fontManifest = { dir, ...JSON.parse(await (0, import_promises.readFile)(file, "utf8")) };
111275
- } catch {
111276
- _fontManifest = { dir, cjk: [], latin: [], cjkUnicodeRange: "" };
111561
+ manifest = JSON.parse(await (0, import_promises2.readFile)(file, "utf8"));
111562
+ } catch (error) {
111563
+ throw new Error(`Cannot load PDF font manifest ${file}: ${error.message}`);
111564
+ }
111565
+ if (!manifest || !Array.isArray(manifest.cjk) || !Array.isArray(manifest.latin) || typeof manifest.cjkUnicodeRange !== "string" || [...manifest.cjk, ...manifest.latin].some((entry) => !entry || typeof entry.file !== "string" || !Array.isArray(entry.families) || !entry.families.every((family) => typeof family === "string"))) {
111566
+ throw new Error(`Invalid PDF font manifest: ${file}`);
111277
111567
  }
111568
+ _fontManifest = { ...manifest, dir };
111278
111569
  return _fontManifest;
111279
111570
  }
111280
111571
  var _faceB64 = /* @__PURE__ */ new Map();
111281
111572
  async function faceBase64(path) {
111282
- if (!_faceB64.has(path)) _faceB64.set(path, (await (0, import_promises.readFile)(path).catch(() => null))?.toString("base64") ?? null);
111573
+ if (!_faceB64.has(path)) {
111574
+ const bytes = await (0, import_promises2.readFile)(path).catch((error) => {
111575
+ throw new Error(`Cannot load PDF font ${path}: ${error.message}`);
111576
+ });
111577
+ if (!bytes.length) throw new Error(`Empty PDF font: ${path}`);
111578
+ _faceB64.set(path, bytes.toString("base64"));
111579
+ }
111283
111580
  return _faceB64.get(path);
111284
111581
  }
111285
111582
  async function faceCss(entries, range, doc) {
@@ -111288,10 +111585,8 @@ async function faceCss(entries, range, doc) {
111288
111585
  for (const entry of entries ?? []) {
111289
111586
  const families = doc ? (entry.families ?? []).filter((f) => doc.includes(f)) : entry.families ?? [];
111290
111587
  if (!families.length) continue;
111291
- const path = (0, import_node_path2.join)(dir, entry.file);
111292
- if (!(0, import_node_fs.existsSync)(path)) continue;
111588
+ const path = (0, import_node_path3.join)(dir, entry.file);
111293
111589
  const b64 = await faceBase64(path);
111294
- if (!b64) continue;
111295
111590
  for (const family of families) {
111296
111591
  rules.push(
111297
111592
  `@font-face{font-family:'${family}';src:local('${family}'),url(data:font/woff2;base64,${b64}) format('woff2');${entry.weight ? `font-weight:${entry.weight};` : ""}${range ? `unicode-range:${range};` : ""}font-display:swap}`
@@ -111320,17 +111615,16 @@ function injectStyle(html, css) {
111320
111615
  const tag = `<style>${css}</style>`;
111321
111616
  return html.includes("</head>") ? html.replace("</head>", `${tag}</head>`) : tag + html;
111322
111617
  }
111323
- async function renderPdfHeadless(html, print = {}) {
111618
+ async function renderPdfHeadless(html) {
111324
111619
  const browser2 = await launchHeadlessChromium();
111325
111620
  if (!browser2) return null;
111326
111621
  try {
111327
111622
  const page = await browser2.newPage();
111328
- const faces = (CJK_RE.test(html) ? await cjkFontFaceCss(html) : "") + await latinFontFaceCss(html);
111623
+ const faces = (CJK_TEXT_RE.test(html) ? await cjkFontFaceCss(html) : "") + await latinFontFaceCss(html);
111624
+ await page.emulateMedia({ media: "print" });
111329
111625
  await page.setContent(faces ? injectStyle(html, faces) : html, { waitUntil: "load" });
111330
- await page.evaluate("document.fonts && document.fonts.ready").catch(() => {
111331
- });
111332
- const hf = print.headerTemplate || print.footerTemplate ? { displayHeaderFooter: true, headerTemplate: print.headerTemplate || "<span></span>", footerTemplate: print.footerTemplate || "<span></span>" } : {};
111333
- return new Uint8Array(await page.pdf({ printBackground: true, preferCSSPageSize: true, ...hf }));
111626
+ await page.evaluate(pdfFontPreparationScript());
111627
+ return new Uint8Array(await page.pdf({ printBackground: true, preferCSSPageSize: true }));
111334
111628
  } finally {
111335
111629
  await browser2.close().catch(() => {
111336
111630
  });
@@ -111338,8 +111632,8 @@ async function renderPdfHeadless(html, print = {}) {
111338
111632
  }
111339
111633
 
111340
111634
  // apps/admin/data/skills.lib/document/bin-src/doc-gen.mjs
111341
- var import_node_path4 = require("node:path");
111342
- var import_node_fs3 = require("node:fs");
111635
+ var import_node_path5 = require("node:path");
111636
+ var import_node_fs2 = require("node:fs");
111343
111637
  var import_node_crypto = require("node:crypto");
111344
111638
 
111345
111639
  // packages/core/dist/document/doc-palette.js
@@ -111577,7 +111871,1316 @@ function listPalettes() {
111577
111871
  return PALETTE_LIBRARY.map(({ name, mood, dark }) => ({ name, mood, dark }));
111578
111872
  }
111579
111873
 
111874
+ // packages/core/dist/document/deck-scenarios.data.js
111875
+ var SCENARIO_MATRIX = {
111876
+ "scenarios": [
111877
+ {
111878
+ "id": "pitch",
111879
+ "subtitle": "\u878D\u8D44/\u8DEF\u6F14",
111880
+ "tone": [
111881
+ "\u81EA\u4FE1",
111882
+ "\u6709\u5F20\u529B",
111883
+ "\u6545\u4E8B\u9A71\u52A8"
111884
+ ],
111885
+ "density": [
111886
+ "\u4E2D",
111887
+ "\u5927\u6570\u5B57+\u4E00\u53E5\u89E3\u91CA"
111888
+ ],
111889
+ "requiredSections": [
111890
+ {
111891
+ "terms": [
111892
+ "Problem",
111893
+ "\u95EE\u9898"
111894
+ ],
111895
+ "content": "\u8C01\u75DB\u3001\u591A\u75DB\uFF1A\u91CF\u5316\u7684\u75DB\u70B9\u8BC1\u636E\uFF08\u65F6\u95F4/\u91D1\u94B1\u635F\u5931\uFF09\uFF1B\u5B9C \u5927\u6570\u5B57"
111896
+ },
111897
+ {
111898
+ "terms": [
111899
+ "Solution",
111900
+ "\u89E3\u51B3\u65B9\u6848"
111901
+ ],
111902
+ "content": "\u600E\u4E48\u89E3\u51B3\u3001\u4E3A\u4EC0\u4E48\u73B0\u5728\u80FD\u89E3\u51B3\uFF1B\u5B9C \u524D\u540E\u5BF9\u6BD4\u6216\u6D41\u7A0B"
111903
+ },
111904
+ {
111905
+ "terms": [
111906
+ "Market",
111907
+ "\u5E02\u573A"
111908
+ ],
111909
+ "content": "TAM/SAM/SOM \u4E0E\u589E\u901F\uFF0C\u6CE8\u660E\u6765\u6E90\u5E74\u4EFD\uFF1B\u5B9C \u67F1\u72B6\u56FE"
111910
+ },
111911
+ {
111912
+ "terms": [
111913
+ "Product",
111914
+ "Traction",
111915
+ "\u4EA7\u54C1",
111916
+ "\u8FDB\u5C55"
111917
+ ],
111918
+ "content": "\u4EA7\u54C1\u5F62\u6001 + \u589E\u957F\u8BC1\u636E\uFF08\u5BA2\u6237\u6570\u3001\u6536\u5165\u3001\u7559\u5B58\uFF09\uFF1B\u5B9C \u589E\u957F\u6298\u7EBF"
111919
+ },
111920
+ {
111921
+ "terms": [
111922
+ "Team",
111923
+ "\u56E2\u961F"
111924
+ ],
111925
+ "content": "\u6838\u5FC3\u6210\u5458\u4E0E\u8FD9\u4EF6\u4E8B\u76F8\u5173\u7684\u7ECF\u5386\uFF1B\u5B9C \u5E76\u5217\u5361\u7247"
111926
+ },
111927
+ {
111928
+ "terms": [
111929
+ "Ask",
111930
+ "\u878D\u8D44\u9700\u6C42"
111931
+ ],
111932
+ "key": true,
111933
+ "content": "\u878D\u8D44\u91D1\u989D\u3001\u8D44\u91D1\u7528\u9014\u5360\u6BD4\u3001\u5230\u4E0B\u4E00\u8F6E\u7684\u91CC\u7A0B\u7891\uFF1B\u5B9C \u997C\u56FE\u6216\u62C6\u5206"
111934
+ }
111935
+ ],
111936
+ "narrative": "SCQA / \u95EE\u9898-\u65B9\u6848",
111937
+ "pages": {
111938
+ "min": 10,
111939
+ "max": 12
111940
+ },
111941
+ "researchFocus": [
111942
+ "\u5E02\u573A\u89C4\u6A21\u4E0E\u589E\u901F(TAM/SAM)",
111943
+ "\u53EF\u6BD4\u516C\u53F8\u878D\u8D44\u4E0E\u4F30\u503C",
111944
+ "\u540C\u7C7B\u4EA7\u54C1\u4E0E\u5DEE\u5F02",
111945
+ "\u76EE\u6807\u5BA2\u7FA4\u75DB\u70B9\u8BC1\u636E"
111946
+ ],
111947
+ "motion": {
111948
+ "delivery": "presented",
111949
+ "keywords": [
111950
+ "pitch",
111951
+ "\u8DEF\u6F14"
111952
+ ]
111953
+ }
111954
+ },
111955
+ {
111956
+ "id": "\u5185\u5BA1",
111957
+ "tone": [
111958
+ "\u5BA2\u89C2",
111959
+ "\u76F4\u63A5",
111960
+ "\u7ED3\u8BBA\u5148\u884C"
111961
+ ],
111962
+ "density": [
111963
+ "\u7565\u5BC6(\u5BB9\u660E\u7EC6/\u6570\u636E)"
111964
+ ],
111965
+ "requiredSections": [
111966
+ {
111967
+ "terms": [
111968
+ "\u7ED3\u8BBA",
111969
+ "\u8FDB\u5C55"
111970
+ ],
111971
+ "content": "\u4E00\u53E5\u8BDD\u7ED3\u8BBA\uFF1A\u8FBE\u6210/\u672A\u8FBE\u6210\u4E0E\u504F\u5DEE\u5E45\u5EA6"
111972
+ },
111973
+ {
111974
+ "terms": [
111975
+ "\u5173\u952E\u6307\u6807"
111976
+ ],
111977
+ "content": "\u6838\u5FC3\u6307\u6807 \u5B9E\u9645 vs \u76EE\u6807 vs \u4E0A\u671F\uFF0C\u53E3\u5F84\u4E00\u81F4\uFF1B\u5B9C \u8868\u683C\u6216\u5BF9\u6BD4\u67F1"
111978
+ },
111979
+ {
111980
+ "terms": [
111981
+ "\u95EE\u9898\u4E0E\u98CE\u9669"
111982
+ ],
111983
+ "content": "\u95EE\u9898\u3001\u5F71\u54CD\u7A0B\u5EA6\u3001\u8D23\u4EFB\u65B9\uFF1B\u5B9C \u5217\u8868\u6216\u77E9\u9635"
111984
+ },
111985
+ {
111986
+ "terms": [
111987
+ "\u4E0B\u4E00\u6B65",
111988
+ "\u51B3\u7B56\u9879"
111989
+ ],
111990
+ "content": "\u9700\u62CD\u677F\u7684\u51B3\u7B56\u9879\u3001\u8D1F\u8D23\u4EBA\u3001\u622A\u6B62\u65F6\u95F4"
111991
+ }
111992
+ ],
111993
+ "narrative": "\u7ED3\u8BBA\u5148\u884C",
111994
+ "pages": {
111995
+ "min": 6,
111996
+ "max": 8
111997
+ },
111998
+ "researchFocus": [
111999
+ "\u884C\u4E1A\u5BF9\u6807\u6307\u6807",
112000
+ "\u53E3\u5F84\u5B9A\u4E49",
112001
+ "\u5916\u90E8\u98CE\u9669\u4E8B\u4EF6"
112002
+ ],
112003
+ "motion": {
112004
+ "delivery": "read",
112005
+ "keywords": [
112006
+ "\u5185\u5BA1"
112007
+ ]
112008
+ }
112009
+ },
112010
+ {
112011
+ "id": "\u9500\u552E",
112012
+ "tone": [
112013
+ "\u5229\u76CA\u9A71\u52A8",
112014
+ "\u5BA2\u6237\u4E2D\u5FC3",
112015
+ "\u8BF4\u670D"
112016
+ ],
112017
+ "density": [
112018
+ "\u4E2D",
112019
+ "\u91CD\u4EF7\u503C\u4E0E\u4F50\u8BC1"
112020
+ ],
112021
+ "requiredSections": [
112022
+ {
112023
+ "terms": [
112024
+ "\u75DB\u70B9"
112025
+ ],
112026
+ "content": "\u5BA2\u6237\u7684\u4E1A\u52A1\u75DB\u70B9\u4E0E\u4EE3\u4EF7\uFF0C\u7528\u5BA2\u6237\u884C\u4E1A\u7684\u6570\u636E"
112027
+ },
112028
+ {
112029
+ "terms": [
112030
+ "\u65B9\u6848",
112031
+ "\u4EF7\u503C\u4E3B\u5F20"
112032
+ ],
112033
+ "content": "\u65B9\u6848\u5982\u4F55\u89E3\u51B3\u3001\u5BF9\u5BA2\u6237\u7684\u4EF7\u503C\u4E3B\u5F20\u4E00\u53E5\u8BDD"
112034
+ },
112035
+ {
112036
+ "terms": [
112037
+ "\u5DEE\u5F02\u5316"
112038
+ ],
112039
+ "content": "\u4E0E\u66FF\u4EE3\u65B9\u6848\u9010\u9879\u5BF9\u6BD4\u7684\u5DEE\u5F02\u70B9\uFF1B\u5B9C \u5BF9\u6BD4\u8868"
112040
+ },
112041
+ {
112042
+ "terms": [
112043
+ "\u5BA2\u6237\u6848\u4F8B"
112044
+ ],
112045
+ "content": "\u540C\u884C\u4E1A\u5BA2\u6237\u3001\u505A\u4E86\u4EC0\u4E48\u3001\u91CF\u5316\u7ED3\u679C"
112046
+ },
112047
+ {
112048
+ "terms": [
112049
+ "ROI",
112050
+ "\u5B9A\u4EF7"
112051
+ ],
112052
+ "content": "\u6295\u5165\u3001\u56DE\u62A5\u3001\u56DE\u672C\u5468\u671F\u6216\u5B9A\u4EF7\u65B9\u6848\uFF1B\u5B9C \u5927\u6570\u5B57"
112053
+ },
112054
+ {
112055
+ "terms": [
112056
+ "CTA",
112057
+ "\u884C\u52A8\u53F7\u53EC"
112058
+ ],
112059
+ "key": true,
112060
+ "content": "\u4E0B\u4E00\u6B65\u5177\u4F53\u52A8\u4F5C\uFF1A\u8BD5\u7528\u3001\u4F1A\u8BAE\u3001\u7B7E\u7EA6\u65F6\u95F4"
112061
+ }
112062
+ ],
112063
+ "narrative": "\u95EE\u9898-\u65B9\u6848",
112064
+ "pages": {
112065
+ "min": 8,
112066
+ "max": 12
112067
+ },
112068
+ "researchFocus": [
112069
+ "\u5BA2\u6237\u6240\u5728\u884C\u4E1A\u75DB\u70B9",
112070
+ "\u7ADE\u54C1\u65B9\u6848\u4E0E\u5DEE\u5F02",
112071
+ "\u540C\u884C\u843D\u5730\u6848\u4F8B\u4E0E ROI",
112072
+ "\u516C\u5F00\u5B9A\u4EF7"
112073
+ ],
112074
+ "motion": {
112075
+ "delivery": "presented",
112076
+ "keywords": [
112077
+ "\u9500\u552E",
112078
+ "sales"
112079
+ ]
112080
+ }
112081
+ },
112082
+ {
112083
+ "id": "\u8BB2\u5EA7",
112084
+ "subtitle": "\u5B66\u672F",
112085
+ "tone": [
112086
+ "\u8BB2\u89E3",
112087
+ "\u5FAA\u5E8F\u6E10\u8FDB"
112088
+ ],
112089
+ "density": [
112090
+ "\u4E2D",
112091
+ "\u6982\u5FF5+\u4F8B\u5B50"
112092
+ ],
112093
+ "requiredSections": [
112094
+ {
112095
+ "terms": [
112096
+ "\u5B66\u4E60\u76EE\u6807"
112097
+ ],
112098
+ "content": "\u542C\u5B8C\u80FD\u505A\u5230\u7684 3 \u4EF6\u4E8B"
112099
+ },
112100
+ {
112101
+ "terms": [
112102
+ "\u80CC\u666F",
112103
+ "\u57FA\u7840"
112104
+ ],
112105
+ "content": "\u7406\u89E3\u6838\u5FC3\u6982\u5FF5\u5FC5\u987B\u5148\u77E5\u9053\u7684\u524D\u7F6E\u77E5\u8BC6"
112106
+ },
112107
+ {
112108
+ "terms": [
112109
+ "\u6838\u5FC3\u6982\u5FF5"
112110
+ ],
112111
+ "content": "\u5B9A\u4E49\u3001\u5173\u952E\u6027\u8D28\uFF0C\u914D\u4E00\u4E2A\u76F4\u89C2\u4F8B\u5B50"
112112
+ },
112113
+ {
112114
+ "terms": [
112115
+ "\u6848\u4F8B",
112116
+ "\u63A8\u5BFC"
112117
+ ],
112118
+ "content": "\u5B8C\u6574\u7684\u6848\u4F8B\u6216\u63A8\u5BFC\u6B65\u9AA4\uFF1B\u5B9C \u6B65\u9AA4"
112119
+ },
112120
+ {
112121
+ "terms": [
112122
+ "\u5C0F\u7ED3"
112123
+ ],
112124
+ "content": "\u8981\u70B9\u56DE\u987E + \u5EF6\u4F38\u9605\u8BFB"
112125
+ }
112126
+ ],
112127
+ "narrative": "\u7531\u6D45\u5165\u6DF1",
112128
+ "pages": {
112129
+ "min": 10,
112130
+ "max": 15
112131
+ },
112132
+ "researchFocus": [
112133
+ "\u6982\u5FF5\u5B9A\u4E49\u4E0E\u6743\u5A01\u6559\u6750",
112134
+ "\u5173\u952E\u8BBA\u6587\u4E0E\u7EFC\u8FF0",
112135
+ "\u7ECF\u5178\u6848\u4F8B/\u63A8\u5BFC",
112136
+ "\u5E38\u89C1\u8BEF\u89E3"
112137
+ ],
112138
+ "motion": {
112139
+ "delivery": "presented",
112140
+ "keywords": [
112141
+ "\u8BB2\u5EA7",
112142
+ "lecture"
112143
+ ]
112144
+ }
112145
+ },
112146
+ {
112147
+ "id": "\u53D1\u5E03\u4F1A",
112148
+ "subtitle": "keynote",
112149
+ "tone": [
112150
+ "\u60C5\u7EEA\u5316",
112151
+ "\u620F\u5267\u6027",
112152
+ "\u63ED\u6653\u611F"
112153
+ ],
112154
+ "density": [
112155
+ "\u6781\u7A00\u758F",
112156
+ "\u4E00\u9875\u4E00\u4FE1\u606F",
112157
+ "\u8D85\u5927\u89C6\u89C9"
112158
+ ],
112159
+ "densityEmphasis": true,
112160
+ "requiredSections": [
112161
+ {
112162
+ "terms": [
112163
+ "\u94A9\u5B50"
112164
+ ],
112165
+ "content": "\u4E00\u53E5\u8BDD\u6216\u4E00\u4E2A\u753B\u9762\u6293\u4F4F\u6CE8\u610F\u529B\uFF1B\u5B9C \u5927\u5B57\u6216\u5927\u56FE"
112166
+ },
112167
+ {
112168
+ "terms": [
112169
+ "\u80CC\u666F",
112170
+ "\u75DB\u70B9"
112171
+ ],
112172
+ "content": "\u7528\u6237\u4ECA\u5929\u7684\u56F0\u6270\uFF0C\u4E00\u4E2A\u5177\u4F53\u573A\u666F"
112173
+ },
112174
+ {
112175
+ "terms": [
112176
+ "\u4EA7\u54C1\u63ED\u6653"
112177
+ ],
112178
+ "content": "\u4EA7\u54C1\u540D\u4E0E\u4E00\u53E5\u8BDD\u5B9A\u4F4D\uFF0C\u5355\u72EC\u4E00\u9875\uFF1B\u5B9C \u5927\u56FE"
112179
+ },
112180
+ {
112181
+ "terms": [
112182
+ "\u4EAE\u70B9\u7279\u6027"
112183
+ ],
112184
+ "content": "3 \u4E2A\u4EE5\u5185\u7684\u6838\u5FC3\u5356\u70B9\uFF0C\u5404\u914D\u4E00\u4E2A\u53EF\u611F\u77E5\u7684\u6570\u5B57"
112185
+ },
112186
+ {
112187
+ "terms": [
112188
+ "Demo",
112189
+ "\u6F14\u793A"
112190
+ ],
112191
+ "content": "\u771F\u5B9E\u4F7F\u7528\u6D41\u7A0B\u6F14\u793A\uFF1B\u5B9C \u6B65\u9AA4\u6216\u622A\u56FE"
112192
+ },
112193
+ {
112194
+ "terms": [
112195
+ "\u4EF7\u683C\u4E0A\u5E02"
112196
+ ],
112197
+ "content": "\u4EF7\u683C\u3001\u7248\u672C\u3001\u4E0A\u5E02\u65F6\u95F4\u4E0E\u6E20\u9053"
112198
+ },
112199
+ {
112200
+ "terms": [
112201
+ "\u884C\u52A8\u53F7\u53EC"
112202
+ ],
112203
+ "key": true,
112204
+ "content": "\u73B0\u5728\u5C31\u80FD\u505A\u7684\u4E8B\uFF1A\u9884\u8BA2\u3001\u4E0B\u8F7D\u3001\u4F53\u9A8C"
112205
+ }
112206
+ ],
112207
+ "narrative": "\u60C5\u7EEA\u7EBF",
112208
+ "pages": {
112209
+ "min": 15,
112210
+ "max": 20
112211
+ },
112212
+ "researchFocus": [
112213
+ "\u540C\u7C7B\u4EA7\u54C1\u75DB\u70B9\u4E0E\u5DEE\u8BC4",
112214
+ "\u7ADE\u54C1\u53C2\u6570\u5BF9\u6BD4",
112215
+ "\u7ADE\u54C1\u5B9A\u4EF7\u4E0E\u4E0A\u5E02\u8282\u594F",
112216
+ "\u53EF\u5F15\u7528\u7684\u7528\u6237\u573A\u666F"
112217
+ ],
112218
+ "motion": {
112219
+ "delivery": "presented",
112220
+ "keywords": [
112221
+ "\u53D1\u5E03\u4F1A",
112222
+ "launch",
112223
+ "keynote"
112224
+ ]
112225
+ }
112226
+ },
112227
+ {
112228
+ "id": "\u57F9\u8BAD",
112229
+ "tone": [
112230
+ "\u6559\u5B66",
112231
+ "\u6E05\u6670",
112232
+ "\u53EF\u64CD\u4F5C"
112233
+ ],
112234
+ "density": [
112235
+ "\u4E2D",
112236
+ "\u5206\u6A21\u5757"
112237
+ ],
112238
+ "requiredSections": [
112239
+ {
112240
+ "terms": [
112241
+ "Objectives",
112242
+ "\u5B66\u4E60\u76EE\u6807"
112243
+ ],
112244
+ "content": "\u5B66\u5B8C\u80FD\u505A\u5230\u4EC0\u4E48\uFF0C\u53EF\u68C0\u9A8C"
112245
+ },
112246
+ {
112247
+ "terms": [
112248
+ "Module",
112249
+ "\u8BFE\u7A0B\u6A21\u5757"
112250
+ ],
112251
+ "content": "\u6A21\u5757\u5212\u5206\u4E0E\u6BCF\u5757\u8981\u70B9\uFF1B\u5B9C \u5206\u5C42\u6216\u6B65\u9AA4"
112252
+ },
112253
+ {
112254
+ "terms": [
112255
+ "\u7EC3\u4E60",
112256
+ "\u793A\u4F8B",
112257
+ "Exercise"
112258
+ ],
112259
+ "content": "\u53EF\u7167\u505A\u7684\u793A\u4F8B\u6216\u7EC3\u4E60\u9898"
112260
+ },
112261
+ {
112262
+ "terms": [
112263
+ "Quiz",
112264
+ "\u968F\u5802\u6D4B\u9A8C"
112265
+ ],
112266
+ "content": "\u68C0\u9A8C\u7406\u89E3\u7684\u9898\u76EE\u4E0E\u7B54\u6848"
112267
+ },
112268
+ {
112269
+ "terms": [
112270
+ "Summary",
112271
+ "\u5C0F\u7ED3"
112272
+ ],
112273
+ "content": "\u8981\u70B9\u56DE\u987E\u4E0E\u8BFE\u540E\u884C\u52A8"
112274
+ }
112275
+ ],
112276
+ "narrative": "\u7531\u6D45\u5165\u6DF1",
112277
+ "pages": {
112278
+ "min": 8,
112279
+ "max": 15
112280
+ },
112281
+ "researchFocus": [
112282
+ "\u6743\u5A01\u6559\u7A0B\u4E0E\u6807\u51C6",
112283
+ "\u5206\u6B65\u64CD\u4F5C\u793A\u4F8B",
112284
+ "\u5E38\u89C1\u9519\u8BEF\u4E0E\u6392\u9519",
112285
+ "\u7EC3\u4E60\u9898\u4E0E\u8003\u70B9"
112286
+ ],
112287
+ "motion": {
112288
+ "delivery": "read",
112289
+ "keywords": [
112290
+ "\u57F9\u8BAD",
112291
+ "training"
112292
+ ]
112293
+ }
112294
+ },
112295
+ {
112296
+ "id": "\u5927\u4F1A",
112297
+ "subtitle": "talk",
112298
+ "tone": [
112299
+ "\u89C2\u70B9\u9C9C\u660E",
112300
+ "\u542F\u53D1",
112301
+ "\u8BB0\u5FC6\u70B9"
112302
+ ],
112303
+ "density": [
112304
+ "\u7A00\u758F",
112305
+ "\u4E00\u56FE\u4E00\u53E5"
112306
+ ],
112307
+ "requiredSections": [
112308
+ {
112309
+ "terms": [
112310
+ "\u5F00\u573A\u94A9\u5B50"
112311
+ ],
112312
+ "content": "\u53CD\u5E38\u8BC6\u7684\u95EE\u9898\u3001\u6570\u636E\u6216\u6545\u4E8B\u5F00\u573A"
112313
+ },
112314
+ {
112315
+ "terms": [
112316
+ "\u6838\u5FC3\u8BBA\u70B9"
112317
+ ],
112318
+ "content": "\u4E00\u53E5\u8BDD\u89C2\u70B9\uFF0C\u5168\u573A\u53EA\u6B64\u4E00\u4E2A"
112319
+ },
112320
+ {
112321
+ "terms": [
112322
+ "\u8BBA\u636E",
112323
+ "\u6848\u4F8B"
112324
+ ],
112325
+ "content": "\u652F\u6491\u89C2\u70B9\u7684\u6848\u4F8B\u4E0E\u6570\u636E\uFF0C\u6CE8\u660E\u51FA\u5904"
112326
+ },
112327
+ {
112328
+ "terms": [
112329
+ "\u53CD\u76F4\u89C9\u6D1E\u5BDF"
112330
+ ],
112331
+ "content": "\u4E0E\u542C\u4F17\u76F4\u89C9\u76F8\u53CD\u7684\u53D1\u73B0\u53CA\u5176\u539F\u56E0"
112332
+ },
112333
+ {
112334
+ "terms": [
112335
+ "\u6536\u675F\u8BB0\u5FC6\u70B9"
112336
+ ],
112337
+ "content": "\u4E00\u53E5\u53EF\u88AB\u590D\u8FF0\u7684\u8BDD\u6536\u5C3E"
112338
+ }
112339
+ ],
112340
+ "narrative": "\u60C5\u7EEA\u7EBF / SCQA",
112341
+ "pages": {
112342
+ "min": 15,
112343
+ "max": 20
112344
+ },
112345
+ "researchFocus": [
112346
+ "\u53CD\u76F4\u89C9\u6570\u636E\u4E0E\u7814\u7A76",
112347
+ "\u4E89\u8BAE\u89C2\u70B9\u4E0E\u53CD\u4F8B",
112348
+ "\u4E00\u624B\u6848\u4F8B/\u5931\u8D25\u6559\u8BAD",
112349
+ "\u53EF\u5F15\u7528\u91D1\u53E5"
112350
+ ],
112351
+ "motion": {
112352
+ "delivery": "presented",
112353
+ "keywords": [
112354
+ "\u5927\u4F1A",
112355
+ "conference",
112356
+ "talk"
112357
+ ]
112358
+ }
112359
+ },
112360
+ {
112361
+ "id": "\u5DE5\u4F5C\u6C47\u62A5",
112362
+ "subtitle": "\u5468\u6708\u5B63\u62A5",
112363
+ "aliases": [
112364
+ "\u5468\u62A5",
112365
+ "\u6708\u62A5",
112366
+ "\u5B63\u62A5"
112367
+ ],
112368
+ "tone": [
112369
+ "\u5BA2\u89C2",
112370
+ "\u7B80\u6D01",
112371
+ "\u7ED3\u8BBA\u5148\u884C"
112372
+ ],
112373
+ "density": [
112374
+ "\u4E2D"
112375
+ ],
112376
+ "requiredSections": [
112377
+ {
112378
+ "terms": [
112379
+ "\u6982\u8981"
112380
+ ],
112381
+ "content": "\u672C\u671F\u7ED3\u8BBA\u4E00\u53E5\u8BDD + 2\u20133 \u4E2A\u5173\u952E\u6570"
112382
+ },
112383
+ {
112384
+ "terms": [
112385
+ "\u8FDB\u5C55",
112386
+ "\u6210\u679C"
112387
+ ],
112388
+ "content": "\u5B8C\u6210\u4E8B\u9879\u4E0E\u4EA7\u51FA\uFF0C\u5BF9\u7167\u8BA1\u5212"
112389
+ },
112390
+ {
112391
+ "terms": [
112392
+ "\u6570\u636E\u6307\u6807"
112393
+ ],
112394
+ "content": "\u5173\u952E\u6307\u6807\u73AF\u6BD4/\u540C\u6BD4\uFF0C\u53E3\u5F84\u4E00\u81F4\uFF1B\u5B9C \u6298\u7EBF\u6216\u67F1\u72B6"
112395
+ },
112396
+ {
112397
+ "terms": [
112398
+ "\u95EE\u9898"
112399
+ ],
112400
+ "content": "\u672A\u8FBE\u6210\u9879\u3001\u539F\u56E0\u3001\u9700\u8981\u7684\u652F\u6301"
112401
+ },
112402
+ {
112403
+ "terms": [
112404
+ "\u4E0B\u4E00\u6B65\u8BA1\u5212"
112405
+ ],
112406
+ "content": "\u4E0B\u671F\u76EE\u6807\u3001\u5173\u952E\u52A8\u4F5C\u3001\u65F6\u95F4\u70B9"
112407
+ }
112408
+ ],
112409
+ "narrative": "\u7ED3\u8BBA\u5148\u884C",
112410
+ "pages": {
112411
+ "min": 5,
112412
+ "max": 10
112413
+ },
112414
+ "researchFocus": [
112415
+ "\u884C\u4E1A\u57FA\u51C6\u4E0E\u540C\u884C\u6570\u636E",
112416
+ "\u6307\u6807\u53E3\u5F84\u5B9A\u4E49",
112417
+ "\u5916\u90E8\u73AF\u5883\u53D8\u5316"
112418
+ ],
112419
+ "motion": {
112420
+ "delivery": "read",
112421
+ "keywords": [
112422
+ "\u6C47\u62A5",
112423
+ "\u5468\u62A5",
112424
+ "\u6708\u62A5"
112425
+ ]
112426
+ }
112427
+ },
112428
+ {
112429
+ "id": "\u8FF0\u804C/\u664B\u5347",
112430
+ "tone": [
112431
+ "\u81EA\u4FE1",
112432
+ "\u6709\u636E",
112433
+ "\u4E2A\u4EBA\u89C6\u89D2"
112434
+ ],
112435
+ "density": [
112436
+ "\u4E2D"
112437
+ ],
112438
+ "requiredSections": [
112439
+ {
112440
+ "terms": [
112441
+ "\u804C\u8D23\u6982\u8FF0"
112442
+ ],
112443
+ "content": "\u5C97\u4F4D\u804C\u8D23\u4E0E\u8D1F\u8D23\u8303\u56F4"
112444
+ },
112445
+ {
112446
+ "terms": [
112447
+ "\u5173\u952E\u6210\u679C",
112448
+ "STAR"
112449
+ ],
112450
+ "content": "2\u20133 \u4E2A\u4EE3\u8868\u6027\u6210\u679C\uFF0C\u6309\u60C5\u5883-\u4EFB\u52A1-\u884C\u52A8-\u7ED3\u679C\u5199"
112451
+ },
112452
+ {
112453
+ "terms": [
112454
+ "\u6570\u636E\u4F50\u8BC1"
112455
+ ],
112456
+ "content": "\u6210\u679C\u7684\u91CF\u5316\u6570\u636E\u4E0E\u5BF9\u6BD4\u57FA\u51C6"
112457
+ },
112458
+ {
112459
+ "terms": [
112460
+ "\u80FD\u529B\u6210\u957F"
112461
+ ],
112462
+ "content": "\u76F8\u6BD4\u4E0A\u671F\u65B0\u589E\u7684\u80FD\u529B\uFF0C\u914D\u4E8B\u4F8B"
112463
+ },
112464
+ {
112465
+ "terms": [
112466
+ "\u89C4\u5212"
112467
+ ],
112468
+ "content": "\u4E0B\u4E00\u9636\u6BB5\u76EE\u6807\u4E0E\u8BA1\u5212"
112469
+ }
112470
+ ],
112471
+ "narrative": "\u7ED3\u8BBA\u5148\u884C",
112472
+ "pages": {
112473
+ "min": 8,
112474
+ "max": 12
112475
+ },
112476
+ "researchFocus": [
112477
+ "\u540C\u5C97\u4F4D\u80FD\u529B\u6A21\u578B",
112478
+ "\u884C\u4E1A\u5BF9\u6807\u6570\u636E",
112479
+ "\u8BE5\u9886\u57DF\u516C\u8BA4\u7684\u6210\u679C\u8861\u91CF\u53E3\u5F84"
112480
+ ],
112481
+ "motion": {
112482
+ "delivery": "read",
112483
+ "keywords": [
112484
+ "\u8FF0\u804C"
112485
+ ]
112486
+ }
112487
+ },
112488
+ {
112489
+ "id": "\u9879\u76EE\u7ACB\u9879/\u8BC4\u5BA1",
112490
+ "aliases": [
112491
+ "\u7ACB\u9879"
112492
+ ],
112493
+ "tone": [
112494
+ "\u4E25\u8C28",
112495
+ "\u8BF4\u670D"
112496
+ ],
112497
+ "density": [
112498
+ "\u4E2D\u504F\u5BC6"
112499
+ ],
112500
+ "requiredSections": [
112501
+ {
112502
+ "terms": [
112503
+ "\u80CC\u666F",
112504
+ "\u75DB\u70B9"
112505
+ ],
112506
+ "content": "\u4E3A\u4EC0\u4E48\u8981\u505A\uFF1A\u73B0\u72B6\u95EE\u9898\u4E0E\u4E0D\u505A\u7684\u4EE3\u4EF7"
112507
+ },
112508
+ {
112509
+ "terms": [
112510
+ "\u76EE\u6807"
112511
+ ],
112512
+ "content": "\u53EF\u8861\u91CF\u7684\u76EE\u6807\u4E0E\u9A8C\u6536\u6807\u51C6"
112513
+ },
112514
+ {
112515
+ "terms": [
112516
+ "\u65B9\u6848"
112517
+ ],
112518
+ "content": "\u65B9\u6848\u8981\u70B9\u4E0E\u5907\u9009\u65B9\u6848\u5BF9\u6BD4\uFF1B\u5B9C \u5BF9\u6BD4\u8868"
112519
+ },
112520
+ {
112521
+ "terms": [
112522
+ "\u8BA1\u5212",
112523
+ "\u91CC\u7A0B\u7891"
112524
+ ],
112525
+ "content": "\u9636\u6BB5\u5212\u5206\u3001\u91CC\u7A0B\u7891\u3001\u65F6\u95F4\uFF1B\u5B9C \u65F6\u95F4\u8F74"
112526
+ },
112527
+ {
112528
+ "terms": [
112529
+ "\u8D44\u6E90",
112530
+ "\u9884\u7B97"
112531
+ ],
112532
+ "content": "\u4EBA\u529B\u3001\u9884\u7B97\u3001\u5916\u90E8\u4F9D\u8D56\uFF1B\u5B9C \u8868\u683C"
112533
+ },
112534
+ {
112535
+ "terms": [
112536
+ "\u98CE\u9669"
112537
+ ],
112538
+ "content": "\u4E3B\u8981\u98CE\u9669\u3001\u6982\u7387\u5F71\u54CD\u3001\u5E94\u5BF9\u63AA\u65BD\uFF1B\u5B9C \u77E9\u9635"
112539
+ }
112540
+ ],
112541
+ "narrative": "\u95EE\u9898-\u65B9\u6848",
112542
+ "pages": {
112543
+ "min": 8,
112544
+ "max": 14
112545
+ },
112546
+ "researchFocus": [
112547
+ "\u540C\u7C7B\u9879\u76EE\u6295\u5165\u4EA7\u51FA",
112548
+ "\u6280\u672F\u65B9\u6848\u4E0E\u9009\u578B\u5BF9\u6BD4",
112549
+ "\u5408\u89C4\u4E0E\u98CE\u9669\u6848\u4F8B",
112550
+ "\u4EBA\u529B/\u9884\u7B97\u57FA\u51C6"
112551
+ ],
112552
+ "motion": {
112553
+ "delivery": "read",
112554
+ "keywords": [
112555
+ "\u8BC4\u5BA1",
112556
+ "review"
112557
+ ]
112558
+ }
112559
+ },
112560
+ {
112561
+ "id": "\u5E74\u5EA6\u603B\u7ED3/\u5E74\u4F1A",
112562
+ "aliases": [
112563
+ "\u5E74\u7EC8\u603B\u7ED3"
112564
+ ],
112565
+ "tone": [
112566
+ "\u632F\u594B",
112567
+ "\u4EEA\u5F0F\u611F"
112568
+ ],
112569
+ "density": [
112570
+ "\u7A00\u758F",
112571
+ "\u5927\u89C6\u89C9"
112572
+ ],
112573
+ "requiredSections": [
112574
+ {
112575
+ "terms": [
112576
+ "\u56DE\u987E",
112577
+ "\u9AD8\u5149"
112578
+ ],
112579
+ "content": "\u5E74\u5EA6\u9AD8\u5149\u65F6\u523B\uFF0C\u914D\u753B\u9762"
112580
+ },
112581
+ {
112582
+ "terms": [
112583
+ "\u5173\u952E\u6570\u636E"
112584
+ ],
112585
+ "content": "\u5168\u5E74\u6838\u5FC3\u6570\u636E\u4E0E\u589E\u957F\uFF1B\u5B9C \u5927\u6570\u5B57"
112586
+ },
112587
+ {
112588
+ "terms": [
112589
+ "\u91CC\u7A0B\u7891"
112590
+ ],
112591
+ "content": "\u6309\u65F6\u95F4\u6392\u5217\u7684\u5173\u952E\u8282\u70B9\uFF1B\u5B9C \u65F6\u95F4\u8F74"
112592
+ },
112593
+ {
112594
+ "terms": [
112595
+ "\u56E2\u961F"
112596
+ ],
112597
+ "content": "\u81F4\u8C22\u7684\u56E2\u961F\u4E0E\u4EBA\u7269\uFF0C\u914D\u6545\u4E8B"
112598
+ },
112599
+ {
112600
+ "terms": [
112601
+ "\u6765\u5E74\u5C55\u671B"
112602
+ ],
112603
+ "content": "\u6765\u5E74\u76EE\u6807\u4E0E\u65B9\u5411"
112604
+ }
112605
+ ],
112606
+ "narrative": "\u60C5\u7EEA\u7EBF",
112607
+ "pages": {
112608
+ "min": 12,
112609
+ "max": 20
112610
+ },
112611
+ "researchFocus": [
112612
+ "\u884C\u4E1A\u5E74\u5EA6\u5927\u4E8B",
112613
+ "\u540C\u884C\u91CC\u7A0B\u7891\u5BF9\u7167",
112614
+ "\u6765\u5E74\u8D8B\u52BF\u9884\u6D4B"
112615
+ ]
112616
+ },
112617
+ {
112618
+ "id": "\u5546\u4E1A\u8BA1\u5212\u4E66",
112619
+ "subtitle": "BP",
112620
+ "tone": [
112621
+ "\u81EA\u4FE1",
112622
+ "\u5168\u9762",
112623
+ "\u6570\u636E\u652F\u6491"
112624
+ ],
112625
+ "density": [
112626
+ "\u4E2D\u504F\u5BC6"
112627
+ ],
112628
+ "requiredSections": [
112629
+ {
112630
+ "terms": [
112631
+ "\u95EE\u9898"
112632
+ ],
112633
+ "content": "\u76EE\u6807\u7528\u6237\u7684\u75DB\u70B9\u4E0E\u89C4\u6A21"
112634
+ },
112635
+ {
112636
+ "terms": [
112637
+ "\u65B9\u6848"
112638
+ ],
112639
+ "content": "\u4EA7\u54C1\u5982\u4F55\u89E3\u51B3\uFF0C\u4E3A\u4EC0\u4E48\u662F\u73B0\u5728"
112640
+ },
112641
+ {
112642
+ "terms": [
112643
+ "\u5E02\u573A"
112644
+ ],
112645
+ "content": "\u5E02\u573A\u89C4\u6A21\u5206\u5C42\u4E0E\u589E\u901F\uFF0C\u6CE8\u660E\u6765\u6E90\uFF1B\u5B9C \u67F1\u72B6\u56FE"
112646
+ },
112647
+ {
112648
+ "terms": [
112649
+ "\u4EA7\u54C1"
112650
+ ],
112651
+ "content": "\u4EA7\u54C1\u5F62\u6001\u3001\u6838\u5FC3\u529F\u80FD\u3001\u5F53\u524D\u8FDB\u5C55"
112652
+ },
112653
+ {
112654
+ "terms": [
112655
+ "\u5546\u4E1A\u6A21\u5F0F"
112656
+ ],
112657
+ "content": "\u600E\u4E48\u8D5A\u94B1\uFF1A\u6536\u5165\u6765\u6E90\u3001\u5B9A\u4EF7\u3001\u5355\u4F4D\u7ECF\u6D4E"
112658
+ },
112659
+ {
112660
+ "terms": [
112661
+ "\u7ADE\u4E89"
112662
+ ],
112663
+ "content": "\u7ADE\u54C1\u683C\u5C40\u4E0E\u5DEE\u5F02\u5316\uFF1B\u5B9C \u77E9\u9635\u6216\u5BF9\u6BD4\u8868"
112664
+ },
112665
+ {
112666
+ "terms": [
112667
+ "\u8D22\u52A1\u9884\u6D4B"
112668
+ ],
112669
+ "content": "\u672A\u6765 3\u20135 \u5E74\u6536\u5165\u3001\u6210\u672C\u3001\u5229\u6DA6\u9884\u6D4B\u4E0E\u5173\u952E\u5047\u8BBE\uFF1B\u5B9C \u8868\u683C"
112670
+ },
112671
+ {
112672
+ "terms": [
112673
+ "\u56E2\u961F"
112674
+ ],
112675
+ "content": "\u6838\u5FC3\u56E2\u961F\u4E0E\u76F8\u5173\u7ECF\u5386"
112676
+ },
112677
+ {
112678
+ "terms": [
112679
+ "\u878D\u8D44"
112680
+ ],
112681
+ "key": true,
112682
+ "content": "\u878D\u8D44\u91D1\u989D\u3001\u51FA\u8BA9\u6BD4\u4F8B\u3001\u8D44\u91D1\u7528\u9014\u5360\u6BD4"
112683
+ }
112684
+ ],
112685
+ "narrative": "SCQA",
112686
+ "pages": {
112687
+ "min": 15,
112688
+ "max": 25
112689
+ },
112690
+ "researchFocus": [
112691
+ "\u5E02\u573A\u89C4\u6A21\u4E0E\u5206\u5C42",
112692
+ "\u7ADE\u4E89\u683C\u5C40\u4E0E\u4EFD\u989D",
112693
+ "\u5546\u4E1A\u6A21\u5F0F\u4E0E\u5355\u4F4D\u7ECF\u6D4E",
112694
+ "\u53EF\u6BD4\u516C\u53F8\u8D22\u52A1\u4E0E\u878D\u8D44"
112695
+ ]
112696
+ },
112697
+ {
112698
+ "id": "\u6295\u6807",
112699
+ "subtitle": "\u62DB\u6295\u6807",
112700
+ "tone": [
112701
+ "\u6B63\u5F0F",
112702
+ "\u8981\u7D20\u9F50\u5168",
112703
+ "\u5F97\u5206\u5BFC\u5411"
112704
+ ],
112705
+ "density": [
112706
+ "\u5BC6"
112707
+ ],
112708
+ "requiredSections": [
112709
+ {
112710
+ "terms": [
112711
+ "\u9700\u6C42\u7406\u89E3"
112712
+ ],
112713
+ "content": "\u5BF9\u62DB\u6807\u9700\u6C42\u4E0E\u8BC4\u5206\u70B9\u7684\u9010\u6761\u56DE\u5E94"
112714
+ },
112715
+ {
112716
+ "terms": [
112717
+ "\u65B9\u6848"
112718
+ ],
112719
+ "content": "\u6280\u672F\u65B9\u6848\u8981\u70B9\uFF0C\u5BF9\u5E94\u9700\u6C42\u6761\u76EE"
112720
+ },
112721
+ {
112722
+ "terms": [
112723
+ "\u56E2\u961F",
112724
+ "\u8D44\u8D28"
112725
+ ],
112726
+ "content": "\u9879\u76EE\u56E2\u961F\u914D\u7F6E\u4E0E\u8D44\u8D28\u8BC1\u4E66"
112727
+ },
112728
+ {
112729
+ "terms": [
112730
+ "\u6848\u4F8B\u4E1A\u7EE9"
112731
+ ],
112732
+ "content": "\u540C\u7C7B\u9879\u76EE\u4E1A\u7EE9\u3001\u5BA2\u6237\u3001\u89C4\u6A21"
112733
+ },
112734
+ {
112735
+ "terms": [
112736
+ "\u5B9E\u65BD\u8BA1\u5212"
112737
+ ],
112738
+ "content": "\u9636\u6BB5\u3001\u91CC\u7A0B\u7891\u3001\u5DE5\u671F\uFF1B\u5B9C \u65F6\u95F4\u8F74"
112739
+ },
112740
+ {
112741
+ "terms": [
112742
+ "\u62A5\u4EF7"
112743
+ ],
112744
+ "key": true,
112745
+ "content": "\u62A5\u4EF7\u603B\u989D\u4E0E\u5206\u9879\u660E\u7EC6\u3001\u4ED8\u6B3E\u65B9\u5F0F\uFF1B\u5B9C \u8868\u683C"
112746
+ },
112747
+ {
112748
+ "terms": [
112749
+ "\u552E\u540E"
112750
+ ],
112751
+ "content": "\u552E\u540E\u670D\u52A1\u5185\u5BB9\u3001\u54CD\u5E94\u65F6\u95F4\u3001\u8D28\u4FDD\u671F"
112752
+ }
112753
+ ],
112754
+ "narrative": "\u7ED3\u8BBA\u5148\u884C",
112755
+ "pages": {
112756
+ "min": 15,
112757
+ "max": 30
112758
+ },
112759
+ "researchFocus": [
112760
+ "\u62DB\u6807\u65B9\u80CC\u666F\u4E0E\u65E2\u5F80\u91C7\u8D2D",
112761
+ "\u8BC4\u5206\u529E\u6CD5\u4E0E\u8D44\u8D28\u8981\u6C42",
112762
+ "\u540C\u7C7B\u4E2D\u6807\u516C\u544A\u4E0E\u62A5\u4EF7\u533A\u95F4",
112763
+ "\u6807\u6746\u6848\u4F8B"
112764
+ ]
112765
+ },
112766
+ {
112767
+ "id": "\u653F\u52A1/\u515A\u653F\u6C47\u62A5",
112768
+ "aliases": [
112769
+ "\u653F\u52A1\u6C47\u62A5"
112770
+ ],
112771
+ "tone": [
112772
+ "\u4E25\u8083",
112773
+ "\u89C4\u8303"
112774
+ ],
112775
+ "density": [
112776
+ "\u4E2D\u504F\u5BC6"
112777
+ ],
112778
+ "requiredSections": [
112779
+ {
112780
+ "terms": [
112781
+ "\u80CC\u666F",
112782
+ "\u4F9D\u636E"
112783
+ ],
112784
+ "content": "\u653F\u7B56\u4F9D\u636E\u4E0E\u4E0A\u7EA7\u90E8\u7F72\uFF0C\u5F15\u539F\u6587\u51FA\u5904"
112785
+ },
112786
+ {
112787
+ "terms": [
112788
+ "\u5DE5\u4F5C\u4E3E\u63AA"
112789
+ ],
112790
+ "content": "\u91C7\u53D6\u7684\u4E3B\u8981\u63AA\u65BD\uFF0C\u5206\u6761\u5217\u51FA"
112791
+ },
112792
+ {
112793
+ "terms": [
112794
+ "\u6210\u6548\u6570\u636E"
112795
+ ],
112796
+ "content": "\u91CF\u5316\u6210\u6548\u4E0E\u540C\u6BD4\uFF0C\u6CE8\u660E\u53E3\u5F84\uFF1B\u5B9C \u8868\u683C"
112797
+ },
112798
+ {
112799
+ "terms": [
112800
+ "\u5B58\u5728\u95EE\u9898"
112801
+ ],
112802
+ "content": "\u5B58\u5728\u7684\u95EE\u9898\u4E0E\u539F\u56E0\u5206\u6790"
112803
+ },
112804
+ {
112805
+ "terms": [
112806
+ "\u4E0B\u6B65\u90E8\u7F72"
112807
+ ],
112808
+ "content": "\u4E0B\u4E00\u6B65\u5DE5\u4F5C\u5B89\u6392\u4E0E\u65F6\u95F4\u8282\u70B9"
112809
+ }
112810
+ ],
112811
+ "narrative": "\u7ED3\u8BBA\u5148\u884C",
112812
+ "pages": {
112813
+ "min": 8,
112814
+ "max": 15
112815
+ },
112816
+ "researchFocus": [
112817
+ "\u653F\u7B56\u6587\u4EF6\u4E0E\u4F9D\u636E\u539F\u6587",
112818
+ "\u4E0A\u7EA7\u90E8\u7F72\u53E3\u5F84",
112819
+ "\u540C\u7EA7\u5730\u533A\u505A\u6CD5",
112820
+ "\u516C\u5F00\u7EDF\u8BA1\u6570\u636E"
112821
+ ],
112822
+ "motion": {
112823
+ "delivery": "read",
112824
+ "keywords": [
112825
+ "\u6C47\u62A5"
112826
+ ]
112827
+ }
112828
+ },
112829
+ {
112830
+ "id": "\u516C\u53F8/\u4EA7\u54C1\u4ECB\u7ECD",
112831
+ "aliases": [
112832
+ "\u516C\u53F8\u4ECB\u7ECD"
112833
+ ],
112834
+ "tone": [
112835
+ "\u54C1\u724C",
112836
+ "\u81EA\u4FE1",
112837
+ "\u5229\u76CA\u5BFC\u5411"
112838
+ ],
112839
+ "density": [
112840
+ "\u4E2D",
112841
+ "\u91CD\u89C6\u89C9"
112842
+ ],
112843
+ "requiredSections": [
112844
+ {
112845
+ "terms": [
112846
+ "\u516C\u53F8",
112847
+ "\u613F\u666F"
112848
+ ],
112849
+ "content": "\u516C\u53F8\u662F\u8C01\u3001\u613F\u666F\u4E00\u53E5\u8BDD\u3001\u5173\u952E\u80CC\u666F\u6570\u636E"
112850
+ },
112851
+ {
112852
+ "terms": [
112853
+ "\u6838\u5FC3\u80FD\u529B"
112854
+ ],
112855
+ "content": "\u6838\u5FC3\u6280\u672F\u6216\u80FD\u529B\uFF0C\u4E0E\u540C\u884C\u7684\u5DEE\u5F02"
112856
+ },
112857
+ {
112858
+ "terms": [
112859
+ "\u4EA7\u54C1",
112860
+ "\u65B9\u6848"
112861
+ ],
112862
+ "content": "\u4EA7\u54C1\u6216\u65B9\u6848\u7EC4\u5408\u4E0E\u9002\u7528\u573A\u666F"
112863
+ },
112864
+ {
112865
+ "terms": [
112866
+ "\u6807\u6746\u6848\u4F8B"
112867
+ ],
112868
+ "content": "\u6807\u6746\u5BA2\u6237\u4E0E\u91CF\u5316\u6210\u679C"
112869
+ },
112870
+ {
112871
+ "terms": [
112872
+ "\u6570\u636E"
112873
+ ],
112874
+ "content": "\u89C4\u6A21\u3001\u5BA2\u6237\u6570\u3001\u589E\u957F\u7B49\u53EF\u516C\u5F00\u6570\u636E\uFF1B\u5B9C \u5927\u6570\u5B57"
112875
+ },
112876
+ {
112877
+ "terms": [
112878
+ "\u5408\u4F5C\u9080\u8BF7"
112879
+ ],
112880
+ "content": "\u5408\u4F5C\u65B9\u5F0F\u4E0E\u8054\u7CFB\u65B9\u5F0F"
112881
+ }
112882
+ ],
112883
+ "narrative": "\u95EE\u9898-\u65B9\u6848",
112884
+ "pages": {
112885
+ "min": 8,
112886
+ "max": 15
112887
+ },
112888
+ "researchFocus": [
112889
+ "\u884C\u4E1A\u5730\u4F4D\u4E0E\u7B2C\u4E09\u65B9\u62A5\u544A",
112890
+ "\u7ADE\u54C1\u5BF9\u6BD4",
112891
+ "\u53EF\u516C\u5F00\u5F15\u7528\u7684\u5BA2\u6237\u6848\u4F8B",
112892
+ "\u884C\u4E1A\u8D8B\u52BF"
112893
+ ]
112894
+ },
112895
+ {
112896
+ "id": "\u4EA7\u54C1\u8C03\u7814",
112897
+ "subtitle": "\u7ADE\u54C1\u5206\u6790 \u5E02\u573A\u7814\u7A76",
112898
+ "tone": [
112899
+ "\u5BA2\u89C2",
112900
+ "\u6709\u636E",
112901
+ "\u4E0D\u66FF\u7ED3\u8BBA\u4E0B\u5224\u65AD"
112902
+ ],
112903
+ "density": [
112904
+ "\u4E2D"
112905
+ ],
112906
+ "requiredSections": [
112907
+ {
112908
+ "terms": [
112909
+ "\u5E02\u573A\u89C4\u6A21"
112910
+ ],
112911
+ "content": "\u5E02\u573A\u89C4\u6A21\u4E0E\u589E\u901F\uFF0C\u6CE8\u660E\u6765\u6E90\u5E74\u4EFD\uFF1B\u5B9C \u67F1\u72B6\u56FE"
112912
+ },
112913
+ {
112914
+ "terms": [
112915
+ "\u7ADE\u54C1\u683C\u5C40"
112916
+ ],
112917
+ "content": "\u4E3B\u8981\u7ADE\u54C1\u7684\u5B9A\u4F4D\u3001\u529F\u80FD\u3001\u5B9A\u4EF7\u3001\u4EFD\u989D\uFF1B\u5B9C \u5BF9\u6BD4\u8868"
112918
+ },
112919
+ {
112920
+ "terms": [
112921
+ "\u7528\u6237\u9700\u6C42"
112922
+ ],
112923
+ "content": "\u7528\u6237\u7684\u6838\u5FC3\u9700\u6C42\u4E0E\u75DB\u70B9\uFF0C\u5F15\u7528\u8BC4\u4EF7\u539F\u8BDD"
112924
+ },
112925
+ {
112926
+ "terms": [
112927
+ "\u5DEE\u8DDD\u4E0E\u673A\u4F1A"
112928
+ ],
112929
+ "content": "\u7ADE\u54C1\u672A\u6EE1\u8DB3\u7684\u9700\u6C42\u4E0E\u6211\u4EEC\u7684\u673A\u4F1A"
112930
+ },
112931
+ {
112932
+ "terms": [
112933
+ "\u7ED3\u8BBA\u5EFA\u8BAE"
112934
+ ],
112935
+ "content": "\u57FA\u4E8E\u4E0A\u8FF0\u4E8B\u5B9E\u7684\u5224\u65AD\u4E0E\u5EFA\u8BAE"
112936
+ }
112937
+ ],
112938
+ "narrative": "\u5148\u6446\u4E8B\u5B9E\uFF0C\u518D\u7ED9\u5224\u65AD",
112939
+ "pages": {
112940
+ "min": 10,
112941
+ "max": 15
112942
+ },
112943
+ "researchFocus": [
112944
+ "\u5E02\u573A\u89C4\u6A21\u4E0E\u589E\u901F",
112945
+ "\u7ADE\u54C1\u529F\u80FD\u4E0E\u5B9A\u4EF7\u5BF9\u6BD4",
112946
+ "\u7528\u6237\u8BC4\u4EF7\u4E0E\u5DEE\u8BC4",
112947
+ "\u6E20\u9053\u4E0E\u4EFD\u989D\u6570\u636E"
112948
+ ],
112949
+ "motion": {
112950
+ "delivery": "read",
112951
+ "keywords": [
112952
+ "\u8C03\u7814",
112953
+ "research"
112954
+ ]
112955
+ }
112956
+ },
112957
+ {
112958
+ "id": "\u4F1A\u8BAE\u7EAA\u8981",
112959
+ "subtitle": "\u4F1A\u540E\u540C\u6B65",
112960
+ "tone": [
112961
+ "\u7B80\u6D01",
112962
+ "\u53EF\u6267\u884C",
112963
+ "\u4E0D\u590D\u8FF0\u8FC7\u7A0B"
112964
+ ],
112965
+ "density": [
112966
+ "\u4F4E"
112967
+ ],
112968
+ "requiredSections": [
112969
+ {
112970
+ "terms": [
112971
+ "\u8BAE\u9898"
112972
+ ],
112973
+ "content": "\u8BA8\u8BBA\u7684\u8BAE\u9898\u6E05\u5355"
112974
+ },
112975
+ {
112976
+ "terms": [
112977
+ "\u7ED3\u8BBA"
112978
+ ],
112979
+ "content": "\u6BCF\u4E2A\u8BAE\u9898\u7684\u7ED3\u8BBA"
112980
+ },
112981
+ {
112982
+ "terms": [
112983
+ "\u5F85\u529E"
112984
+ ],
112985
+ "content": "\u5F85\u529E\u4E8B\u9879\u3001\u8D1F\u8D23\u4EBA\u3001\u622A\u6B62\u65F6\u95F4\uFF1B\u5B9C \u8868\u683C"
112986
+ },
112987
+ {
112988
+ "terms": [
112989
+ "\u5F85\u51B3\u4E8B\u9879"
112990
+ ],
112991
+ "content": "\u672A\u51B3\u4E8B\u9879\u4E0E\u5F85\u51B3\u4EBA"
112992
+ }
112993
+ ],
112994
+ "narrative": "\u7ED3\u8BBA\u5148\u884C",
112995
+ "pages": {
112996
+ "min": 4,
112997
+ "max": 8
112998
+ },
112999
+ "researchFocus": [
113000
+ "\u8BAE\u9898\u6D89\u53CA\u7684\u5916\u90E8\u4E8B\u5B9E",
113001
+ "\u76F8\u5173\u53E3\u5F84\u4E0E\u5B9A\u4E49",
113002
+ "\u540C\u7C7B\u51B3\u7B56\u7684\u516C\u5F00\u5148\u4F8B"
113003
+ ],
113004
+ "motion": {
113005
+ "delivery": "read",
113006
+ "keywords": [
113007
+ "\u7EAA\u8981",
113008
+ "minutes"
113009
+ ]
113010
+ }
113011
+ },
113012
+ {
113013
+ "id": "\u6570\u636E\u5206\u6790",
113014
+ "subtitle": "\u6570\u636E\u89E3\u8BFB \u6307\u6807\u590D\u76D8",
113015
+ "tone": [
113016
+ "\u7ED3\u8BBA\u5148\u884C",
113017
+ "\u53EF\u8FFD\u6EAF"
113018
+ ],
113019
+ "density": [
113020
+ "\u4E2D"
113021
+ ],
113022
+ "requiredSections": [
113023
+ {
113024
+ "terms": [
113025
+ "\u7ED3\u8BBA"
113026
+ ],
113027
+ "content": "\u4E00\u53E5\u8BDD\u7ED3\u8BBA\u4E0E\u5173\u952E\u6570\u5B57\uFF1B\u5B9C \u5927\u6570\u5B57"
113028
+ },
113029
+ {
113030
+ "terms": [
113031
+ "\u53E3\u5F84\u4E0E\u6570\u636E\u6E90"
113032
+ ],
113033
+ "content": "\u6307\u6807\u5B9A\u4E49\u3001\u6570\u636E\u6765\u6E90\u3001\u65F6\u95F4\u8303\u56F4"
113034
+ },
113035
+ {
113036
+ "terms": [
113037
+ "\u7EF4\u5EA6\u62C6\u89E3"
113038
+ ],
113039
+ "content": "\u6309\u7EF4\u5EA6\u62C6\u89E3\u7684\u5206\u5E03\u4E0E\u53D8\u5316\uFF1B\u5B9C \u67F1\u72B6\u6216\u6298\u7EBF"
113040
+ },
113041
+ {
113042
+ "terms": [
113043
+ "\u5F52\u56E0"
113044
+ ],
113045
+ "content": "\u53D8\u5316\u7684\u4E3B\u8981\u539F\u56E0\u53CA\u5176\u8D21\u732E"
113046
+ },
113047
+ {
113048
+ "terms": [
113049
+ "\u5EFA\u8BAE"
113050
+ ],
113051
+ "content": "\u57FA\u4E8E\u5F52\u56E0\u7684\u53EF\u6267\u884C\u5EFA\u8BAE"
113052
+ }
113053
+ ],
113054
+ "narrative": "\u7ED3\u8BBA\u5148\u884C",
113055
+ "pages": {
113056
+ "min": 6,
113057
+ "max": 10
113058
+ },
113059
+ "researchFocus": [
113060
+ "\u6307\u6807\u53E3\u5F84\u5B9A\u4E49",
113061
+ "\u884C\u4E1A\u57FA\u51C6\u503C",
113062
+ "\u540C\u7C7B\u5F52\u56E0\u6848\u4F8B\u4E0E\u65B9\u6CD5"
113063
+ ],
113064
+ "motion": {
113065
+ "delivery": "read",
113066
+ "keywords": [
113067
+ "\u5206\u6790",
113068
+ "analysis"
113069
+ ]
113070
+ }
113071
+ }
113072
+ ],
113073
+ "narratives": [
113074
+ {
113075
+ "deckType": "\u62A5\u544A/\u603B\u7ED3",
113076
+ "structure": "\u7ED3\u8BBA\u5148\u884C",
113077
+ "flow": [
113078
+ "\u7ED3\u8BBA",
113079
+ "\u8BC1\u636E",
113080
+ "\u7EC6\u8282",
113081
+ "\u4E0B\u4E00\u6B65"
113082
+ ]
113083
+ },
113084
+ {
113085
+ "deckType": "\u4EA7\u54C1/\u9500\u552E",
113086
+ "structure": "\u95EE\u9898-\u65B9\u6848",
113087
+ "flow": [
113088
+ "\u75DB\u70B9",
113089
+ "\u65B9\u6848",
113090
+ "\u4EF7\u503C",
113091
+ "\u4F50\u8BC1",
113092
+ "CTA"
113093
+ ]
113094
+ },
113095
+ {
113096
+ "deckType": "\u57F9\u8BAD/\u6559\u5B66",
113097
+ "structure": "\u7531\u6D45\u5165\u6DF1",
113098
+ "flow": [
113099
+ "\u57FA\u7840",
113100
+ "\u6838\u5FC3",
113101
+ "\u8FDB\u9636",
113102
+ "\u7EC3\u4E60"
113103
+ ]
113104
+ },
113105
+ {
113106
+ "deckType": "\u878D\u8D44/\u8DEF\u6F14",
113107
+ "structure": "SCQA",
113108
+ "flow": [
113109
+ "\u60C5\u5883",
113110
+ "\u51B2\u7A81",
113111
+ "\u95EE\u9898",
113112
+ "\u89E3\u7B54"
113113
+ ]
113114
+ },
113115
+ {
113116
+ "deckType": "\u6D3B\u52A8/\u5BA3\u4F20",
113117
+ "structure": "\u60C5\u7EEA\u7EBF",
113118
+ "flow": [
113119
+ "\u94A9\u5B50",
113120
+ "\u5171\u9E23",
113121
+ "\u9AD8\u6F6E",
113122
+ "\u884C\u52A8"
113123
+ ]
113124
+ }
113125
+ ],
113126
+ "styleBias": [
113127
+ {
113128
+ "tones": [
113129
+ "\u5F20\u529B",
113130
+ "\u60C5\u7EEA"
113131
+ ],
113132
+ "scenarios": [
113133
+ "pitch",
113134
+ "\u53D1\u5E03\u4F1A",
113135
+ "\u5927\u4F1A"
113136
+ ],
113137
+ "look": "\u6DF1\u8272\u9177\u70AB",
113138
+ "styles": [
113139
+ "cool",
113140
+ "apple",
113141
+ "black-gold"
113142
+ ]
113143
+ },
113144
+ {
113145
+ "tones": [
113146
+ "\u52A1\u5B9E"
113147
+ ],
113148
+ "scenarios": [
113149
+ "\u5185\u5BA1",
113150
+ "\u9500\u552E"
113151
+ ],
113152
+ "look": "\u767D\u5E95\u54A8\u8BE2",
113153
+ "styles": [
113154
+ "mckinsey"
113155
+ ]
113156
+ },
113157
+ {
113158
+ "tones": [
113159
+ "\u6E05\u6670"
113160
+ ],
113161
+ "scenarios": [
113162
+ "\u8BB2\u5EA7",
113163
+ "\u57F9\u8BAD"
113164
+ ],
113165
+ "look": "\u4E2D\u6027/\u6559\u80B2\u98CE",
113166
+ "styles": []
113167
+ }
113168
+ ],
113169
+ "motionExtraKeywords": {
113170
+ "presented": [
113171
+ "\u4E3B\u9898\u6F14\u8BB2"
113172
+ ],
113173
+ "read": [
113174
+ "\u62A5\u544A",
113175
+ "report",
113176
+ "\u8BB2\u4E49",
113177
+ "handout"
113178
+ ]
113179
+ }
113180
+ };
113181
+
111580
113182
  // packages/core/dist/document/deck-catalog.js
113183
+ var SCENARIO_IDS = new Set(SCENARIO_MATRIX.scenarios.map((s) => s.id));
111581
113184
  var KINDS = ["skin", "pack"];
111582
113185
  var MODES = ["light", "dark"];
111583
113186
  var RENDER_MODES = ["classic-v1", "theme-v2"];
@@ -111666,6 +113269,14 @@ function parseCatalog(raw) {
111666
113269
  errors.push(`${at}: missing sample`);
111667
113270
  if (e?.motion !== void 0 && !isStr(e.motion))
111668
113271
  errors.push(`${at}: motion must be a string when present`);
113272
+ if (e?.use_cases !== void 0) {
113273
+ if (!isStrArr(e.use_cases))
113274
+ errors.push(`${at}: use_cases must be a string array`);
113275
+ else
113276
+ for (const uc of e.use_cases)
113277
+ if (!SCENARIO_IDS.has(uc))
113278
+ errors.push(`${at}: use_cases "${uc}" is not a scenarios.json id`);
113279
+ }
111669
113280
  if (errors.length === before) {
111670
113281
  entries.push({
111671
113282
  id: e.id,
@@ -111676,11 +113287,27 @@ function parseCatalog(raw) {
111676
113287
  scenarios: e.scenarios,
111677
113288
  mode: e.mode,
111678
113289
  sample: e.sample,
111679
- ...e.motion !== void 0 ? { motion: e.motion } : {}
113290
+ ...e.motion !== void 0 ? { motion: e.motion } : {},
113291
+ ...isStrArr(e.use_cases) ? { use_cases: e.use_cases } : {}
111680
113292
  });
111681
113293
  }
111682
113294
  });
111683
- return { catalog: errors.length ? null : { groups, ...collections.length ? { collections } : {}, entries }, errors };
113295
+ let fallbackEntryIds;
113296
+ if (o.fallbackEntryIds !== void 0) {
113297
+ if (!isStrArr(o.fallbackEntryIds))
113298
+ errors.push("fallbackEntryIds must be a string array");
113299
+ else {
113300
+ const ids = new Set(entries.map((e) => e.id));
113301
+ for (const id of o.fallbackEntryIds)
113302
+ if (!ids.has(id))
113303
+ errors.push(`fallbackEntryIds: "${id}" is not a registered entry`);
113304
+ fallbackEntryIds = o.fallbackEntryIds;
113305
+ }
113306
+ }
113307
+ return {
113308
+ catalog: errors.length ? null : { groups, ...collections.length ? { collections } : {}, entries, ...fallbackEntryIds ? { fallbackEntryIds } : {} },
113309
+ errors
113310
+ };
111684
113311
  }
111685
113312
  function resolveEntry(catalog, id) {
111686
113313
  return catalog.entries.find((e) => e.id === id) ?? null;
@@ -111693,8 +113320,8 @@ function cssFileOf(entry) {
111693
113320
  }
111694
113321
 
111695
113322
  // apps/admin/data/skills.lib/document/bin-src/lib/user-styles.mjs
111696
- var import_node_fs2 = require("node:fs");
111697
- var import_node_path3 = require("node:path");
113323
+ var import_node_fs = require("node:fs");
113324
+ var import_node_path4 = require("node:path");
111698
113325
  var SAFE_NAME = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
111699
113326
  function userStylesDir() {
111700
113327
  return process.env.TALOS_DOC_STYLES_DIR?.trim() || null;
@@ -111702,15 +113329,15 @@ function userStylesDir() {
111702
113329
  function userSkinDir(name) {
111703
113330
  const root = userStylesDir();
111704
113331
  if (!root || !SAFE_NAME.test(name)) return null;
111705
- const dir = (0, import_node_path3.join)(root, "styles", name);
111706
- return (0, import_node_fs2.existsSync)((0, import_node_path3.join)(dir, "skin.css")) ? dir : null;
113332
+ const dir = (0, import_node_path4.join)(root, "styles", name);
113333
+ return (0, import_node_fs.existsSync)((0, import_node_path4.join)(dir, "skin.css")) ? dir : null;
111707
113334
  }
111708
113335
  function userThemePath(name) {
111709
113336
  const root = userStylesDir();
111710
113337
  const base = name.replace(/\.json$/i, "");
111711
113338
  if (!root || !SAFE_NAME.test(base)) return null;
111712
- const path = (0, import_node_path3.join)(root, "themes", `${base}.json`);
111713
- return (0, import_node_fs2.existsSync)(path) ? path : null;
113339
+ const path = (0, import_node_path4.join)(root, "themes", `${base}.json`);
113340
+ return (0, import_node_fs.existsSync)(path) ? path : null;
111714
113341
  }
111715
113342
 
111716
113343
  // apps/admin/data/skills.lib/document/bin-src/doc-gen.mjs
@@ -111720,13 +113347,13 @@ function die(msg, code = 1) {
111720
113347
  process.exit(code);
111721
113348
  }
111722
113349
  async function writeArtifactAtomically(out, bytes) {
111723
- const temp = (0, import_node_path4.join)((0, import_node_path4.dirname)(out), `.${(0, import_node_path4.basename)(out)}.${process.pid}.${(0, import_node_crypto.randomUUID)()}.tmp`);
113350
+ const temp = (0, import_node_path5.join)((0, import_node_path5.dirname)(out), `.${(0, import_node_path5.basename)(out)}.${process.pid}.${(0, import_node_crypto.randomUUID)()}.tmp`);
111724
113351
  try {
111725
- await (0, import_promises2.writeFile)(temp, Buffer.from(bytes), { flag: "wx" });
111726
- await (0, import_promises2.rename)(temp, out);
113352
+ await (0, import_promises3.writeFile)(temp, Buffer.from(bytes), { flag: "wx" });
113353
+ await (0, import_promises3.rename)(temp, out);
111727
113354
  } catch (error) {
111728
113355
  try {
111729
- await (0, import_promises2.rm)(temp, { force: true });
113356
+ await (0, import_promises3.rm)(temp, { force: true });
111730
113357
  } catch (cleanupError) {
111731
113358
  process.stderr.write(`doc-gen: cleanup failed for ${temp}: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}
111732
113359
  `);
@@ -111738,17 +113365,13 @@ async function renderPdfViaService(spec, theme) {
111738
113365
  const url = process.env.TALOS_PDF_URL;
111739
113366
  if (!url) return null;
111740
113367
  const token = process.env.TALOS_PDF_TOKEN;
111741
- const print = themePrintOptions(theme, spec.title);
111742
113368
  try {
111743
- if (print && /[一-鿿぀-ヿ]/.test(`${print.headerTemplate}${print.footerTemplate}`)) {
111744
- process.stderr.write("doc-gen: warning: CJK in page header/footer may render blank (Chromium print-template limitation); prefer Latin/digits there\n");
111745
- }
111746
113369
  const res = await fetch(url, {
111747
113370
  method: "POST",
111748
113371
  headers: { "content-type": "application/json", ...token ? { authorization: `Bearer ${token}` } : {} },
111749
113372
  // The service injects a CJK @font-face (Chromium can't load system CJK
111750
- // fonts in printToPDF); the bin sends themed HTML + print header/footer.
111751
- body: JSON.stringify({ html: specToHtml(spec, theme), ...print ?? {} })
113373
+ // fonts in printToPDF); the bin sends themed body HTML; labels are added after pagination.
113374
+ body: JSON.stringify({ html: specToHtml(spec, theme) })
111752
113375
  });
111753
113376
  if (!res.ok) {
111754
113377
  process.stderr.write(`doc-gen: pdf service HTTP ${res.status}; trying headless Chromium
@@ -111784,7 +113407,7 @@ async function main() {
111784
113407
  themePath = args[themeIdx + 1];
111785
113408
  if (!themePath) die("--theme needs a path to a theme.json", 64);
111786
113409
  args.splice(themeIdx, 2);
111787
- if (!(0, import_node_fs3.existsSync)(themePath)) themePath = userThemePath(themePath) ?? themePath;
113410
+ if (!(0, import_node_fs2.existsSync)(themePath)) themePath = userThemePath(themePath) ?? themePath;
111788
113411
  }
111789
113412
  const topicFlag = takeFlag(args, "--topic");
111790
113413
  const paletteFlag = takeFlag(args, "--palette");
@@ -111798,7 +113421,7 @@ async function main() {
111798
113421
  if (kind === "pptx") die(DECKS_ARE_HTML2PPTX, 64);
111799
113422
  let spec;
111800
113423
  try {
111801
- spec = JSON.parse(await (0, import_promises2.readFile)(specPath, "utf-8"));
113424
+ spec = JSON.parse(await (0, import_promises3.readFile)(specPath, "utf-8"));
111802
113425
  } catch (e) {
111803
113426
  die(`bad spec: ${e.message}`, 64);
111804
113427
  }
@@ -111812,7 +113435,7 @@ async function main() {
111812
113435
  let rawTheme = spec.theme;
111813
113436
  if (themePath) {
111814
113437
  try {
111815
- rawTheme = JSON.parse(await (0, import_promises2.readFile)(themePath, "utf-8"));
113438
+ rawTheme = JSON.parse(await (0, import_promises3.readFile)(themePath, "utf-8"));
111816
113439
  } catch (e) {
111817
113440
  die(`bad theme: ${e.message}`, 64);
111818
113441
  }
@@ -111820,21 +113443,21 @@ async function main() {
111820
113443
  } else if (accentFlag || styleFlag) {
111821
113444
  let accent = accentFlag;
111822
113445
  if (!accent && styleFlag) {
111823
- const skillDir = (0, import_node_path4.dirname)((0, import_node_path4.dirname)(process.argv[1] || ""));
111824
- let skinPath = (0, import_node_path4.join)(styleFlag, "skin.css");
111825
- if (!(0, import_node_fs3.existsSync)(skinPath)) {
113446
+ const skillDir = (0, import_node_path5.dirname)((0, import_node_path5.dirname)(process.argv[1] || ""));
113447
+ let skinPath = (0, import_node_path5.join)(styleFlag, "skin.css");
113448
+ if (!(0, import_node_fs2.existsSync)(skinPath)) {
111826
113449
  const user = userSkinDir(styleFlag);
111827
- skinPath = user ? (0, import_node_path4.join)(user, "skin.css") : (0, import_node_path4.join)(skillDir, "styles", styleFlag, "skin.css");
113450
+ skinPath = user ? (0, import_node_path5.join)(user, "skin.css") : (0, import_node_path5.join)(skillDir, "styles", styleFlag, "skin.css");
111828
113451
  try {
111829
- const { catalog } = parseCatalog(JSON.parse(await (0, import_promises2.readFile)((0, import_node_path4.join)(skillDir, "catalog.json"), "utf-8")));
113452
+ const { catalog } = parseCatalog(JSON.parse(await (0, import_promises3.readFile)((0, import_node_path5.join)(skillDir, "catalog.json"), "utf-8")));
111830
113453
  const entry = catalog ? resolveEntry(catalog, styleFlag) : null;
111831
- if (entry) skinPath = (0, import_node_path4.join)(skillDir, assetDirOf(entry), cssFileOf(entry));
113454
+ if (entry) skinPath = (0, import_node_path5.join)(skillDir, assetDirOf(entry), cssFileOf(entry));
111832
113455
  } catch {
111833
113456
  }
111834
113457
  }
111835
113458
  let skinCss;
111836
113459
  try {
111837
- skinCss = await (0, import_promises2.readFile)(skinPath, "utf-8");
113460
+ skinCss = await (0, import_promises3.readFile)(skinPath, "utf-8");
111838
113461
  } catch {
111839
113462
  die(`--style: cannot read ${skinPath}`, 66);
111840
113463
  }
@@ -111856,7 +113479,7 @@ async function main() {
111856
113479
  bytes = await renderPdfViaService(spec, theme);
111857
113480
  if (bytes) engine = "pdf (chromium)";
111858
113481
  else {
111859
- bytes = await renderPdfHeadless(specToHtml(spec, theme), themePrintOptions(theme, spec.title) ?? {}).catch((e) => die(`headless Chromium failed: ${e.message}`, 1));
113482
+ bytes = await renderPdfHeadless(specToHtml(spec, theme)).catch((e) => die(`headless Chromium failed: ${e.message}`, 1));
111860
113483
  if (bytes) engine = "pdf (headless chromium)";
111861
113484
  else die(PDF_NEEDS_BROWSER, 69);
111862
113485
  }
@@ -111868,6 +113491,7 @@ async function main() {
111868
113491
  die(e.message, e.message.startsWith("unsupported kind") ? 64 : 1);
111869
113492
  }
111870
113493
  }
113494
+ if (kind === "pdf") bytes = await addPdfPageLabels(bytes, theme, spec.title, { fontDir: (0, import_node_path5.join)(__dirname, "..", "assets", "pdf-fonts") });
111871
113495
  await writeArtifactAtomically(out, bytes);
111872
113496
  process.stdout.write(`wrote ${out}${kind === "pdf" ? ` [${engine}]` : ""}
111873
113497
  `);
@@ -111890,8 +113514,8 @@ async function reportPdf(out, bytes, spec, noPreview) {
111890
113514
  if (!noPreview && validation.ok) {
111891
113515
  try {
111892
113516
  for (const r of await renderPdfPages(bytes, "all", 1)) {
111893
- const dest = (0, import_node_path4.join)((0, import_node_path4.dirname)(out), `${(0, import_node_path4.basename)(out).replace(/\.[^.]+$/, "")}_p${r.page}.png`);
111894
- await (0, import_promises2.writeFile)(dest, Buffer.from(r.png));
113517
+ const dest = (0, import_node_path5.join)((0, import_node_path5.dirname)(out), `${(0, import_node_path5.basename)(out).replace(/\.[^.]+$/, "")}_p${r.page}.png`);
113518
+ await (0, import_promises3.writeFile)(dest, Buffer.from(r.png));
111895
113519
  previews.push(dest);
111896
113520
  }
111897
113521
  } catch (e) {
@@ -111902,6 +113526,9 @@ async function reportPdf(out, bytes, spec, noPreview) {
111902
113526
  const report = {
111903
113527
  valid: validation.ok,
111904
113528
  pages: validation.pages ?? 0,
113529
+ validationScope: "structure-only",
113530
+ textStatsSource: "input-spec",
113531
+ warnings: validation.warnings,
111905
113532
  ...documentTextStats(spec),
111906
113533
  previews,
111907
113534
  ...validation.ok ? {} : { errors: validation.errors }