@diagrammo/dgmo 0.40.0 → 0.41.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.
- package/dist/advanced.cjs +48 -46
- package/dist/advanced.js +48 -46
- package/dist/auto.cjs +49 -47
- package/dist/auto.js +3 -3
- package/dist/auto.mjs +49 -47
- package/dist/cli.cjs +41 -41
- package/dist/index.cjs +48 -46
- package/dist/index.js +48 -46
- package/docs/language-reference.md +17 -0
- package/gallery/fixtures/event-line.dgmo +12 -12
- package/package.json +1 -1
- package/src/event-line/parser.ts +64 -54
package/dist/advanced.cjs
CHANGED
|
@@ -15148,6 +15148,8 @@ function parseEventLine(content, palette) {
|
|
|
15148
15148
|
let currentTagGroup = null;
|
|
15149
15149
|
let currentEvent = null;
|
|
15150
15150
|
let currentEra = null;
|
|
15151
|
+
let eraIndent = -1;
|
|
15152
|
+
let currentEventIndent = 0;
|
|
15151
15153
|
const aliasMap = /* @__PURE__ */ new Map();
|
|
15152
15154
|
for (let i = 0; i < lines.length; i++) {
|
|
15153
15155
|
const line11 = lines[i];
|
|
@@ -15222,52 +15224,15 @@ function parseEventLine(content, palette) {
|
|
|
15222
15224
|
});
|
|
15223
15225
|
continue;
|
|
15224
15226
|
}
|
|
15225
|
-
if (indent >
|
|
15226
|
-
if (!currentEvent) {
|
|
15227
|
-
pushWarning(
|
|
15228
|
-
lineNumber,
|
|
15229
|
-
`Indented description "${trimmed}" has no event above it \u2014 add an event line first. (\xA728)`
|
|
15230
|
-
);
|
|
15231
|
-
continue;
|
|
15232
|
-
}
|
|
15227
|
+
if (currentEvent && indent > currentEventIndent) {
|
|
15233
15228
|
const descLine = trimmed.startsWith("- ") ? `\u2022 ${trimmed.substring(2)}` : trimmed;
|
|
15234
15229
|
currentEvent.description.push(descLine);
|
|
15235
15230
|
continue;
|
|
15236
15231
|
}
|
|
15237
|
-
currentTagGroup = null;
|
|
15238
|
-
if (trimmed.toLowerCase() === "no-scale") {
|
|
15239
|
-
options.scale = false;
|
|
15240
|
-
continue;
|
|
15241
|
-
}
|
|
15242
|
-
const sideMatch = trimmed.match(SIDE_RE);
|
|
15243
|
-
if (sideMatch) {
|
|
15244
|
-
options.side = sideMatch[1].toLowerCase();
|
|
15245
|
-
continue;
|
|
15246
|
-
}
|
|
15247
|
-
if (trimmed.toLowerCase() === "no-box") {
|
|
15248
|
-
options.noBox = true;
|
|
15249
|
-
continue;
|
|
15250
|
-
}
|
|
15251
|
-
if (trimmed.toLowerCase() === "no-legend") {
|
|
15252
|
-
options.noLegend = true;
|
|
15253
|
-
continue;
|
|
15254
|
-
}
|
|
15255
|
-
const dirMatch = trimmed.match(DIRECTION_RE);
|
|
15256
|
-
if (dirMatch) {
|
|
15257
|
-
const dir = dirMatch[1].toUpperCase();
|
|
15258
|
-
if (dir !== "LR") {
|
|
15259
|
-
pushWarning(
|
|
15260
|
-
lineNumber,
|
|
15261
|
-
`event-line is horizontal-only in v1; \`direction ${dir}\` (vertical orientation) is a fast-follow.`,
|
|
15262
|
-
EVENT_LINE_DIAGNOSTIC_CODES.UNSUPPORTED
|
|
15263
|
-
);
|
|
15264
|
-
}
|
|
15265
|
-
continue;
|
|
15266
|
-
}
|
|
15267
|
-
if (tryParseSharedOption(trimmed, sharedOptions)) continue;
|
|
15268
15232
|
const eraMatch = trimmed.match(ERA_RE);
|
|
15269
15233
|
if (eraMatch) {
|
|
15270
15234
|
contentStarted = true;
|
|
15235
|
+
currentTagGroup = null;
|
|
15271
15236
|
currentEvent = null;
|
|
15272
15237
|
const name = eraMatch[1].trim();
|
|
15273
15238
|
let rest = (eraMatch[2] ?? "").trim();
|
|
@@ -15291,16 +15256,52 @@ function parseEventLine(content, palette) {
|
|
|
15291
15256
|
const era = { name, color, collapsed, lineNumber };
|
|
15292
15257
|
result.eras.push(era);
|
|
15293
15258
|
currentEra = name;
|
|
15259
|
+
eraIndent = indent;
|
|
15294
15260
|
continue;
|
|
15295
15261
|
}
|
|
15296
|
-
if (
|
|
15297
|
-
|
|
15298
|
-
|
|
15299
|
-
|
|
15300
|
-
|
|
15301
|
-
|
|
15302
|
-
|
|
15262
|
+
if (indent === 0) {
|
|
15263
|
+
currentTagGroup = null;
|
|
15264
|
+
if (trimmed.toLowerCase() === "no-scale") {
|
|
15265
|
+
options.scale = false;
|
|
15266
|
+
continue;
|
|
15267
|
+
}
|
|
15268
|
+
const sideMatch = trimmed.match(SIDE_RE);
|
|
15269
|
+
if (sideMatch) {
|
|
15270
|
+
options.side = sideMatch[1].toLowerCase();
|
|
15271
|
+
continue;
|
|
15272
|
+
}
|
|
15273
|
+
if (trimmed.toLowerCase() === "no-box") {
|
|
15274
|
+
options.noBox = true;
|
|
15275
|
+
continue;
|
|
15276
|
+
}
|
|
15277
|
+
if (trimmed.toLowerCase() === "no-legend") {
|
|
15278
|
+
options.noLegend = true;
|
|
15279
|
+
continue;
|
|
15280
|
+
}
|
|
15281
|
+
const dirMatch = trimmed.match(DIRECTION_RE);
|
|
15282
|
+
if (dirMatch) {
|
|
15283
|
+
const dir = dirMatch[1].toUpperCase();
|
|
15284
|
+
if (dir !== "LR") {
|
|
15285
|
+
pushWarning(
|
|
15286
|
+
lineNumber,
|
|
15287
|
+
`event-line is horizontal-only in v1; \`direction ${dir}\` (vertical orientation) is a fast-follow.`,
|
|
15288
|
+
EVENT_LINE_DIAGNOSTIC_CODES.UNSUPPORTED
|
|
15289
|
+
);
|
|
15290
|
+
}
|
|
15291
|
+
continue;
|
|
15292
|
+
}
|
|
15293
|
+
if (tryParseSharedOption(trimmed, sharedOptions)) continue;
|
|
15294
|
+
if (SECTION_SEAM_RE.test(trimmed)) {
|
|
15295
|
+
pushWarning(
|
|
15296
|
+
lineNumber,
|
|
15297
|
+
"Group events with `[Name]` era brackets (\xA728.6a), not `section`.",
|
|
15298
|
+
EVENT_LINE_DIAGNOSTIC_CODES.UNSUPPORTED
|
|
15299
|
+
);
|
|
15300
|
+
continue;
|
|
15301
|
+
}
|
|
15303
15302
|
}
|
|
15303
|
+
const inEra = currentEra !== null && indent > eraIndent;
|
|
15304
|
+
if (!inEra) currentEra = null;
|
|
15304
15305
|
contentStarted = true;
|
|
15305
15306
|
const event = parseEventHeader(
|
|
15306
15307
|
trimmed,
|
|
@@ -15312,6 +15313,7 @@ function parseEventLine(content, palette) {
|
|
|
15312
15313
|
);
|
|
15313
15314
|
result.events.push(event);
|
|
15314
15315
|
currentEvent = event;
|
|
15316
|
+
currentEventIndent = indent;
|
|
15315
15317
|
}
|
|
15316
15318
|
options.noTitle = sharedOptions["no-title"] === "on";
|
|
15317
15319
|
finalizeAutoTagColors(result.tagGroups, palette);
|
package/dist/advanced.js
CHANGED
|
@@ -15164,6 +15164,8 @@ function parseEventLine(content, palette) {
|
|
|
15164
15164
|
let currentTagGroup = null;
|
|
15165
15165
|
let currentEvent = null;
|
|
15166
15166
|
let currentEra = null;
|
|
15167
|
+
let eraIndent = -1;
|
|
15168
|
+
let currentEventIndent = 0;
|
|
15167
15169
|
const aliasMap = /* @__PURE__ */ new Map();
|
|
15168
15170
|
for (let i = 0; i < lines.length; i++) {
|
|
15169
15171
|
const line11 = lines[i];
|
|
@@ -15238,52 +15240,15 @@ function parseEventLine(content, palette) {
|
|
|
15238
15240
|
});
|
|
15239
15241
|
continue;
|
|
15240
15242
|
}
|
|
15241
|
-
if (indent >
|
|
15242
|
-
if (!currentEvent) {
|
|
15243
|
-
pushWarning(
|
|
15244
|
-
lineNumber,
|
|
15245
|
-
`Indented description "${trimmed}" has no event above it \u2014 add an event line first. (\xA728)`
|
|
15246
|
-
);
|
|
15247
|
-
continue;
|
|
15248
|
-
}
|
|
15243
|
+
if (currentEvent && indent > currentEventIndent) {
|
|
15249
15244
|
const descLine = trimmed.startsWith("- ") ? `\u2022 ${trimmed.substring(2)}` : trimmed;
|
|
15250
15245
|
currentEvent.description.push(descLine);
|
|
15251
15246
|
continue;
|
|
15252
15247
|
}
|
|
15253
|
-
currentTagGroup = null;
|
|
15254
|
-
if (trimmed.toLowerCase() === "no-scale") {
|
|
15255
|
-
options.scale = false;
|
|
15256
|
-
continue;
|
|
15257
|
-
}
|
|
15258
|
-
const sideMatch = trimmed.match(SIDE_RE);
|
|
15259
|
-
if (sideMatch) {
|
|
15260
|
-
options.side = sideMatch[1].toLowerCase();
|
|
15261
|
-
continue;
|
|
15262
|
-
}
|
|
15263
|
-
if (trimmed.toLowerCase() === "no-box") {
|
|
15264
|
-
options.noBox = true;
|
|
15265
|
-
continue;
|
|
15266
|
-
}
|
|
15267
|
-
if (trimmed.toLowerCase() === "no-legend") {
|
|
15268
|
-
options.noLegend = true;
|
|
15269
|
-
continue;
|
|
15270
|
-
}
|
|
15271
|
-
const dirMatch = trimmed.match(DIRECTION_RE);
|
|
15272
|
-
if (dirMatch) {
|
|
15273
|
-
const dir = dirMatch[1].toUpperCase();
|
|
15274
|
-
if (dir !== "LR") {
|
|
15275
|
-
pushWarning(
|
|
15276
|
-
lineNumber,
|
|
15277
|
-
`event-line is horizontal-only in v1; \`direction ${dir}\` (vertical orientation) is a fast-follow.`,
|
|
15278
|
-
EVENT_LINE_DIAGNOSTIC_CODES.UNSUPPORTED
|
|
15279
|
-
);
|
|
15280
|
-
}
|
|
15281
|
-
continue;
|
|
15282
|
-
}
|
|
15283
|
-
if (tryParseSharedOption(trimmed, sharedOptions)) continue;
|
|
15284
15248
|
const eraMatch = trimmed.match(ERA_RE);
|
|
15285
15249
|
if (eraMatch) {
|
|
15286
15250
|
contentStarted = true;
|
|
15251
|
+
currentTagGroup = null;
|
|
15287
15252
|
currentEvent = null;
|
|
15288
15253
|
const name = eraMatch[1].trim();
|
|
15289
15254
|
let rest = (eraMatch[2] ?? "").trim();
|
|
@@ -15307,16 +15272,52 @@ function parseEventLine(content, palette) {
|
|
|
15307
15272
|
const era = { name, color, collapsed, lineNumber };
|
|
15308
15273
|
result.eras.push(era);
|
|
15309
15274
|
currentEra = name;
|
|
15275
|
+
eraIndent = indent;
|
|
15310
15276
|
continue;
|
|
15311
15277
|
}
|
|
15312
|
-
if (
|
|
15313
|
-
|
|
15314
|
-
|
|
15315
|
-
|
|
15316
|
-
|
|
15317
|
-
|
|
15318
|
-
|
|
15278
|
+
if (indent === 0) {
|
|
15279
|
+
currentTagGroup = null;
|
|
15280
|
+
if (trimmed.toLowerCase() === "no-scale") {
|
|
15281
|
+
options.scale = false;
|
|
15282
|
+
continue;
|
|
15283
|
+
}
|
|
15284
|
+
const sideMatch = trimmed.match(SIDE_RE);
|
|
15285
|
+
if (sideMatch) {
|
|
15286
|
+
options.side = sideMatch[1].toLowerCase();
|
|
15287
|
+
continue;
|
|
15288
|
+
}
|
|
15289
|
+
if (trimmed.toLowerCase() === "no-box") {
|
|
15290
|
+
options.noBox = true;
|
|
15291
|
+
continue;
|
|
15292
|
+
}
|
|
15293
|
+
if (trimmed.toLowerCase() === "no-legend") {
|
|
15294
|
+
options.noLegend = true;
|
|
15295
|
+
continue;
|
|
15296
|
+
}
|
|
15297
|
+
const dirMatch = trimmed.match(DIRECTION_RE);
|
|
15298
|
+
if (dirMatch) {
|
|
15299
|
+
const dir = dirMatch[1].toUpperCase();
|
|
15300
|
+
if (dir !== "LR") {
|
|
15301
|
+
pushWarning(
|
|
15302
|
+
lineNumber,
|
|
15303
|
+
`event-line is horizontal-only in v1; \`direction ${dir}\` (vertical orientation) is a fast-follow.`,
|
|
15304
|
+
EVENT_LINE_DIAGNOSTIC_CODES.UNSUPPORTED
|
|
15305
|
+
);
|
|
15306
|
+
}
|
|
15307
|
+
continue;
|
|
15308
|
+
}
|
|
15309
|
+
if (tryParseSharedOption(trimmed, sharedOptions)) continue;
|
|
15310
|
+
if (SECTION_SEAM_RE.test(trimmed)) {
|
|
15311
|
+
pushWarning(
|
|
15312
|
+
lineNumber,
|
|
15313
|
+
"Group events with `[Name]` era brackets (\xA728.6a), not `section`.",
|
|
15314
|
+
EVENT_LINE_DIAGNOSTIC_CODES.UNSUPPORTED
|
|
15315
|
+
);
|
|
15316
|
+
continue;
|
|
15317
|
+
}
|
|
15319
15318
|
}
|
|
15319
|
+
const inEra = currentEra !== null && indent > eraIndent;
|
|
15320
|
+
if (!inEra) currentEra = null;
|
|
15320
15321
|
contentStarted = true;
|
|
15321
15322
|
const event = parseEventHeader(
|
|
15322
15323
|
trimmed,
|
|
@@ -15328,6 +15329,7 @@ function parseEventLine(content, palette) {
|
|
|
15328
15329
|
);
|
|
15329
15330
|
result.events.push(event);
|
|
15330
15331
|
currentEvent = event;
|
|
15332
|
+
currentEventIndent = indent;
|
|
15331
15333
|
}
|
|
15332
15334
|
options.noTitle = sharedOptions["no-title"] === "on";
|
|
15333
15335
|
finalizeAutoTagColors(result.tagGroups, palette);
|
package/dist/auto.cjs
CHANGED
|
@@ -15099,6 +15099,8 @@ function parseEventLine(content, palette) {
|
|
|
15099
15099
|
let currentTagGroup = null;
|
|
15100
15100
|
let currentEvent = null;
|
|
15101
15101
|
let currentEra = null;
|
|
15102
|
+
let eraIndent = -1;
|
|
15103
|
+
let currentEventIndent = 0;
|
|
15102
15104
|
const aliasMap = /* @__PURE__ */ new Map();
|
|
15103
15105
|
for (let i = 0; i < lines.length; i++) {
|
|
15104
15106
|
const line11 = lines[i];
|
|
@@ -15173,52 +15175,15 @@ function parseEventLine(content, palette) {
|
|
|
15173
15175
|
});
|
|
15174
15176
|
continue;
|
|
15175
15177
|
}
|
|
15176
|
-
if (indent >
|
|
15177
|
-
if (!currentEvent) {
|
|
15178
|
-
pushWarning(
|
|
15179
|
-
lineNumber,
|
|
15180
|
-
`Indented description "${trimmed}" has no event above it \u2014 add an event line first. (\xA728)`
|
|
15181
|
-
);
|
|
15182
|
-
continue;
|
|
15183
|
-
}
|
|
15178
|
+
if (currentEvent && indent > currentEventIndent) {
|
|
15184
15179
|
const descLine = trimmed.startsWith("- ") ? `\u2022 ${trimmed.substring(2)}` : trimmed;
|
|
15185
15180
|
currentEvent.description.push(descLine);
|
|
15186
15181
|
continue;
|
|
15187
15182
|
}
|
|
15188
|
-
currentTagGroup = null;
|
|
15189
|
-
if (trimmed.toLowerCase() === "no-scale") {
|
|
15190
|
-
options.scale = false;
|
|
15191
|
-
continue;
|
|
15192
|
-
}
|
|
15193
|
-
const sideMatch = trimmed.match(SIDE_RE);
|
|
15194
|
-
if (sideMatch) {
|
|
15195
|
-
options.side = sideMatch[1].toLowerCase();
|
|
15196
|
-
continue;
|
|
15197
|
-
}
|
|
15198
|
-
if (trimmed.toLowerCase() === "no-box") {
|
|
15199
|
-
options.noBox = true;
|
|
15200
|
-
continue;
|
|
15201
|
-
}
|
|
15202
|
-
if (trimmed.toLowerCase() === "no-legend") {
|
|
15203
|
-
options.noLegend = true;
|
|
15204
|
-
continue;
|
|
15205
|
-
}
|
|
15206
|
-
const dirMatch = trimmed.match(DIRECTION_RE);
|
|
15207
|
-
if (dirMatch) {
|
|
15208
|
-
const dir = dirMatch[1].toUpperCase();
|
|
15209
|
-
if (dir !== "LR") {
|
|
15210
|
-
pushWarning(
|
|
15211
|
-
lineNumber,
|
|
15212
|
-
`event-line is horizontal-only in v1; \`direction ${dir}\` (vertical orientation) is a fast-follow.`,
|
|
15213
|
-
EVENT_LINE_DIAGNOSTIC_CODES.UNSUPPORTED
|
|
15214
|
-
);
|
|
15215
|
-
}
|
|
15216
|
-
continue;
|
|
15217
|
-
}
|
|
15218
|
-
if (tryParseSharedOption(trimmed, sharedOptions)) continue;
|
|
15219
15183
|
const eraMatch = trimmed.match(ERA_RE);
|
|
15220
15184
|
if (eraMatch) {
|
|
15221
15185
|
contentStarted = true;
|
|
15186
|
+
currentTagGroup = null;
|
|
15222
15187
|
currentEvent = null;
|
|
15223
15188
|
const name = eraMatch[1].trim();
|
|
15224
15189
|
let rest = (eraMatch[2] ?? "").trim();
|
|
@@ -15242,16 +15207,52 @@ function parseEventLine(content, palette) {
|
|
|
15242
15207
|
const era = { name, color, collapsed, lineNumber };
|
|
15243
15208
|
result.eras.push(era);
|
|
15244
15209
|
currentEra = name;
|
|
15210
|
+
eraIndent = indent;
|
|
15245
15211
|
continue;
|
|
15246
15212
|
}
|
|
15247
|
-
if (
|
|
15248
|
-
|
|
15249
|
-
|
|
15250
|
-
|
|
15251
|
-
|
|
15252
|
-
|
|
15253
|
-
|
|
15213
|
+
if (indent === 0) {
|
|
15214
|
+
currentTagGroup = null;
|
|
15215
|
+
if (trimmed.toLowerCase() === "no-scale") {
|
|
15216
|
+
options.scale = false;
|
|
15217
|
+
continue;
|
|
15218
|
+
}
|
|
15219
|
+
const sideMatch = trimmed.match(SIDE_RE);
|
|
15220
|
+
if (sideMatch) {
|
|
15221
|
+
options.side = sideMatch[1].toLowerCase();
|
|
15222
|
+
continue;
|
|
15223
|
+
}
|
|
15224
|
+
if (trimmed.toLowerCase() === "no-box") {
|
|
15225
|
+
options.noBox = true;
|
|
15226
|
+
continue;
|
|
15227
|
+
}
|
|
15228
|
+
if (trimmed.toLowerCase() === "no-legend") {
|
|
15229
|
+
options.noLegend = true;
|
|
15230
|
+
continue;
|
|
15231
|
+
}
|
|
15232
|
+
const dirMatch = trimmed.match(DIRECTION_RE);
|
|
15233
|
+
if (dirMatch) {
|
|
15234
|
+
const dir = dirMatch[1].toUpperCase();
|
|
15235
|
+
if (dir !== "LR") {
|
|
15236
|
+
pushWarning(
|
|
15237
|
+
lineNumber,
|
|
15238
|
+
`event-line is horizontal-only in v1; \`direction ${dir}\` (vertical orientation) is a fast-follow.`,
|
|
15239
|
+
EVENT_LINE_DIAGNOSTIC_CODES.UNSUPPORTED
|
|
15240
|
+
);
|
|
15241
|
+
}
|
|
15242
|
+
continue;
|
|
15243
|
+
}
|
|
15244
|
+
if (tryParseSharedOption(trimmed, sharedOptions)) continue;
|
|
15245
|
+
if (SECTION_SEAM_RE.test(trimmed)) {
|
|
15246
|
+
pushWarning(
|
|
15247
|
+
lineNumber,
|
|
15248
|
+
"Group events with `[Name]` era brackets (\xA728.6a), not `section`.",
|
|
15249
|
+
EVENT_LINE_DIAGNOSTIC_CODES.UNSUPPORTED
|
|
15250
|
+
);
|
|
15251
|
+
continue;
|
|
15252
|
+
}
|
|
15254
15253
|
}
|
|
15254
|
+
const inEra = currentEra !== null && indent > eraIndent;
|
|
15255
|
+
if (!inEra) currentEra = null;
|
|
15255
15256
|
contentStarted = true;
|
|
15256
15257
|
const event = parseEventHeader(
|
|
15257
15258
|
trimmed,
|
|
@@ -15263,6 +15264,7 @@ function parseEventLine(content, palette) {
|
|
|
15263
15264
|
);
|
|
15264
15265
|
result.events.push(event);
|
|
15265
15266
|
currentEvent = event;
|
|
15267
|
+
currentEventIndent = indent;
|
|
15266
15268
|
}
|
|
15267
15269
|
options.noTitle = sharedOptions["no-title"] === "on";
|
|
15268
15270
|
finalizeAutoTagColors(result.tagGroups, palette);
|
|
@@ -69231,7 +69233,7 @@ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
|
|
|
69231
69233
|
|
|
69232
69234
|
// src/auto/index.ts
|
|
69233
69235
|
init_safe_href();
|
|
69234
|
-
var VERSION = "0.
|
|
69236
|
+
var VERSION = "0.41.0";
|
|
69235
69237
|
var DEFAULTS = {
|
|
69236
69238
|
theme: "auto",
|
|
69237
69239
|
palette: "slate",
|
package/dist/auto.js
CHANGED
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
$2`),...h}},splitLine:{lineStyle:{color:r,opacity:o}},...i&&{name:i,nameLocation:"middle",nameGap:s??f,nameTextStyle:{color:e,fontSize:d.text(18),fontFamily:Wt}}}}function p$t(t,e,n,r,o){if(t.error)return{};let i=o??ge.identity(),{textColor:a,axisLineColor:s,splitLineColor:l,gridOpacity:c,colors:u,titleConfig:d}=Zct(t,e,n,i),f=Lr(e,n);switch(t.type){case"bar":return m$t(t,e,n,a,s,l,c,u,f,d,r,i);case"bar-stacked":return S$t(t,e,n,a,s,l,c,u,f,d,r,i);case"line":return t.seriesNames?y$t(t,e,a,s,l,c,u,d,r,i):g$t(t,e,a,s,l,c,d,r,i);case"area":return v$t(t,e,a,s,l,c,d,r,i);case"pie":return Xct(t,e,n,a,Wg(e,t.data.length),f,d,!1,i);case"doughnut":return Xct(t,e,n,a,Wg(e,t.data.length),f,d,!0,i);case"radar":return b$t(t,e,n,a,c,d,i);case"polar-area":return x$t(t,e,n,a,Wg(e,t.data.length),f,d,i)}}function Jv(t){let e=t.yLabel?"12%":"3%",n=t.hasTitle&&t.hasLegend?"22%":t.hasTitle?"15%":t.hasLegend?"12%":"5%";return{left:e,right:"4%",bottom:t.xLabel?"10%":"3%",top:n,containLabel:!0}}function h$t(t,e,n){return dr(t,e,n).join(`
|
|
46
46
|
`)}function m$t(t,e,n,r,o,i,a,s,l,c,u,d){let{xLabel:f,yLabel:p}=WS(t),h=t.orientation==="horizontal",m=t.data.map(M=>M.label),g=t.data.map((M,T)=>{let E=M.color??s[T%s.length];return{value:M.value,itemStyle:{color:ye(e,E,n,{solid:t.solidFill===!0}),borderColor:E,borderWidth:vf}}}),y=(d??ge.identity()).text(16),v=kt("0".repeat(12),y),b=h?m.map(M=>h$t(M,y,v)):m,x=Math.max(0,...b.map(M=>Math.max(...M.split(`
|
|
47
47
|
`).map(T=>kt(T,y))))),w=h&&p?Math.max(40,x+16):void 0,S=ad("category",r,o,i,a,h?p:f,b,w,h?void 0:u,void 0,d),N=ad("value",r,o,i,a,h?f:p,void 0,h&&f?40:void 0,void 0,void 0,d),L=d??ge.identity();return{...Ds,...c!==void 0&&{title:c},grid:Jv({xLabel:f,yLabel:p,hasTitle:!!t.title&&!t.noTitle,isHorizontal:h}),xAxis:h?N:S,yAxis:h?{...S,inverse:!0}:N,series:[{type:"bar",data:g,label:{show:!t.noValue,position:h?"right":"top",formatter:"{c}",color:r,fontSize:L.text(11),fontFamily:Wt},labelLayout:{hideOverlap:!0},emphasis:dg,blur:tl}]}}function iz(t){let e=t.length;if(e<=12)return 0;let n=[1,2,5,10,25,50,100],r=Math.ceil(e/5);return([...n].reverse().find(i=>i<=r)??1)-1}function az(t,e,n,r){if(t.length!==0)return{silent:!1,tooltip:{show:!1},data:t.map(o=>{let i=e.indexOf(o.start),a=e.indexOf(o.end),s=i>=0&&a>=0?a-i:1/0,l=o.color??r;return[{name:o.label,xAxis:o.start,itemStyle:{color:l,opacity:.15},label:{show:s>=2,position:"insideTop",fontSize:11,color:n}},{xAxis:o.end}]})}}function g$t(t,e,n,r,o,i,a,s,l){let c=l??ge.identity(),{xLabel:u,yLabel:d}=WS(t),f=t.color??t.seriesNameColors?.[0]??e.primary,p=t.data.map(v=>v.label),h=t.data.map(v=>v.value),m=t.eras??[],g=iz(p),y=az(m,p,n,e.colors.blue);return{...Ds,...a!==void 0&&{title:a},grid:Jv({xLabel:u,yLabel:d,hasTitle:!!t.title&&!t.noTitle}),xAxis:ad("category",n,r,o,i,u,p,void 0,s,g,l),yAxis:ad("value",n,r,o,i,d,void 0,void 0,void 0,void 0,l),series:[{type:"line",data:h,smooth:!1,symbolSize:8,lineStyle:{color:f,width:3},itemStyle:{color:f},label:{show:!t.noValue,position:"top",formatter:"{c}",color:n,fontSize:c.text(11),fontFamily:Wt},labelLayout:{hideOverlap:!0},emphasis:JH,blur:tl,...y&&{markArea:y}}]}}function y$t(t,e,n,r,o,i,a,s,l,c){let u=c??ge.identity(),{xLabel:d,yLabel:f}=WS(t),p=t.seriesNames??[],h=t.data.map(b=>b.label),m=t.eras??[],g=iz(h),y=az(m,h,n,e.colors.blue),v=p.map((b,x)=>{let w=t.seriesNameColors?.[x]??a[x%a.length],S=t.data.map(_=>x===0?_.value:_.extraValues?.[x-1]??0);return{name:b,type:"line",data:S,smooth:!1,symbolSize:8,lineStyle:{color:w,width:3},itemStyle:{color:w},label:{show:!t.noValue,position:"top",formatter:"{c}",color:n,fontSize:u.text(11),fontFamily:Wt},labelLayout:{hideOverlap:!0},emphasis:JH,blur:tl,...x===0&&y&&{markArea:y}}});return{...Ds,...s!==void 0&&{title:s},legend:{data:p,bottom:10,textStyle:{color:n}},grid:Jv({xLabel:d,yLabel:f,hasTitle:!!t.title&&!t.noTitle,hasLegend:!0}),xAxis:ad("category",n,r,o,i,d,h,void 0,l,g,c),yAxis:ad("value",n,r,o,i,f,void 0,void 0,void 0,void 0,c),series:v}}function v$t(t,e,n,r,o,i,a,s,l){let c=l??ge.identity(),{xLabel:u,yLabel:d}=WS(t),f=t.color??t.seriesNameColors?.[0]??e.primary,p=t.data.map(v=>v.label),h=t.data.map(v=>v.value),m=t.eras??[],g=iz(p),y=az(m,p,n,e.colors.blue);return{...Ds,...a!==void 0&&{title:a},grid:Jv({xLabel:u,yLabel:d,hasTitle:!!t.title&&!t.noTitle}),xAxis:ad("category",n,r,o,i,u,p,void 0,s,g,l),yAxis:ad("value",n,r,o,i,d,void 0,void 0,void 0,void 0,l),series:[{type:"line",data:h,smooth:!1,symbolSize:8,lineStyle:{color:f,width:3},itemStyle:{color:f},areaStyle:{opacity:.25},label:{show:!t.noValue,position:"top",formatter:"{c}",color:n,fontSize:c.text(11),fontFamily:Wt},labelLayout:{hideOverlap:!0},emphasis:JH,blur:tl,...y&&{markArea:y}}]}}function sz(t){let e=!t.noName,n=!t.noValue,r=!t.noPercent,o=[];return e&&o.push("{b}"),n&&o.push("{c}"),r&&o.push("{d}%"),o.length===0?"{b}":o.length===1?o[0]:e&&n&&r?"{b} \u2014 {c} ({d}%)":e?"{b} \u2014 "+o.slice(1).join(" "):o.join(" ")}function QH(t){let e=sz(t),n=t.data.reduce((o,i)=>o+i.value,0),r=t.data.reduce((o,i)=>{let a=e.replace("{b}",i.label).replace("{c}",String(i.value)).replace("{d}",n>0?(i.value/n*100).toFixed(2):"0");return Math.max(o,a.length)},0);return r>30?{outerRadius:38,fontSize:11}:r>24?{outerRadius:45,fontSize:12}:r>18?{outerRadius:55,fontSize:13}:{outerRadius:70,fontSize:14}}function Xct(t,e,n,r,o,i,a,s,l){let c=l??ge.identity(),u={xAxis:{show:!1},yAxis:{show:!1}},d=t.data.map((h,m)=>{let g=h.color??o[m%o.length];return{name:h.label,value:h.value,itemStyle:{color:ye(e,g,n,{solid:t.solidFill===!0}),borderColor:g,borderWidth:vf}}}),{outerRadius:f,fontSize:p}=QH(t);return{...Ds,...u,...a!==void 0&&{title:a},series:[{type:"pie",radius:s?[`${Math.round(f*.57)}%`,`${f}%`]:["0%",`${f}%`],data:d,label:{position:"outside",formatter:sz(t),color:r,fontFamily:Wt,fontSize:c.text(p)},labelLine:{show:!0},emphasis:dg,blur:tl}]}}function b$t(t,e,n,r,o,i,a){let s=a??ge.identity(),l=t.color??t.seriesNameColors?.[0]??e.primary,c=t.data.map(f=>f.value),u=Math.max(...c)*1.15,d=t.data.map(f=>({name:f.label,max:u}));return{...Ds,...i!==void 0&&{title:i},xAxis:{show:!1},yAxis:{show:!1},radar:{indicator:d,axisName:{color:r,fontFamily:Wt,fontSize:s.text(16)},splitLine:{lineStyle:{color:e.border,opacity:o}},axisLine:{lineStyle:{color:e.border,opacity:o}},splitArea:{show:!1}},series:[{type:"radar",data:[{value:c,name:t.series??"Value",areaStyle:{color:ye(e,l,n,{solid:t.solidFill===!0})},lineStyle:{color:l},itemStyle:{color:l},symbol:"circle",symbolSize:8,label:{show:!t.noValue,formatter:"{c}",color:r,fontSize:s.text(11),fontFamily:Wt}}],emphasis:dg,blur:tl}]}}function x$t(t,e,n,r,o,i,a,s){let l=s??ge.identity(),c=t.data.map((u,d)=>{let f=u.color??o[d%o.length];return{name:u.label,value:u.value,itemStyle:{color:ye(e,f,n,{solid:t.solidFill===!0}),borderColor:f,borderWidth:vf}}});return{...Ds,...a!==void 0&&{title:a},xAxis:{show:!1},yAxis:{show:!1},series:[{type:"pie",roseType:"radius",radius:(()=>{let{outerRadius:u}=QH(t);return[`${Math.round(u*.14)}%`,`${u}%`]})(),data:c,label:{position:"outside",formatter:sz(t),color:r,fontFamily:Wt,fontSize:l.text(QH(t).fontSize)},labelLine:{show:!0},emphasis:dg,blur:tl}]}}function S$t(t,e,n,r,o,i,a,s,l,c,u,d){let f=d??ge.identity(),{xLabel:p,yLabel:h}=WS(t),m=t.orientation==="horizontal",g=t.seriesNames??[],y=t.data.map(N=>N.label),v=g.map((N,L)=>{let M=t.seriesNameColors?.[L]??s[L%s.length],T=ye(e,M,n,{solid:t.solidFill===!0}),E=t.data.map(C=>L===0?C.value:C.extraValues?.[L-1]??0);return{name:N,type:"bar",stack:"total",data:E,itemStyle:{color:T,borderColor:M,borderWidth:vf},label:{show:!t.noValue,position:"inside",formatter:"{c}",color:He(T,e.textOnFillLight,e.textOnFillDark),fontSize:f.text(14),fontWeight:"bold",fontFamily:Wt},labelLayout:w$t,emphasis:QBt,blur:tl}}),b=f.text(16),x=m&&h?Math.max(40,Math.max(...y.map(N=>kt(N,b)))+16):void 0,w=ad("category",r,o,i,a,m?h:p,y,x,m?void 0:u,void 0,d),_=ad("value",r,o,i,a,m?p:h,void 0,m&&p?40:void 0,void 0,void 0,d);return{...Ds,...c!==void 0&&{title:c},legend:{data:g,bottom:10,textStyle:{color:r}},grid:Jv({xLabel:p,yLabel:h,hasTitle:!!t.title&&!t.noTitle,hasLegend:!0}),xAxis:m?_:w,yAxis:m?{...w,inverse:!0}:_,series:v}}async function Qct(t,e,n){let r=e==="dark",{getPalette:o}=await Promise.resolve().then(()=>(pl(),HE)),i=n??(r?o("nord").dark:o("nord").light),a;for(let p of t.split(`
|
|
48
|
-
`)){let h=p.trim();if(!h||h.startsWith("//"))continue;let m=pn(h);m&&(a=m.chartType.toLowerCase());break}if(!a)return"";let s,l=[],c=ao(i);if(_$t.has(a)){let p=ml(t,i);if(p.error)return"";s=p$t(p,i,r,VS,ge.identity()),l=s$t(p,c)}else{let p=fg(t,i);if(p.error)return"";s=n$t(p,i,r,ge.identity()),l=l$t(p,c)}if(!s||Object.keys(s).length===0)return"";let u="",d=0;if(l.length>0){let{legend:p,...h}=s;s=h,d=8+(s.title&&s.title.text?40:0);let{svg:g,height:y}=Vct(l,{palette:i,isDark:r,containerWidth:VS,activeGroup:l[0].name,className:"chart-legend"});u=g;let v=s.grid;if(v&&y>Fe){let b=d+y+12,x=v.top,w=typeof x=="string"&&x.endsWith("%")?parseFloat(x)/100*ug:typeof x=="number"?x:typeof x=="string"?parseFloat(x):0;b>w&&(v.top=`${b}px`)}}let f=Ptt(null,null,{renderer:"svg",ssr:!0,width:VS,height:ug});try{f.setOption(s);let p=f.renderToSVGString();if(!p)return"";let h=e!=="transparent"?`background: ${i.bg}; `:"",m=p.replace(/^<svg /,`<svg style="${h}font-family: ${Wt}" `);return u&&(m=m.replace(/(<svg[^>]*>)/,`$1<g transform="translate(0,${d})">${u}</g>`)),m}finally{f.dispose()}}var dg,QBt,tl,JH,Ds,vf,Uct,HS,JBt,Kct,qct,jct,w$t,VS,ug,_$t,lz=U(()=>{"use strict";Lnt();sst();fct();zct();_r();Wct();Mo();O1();Kr();Bn();pl();ur();X1();Xn();bo();wr();X1();Fo([M$,m$,D$,X$,J$,GF,RF,BF,IF,JF,cH,aH,bH,dS,MH,eH,ZH]);dg={focus:"self",blurScope:"global",itemStyle:{opacity:1}},QBt={focus:"series",blurScope:"global",itemStyle:{opacity:1}},tl={itemStyle:{opacity:.15},lineStyle:{opacity:.15}},JH={...dg},Ds={backgroundColor:"transparent",animation:!1,tooltip:{show:!1}},vf=2,Uct=.65,HS=new Set(["sankey","chord","function","scatter","heatmap","funnel"]),JBt=new Set(["chart","title","series","x-label","y-label","size-label","no-name","no-value","no-percent","columns","rows","x"]);Kct=new Set([tz,ez,nz,rz,eA,oz]);qct=2,jct=-99999,w$t=({rect:t,labelRect:e})=>e.width<=t.width-qct&&e.height<=t.height-qct?{hideOverlap:!0}:{x:jct,y:jct,fontSize:0};VS=1200,ug=800,_$t=new Set(["bar","line","multi-line","area","pie","doughnut","radar","polar-area","bar-stacked"])});var Jct={};De(Jct,{EVENT_LINE_DIAGNOSTIC_CODES:()=>Kp,parseEventLine:()=>nA});function nA(t,e){let n={scale:!0,side:"alternate",noTitle:!1,noBox:!1,noLegend:!1},r={type:"event-line",title:null,titleLineNumber:null,events:[],eras:[],tagGroups:[],options:n,diagnostics:[],error:null},o=Fr(r),i=(
|
|
49
|
-
`),l=!1,c=!1,u={},d=null,f=null,p=null,h=new Map;for(let
|
|
48
|
+
`)){let h=p.trim();if(!h||h.startsWith("//"))continue;let m=pn(h);m&&(a=m.chartType.toLowerCase());break}if(!a)return"";let s,l=[],c=ao(i);if(_$t.has(a)){let p=ml(t,i);if(p.error)return"";s=p$t(p,i,r,VS,ge.identity()),l=s$t(p,c)}else{let p=fg(t,i);if(p.error)return"";s=n$t(p,i,r,ge.identity()),l=l$t(p,c)}if(!s||Object.keys(s).length===0)return"";let u="",d=0;if(l.length>0){let{legend:p,...h}=s;s=h,d=8+(s.title&&s.title.text?40:0);let{svg:g,height:y}=Vct(l,{palette:i,isDark:r,containerWidth:VS,activeGroup:l[0].name,className:"chart-legend"});u=g;let v=s.grid;if(v&&y>Fe){let b=d+y+12,x=v.top,w=typeof x=="string"&&x.endsWith("%")?parseFloat(x)/100*ug:typeof x=="number"?x:typeof x=="string"?parseFloat(x):0;b>w&&(v.top=`${b}px`)}}let f=Ptt(null,null,{renderer:"svg",ssr:!0,width:VS,height:ug});try{f.setOption(s);let p=f.renderToSVGString();if(!p)return"";let h=e!=="transparent"?`background: ${i.bg}; `:"",m=p.replace(/^<svg /,`<svg style="${h}font-family: ${Wt}" `);return u&&(m=m.replace(/(<svg[^>]*>)/,`$1<g transform="translate(0,${d})">${u}</g>`)),m}finally{f.dispose()}}var dg,QBt,tl,JH,Ds,vf,Uct,HS,JBt,Kct,qct,jct,w$t,VS,ug,_$t,lz=U(()=>{"use strict";Lnt();sst();fct();zct();_r();Wct();Mo();O1();Kr();Bn();pl();ur();X1();Xn();bo();wr();X1();Fo([M$,m$,D$,X$,J$,GF,RF,BF,IF,JF,cH,aH,bH,dS,MH,eH,ZH]);dg={focus:"self",blurScope:"global",itemStyle:{opacity:1}},QBt={focus:"series",blurScope:"global",itemStyle:{opacity:1}},tl={itemStyle:{opacity:.15},lineStyle:{opacity:.15}},JH={...dg},Ds={backgroundColor:"transparent",animation:!1,tooltip:{show:!1}},vf=2,Uct=.65,HS=new Set(["sankey","chord","function","scatter","heatmap","funnel"]),JBt=new Set(["chart","title","series","x-label","y-label","size-label","no-name","no-value","no-percent","columns","rows","x"]);Kct=new Set([tz,ez,nz,rz,eA,oz]);qct=2,jct=-99999,w$t=({rect:t,labelRect:e})=>e.width<=t.width-qct&&e.height<=t.height-qct?{hideOverlap:!0}:{x:jct,y:jct,fontSize:0};VS=1200,ug=800,_$t=new Set(["bar","line","multi-line","area","pie","doughnut","radar","polar-area","bar-stacked"])});var Jct={};De(Jct,{EVENT_LINE_DIAGNOSTIC_CODES:()=>Kp,parseEventLine:()=>nA});function nA(t,e){let n={scale:!0,side:"alternate",noTitle:!1,noBox:!1,noLegend:!1},r={type:"event-line",title:null,titleLineNumber:null,events:[],eras:[],tagGroups:[],options:n,diagnostics:[],error:null},o=Fr(r),i=(y,v,b)=>{r.diagnostics.push(wt(y,v,"warning",b))},a=(y,v,b)=>{let x=wt(y,v,"error",b);r.diagnostics.push(x),r.error||(r.error=fn(x))};if(!t?.trim())return o(0,"No content provided");let s=t.split(`
|
|
49
|
+
`),l=!1,c=!1,u={},d=null,f=null,p=null,h=-1,m=0,g=new Map;for(let y=0;y<s.length;y++){let v=s[y],b=y+1,x=v.trim();if(!x){d=null;continue}if(x.startsWith("//"))continue;let w=$e(v);if(!c){let M=pn(x);if(M?.chartType==="event-line"){r.title=M.title??null,r.titleLineNumber=b,c=!0;continue}let T='Expected "event-line [Title]" as the first line.',E=Ie(M?.chartType??x,["event-line"]);return E&&(T+=` ${E}`),o(b,T)}let S=ir(x);if(S){if(Cr(S,b,r.diagnostics),l){a(b,"Tag groups must appear before event-line content","E_TAG_DECLARED_AFTER_CONTENT");continue}d={name:S.name,...S.alias!==void 0&&{alias:S.alias},entries:[],lineNumber:b},S.alias&&g.set(S.alias.toLowerCase(),te(S.name)),g.set(te(S.name),te(S.name)),r.tagGroups.push(d);continue}if(d&&!l&&w>0){let{text:M,isDefault:T}=or(x),{label:E,color:C}=ln(M,e,r.diagnostics,b);(T||d.entries.length===0)&&(d.defaultValue=E),d.entries.push({value:E,color:C??Sr,lineNumber:b});continue}if(f&&w>m){let M=x.startsWith("- ")?`\u2022 ${x.substring(2)}`:x;f.description.push(M);continue}let _=x.match(C$t);if(_){l=!0,d=null,f=null;let M=_[1].trim(),T=(_[2]??"").trim(),E=!1,C=T.match(L$t);C&&(E=C[1].toLowerCase()==="true",T=(T.slice(0,C.index)+T.slice(C.index+C[0].length)).trim());let k=null;if(T){let I=T.split(/\s+/).pop();ln(`x ${I}`,e,r.diagnostics,b).color!==void 0&&(k=I)}let A={name:M,color:k,collapsed:E,lineNumber:b};r.eras.push(A),p=M,h=w;continue}if(w===0){if(d=null,x.toLowerCase()==="no-scale"){n.scale=!1;continue}let M=x.match(T$t);if(M){n.side=M[1].toLowerCase();continue}if(x.toLowerCase()==="no-box"){n.noBox=!0;continue}if(x.toLowerCase()==="no-legend"){n.noLegend=!0;continue}let T=x.match(N$t);if(T){let E=T[1].toUpperCase();E!=="LR"&&i(b,`event-line is horizontal-only in v1; \`direction ${E}\` (vertical orientation) is a fast-follow.`,Kp.UNSUPPORTED);continue}if(io(x,u))continue;if(M$t.test(x)){i(b,"Group events with `[Name]` era brackets (\xA728.6a), not `section`.",Kp.UNSUPPORTED);continue}}p!==null&&w>h||(p=null),l=!0;let L=k$t(x,b,p,g,r.diagnostics,i);r.events.push(L),f=L,m=w}return n.noTitle=u["no-title"]==="on",Hr(r.tagGroups,e),r.tagGroups.length>0&&(Xo(r.events,r.tagGroups,i,Ie),Tr(r.tagGroups,i)),r.events.length===0&&!r.error&&a(r.titleLineNumber??1,"event-line has no events.",Kp.NO_EVENTS),n.scale&&A$t(r.events,r.eras,i),r}function A$t(t,e,n){if(e.length<2)return;let r=new Map(e.map((c,u)=>[c.name,u])),o=t.filter(c=>c.dateValue!==null&&c.era!==null&&r.has(c.era));if(o.length===0)return;let i=new Map;for(let c of o){let u=r.get(c.era),d=i.get(u);d?(c.dateValue<d.min.dateValue&&(d.min=c),c.dateValue>d.max.dateValue&&(d.max=c)):i.set(u,{min:c,max:c})}let a=e.length,s=new Array(a).fill(null),l=new Array(a).fill(null);for(let c=1;c<a;c++){let u=i.get(c-1)?.max??null,d=s[c-1]??null;s[c]=u&&(!d||u.dateValue>d.dateValue)?u:d}for(let c=a-2;c>=0;c--){let u=i.get(c+1)?.min??null,d=l[c+1]??null;l[c]=u&&(!d||u.dateValue<d.dateValue)?u:d}for(let c of o){let u=r.get(c.era),d=l[u],f=s[u];d&&c.dateValue>d.dateValue?n(c.lineNumber,`"${c.label}" (${c.date}) is in era "${c.era}" but dated after era "${d.era}" begins (${d.date}). event-line eras run left-to-right by date \u2014 fix the date or move it to the right era, or their brackets will overlap.`,Kp.ERA_DATE_ORDER):f&&c.dateValue<f.dateValue&&n(c.lineNumber,`"${c.label}" (${c.date}) is in era "${c.era}" but dated before era "${f.era}" ends (${f.date}). event-line eras run left-to-right by date \u2014 fix the date or move it to the right era, or their brackets will overlap.`,Kp.ERA_DATE_ORDER)}}function k$t(t,e,n,r,o,i){let a=null,s=null,l=t,c=AI(t);if(c)a=c.startDate,s=ar(c.startDate),l=c.remainder||"",c.endDate&&i(e,"event-line events are points; a date range (`->`) is not supported \u2014 using the start date.",Kp.UNSUPPORTED);else if(E$t.test(t)){let p=t.split(/\s+/)[0];i(e,`Use ISO dates (YYYY, YYYY-MM, or YYYY-MM-DD). Got '${p}'.`,Kp.BAD_DATE)}let u=In($4,new Set(r.keys())),d=xn(l,u,r,void 0,o,e);hn(d.meta,u,p=>i(e,p),d.name);let f={...d.meta};return d.color!==void 0&&(f.color=d.color),{label:d.name||l.trim(),lineNumber:e,date:a,dateValue:s,metadata:f,description:[],era:n}}var Kp,E$t,T$t,C$t,L$t,M$t,N$t,cz=U(()=>{"use strict";Xn();Sn();wr();To();LE();Kp={NO_EVENTS:"E_EVENT_LINE_NO_EVENTS",BAD_DATE:"E_EVENT_LINE_BAD_DATE",UNSUPPORTED:"E_EVENT_LINE_UNSUPPORTED",ERA_DATE_ORDER:"E_EVENT_LINE_ERA_DATE_ORDER"},E$t=/^\d{1,4}[/.]\d/,T$t=/^side\s+(above|below|alternate)\b/i,C$t=/^\[([^\]]+)\]\s*(.*)$/,L$t=/\bcollapsed:\s*(true|false)\b/i,M$t=/^section\b/i,N$t=/^direction\s+(\w+)/i});var eut={};De(eut,{VERSION_CONTROL_DIAGNOSTIC_CODES:()=>tb,parseVersionControl:()=>rA});function rA(t,e){let n={direction:"LR",noLabels:!1,noLanes:!1,noHead:!1},r={type:"version-control",title:null,titleLineNumber:null,nodes:[],branches:[],refs:[],notes:[],options:n,diagnostics:[],error:null},o=Fr(r),i=(M,T,E)=>{r.diagnostics.push(wt(M,T,"warning",E))},a=(M,T,E)=>{let C=wt(M,T,"error",E);r.diagnostics.push(C),r.error||(r.error=fn(C))};if(!t?.trim())return o(0,"No content provided");let s=r.nodes,l=new Map,c=[],u=r.refs,d=r.notes,f=null,p=0,h=0,m=!1,g=(M,T,E,C)=>{let k=l.get(M);if(k)return k;let A={name:M,creationLane:h++,colorToken:E,order:C,tip:null,pendingParent:null,ab:null};if(T!=null){let I=l.get(T);A.pendingParent=I?I.tip:null}return l.set(M,A),c.push(M),A},y=M=>s.filter(T=>T.message===M||T.id===M),v=(M,T)=>{let E=y(M);return E.length===0?null:(E.length>1&&!/^[0-9a-f]{4,}$/.test(M)&&i(T,`Commit reference "${M}" matches ${E.length} commits \u2014 use an explicit id:. (\xA729.10)`,tb.AMBIGUOUS_REF),E[E.length-1])},b=M=>{let T=l.get(f),E=M.id??null,C={key:s.length,branch:f,lane:T.creationLane,seq:p++,kind:M.kind,message:M.message,type:M.type,id:E,tag:M.tag,lineNumber:M.lineNumber,prev:T.tip,parent:null,mergeFrom:null,cherryFrom:null,revertFrom:null,squashFrom:null,movedTo:null,ghost:!1};return T.pendingParent!=null&&C.prev===null&&(C.parent=T.pendingParent,T.pendingParent=null),T.tip=C.key,s.push(C),C},x=M=>{f||(g("main",null,null,null),f="main")},w=(M,T,E)=>{let C=l.get(M),k=l.get(T);if(!C||!k){i(E,`rebase references unknown branch "${C?T:M}". (\xA729.8)`,tb.UNKNOWN_BRANCH);return}let A=s.filter(R=>R.branch===M).sort((R,B)=>R.seq-B.seq),I=null,P=k.tip;for(let R of A){R.ghost=!0;let B={key:s.length,branch:M,lane:C.creationLane,seq:p++,kind:"commit",message:R.message,type:R.type,id:R.id,tag:R.tag,lineNumber:R.lineNumber,prev:I,parent:I==null?P:null,mergeFrom:null,cherryFrom:null,revertFrom:null,squashFrom:null,movedTo:null,ghost:!1};R.movedTo=B.key,s.push(B),I=B.key}C.tip=I,f=M},S=t.split(`
|
|
50
50
|
`);for(let M=0;M<S.length;M++){let T=S[M],E=M+1,C=T.trim();if(!C||C.startsWith("//"))continue;let k=$e(T);if(!m){let $=pn(C);if($?.chartType==="version-control"){r.title=$.title??null,r.titleLineNumber=E,m=!0;continue}let W='Expected "version-control [Title]" as the first line.',D=Ie($?.chartType??C,["version-control"]);return D&&(W+=` ${D}`),o(E,W)}let A=/^direction\s+(LR|TB|BT)$/i.exec(C);if(A){n.direction=A[1].toUpperCase();continue}if(C==="no-labels"){n.noLabels=!0;continue}if(C==="no-lanes"){n.noLanes=!0;continue}if(C==="no-head"){n.noHead=!0;continue}if(k===0){let $;if($=/^ref\s+(.+?)\s+at\s+(.+?)(?:\s+(remote))?$/.exec(C)){let j=$[1].trim(),Q=v($[2].trim(),E);u.push({name:j,atKey:Q?Q.key:null,remote:!!$[3]||/^(origin|upstream)\//.test(j),head:j==="HEAD",lineNumber:E});continue}if($=/^rebase\s+(.+?)\s+onto\s+(.+)$/.exec(C)){w($[1].trim(),$[2].trim(),E);continue}if($=/^reset\s+(.+?)\s+to\s+(.+)$/.exec(C)){let j=l.get($[1].trim()),Q=v($[2].trim(),E);if(!j)i(E,`reset references unknown branch "${$[1].trim()}". (\xA729.8)`,tb.UNKNOWN_BRANCH);else if(Q){for(let tt of s)tt.branch===j.name&&tt.seq>Q.seq&&(tt.ghost=!0);j.tip=Q.key,f=j.name}continue}let W=C.split(/\s+/).pop()??"",D=ln(C,e,r.diagnostics,E),H=D.label,V=D.color!==void 0?W:null,X=null,q=/\s+order:\s*(\d+)\s*$/.exec(H);q&&(X=Number(q[1]),H=H.replace(/\s+order:\s*\d+\s*$/,""));let Z=H.trim(),F=null,Y=H.split(/\s+from\s+/);Y.length===2&&(Z=Y[0].trim(),F=Y[1].trim()),l.get(Z)||g(Z,F??f,V,X),f=Z;continue}x(E);let I;if(/^merge\b/.test(C)){let{msg:$,tag:W,id:D,type:H}=tut(C.slice(5).trim()),V=$.trim(),X=null,q=/^(.*?)\s+(squash|ff|no-ff)$/.exec(V);q&&(V=q[1].trim(),X=q[2]);let Z=l.get(V);if(Z||i(E,`merge references unknown branch "${V}". (\xA729.4)`,tb.UNKNOWN_BRANCH),X==="squash"){if(Z)for(let Y of s)Y.branch===V&&(Y.ghost=!0);let F=b({kind:"commit",message:`Squash ${V}`,type:"normal",tag:W??null,id:D??null,lineNumber:E});F.squashFrom=Z?Z.tip:null}else{let F=b({kind:"merge",message:V,type:H??"normal",tag:W??null,id:D??null,lineNumber:E});F.mergeFrom=Z?Z.tip:null}continue}if(/^cherry-pick\b/.test(C)){let $=C.slice(11).trim(),W=v($,E),D=b({kind:"cherry",message:$,type:"normal",tag:null,id:null,lineNumber:E});D.cherryFrom=W?W.key:null;continue}if(/^revert\b/.test(C)){let $=C.slice(6).trim(),W=v($,E),D=b({kind:"commit",message:W?`Revert ${W.message}`:"Revert",type:"reverse",tag:null,id:null,lineNumber:E});D.revertFrom=W?W.key:null;continue}if(I=/^note\b\s*(.*)$/.exec(C)){let $=l.get(f);d.push({num:d.length+1,anchorKey:$.tip,text:I[1].trim(),lineNumber:E});continue}let P=C.replace(/^commit\b\s*/,""),{msg:R,tag:B,id:G,type:O}=tut(P);b({kind:"commit",message:R||null,type:O??"normal",tag:B??null,id:G??null,lineNumber:E})}if(!n.noHead&&f){let M=l.get(f).tip;M!=null&&!u.some(T=>T.head)&&u.push({name:"HEAD",atKey:M,remote:!1,head:!0,lineNumber:0})}let _=M=>{let T=new Set,E=[M];for(;E.length;){let C=E.pop();if(T.has(C))continue;T.add(C);let k=s[C];k&&(k.prev!=null&&E.push(k.prev),k.parent!=null&&E.push(k.parent),k.mergeFrom!=null&&E.push(k.mergeFrom))}return T};for(let M of c){let T=l.get(M);if(T.tip==null)continue;let E=u.find(C=>C.remote&&(C.name===`origin/${M}`||C.name.endsWith(`/${M}`)));if(E&&E.atKey!=null){let C=_(T.tip),k=_(E.atKey),A=0,I=0;C.forEach(P=>{k.has(P)||A++}),k.forEach(P=>{C.has(P)||I++}),T.ab={ahead:A,behind:I}}}let N=[...c].sort((M,T)=>{let E=l.get(M),C=l.get(T),k=E.order??E.creationLane,A=C.order??C.creationLane;return k-A||E.creationLane-C.creationLane}),L=new Map;N.forEach((M,T)=>L.set(M,T));for(let M of s)M.lane=L.get(M.branch);return r.branches=c.map(M=>{let T=l.get(M);return{name:M,lane:L.get(M),colorToken:T.colorToken,order:T.order,tip:T.tip,ab:T.ab}}),s.length===0&&!r.error&&a(r.titleLineNumber??1,"version-control has no commits.",tb.NO_COMMITS),r}function tut(t){let e={msg:t,tag:null,type:null,id:null},n=t.search(/\b(tag|type|id)\s*:/);if(n>=0){e.msg=t.slice(0,n).trim();let r=/(tag|type|id)\s*:\s*([^,]+)/g,o,i=t.slice(n);for(;(o=r.exec(i))!==null;){let a=o[1];e[a]=o[2].trim()}}return e}var tb,uz=U(()=>{"use strict";Xn();wr();tb={NO_COMMITS:"E_VERSION_CONTROL_NO_COMMITS",UNKNOWN_BRANCH:"E_VERSION_CONTROL_UNKNOWN_BRANCH",AMBIGUOUS_REF:"E_VERSION_CONTROL_AMBIGUOUS_REF",CYCLE:"E_VERSION_CONTROL_CYCLE",UNSUPPORTED:"E_VERSION_CONTROL_UNSUPPORTED"}});var rut={};De(rut,{parseKanban:()=>eb});function eb(t,e){let n={},r={type:"kanban",columns:[],tagGroups:[],options:n,diagnostics:[],error:null},o=Fr(r),i=(y,v)=>{r.diagnostics.push(wt(y,v,"warning"))};if(!t?.trim())return o(0,"No content provided");let a=t.split(`
|
|
51
51
|
`),s=!1,l=null,c=null,u=null,d=0,f=0,p=0,h=new Map,m=new Map,g=new Map;for(let y=0;y<a.length;y++){let v=a[y],b=y+1,x=v.trim();if(!x){l&&(l=null);continue}if(x.startsWith("//"))continue;if(!s&&!l){let _=pn(x);if(_){if(_.chartType!=="kanban"){let N=["kanban","org","class","flowchart","sequence","er","bar","line","pie"],L=`Expected chart type "kanban", got "${_.chartType}"`,M=Ie(_.chartType,N);return M&&(L+=`. ${M}`),o(b,L)}_.title&&(r.title=_.title,r.titleLineNumber=b);continue}}if(!s){let _=ir(x);if(_){Cr(_,b,r.diagnostics),l={name:_.name,..._.alias!==void 0&&{alias:_.alias},entries:[],lineNumber:b},_.alias&&h.set(Se(_.alias),te(_.name)),h.set(Se(_.name),te(_.name)),r.tagGroups.push(l);continue}}if(!s&&!l&&$e(v)===0){let _=x.match(Er);if(_&&!oA.test(x)){let L=_[1].trim().toLowerCase();if(D$t.has(L)){n[L]=_[2].trim();continue}}let N=O$t[x.toLowerCase()];if(N&&!oA.test(x)){i(b,N);continue}if(P$t.has(x.toLowerCase())&&!oA.test(x)){n[x.toLowerCase()]="on";continue}}if(l&&!s){if($e(v)>0){let{text:N,isDefault:L}=or(x),{label:M,color:T}=ln(N,e,r.diagnostics,b);(L||l.entries.length===0)&&(l.defaultValue=M),l.entries.push({value:M,color:T??Sr,lineNumber:b});continue}l=null}let w=$e(v);if(nut.test(x)){let N=x.match(nut)[1].replace(/\s*\(.*\)\s*$/,"").trim();r.diagnostics.push(wt(b,`'== ${N} ==' is no longer supported. Use '[${N}]' instead`));continue}let S=w===0?x.match(oA):null;if(S){if(s=!0,l=null,u)for(u.endLineNumber=b-1;u.endLineNumber>u.lineNumber&&!a[u.endLineNumber-1].trim();)u.endLineNumber--;u=null,f++;let _=S[1].trim(),N=(S[2]??"").trim(),L,M=N.match(R$t);M&&(L=hr(M[1],b,r.diagnostics,e),N=N.substring(M[0].length).trim());let T,E=N.match(I$t);E&&(T=E[1],N=N.substring(E[0].length).trim()),N.startsWith("|")&&(r.diagnostics.push(wt(b,Un(),"error",Je.PIPE_OPERATOR_REMOVED)),N=N.replace(/^\|\s*/,""));let C={},k;if(N.length>0){let I=In(TI,new Set(h.keys())),P=xn(N,I,h,void 0,r.diagnostics,b);hn(P.meta,I,R=>i(b,R),P.name),Object.assign(C,P.meta)}if(C.wip){let I=parseInt(C.wip,10);isNaN(I)||(k=I)}let A=`col-${f}`;T&&m.set(T,A),c={id:A,name:_,...k!==void 0&&{wipLimit:k},...L!==void 0&&{color:L},cards:[],lineNumber:b,metadata:C},r.columns.push(c);continue}if(s){if(!c){i(b,"Card line found before any column. Declare a column first with '[Column Name]', then indent cards beneath it. (\xA711)");continue}if(u&&w>d){u.details.push(x),u.endLineNumber=b;continue}if(w>0){p++;let _=G$t(x,b,p,h,e,r.diagnostics);if(c.metadata){let N=_.tags;for(let[L,M]of Object.entries(c.metadata))L!=="wip"&&(L in N||(N[L]=M))}d=w,u=_,c.cards.push(_);continue}i(b,c?`Unexpected line: '${x}'. Expected an indented card name or column header like '[Column Name]'.`:`Unexpected line: '${x}'. Expected a column header like '[Column Name]'.`)}}for(let y of r.tagGroups){let v=new Set(y.entries.map(b=>b.value.toLowerCase()));g.set(te(y.name),v)}for(let y of r.columns)y.wipLimit!=null&&y.cards.length>y.wipLimit&&i(y.lineNumber,`Column "${y.name}" has ${y.cards.length} cards but WIP limit is ${y.wipLimit}`);for(let y of r.columns)for(let v of y.cards)for(let[b,x]of Object.entries(v.tags)){let w=h.get(b.toLowerCase())??b.toLowerCase(),S=g.get(w);if(S&&!S.has(x.toLowerCase())){let _=r.tagGroups.find(L=>L.name.toLowerCase()===w)?.entries.map(L=>L.value),N=`Unknown tag value "${x}" for group "${w}"`;if(_){let L=Ie(x,_);L&&(N+=`. ${L}`)}i(v.lineNumber,N)}}return r.columns.length===0&&!r.error?o(1,"No columns found. Use [Column Name] to define columns"):(Hr(r.tagGroups,e),Tr(r.tagGroups,i,(y,v)=>{let b=wt(y,v);r.diagnostics.push(b),r.error||(r.error=fn(b))}),r)}function G$t(t,e,n,r,o,i){t.includes("|")&&i&&i.push(wt(e,Un(),"error",Je.PIPE_OPERATOR_REMOVED));let a=In(TI,new Set(r.keys())),s=xn(t,a,r,void 0,i,e);hn(s.meta,a,u=>i?.push(wt(e,u,"warning")),s.name);let l=s.color!==void 0?`${s.name} ${s.color}`:s.name,c={...s.meta};return{id:`card-${n}`,title:l,tags:c,details:[],lineNumber:e,endLineNumber:e}}var oA,R$t,I$t,nut,D$t,P$t,O$t,iA=U(()=>{"use strict";Xn();bo();To();Sn();wr();ta();oA=/^\[(.+?)\]\s*(.*)$/,R$t=/^(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\b/,I$t=/^as\s+([A-Za-z][A-Za-z0-9_]{0,11})\b/,nut=/^==\s+(.+?)\s*(?:\[wip:\s*(\d+)\])?\s*==$/,D$t=new Set(["hide","active-tag"]),P$t=new Set(["solid-fill","no-title"]),O$t={"no-auto-color":'"no-auto-color" was removed \u2014 colors are always auto-assigned from the palette; delete this line.'}});var lut={};De(lut,{parseC4:()=>Qp});function aut(t){switch(t){case"database":return"database";case"cache":return"cache";case"queue":return"queue";case"external":return"external";case"networking":return"cloud";default:return"default"}}function fz(t,e){if(e){let n=aut(Qx(e));if(n!=="default")return n}return aut(Qx(t))}function Z$t(t,e,n,r){let o=t.trim();if(!o)return{};if(o.startsWith("|")){let i=o.split("|").map(a=>a.trim());return Ti(i,e,n)}return o.includes(":")?Ti(["",o],e):(r?.(o),{})}function pz(t,e,n){if(t.includes("|")){let i=t.split("|").map(a=>a.trim());return{name:i[0]??"",metadata:Ti(i,e,n)}}let r=In(Tx,new Set(e.keys())),o=xn(t,r,e);return{name:o.name,metadata:o.meta}}function Q$t(t){switch(t){case"->":return"sync";case"~>":return"async";case"<->":return"bidirectional";case"<~>":return"bidirectional-async";default:return null}}function Qp(t,e){let n={},r={title:null,titleLineNumber:null,options:n,tagGroups:[],elements:[],relationships:[],deployment:[],diagnostics:[],error:null},o=(b,x,w="error")=>{let S=wt(b,x,w);r.diagnostics.push(S),!r.error&&w==="error"&&(r.error=fn(S))},i=Fr(r);if(!t?.trim())return i(0,"No content provided");let a=t.split(`
|
|
52
52
|
`),s=!1,l=!1,c=!1,u=null,d=new Map,f=new Map;function p(b){return f.get(b.trim())??b}let h=new Map,m=new WeakMap,g=new WeakMap,y=[],v=[];for(let b=0;b<a.length;b++){let x=a[b],w=b+1,S=x.trim();if(!S){u&&(u=null);continue}if(S.startsWith("//"))continue;if(S.includes("|")&&!/-\S*\|\S*->/.test(S)&&!/~\S*\|\S*~>/.test(S)&&r.diagnostics.push(wt(w,Un(),"error",Je.PIPE_OPERATOR_REMOVED)),!s&&!l){let R=pn(S);if(R){if(R.chartType!=="c4"){let B=`Expected chart type "c4", got "${R.chartType}"`,G=Ie(R.chartType,K$t);return G&&(B+=`. ${G}`),i(w,B)}l=!0,R.title&&(r.title=R.title,r.titleLineNumber=w);continue}}let _=ir(S);if(_){if(Cr(_,w,r.diagnostics),s){o(w,"Tag groups must appear before content");continue}u={name:_.name,..._.alias!==void 0&&{alias:_.alias},entries:[],lineNumber:w},_.alias&&d.set(Se(_.alias),te(_.name)),d.set(Se(_.name),te(_.name)),r.tagGroups.push(u);continue}if(!s&&!u&&$e(x)===0){if(j$t.has(S.toLowerCase())){n[S.toLowerCase()]="on";continue}let R=S.match(Er);if(R){let B=R[1].trim().toLowerCase();if(q$t.has(B)){n[B]=R[2].trim();continue}}}if(u&&!s){if($e(x)>0){let{text:B,isDefault:G}=or(S),{label:O,color:$}=ln(B,e,r.diagnostics,w);(G||u.entries.length===0)&&(u.defaultValue=O),u.entries.push({value:O,color:$??Sr,lineNumber:w});continue}u=null}if(s=!0,u=null,!l)return i(w,'Missing "c4" header');let N=$e(x);if(c){for(;v.length>0&&!(v[v.length-1].indent<N);)v.pop();if(N===0&&(iut.test(S)||dz.test(S)))c=!1;else{let R=S.match(U$t);if(R){let W=R[1].trim();v.length>0?v[v.length-1].node.containerRefs.push(W):o(w,`"container ${W}" must be indented under a deployment node (e.g. under 'Prod is a deployment-node')`);continue}let{name:B,metadata:G}=pz(S,d,()=>o(w,sc));hn(G,In(Tx,new Set(d.keys())),W=>o(w,W,"warning"),B);let O=fz(B,G.tech??G.technology),$={name:B,metadata:G,shape:O,children:[],containerRefs:[],lineNumber:w};v.length>0?v[v.length-1].node.children.push($):r.deployment.push($),v.push({node:$,indent:N});continue}}let L=S.match(W$t);if(L){let R=L[1].toLowerCase();if(R==="deployment"){c=!0;continue}let B=Zp(N,y);B?(B.element.sectionHeader=R,B.element.sectionHeaderLineNumber=w,y.push({kind:"section",sectionType:R,parentElement:B.element,indent:N})):o(w,`"${R}" must be indented under an element (e.g. under 'Web App is a container')`);continue}for(;y.length>0&&!(y[y.length-1].indent<N);)y.pop();let M=S.match(B$t);if(M){let R=M[1].trim(),B=Zp(N,y);if(B){let G={name:R,children:[],lineNumber:w};B.element.groups.push(G),y.push({kind:"group",group:G,parentElement:B.element,indent:N})}else o(w,`Group [${R}] must be indented under an element (e.g. under 'Web App is a container')`);continue}{let R=[{re:z$t,arrowType:"bidirectional"},{re:V$t,arrowType:"bidirectional-async"},{re:F$t,arrowType:"sync"},{re:H$t,arrowType:"async"}],B=!1;for(let{re:G,arrowType:O}of R){let $=S.match(G);if(!$)continue;let W=$[1].trim(),D=$[2].trim();if(!W)break;if(O==="bidirectional"||O==="bidirectional-async"){let z=Zp(N,y)?.element.name??"?";o(w,`Bidirectional arrows are no longer supported. Replace with two separate arrows:
|
|
@@ -383,7 +383,7 @@ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
|
|
|
383
383
|
.dgmo-rendered.dgmo-theme-dark .dgmo-source-pre .dgmo-tok-comment,
|
|
384
384
|
.dgmo-rendered.dgmo-theme-dark .dgmo-source-pre .dgmo-tok-noteContent,
|
|
385
385
|
.dgmo-rendered.dgmo-theme-dark .dgmo-source-pre .dgmo-tok-punctuation { color: #616e88; }
|
|
386
|
-
`;t0();var h4="0.
|
|
386
|
+
`;t0();var h4="0.41.0",ete={theme:"auto",palette:"slate",showSource:!0,showEditorLink:!0},mI={...ete},gE=new Set,nte="https://online.diagrammo.app",rte=8192,BSt=256*1024,ote=200,ite=1200,ate="[dgmo:auto]",ste=/[\x00-\x1F--]/g,f4="dgmoAutoStyles";function _a(...t){typeof console<"u"&&console.warn&&console.warn(ate,...t)}function FSt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function lte(t){t.querySelectorAll("script, foreignObject").forEach(r=>r.remove());let n=[t,...Array.from(t.querySelectorAll("*"))];for(let r of n){for(let o of Array.from(r.attributes))o.name.toLowerCase().startsWith("on")&&r.removeAttribute(o.name);if(r.hasAttribute("href")&&gu(r.getAttribute("href"))===null&&r.removeAttribute("href"),r.hasAttributeNS("http://www.w3.org/1999/xlink","href")){let o=r.getAttributeNS("http://www.w3.org/1999/xlink","href");gu(o)===null&&r.removeAttributeNS("http://www.w3.org/1999/xlink","href")}}}function HSt(t){try{return BE().some(e=>e.id===t)}catch{return!1}}function zSt(){if(typeof document>"u")return null;let t=document.currentScript;if(t&&t instanceof HTMLScriptElement)return t;let e=document.querySelectorAll('script[src*="auto.js"], script[src*="auto.min.js"]');return e.length===0?null:e[e.length-1]}var cte=["theme","palette","showSource","showEditorLink"],VSt=["__proto__","constructor","prototype"],ute=["auto","light","dark","transparent"];function WSt(t){return typeof t=="string"&&ute.includes(t)}function USt(t){if(!t)return{};let e;try{e=JSON.parse(t)}catch(r){return _a("data-config: invalid JSON",r),{}}if(!FSt(e))return _a("data-config: not an object"),{};for(let r of VSt)if(Object.prototype.hasOwnProperty.call(e,r))return _a("data-config: rejected (prototype-pollution key:",r,")"),{};let n={};for(let[r,o]of Object.entries(e)){if(!cte.includes(r)){_a("data-config: dropping unknown key",r);continue}if(r==="theme"){if(!WSt(o)){_a("data-config: rejected theme",o);continue}n.theme=o}else if(r==="palette"){if(typeof o!="string"||!HSt(o)){_a("data-config: rejected palette",o);continue}n.palette=o}else if(r==="showSource"){if(typeof o!="boolean"){_a("data-config: rejected showSource",o);continue}n.showSource=o}else if(r==="showEditorLink"){if(typeof o!="boolean"){_a("data-config: rejected showEditorLink",o);continue}n.showEditorLink=o}}return n}function YSt(t=document){let e=t.querySelectorAll(".dgmo:not([data-dgmo-processed]), .language-dgmo:not([data-dgmo-processed])");return Array.from(e).filter(n=>!n.closest(".dgmo-rendered"))}function XSt(t){if(t==="light"||t==="dark"||t==="transparent")return t;if(typeof document>"u")return"light";let e=document.documentElement,n=e.getAttribute("data-theme");return n==="dark"?"dark":n==="light"?"light":e.classList.contains("dark")?"dark":e.classList.contains("light")?"light":typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function qSt(){if(typeof document>"u")return;let t=document.documentElement;if(t?.dataset?.[f4]==="1")return;if(document.querySelector('link[rel="stylesheet"][href*="auto.css"]')){t&&t.dataset&&(t.dataset[f4]="1");return}let n=document.createElement("style");n.setAttribute("data-dgmo-auto",""),n.textContent=GSt,document.head.appendChild(n),t&&t.dataset&&(t.dataset[f4]="1")}function dte(t){let e=document.createDocumentFragment(),n;try{n=OSt(t)}catch{return e.appendChild(document.createTextNode(t)),e}for(let r of n){if(!r.text)continue;let o=document.createElement("span");o.className=`dgmo-tok-${r.role}`,o.textContent=r.text,e.appendChild(o)}return e}var jSt='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 5.5V3a1.5 1.5 0 0 0-1.5-1.5H3A1.5 1.5 0 0 0 1.5 3v6A1.5 1.5 0 0 0 3 10.5h2.5"/></svg>',fte='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="3 8.5 6.5 12 13 4.5"/></svg>',pte='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 2h5v5"/><path d="M14 2L7 9"/><path d="M13 9v4a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4"/></svg>';function gI(t,e){t.innerHTML=e}function hte(t,e,n){let r=document.createElement("div");r.className="dgmo-source-panel";let o=document.createElement("button");o.type="button",o.className="dgmo-source-toggle",o.setAttribute("aria-expanded","false");let i=document.createElement("span");i.className="dgmo-chevron",i.setAttribute("aria-hidden","true"),i.textContent="\u25B8",o.appendChild(i);let a=document.createElement("span");a.textContent="DGMO source",o.appendChild(a);let s=document.createElement("div");s.className="dgmo-source-body";let l=document.createElement("pre");l.className="dgmo-source-pre",l.appendChild(dte(t)),s.appendChild(l);let c=document.createElement("div");c.className="dgmo-source-actions";let u=document.createElement("button");if(u.type="button",u.className="dgmo-btn dgmo-btn-copy",u.setAttribute("aria-label","Copy DGMO source"),u.title="Copy source",gI(u,jSt),u.addEventListener("click",()=>{mte(t,u)}),c.appendChild(u),n){let d=document.createElement("a");d.className="dgmo-btn dgmo-btn-editor",d.target="_blank",d.rel="noopener noreferrer",d.setAttribute("aria-label","Open in editor"),gI(d,pte),e?(d.href=e,d.title="Open in editor"):(d.setAttribute("aria-disabled","true"),d.title="Diagram too large for share link; copy source and paste into editor",d.addEventListener("click",f=>f.preventDefault())),c.appendChild(d)}return s.appendChild(c),r.appendChild(o),r.appendChild(s),o.addEventListener("click",()=>{let d=s.classList.toggle("dgmo-open");o.setAttribute("aria-expanded",d?"true":"false")}),r}async function mte(t,e){let n=!1;try{navigator?.clipboard?.writeText&&(await navigator.clipboard.writeText(t),n=!0)}catch{}if(!n&&typeof document<"u")try{let r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="absolute",r.style.left="-9999px",document.body.appendChild(r),r.select(),n=document.execCommand("copy"),document.body.removeChild(r)}catch{n=!1}n?(gI(e,fte),e.classList.add("dgmo-btn-copied"),setTimeout(()=>{gI(e,jSt),e.classList.remove("dgmo-btn-copied")},ite)):_a("clipboard write failed")}function mE(t){let e=document.createElement("div");e.className="dgmo-error-banner",e.setAttribute("role","alert");let n=document.createElement("div");if(n.className="dgmo-error-banner-title",n.textContent=`${t.severity??"error"}: ${t.message}`,e.appendChild(n),t.line!==void 0&&t.line>0){let r=document.createElement("div");r.className="dgmo-error-banner-loc",r.textContent=t.column!==void 0?`at ${t.line}:${t.column}`:`at line ${t.line}`,e.appendChild(r)}return e}function gte(t){let e=t.split(`
|
|
387
387
|
`).map(n=>n.trim()).find(n=>n.length>0);return e?e.replace(ste,"").slice(0,ote):"DGMO diagram"}function yte(t){if(t.tagName==="CODE"){let e=t.parentElement;if(e?.tagName==="PRE"){let n=Array.from(e.childNodes).filter(r=>r.nodeType===1||r.nodeType===3&&(r.textContent||"").trim().length>0);if(n.length===1&&n[0]===t)return e}}return t}async function KSt(t){if(!(t instanceof HTMLElement))return{};if(t.dataset.dgmoProcessed==="true")return{};t.dataset.dgmoProcessed="true";let e=t.textContent||"";if(new TextEncoder().encode(e).byteLength>BSt){t.style.visibility="";let y=mE({message:`DGMO source too large to render \u2014 ${BSt/1024} KB max`,severity:"error"});return t.parentElement?.insertBefore(y,t),_a("source exceeds 256 KB cap"),{}}let r=mI,o=r.theme==="transparent"?"transparent":XSt(r.theme),i=o==="transparent"?"transparent":o,a=gte(e),s=t.dataset.showSource,l=r.showSource;s==="true"?l=!0:s==="false"?l=!1:s!==void 0&&_a("data-show-source: invalid value",s,'\u2014 expected "true" or "false"');let c;try{c=await hSt(e,{theme:i,palette:r.palette})}catch(y){t.style.visibility="";let v=y instanceof Error?y.message:"Render failed unexpectedly",b=mE({message:v,severity:"error"});return t.parentElement?.insertBefore(b,t),_a("render() rejected:",y),{}}if(c.diagnostics&&c.diagnostics.length>0){t.style.visibility="";let y=c.diagnostics[0],v=mE({message:y.message,severity:y.severity,line:y.line,...y.column!==void 0&&{column:y.column}});return t.parentElement?.insertBefore(v,t),_a("diagnostic:",y.message,y.line,y.column),{}}if(!c.svg){t.style.visibility="";let y=mE({message:"Empty SVG returned from renderer",severity:"error"});return t.parentElement?.insertBefore(y,t),{}}let u=document.createElement("div"),d=o==="dark"?"dgmo-theme-dark":o==="transparent"?"dgmo-theme-transparent":"dgmo-theme-light";u.className=`dgmo-rendered ${d}`,u.dataset.dgmoProcessed="true";let f=document.createElement("div");f.innerHTML=c.svg;let p=f.querySelector("svg");if(!p){t.style.visibility="";let y=mE({message:"Empty SVG returned from renderer",severity:"error"});return t.parentElement?.insertBefore(y,t),{}}if(lte(p),p.setAttribute("role","img"),p.setAttribute("aria-label",a),u.appendChild(p),l){let y=null;if(r.showEditorLink){let b=o==="dark"?"dark":"light",x=ySt(e,{baseUrl:nte,palette:r.palette,theme:b});if(x.url){let w=`utm_source=auto-embed&utm_medium=html&utm_campaign=${encodeURIComponent(h4)}`,S=x.url.indexOf("#"),_;if(S===-1){let N=x.url.includes("?")?"&":"?";_=x.url+N+w}else{let N=x.url.slice(0,S),L=x.url.slice(S+1),M=N.includes("?")?"&":"?",T=L.length>0?"&":"";_=N+M+w+"#"+L+T+w}y=_,gu(y)||(y=null)}else x.error==="too-large"&&x.compressedSize>rte&&(y=null)}let v=hte(e,y,r.showEditorLink);u.appendChild(v)}let m={wrapper:u,source:e,perElementShowSource:s==="true"?!0:s==="false"?!1:null};return gE.add(m),yte(t).replaceWith(u),{wrapper:u}}function m4(t={}){if(!FSt(t))return;for(let n of VSt)if(Object.prototype.hasOwnProperty.call(t,n)){_a("initialize: rejected (prototype-pollution key:",n,")");return}let e={...mI};WSt(t.theme)&&(e.theme=t.theme),typeof t.palette=="string"&&HSt(t.palette)&&(e.palette=t.palette),typeof t.showSource=="boolean"&&(e.showSource=t.showSource),typeof t.showEditorLink=="boolean"&&(e.showEditorLink=t.showEditorLink),mI=e}async function g4(t={}){qSt();for(let n of Array.from(gE))document.contains(n.wrapper)||gE.delete(n);let e;if(t.nodes){e=("length"in t.nodes&&typeof t.nodes!="string"?Array.from(t.nodes):[]).filter(o=>o instanceof Element&&(o.matches(".dgmo, .language-dgmo")||o.querySelector(".dgmo, .language-dgmo")!==null));let r=[];for(let o of e)o.matches(".dgmo, .language-dgmo")&&r.push(o),o.querySelectorAll(".dgmo:not([data-dgmo-processed]), .language-dgmo:not([data-dgmo-processed])").forEach(a=>r.push(a));e=Array.from(new Set(r)).filter(o=>!o.closest(".dgmo-rendered"))}else e=YSt();await Promise.all(e.map(n=>KSt(n).catch(()=>({}))))}function vte(){if(mI.theme==="auto")for(let t of Array.from(gE)){let e=document.createElement("pre");e.className="dgmo",e.textContent=t.source,t.perElementShowSource!==null&&(e.dataset.showSource=String(t.perElementShowSource)),t.wrapper.replaceWith(e),gE.delete(t),KSt(e)}}function bte(){if(typeof window>"u"||!window.matchMedia)return;let t=window.matchMedia("(prefers-color-scheme: dark)"),e=()=>vte();t.addEventListener?t.addEventListener("change",e):"addListener"in t&&typeof t.addListener=="function"&&t.addListener(e)}function p4(){if(typeof document>"u")return;document.querySelectorAll(".dgmo:not(.dgmo-rendered), .language-dgmo").forEach(e=>{e.closest(".dgmo-rendered")||(e.style.visibility="visible")}),document.documentElement&&document.documentElement.dataset&&(document.documentElement.dataset.dgmoAutoFailed="1")}function xte(){try{qSt();let t=zSt(),e=t?.getAttribute("data-auto"),n=t?.getAttribute("data-config");if(n){let o=USt(n);m4(o)}if(bte(),typeof window<"u"&&window.setTimeout(()=>{document.querySelectorAll(".dgmo:not(.dgmo-rendered):not([data-dgmo-processed])").length>0&&(_a("safety timeout: un-hiding unrendered sources"),p4())},3e4),e==="false")return;let r=()=>{g4().catch(o=>{_a("run() crashed:",o),p4()})};typeof document<"u"&&document.readyState!=="loading"?r():typeof document<"u"&&document.addEventListener("DOMContentLoaded",r,{once:!0})}catch(t){_a("bootstrap failed:",t),p4()}}var ZSt=Object.freeze({initialize:m4,run:g4,version:h4});function $St(t,e){try{Object.defineProperty(t,e,{value:ZSt,writable:!1,configurable:!1,enumerable:!0})}catch{}}typeof window<"u"&&($St(window,"dgmo"),$St(window,"diagrammo"),xte());var wte=ZSt;return w4(Ste);})();
|
|
388
388
|
/*! Bundled license information:
|
|
389
389
|
|