@gmb/bitmark-parser-generator 4.1.2 → 4.2.0

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.
@@ -11,7 +11,24 @@ var BitType = superenum({
11
11
  // Used to indicate a bit is commented out
12
12
  _standard: "_standard",
13
13
  // Not to be used as a bit, but as a base for other bit types
14
+ advertising: "advertising",
15
+ advertisingAdvertorial: "advertising-advertorial",
16
+ advertisingCallToAction: "advertising-call-to-action",
17
+ advertisingCallToActionMeeting: "advertising-call-to-action-meeting",
18
+ advertisingBanner: "advertising-banner",
19
+ advertisingSkyscraper: "advertising-skyscraper",
20
+ advertisingRectangle: "advertising-rectangle",
21
+ advertisingFullPage: "advertising-full-page",
22
+ advertisingHalfPage: "advertising-half-page",
23
+ advertisingQuarterPage: "advertising-quarter-page",
24
+ advertisingClassifiedPage: "advertising-classified-page",
25
+ advertisingLandscape: "advertising-landscape",
26
+ advertisingPortrait: "advertising-portrait",
27
+ aiChat: "ai-chat",
28
+ aiEditor: "ai-editor",
14
29
  aiPrompt: "ai-prompt",
30
+ aiTutor: "ai-tutor",
31
+ aiWbt: "ai-wbt",
15
32
  anchor: "anchor",
16
33
  appAiPrompt: "app-ai-prompt",
17
34
  appBitmarkFromEditor: "app-bitmark-from-editor",
@@ -29,6 +46,7 @@ var BitType = superenum({
29
46
  articleAi: "article-ai",
30
47
  articleAlt: "article-alt",
31
48
  articleAttachment: "article-attachment",
49
+ articleAuthor: "article-author",
32
50
  articleEmbed: "article-embed",
33
51
  articleLink: "article-link",
34
52
  articleResponsive: "article-responsive",
@@ -39,6 +57,8 @@ var BitType = superenum({
39
57
  audioEmbed: "audio-embed",
40
58
  audioLink: "audio-link",
41
59
  audioTranscript: "audio-transcript",
60
+ author: "author",
61
+ authorContentBitGenerator: "author-content-bit-generator",
42
62
  bitAlias: "bit-alias",
43
63
  bitBookEnding: "bit-book-ending",
44
64
  bitBookSummary: "bit-book-summary",
@@ -51,6 +71,7 @@ var BitType = superenum({
51
71
  bookAlias: "book-alias",
52
72
  bookAppendix: "book-appendix",
53
73
  bookArticle: "book-article",
74
+ bookAuthor: "book-author",
54
75
  bookAutherBio: "book-author-bio",
55
76
  bookBibliography: "book-bibliography",
56
77
  bookClose: "book-close",
@@ -1117,6 +1138,7 @@ var propertyKeys = {
1117
1138
  property_disableCalculation: "@disableCalculation",
1118
1139
  property_disableFeedback: "@disableFeedback",
1119
1140
  property_duration: "@duration",
1141
+ property_isEditable: "@isEditable",
1120
1142
  property_emphasis: "@emphasis",
1121
1143
  property_example: "@example",
1122
1144
  property_externalId: "@externalId",
@@ -1128,6 +1150,7 @@ var propertyKeys = {
1128
1150
  property_focusX: "@focusX",
1129
1151
  property_focusY: "@focusY",
1130
1152
  property_format: "@format",
1153
+ property_fullName: "@fullName",
1131
1154
  property_groupTag: "@groupTag",
1132
1155
  property_handInAcceptFileType: "@handInAcceptFileType",
1133
1156
  property_handInInstruction: "@handInInstruction",
@@ -1148,6 +1171,7 @@ var propertyKeys = {
1148
1171
  property_isTemplate: "@isTemplate",
1149
1172
  property_isTemplateStripTheme: "@isTemplateStripTheme",
1150
1173
  property_isTracked: "@isTracked",
1174
+ property_jobTitle: "@jobTitle",
1151
1175
  property_jupyterExecutionCount: "@jupyterExecutionCount",
1152
1176
  property_jupyterId: "@jupyterId",
1153
1177
  property_kind: "@kind",
@@ -1192,6 +1216,7 @@ var propertyKeys = {
1192
1216
  property_productId: "@productId",
1193
1217
  property_productVideo: "@productVideo",
1194
1218
  property_progress: "@progress",
1219
+ property_pseudonym: "@pseudonym",
1195
1220
  property_publications: "@publications",
1196
1221
  property_publisher: "@publisher",
1197
1222
  property_publisherName: "@publisherName",
@@ -3094,6 +3119,12 @@ var GROUPS = {
3094
3119
  format: TagFormat.boolean,
3095
3120
  defaultValue: "false"
3096
3121
  },
3122
+ {
3123
+ key: ConfigKey.property_isEditable,
3124
+ description: "If true, the book is editable",
3125
+ format: TagFormat.boolean,
3126
+ defaultValue: "false"
3127
+ },
3097
3128
  {
3098
3129
  key: ConfigKey.property_chatWithBook,
3099
3130
  description: "If true, the user can chat about the book with an AI assistant",
@@ -4106,6 +4137,40 @@ var BITS = {
4106
4137
  ],
4107
4138
  resourceAttachmentAllowed: false
4108
4139
  },
4140
+ [BitType.author]: {
4141
+ since: "4.2.0",
4142
+ baseBitType: BitType._standard,
4143
+ description: "Represents an author of something",
4144
+ tags: [
4145
+ {
4146
+ key: ConfigKey.property_fullName,
4147
+ description: "Full name of the author"
4148
+ },
4149
+ {
4150
+ key: ConfigKey.property_pseudonym,
4151
+ description: "A pseudonym of the author, if any"
4152
+ },
4153
+ {
4154
+ key: ConfigKey.property_title,
4155
+ description: 'The title of the author, e.g. "Dr.", "Prof.", etc.',
4156
+ jsonKey: "title"
4157
+ },
4158
+ {
4159
+ key: ConfigKey.property_jobTitle,
4160
+ description: 'The job title of the author, e.g. "Software Engineer", "Professor", etc.'
4161
+ }
4162
+ ]
4163
+ },
4164
+ [BitType.bookAuthor]: {
4165
+ since: "4.2.0",
4166
+ baseBitType: BitType.author,
4167
+ description: "Represents an author of a book"
4168
+ },
4169
+ [BitType.articleAuthor]: {
4170
+ since: "4.2.0",
4171
+ baseBitType: BitType.author,
4172
+ description: "Represents an author of a book"
4173
+ },
4109
4174
  [BitType.article]: {
4110
4175
  since: "1.3.0",
4111
4176
  baseBitType: BitType._standard,
@@ -5081,6 +5146,71 @@ var BITS = {
5081
5146
  baseBitType: BitType.conversationLeft1,
5082
5147
  description: "Cloze and multiple choice text conversation right thought bit, used for conversations with cloze and multiple choice text and a thought on the right side of the screen"
5083
5148
  },
5149
+ [BitType.advertising]: {
5150
+ since: "4.2.0",
5151
+ baseBitType: BitType.article,
5152
+ description: "General advertising content bit"
5153
+ },
5154
+ [BitType.advertisingAdvertorial]: {
5155
+ since: "4.2.0",
5156
+ baseBitType: BitType.article,
5157
+ description: "Advertorial content bit (sponsored article)"
5158
+ },
5159
+ [BitType.advertisingCallToAction]: {
5160
+ since: "4.2.0",
5161
+ baseBitType: BitType.callToAction,
5162
+ description: "Call-to-action for advertising"
5163
+ },
5164
+ [BitType.advertisingCallToActionMeeting]: {
5165
+ since: "4.2.0",
5166
+ baseBitType: BitType.callToAction,
5167
+ description: "Call-to-action for meeting or appointment"
5168
+ },
5169
+ [BitType.advertisingBanner]: {
5170
+ since: "4.2.0",
5171
+ baseBitType: BitType.image,
5172
+ description: "Banner advertisement bit"
5173
+ },
5174
+ [BitType.advertisingSkyscraper]: {
5175
+ since: "4.2.0",
5176
+ baseBitType: BitType.image,
5177
+ description: "Skyscraper (vertical) advertisement bit"
5178
+ },
5179
+ [BitType.advertisingRectangle]: {
5180
+ since: "4.2.0",
5181
+ baseBitType: BitType.image,
5182
+ description: "Rectangle advertisement bit"
5183
+ },
5184
+ [BitType.advertisingFullPage]: {
5185
+ since: "4.2.0",
5186
+ baseBitType: BitType.image,
5187
+ description: "Full-page advertisement bit"
5188
+ },
5189
+ [BitType.advertisingHalfPage]: {
5190
+ since: "4.2.0",
5191
+ baseBitType: BitType.image,
5192
+ description: "Half-page advertisement bit"
5193
+ },
5194
+ [BitType.advertisingQuarterPage]: {
5195
+ since: "4.2.0",
5196
+ baseBitType: BitType.image,
5197
+ description: "Quarter-page advertisement bit"
5198
+ },
5199
+ [BitType.advertisingClassifiedPage]: {
5200
+ since: "4.2.0",
5201
+ baseBitType: BitType.image,
5202
+ description: "Classifieds advertisement page bit"
5203
+ },
5204
+ [BitType.advertisingLandscape]: {
5205
+ since: "4.2.0",
5206
+ baseBitType: BitType.image,
5207
+ description: "Landscape format advertisement bit"
5208
+ },
5209
+ [BitType.advertisingPortrait]: {
5210
+ since: "4.2.0",
5211
+ baseBitType: BitType.image,
5212
+ description: "Portrait format advertisement bit"
5213
+ },
5084
5214
  [BitType.cookPreparation]: {
5085
5215
  since: "1.3.0",
5086
5216
  baseBitType: BitType.article,
@@ -5370,6 +5500,19 @@ var BITS = {
5370
5500
  baseBitType: BitType.smartStandardExampleNonNormative,
5371
5501
  description: "Smart standard non-normative example collapsible bit, used to provide non-normative examples in smart standards that can be collapsed"
5372
5502
  },
5503
+ [BitType.authorContentBitGenerator]: {
5504
+ since: "4.2.0",
5505
+ baseBitType: BitType.article,
5506
+ description: "Body contains the content of one or more bits to be created by the bit generator",
5507
+ tags: [
5508
+ {
5509
+ key: ConfigKey.property_classification,
5510
+ description: "Classification for the created bits",
5511
+ format: TagFormat.plainText,
5512
+ maxCount: Count.infinity
5513
+ }
5514
+ ]
5515
+ },
5373
5516
  [BitType.appAiPrompt]: {
5374
5517
  since: "1.3.0",
5375
5518
  baseBitType: BitType.article,
@@ -5380,6 +5523,26 @@ var BITS = {
5380
5523
  baseBitType: BitType.article,
5381
5524
  description: "AI prompt bit, used to create AI prompts in articles or books"
5382
5525
  },
5526
+ [BitType.aiChat]: {
5527
+ since: "4.2.0",
5528
+ baseBitType: BitType.article,
5529
+ description: "AI chat bit, used to create an AI chat"
5530
+ },
5531
+ [BitType.aiEditor]: {
5532
+ since: "4.2.0",
5533
+ baseBitType: BitType.article,
5534
+ description: "AI editor bit, used to create an AI editor"
5535
+ },
5536
+ [BitType.aiTutor]: {
5537
+ since: "4.2.0",
5538
+ baseBitType: BitType.article,
5539
+ description: "AI tutor bit, used to create an AI tutor"
5540
+ },
5541
+ [BitType.aiWbt]: {
5542
+ since: "4.2.0",
5543
+ baseBitType: BitType.article,
5544
+ description: "AI WBT bit, used to create an AI WBT (Web-Based Training)"
5545
+ },
5383
5546
  [BitType.articleAi]: {
5384
5547
  since: "1.3.0",
5385
5548
  baseBitType: BitType.article,
@@ -8880,7 +9043,7 @@ var instance2 = new Config();
8880
9043
  // src/generated/package_info.ts
8881
9044
  var PACKAGE_INFO = {
8882
9045
  "name": "@gmb/bitmark-parser-generator",
8883
- "version": "4.1.2",
9046
+ "version": "4.2.0",
8884
9047
  "author": "Get More Brain Ltd",
8885
9048
  "license": "ISC",
8886
9049
  "description": "A bitmark parser and generator using Peggy.js"
@@ -9406,6 +9569,8 @@ var NodeType = superenum20({
9406
9569
  format: "format",
9407
9570
  forValues: "forValues",
9408
9571
  forValuesValue: "forValuesValue",
9572
+ fullName: "fullName",
9573
+ fullNameValue: "fullNameValue",
9409
9574
  gap: "gap",
9410
9575
  groupTag: "groupTag",
9411
9576
  groupTagValue: "groupTagValue",
@@ -9450,6 +9615,8 @@ var NodeType = superenum20({
9450
9615
  isCaseSensitive: "isCaseSensitive",
9451
9616
  isCommented: "isCommented",
9452
9617
  isCorrect: "isCorrect",
9618
+ isEditable: "isEditable",
9619
+ isEditableValue: "isEditableValue",
9453
9620
  isExample: "isExample",
9454
9621
  isInfoOnly: "isInfoOnly",
9455
9622
  isInfoOnlyValue: "isInfoOnlyValue",
@@ -9464,6 +9631,8 @@ var NodeType = superenum20({
9464
9631
  isTrackedValue: "isTrackedValue",
9465
9632
  item: "item",
9466
9633
  itemLead: "itemLead",
9634
+ jobTitle: "jobTitle",
9635
+ jobTitleValue: "jobTitleValue",
9467
9636
  jupyterExecutionCount: "jupyterExecutionCount",
9468
9637
  jupyterExecutionCountValue: "jupyterExecutionCountValue",
9469
9638
  jupyterId: "jupyterId",
@@ -9579,6 +9748,8 @@ var NodeType = superenum20({
9579
9748
  propertyValue: "propertyValue",
9580
9749
  propertyValues: "propertyValues",
9581
9750
  provider: "provider",
9751
+ pseudonym: "pseudonym",
9752
+ pseudonymValue: "pseudonymValue",
9582
9753
  publications: "publications",
9583
9754
  publicationsValue: "publicationsValue",
9584
9755
  publisher: "publisher",
@@ -9726,6 +9897,7 @@ var NodeType = superenum20({
9726
9897
  thumbnails: "thumbnails",
9727
9898
  thumbnailsValue: "thumbnailsValue",
9728
9899
  title: "title",
9900
+ titleString: "titleString",
9729
9901
  toc: "toc",
9730
9902
  tocContent: "tocContent",
9731
9903
  tocContentValue: "tocContentValue",
@@ -20584,62 +20756,99 @@ var NodeValidator = class {
20584
20756
  validateResource(resource) {
20585
20757
  if (!resource) return void 0;
20586
20758
  const ret = resource;
20587
- let valid = false;
20759
+ let valid = true;
20588
20760
  switch (resource.type) {
20589
- case ResourceType.image:
20590
- valid = !!resource.image.src;
20761
+ case ResourceType.image: {
20762
+ const imageResource = resource.image;
20763
+ if (!stringUtils.isString(imageResource.src)) imageResource.src = "";
20591
20764
  break;
20592
- case ResourceType.imageLink:
20593
- valid = !!resource.imageLink.url;
20765
+ }
20766
+ case ResourceType.imageLink: {
20767
+ const imageLink = resource.imageLink;
20768
+ if (!stringUtils.isString(imageLink.url)) imageLink.url = "";
20594
20769
  break;
20595
- case ResourceType.audio:
20596
- valid = !!resource.audio.src;
20770
+ }
20771
+ case ResourceType.audio: {
20772
+ const audio = resource.audio;
20773
+ if (!stringUtils.isString(audio.src)) audio.src = "";
20597
20774
  break;
20598
- case ResourceType.audioEmbed:
20599
- valid = !!resource.audioEmbed.src;
20775
+ }
20776
+ case ResourceType.audioEmbed: {
20777
+ const audioEmbed = resource.audioEmbed;
20778
+ if (!stringUtils.isString(audioEmbed.src)) audioEmbed.src = "";
20600
20779
  break;
20601
- case ResourceType.audioLink:
20602
- valid = !!resource.audioLink.url;
20780
+ }
20781
+ case ResourceType.audioLink: {
20782
+ const audioLink = resource.audioLink;
20783
+ if (!stringUtils.isString(audioLink.url)) audioLink.url = "";
20603
20784
  break;
20604
- case ResourceType.video:
20605
- valid = !!resource.video.src;
20785
+ }
20786
+ case ResourceType.video: {
20787
+ const video = resource.video;
20788
+ if (!stringUtils.isString(video.src)) video.src = "";
20606
20789
  break;
20607
- case ResourceType.videoEmbed:
20608
- valid = !!resource.videoEmbed.url;
20790
+ }
20791
+ case ResourceType.videoEmbed: {
20792
+ const videoEmbed = resource.videoEmbed;
20793
+ if (!stringUtils.isString(videoEmbed.url)) videoEmbed.url = "";
20609
20794
  break;
20610
- case ResourceType.videoLink:
20611
- valid = !!resource.videoLink.url;
20795
+ }
20796
+ case ResourceType.videoLink: {
20797
+ const videoLink = resource.videoLink;
20798
+ if (!stringUtils.isString(videoLink.url)) videoLink.url = "";
20612
20799
  break;
20613
- case ResourceType.stillImageFilm:
20614
- valid = !!resource.image.src && !!resource.audio.src;
20800
+ }
20801
+ case ResourceType.stillImageFilm: {
20802
+ const stillImageFilm = resource;
20803
+ if (!stringUtils.isString(stillImageFilm.image.src)) stillImageFilm.image.src = "";
20804
+ if (!stringUtils.isString(stillImageFilm.audio.src)) stillImageFilm.audio.src = "";
20615
20805
  break;
20616
- case ResourceType.stillImageFilmEmbed:
20617
- valid = !!resource.stillImageFilmEmbed.url;
20806
+ }
20807
+ case ResourceType.stillImageFilmEmbed: {
20808
+ const stillImageFilmEmbed = resource.stillImageFilmEmbed;
20809
+ if (!stringUtils.isString(stillImageFilmEmbed.url)) stillImageFilmEmbed.url = "";
20618
20810
  break;
20619
- case ResourceType.stillImageFilmLink:
20620
- valid = !!resource.stillImageFilmLink.url;
20811
+ }
20812
+ case ResourceType.stillImageFilmLink: {
20813
+ const stillImageFilmLink = resource.stillImageFilmLink;
20814
+ if (!stringUtils.isString(stillImageFilmLink.url)) stillImageFilmLink.url = "";
20621
20815
  break;
20622
- case ResourceType.article:
20623
- valid = !!resource.article.body;
20816
+ }
20817
+ case ResourceType.article: {
20818
+ const article = resource.article;
20819
+ if (!stringUtils.isString(article.body)) article.body = "";
20624
20820
  break;
20625
- case ResourceType.document:
20626
- valid = !!resource.document.url;
20821
+ }
20822
+ case ResourceType.document: {
20823
+ const document2 = resource.document;
20824
+ if (!stringUtils.isString(document2.url)) document2.url = "";
20627
20825
  break;
20628
- case ResourceType.documentEmbed:
20629
- valid = !!resource.documentEmbed.url;
20826
+ }
20827
+ case ResourceType.documentEmbed: {
20828
+ const documentEmbed = resource.documentEmbed;
20829
+ if (!stringUtils.isString(documentEmbed.url)) documentEmbed.url = "";
20630
20830
  break;
20631
- case ResourceType.documentLink:
20632
- valid = !!resource.documentLink.url;
20831
+ }
20832
+ case ResourceType.documentLink: {
20833
+ const documentLink = resource.documentLink;
20834
+ if (!stringUtils.isString(documentLink.url)) documentLink.url = "";
20633
20835
  break;
20634
- case ResourceType.documentDownload:
20635
- valid = !!resource.documentDownload.url;
20836
+ }
20837
+ case ResourceType.documentDownload: {
20838
+ const documentDownload = resource.documentDownload;
20839
+ if (!stringUtils.isString(documentDownload.url)) documentDownload.url = "";
20636
20840
  break;
20637
- case ResourceType.appLink:
20638
- valid = !!resource.appLink.url;
20841
+ }
20842
+ case ResourceType.appLink: {
20843
+ const appLink = resource.appLink;
20844
+ if (!stringUtils.isString(appLink.url)) appLink.url = "";
20639
20845
  break;
20640
- case ResourceType.websiteLink:
20641
- valid = !!resource.websiteLink.url;
20846
+ }
20847
+ case ResourceType.websiteLink: {
20848
+ const websiteLink = resource.websiteLink;
20849
+ if (!stringUtils.isString(websiteLink.url)) websiteLink.url = "";
20642
20850
  break;
20851
+ }
20643
20852
  default:
20644
20853
  valid = false;
20645
20854
  }
@@ -21869,6 +22078,12 @@ var Builder = class extends BaseBuilder {
21869
22078
  data.isTemplateStripTheme,
21870
22079
  options
21871
22080
  ),
22081
+ isEditable: this.toAstProperty(
22082
+ bitType,
22083
+ ConfigKey.property_isEditable,
22084
+ data.isEditable,
22085
+ options
22086
+ ),
21872
22087
  aiGenerated: this.toAstProperty(
21873
22088
  bitType,
21874
22089
  ConfigKey.property_aiGenerated,
@@ -22471,6 +22686,11 @@ var Builder = class extends BaseBuilder {
22471
22686
  data.referenceProperty,
22472
22687
  options
22473
22688
  ),
22689
+ // Author data
22690
+ fullName: this.toAstProperty(bitType, ConfigKey.property_fullName, data.fullName, options),
22691
+ pseudonym: this.toAstProperty(bitType, ConfigKey.property_pseudonym, data.pseudonym, options),
22692
+ titleString: this.toAstProperty(bitType, ConfigKey.property_title, data.titleString, options),
22693
+ jobTitle: this.toAstProperty(bitType, ConfigKey.property_jobTitle, data.jobTitle, options),
22474
22694
  // Book data
22475
22695
  title: this.handleJsonText(context, TextLocation2.tag, data.title),
22476
22696
  subtitle: this.handleJsonText(context, TextLocation2.tag, data.subtitle),
@@ -25577,6 +25797,18 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
25577
25797
  }
25578
25798
  return false;
25579
25799
  }
25800
+ // bitmarkAst -> bits -> bitsValue -> titleString
25801
+ leaf_titleString(node, route) {
25802
+ const parent = this.getParentNode(route);
25803
+ if (parent?.key !== NodeType.bitsValue) return true;
25804
+ if (node.value) {
25805
+ this.writeNL();
25806
+ this.writeProperty("title", node.value, route, {
25807
+ format: TagFormat.plainText
25808
+ });
25809
+ }
25810
+ return false;
25811
+ }
25580
25812
  // bitmarkAst -> bits -> title
25581
25813
  enter_title(node, route) {
25582
25814
  const parent = this.getParentNode(route);
@@ -26785,6 +27017,15 @@ var JsonGenerator = class extends AstWalkerGenerator {
26785
27017
  enter_instruction(node, route) {
26786
27018
  return this.standardHandler(node, route, NodeType.bitsValue, { array: true });
26787
27019
  }
27020
+ // bitmarkAst -> bits -> bitsValue -> titleString
27021
+ leaf_titleString(node, route) {
27022
+ const parent = this.getParentNode(route);
27023
+ if (parent?.key !== NodeType.bitsValue) return true;
27024
+ return this.standardHandler(node, route, [NodeType.bitsValue], {
27025
+ array: false,
27026
+ keyOverride: "title"
27027
+ });
27028
+ }
26788
27029
  // bitmarkAst -> bits -> bitsValue -> title
26789
27030
  enter_title(node, route) {
26790
27031
  return this.standardHandler(node, route, [NodeType.bitsValue, NodeType.cardNode], {
@@ -28034,6 +28275,7 @@ var JsonParser = class {
28034
28275
  resourceType: this.getResourceType(bit.resource),
28035
28276
  isCommented,
28036
28277
  internalComment: internalComments,
28278
+ ...this.processTitle(bitType, bit.title),
28037
28279
  ...this.processReference(referenceBit),
28038
28280
  // reference and referenceProperty
28039
28281
  ...this.parseExample(bit.example),
@@ -28134,6 +28376,17 @@ var JsonParser = class {
28134
28376
  footer: footerText
28135
28377
  };
28136
28378
  }
28379
+ processTitle(bitType, title) {
28380
+ if (instance2.isOfBitType(bitType, BitType.author))
28381
+ return {
28382
+ titleString: title,
28383
+ title: void 0
28384
+ };
28385
+ return {
28386
+ titleString: void 0,
28387
+ title
28388
+ };
28389
+ }
28137
28390
  processReference(reference) {
28138
28391
  if (Array.isArray(reference) && reference.length > 0) {
28139
28392
  return {
@@ -31296,12 +31549,21 @@ function buildTitles(_context, bitType, title) {
31296
31549
  level: title.length > 0 ? title.length - 1 : void 0
31297
31550
  };
31298
31551
  } else {
31299
- return {
31300
- title: title[1]?.titleAst ?? void 0,
31301
- titleString: title[1]?.titleString ?? void 0,
31302
- subtitle: title[2]?.titleAst ?? void 0,
31303
- subtitleString: title[2]?.titleString ?? void 0
31304
- };
31552
+ if (Array.isArray(title)) {
31553
+ return {
31554
+ title: title[1]?.titleAst ?? void 0,
31555
+ titleString: title[1]?.titleString ?? void 0,
31556
+ subtitle: title[2]?.titleAst ?? void 0,
31557
+ subtitleString: title[2]?.titleString ?? void 0
31558
+ };
31559
+ } else {
31560
+ return {
31561
+ title: void 0,
31562
+ titleString: title ?? void 0,
31563
+ subtitle: void 0,
31564
+ subtitleString: void 0
31565
+ };
31566
+ }
31305
31567
  }
31306
31568
  }
31307
31569