Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

fix: harden Windows path publication contracts

sunsunsun85dea3695231
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 78c776a7..e4a984e9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -194,85 +194,16 @@ jobs:
working-directory: archify
- name: Provision controlled Windows path fixtures
shell: pwsh
- run: |
- $ErrorActionPreference = 'Stop'
- $shareName = "archify-$env:GITHUB_RUN_ID-$env:GITHUB_RUN_ATTEMPT-node${{ matrix.node-version }}"
- $fixtureRoot = Join-Path $env:RUNNER_TEMP $shareName
- $shareRoot = Join-Path $fixtureRoot 'share'
- $caseRoot = Join-Path $fixtureRoot 'case-sensitive'
- $eightDotThreeRoot = Join-Path $fixtureRoot 'controlled-eight-dot-three-root'
- $eightDotThreeShortRoot = Join-Path $fixtureRoot 'ARCH8D~1'
- Get-SmbShare -Name $shareName -ErrorAction SilentlyContinue |
- Remove-SmbShare -Force -Confirm:$false -ErrorAction SilentlyContinue
- if (Test-Path -LiteralPath $fixtureRoot) {
- Remove-Item -LiteralPath $fixtureRoot -Recurse -Force
- }
- New-Item -ItemType Directory -Path $shareRoot, $caseRoot, $eightDotThreeRoot | Out-Null
-
- & fsutil.exe file setshortname $eightDotThreeRoot 'ARCH8D~1'
- if ($LASTEXITCODE -ne 0) {
- throw "Could not assign the controlled 8.3 alias at $eightDotThreeRoot"
- }
- $eightDotThreeProbe = Join-Path $eightDotThreeRoot 'short-name-probe.txt'
- $eightDotThreeAliasProbe = Join-Path $eightDotThreeShortRoot 'short-name-probe.txt'
- [IO.File]::WriteAllText($eightDotThreeProbe, 'controlled-8dot3')
- if (-not [IO.Directory]::Exists($eightDotThreeShortRoot) -or
- [IO.File]::ReadAllText($eightDotThreeAliasProbe) -ne 'controlled-8dot3') {
- throw 'The explicit 8.3 alias did not resolve to the controlled NTFS directory.'
- }
- [IO.File]::Delete($eightDotThreeProbe)
-
- & fsutil.exe file setCaseSensitiveInfo $caseRoot enable
- if ($LASTEXITCODE -ne 0) {
- throw "Could not enable per-directory case sensitivity at $caseRoot"
- }
- $upperProbe = Join-Path $caseRoot 'ArchifyCaseProbe.txt'
- $lowerProbe = Join-Path $caseRoot 'archifycaseprobe.txt'
- [IO.File]::WriteAllText($upperProbe, 'upper')
- [IO.File]::WriteAllText($lowerProbe, 'lower')
- if ([IO.File]::ReadAllText($upperProbe) -ne 'upper' -or
- [IO.File]::ReadAllText($lowerProbe) -ne 'lower') {
- throw 'The controlled NTFS directory did not preserve case-distinct files.'
- }
- [IO.File]::Delete($upperProbe)
- [IO.File]::Delete($lowerProbe)
-
- $identity = [Security.Principal.WindowsIdentity]::GetCurrent().Name
- New-SmbShare -Name $shareName -Path $shareRoot -Temporary -ChangeAccess $identity | Out-Null
- $uncRoot = "\\localhost\$shareName"
- $extendedUncRoot = "\\?\UNC\localhost\$shareName"
- $uncProbe = [IO.Path]::Combine($uncRoot, 'ordinary-unc-probe.txt')
- $extendedProbe = [IO.Path]::Combine($extendedUncRoot, 'extended-unc-probe.txt')
- [IO.File]::WriteAllText($uncProbe, 'ordinary')
- [IO.File]::WriteAllText($extendedProbe, 'extended')
- if ([IO.File]::ReadAllText($uncProbe) -ne 'ordinary' -or
- [IO.File]::ReadAllText($extendedProbe) -ne 'extended') {
- throw 'The controlled SMB share did not support ordinary and extended UNC access.'
- }
- [IO.File]::Delete($uncProbe)
- [IO.File]::Delete($extendedProbe)
-
- Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_CASE_SENSITIVE_ROOT=$caseRoot"
- Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_UNC_ROOT=$uncRoot"
- Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_EXTENDED_UNC_ROOT=$extendedUncRoot"
- Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_8DOT3_ROOT=$eightDotThreeRoot"
- Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_8DOT3_SHORT_ROOT=$eightDotThreeShortRoot"
+ run: scripts/windows-path-fixtures.ps1 -NodeVersion '${{ matrix.node-version }}'
- name: Verify maintained Windows path contracts
run: node scripts/run-windows-path-tests.mjs
env:
- ARCHIFY_REQUIRE_WINDOWS_8DOT3: ${{ matrix.node-version == 22 && '1' || '0' }}
+ ARCHIFY_REQUIRE_WINDOWS_8DOT3: '1'
ARCHIFY_REQUIRE_WINDOWS_REAL_PATHS: '1'
- name: Clean up controlled Windows path fixtures
if: ${{ always() }}
shell: pwsh
- run: |
- $shareName = "archify-$env:GITHUB_RUN_ID-$env:GITHUB_RUN_ATTEMPT-node${{ matrix.node-version }}"
- Get-SmbShare -Name $shareName -ErrorAction SilentlyContinue |
- Remove-SmbShare -Force -Confirm:$false -ErrorAction SilentlyContinue
- $fixtureRoot = Join-Path $env:RUNNER_TEMP $shareName
- if (Test-Path -LiteralPath $fixtureRoot) {
- Remove-Item -LiteralPath $fixtureRoot -Recurse -Force
- }
+ run: scripts/windows-path-fixtures.ps1 -NodeVersion '${{ matrix.node-version }}' -Cleanup
deploy-pages:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
diff --git a/.github/workflows/dsh.yml b/.github/workflows/dsh.yml
index e0b53fe6..cd3f348d 100644
--- a/.github/workflows/dsh.yml
+++ b/.github/workflows/dsh.yml
@@ -6,8 +6,10 @@ on:
- 'integrations/deepseek-harness/**'
- '.github/workflows/dsh.yml'
- 'archify/renderers/shared/atomic-output.mjs'
+ - 'archify/renderers/shared/output-path.mjs'
- 'archify/renderers/shared/path-semantics.mjs'
- 'archify/renderers/shared/portable-path.mjs'
+ - 'archify/renderers/shared/sidecar-path.mjs'
- 'scripts/stage-clean-skill.mjs'
- 'scripts/third-party-notices-contract.mjs'
push:
@@ -16,8 +18,10 @@ on:
- 'integrations/deepseek-harness/**'
- '.github/workflows/dsh.yml'
- 'archify/renderers/shared/atomic-output.mjs'
+ - 'archify/renderers/shared/output-path.mjs'
- 'archify/renderers/shared/path-semantics.mjs'
- 'archify/renderers/shared/portable-path.mjs'
+ - 'archify/renderers/shared/sidecar-path.mjs'
- 'scripts/stage-clean-skill.mjs'
- 'scripts/third-party-notices-contract.mjs'
tags:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 1fed2b5b..a58a474a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -25,85 +25,16 @@ jobs:
working-directory: archify
- name: Provision controlled Windows path fixtures
shell: pwsh
- run: |
- $ErrorActionPreference = 'Stop'
- $shareName = "archify-$env:GITHUB_RUN_ID-$env:GITHUB_RUN_ATTEMPT-node${{ matrix.node-version }}"
- $fixtureRoot = Join-Path $env:RUNNER_TEMP $shareName
- $shareRoot = Join-Path $fixtureRoot 'share'
- $caseRoot = Join-Path $fixtureRoot 'case-sensitive'
- $eightDotThreeRoot = Join-Path $fixtureRoot 'controlled-eight-dot-three-root'
- $eightDotThreeShortRoot = Join-Path $fixtureRoot 'ARCH8D~1'
- Get-SmbShare -Name $shareName -ErrorAction SilentlyContinue |
- Remove-SmbShare -Force -Confirm:$false -ErrorAction SilentlyContinue
- if (Test-Path -LiteralPath $fixtureRoot) {
- Remove-Item -LiteralPath $fixtureRoot -Recurse -Force
- }
- New-Item -ItemType Directory -Path $shareRoot, $caseRoot, $eightDotThreeRoot | Out-Null
-
- & fsutil.exe file setshortname $eightDotThreeRoot 'ARCH8D~1'
- if ($LASTEXITCODE -ne 0) {
- throw "Could not assign the controlled 8.3 alias at $eightDotThreeRoot"
- }
- $eightDotThreeProbe = Join-Path $eightDotThreeRoot 'short-name-probe.txt'
- $eightDotThreeAliasProbe = Join-Path $eightDotThreeShortRoot 'short-name-probe.txt'
- [IO.File]::WriteAllText($eightDotThreeProbe, 'controlled-8dot3')
- if (-not [IO.Directory]::Exists($eightDotThreeShortRoot) -or
- [IO.File]::ReadAllText($eightDotThreeAliasProbe) -ne 'controlled-8dot3') {
- throw 'The explicit 8.3 alias did not resolve to the controlled NTFS directory.'
- }
- [IO.File]::Delete($eightDotThreeProbe)
-
- & fsutil.exe file setCaseSensitiveInfo $caseRoot enable
- if ($LASTEXITCODE -ne 0) {
- throw "Could not enable per-directory case sensitivity at $caseRoot"
- }
- $upperProbe = Join-Path $caseRoot 'ArchifyCaseProbe.txt'
- $lowerProbe = Join-Path $caseRoot 'archifycaseprobe.txt'
- [IO.File]::WriteAllText($upperProbe, 'upper')
- [IO.File]::WriteAllText($lowerProbe, 'lower')
- if ([IO.File]::ReadAllText($upperProbe) -ne 'upper' -or
- [IO.File]::ReadAllText($lowerProbe) -ne 'lower') {
- throw 'The controlled NTFS directory did not preserve case-distinct files.'
- }
- [IO.File]::Delete($upperProbe)
- [IO.File]::Delete($lowerProbe)
-
- $identity = [Security.Principal.WindowsIdentity]::GetCurrent().Name
- New-SmbShare -Name $shareName -Path $shareRoot -Temporary -ChangeAccess $identity | Out-Null
- $uncRoot = "\\localhost\$shareName"
- $extendedUncRoot = "\\?\UNC\localhost\$shareName"
- $uncProbe = [IO.Path]::Combine($uncRoot, 'ordinary-unc-probe.txt')
- $extendedProbe = [IO.Path]::Combine($extendedUncRoot, 'extended-unc-probe.txt')
- [IO.File]::WriteAllText($uncProbe, 'ordinary')
- [IO.File]::WriteAllText($extendedProbe, 'extended')
- if ([IO.File]::ReadAllText($uncProbe) -ne 'ordinary' -or
- [IO.File]::ReadAllText($extendedProbe) -ne 'extended') {
- throw 'The controlled SMB share did not support ordinary and extended UNC access.'
- }
- [IO.File]::Delete($uncProbe)
- [IO.File]::Delete($extendedProbe)
-
- Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_CASE_SENSITIVE_ROOT=$caseRoot"
- Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_UNC_ROOT=$uncRoot"
- Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_EXTENDED_UNC_ROOT=$extendedUncRoot"
- Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_8DOT3_ROOT=$eightDotThreeRoot"
- Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_8DOT3_SHORT_ROOT=$eightDotThreeShortRoot"
+ run: scripts/windows-path-fixtures.ps1 -NodeVersion '${{ matrix.node-version }}'
- name: Verify maintained Windows path contracts
run: node scripts/run-windows-path-tests.mjs
env:
- ARCHIFY_REQUIRE_WINDOWS_8DOT3: ${{ matrix.node-version == 22 && '1' || '0' }}
+ ARCHIFY_REQUIRE_WINDOWS_8DOT3: '1'
ARCHIFY_REQUIRE_WINDOWS_REAL_PATHS: '1'
- name: Clean up controlled Windows path fixtures
if: ${{ always() }}
shell: pwsh
- run: |
- $shareName = "archify-$env:GITHUB_RUN_ID-$env:GITHUB_RUN_ATTEMPT-node${{ matrix.node-version }}"
- Get-SmbShare -Name $shareName -ErrorAction SilentlyContinue |
- Remove-SmbShare -Force -Confirm:$false -ErrorAction SilentlyContinue
- $fixtureRoot = Join-Path $env:RUNNER_TEMP $shareName
- if (Test-Path -LiteralPath $fixtureRoot) {
- Remove-Item -LiteralPath $fixtureRoot -Recurse -Force
- }
+ run: scripts/windows-path-fixtures.ps1 -NodeVersion '${{ matrix.node-version }}' -Cleanup
release:
needs: windows-test-portability
diff --git a/archify.zip b/archify.zip
index 2b3ad726..452f81b9 100644
Binary files a/archify.zip and b/archify.zip differ
diff --git a/archify/bin/archify.mjs b/archify/bin/archify.mjs
index 20568a5e..6e726856 100755
--- a/archify/bin/archify.mjs
+++ b/archify/bin/archify.mjs
@@ -625,8 +625,45 @@ function acquireDeliveryLock(
// lock. Bind ownership from the still-open handle before cleanup.
try {
handleIdentity = fs.fstatSync(descriptor, { bigint: true });
- } catch {}
- if (!handleIdentity) throw error;
+ } catch {
+ // Both handle metadata reads failed. Stamp the still-open inode with
+ // this attempt's unpredictable receipt before consulting the public
+ // path. A replacement claimant cannot be mistaken for our empty
+ // lock, while a successful content-bound capture gives cleanup the
+ // identity it needs after the original descriptor is closed.
+ const recoveryReceipt = `${JSON.stringify({ schemaVersion: 1, receiptId, pid: process.pid })}\n`;
+ const recoveryContent = artifactIdentity(Buffer.from(recoveryReceipt));
+ let captured;
+ try {
+ fs.writeFileSync(descriptor, recoveryReceipt);
+ captured = fileBindingRuntime?.captureRegularFileBinding?.(ownedLockPath, {
+ subject: 'owned-delivery-lock',
+ expectedSha256: recoveryContent.sha256,
+ expectedBytes: recoveryContent.bytes,
+ expectedLinks: 1,
+ });
+ } catch {}
+ if (captured?.status === 'captured') {
+ fileBindingRuntime.releaseRegularFileBinding(captured.binding);
+ openedLocks.push({
+ path: ownedLockPath,
+ identity: {
+ dev: captured.identity.device,
+ ino: captured.identity.inode,
+ mode: BigInt(captured.mode),
+ },
+ content: recoveryContent,
+ descriptor,
+ });
+ } else {
+ try {
+ fs.closeSync(descriptor);
+ } catch (closeError) {
+ error.lockCleanupError = closeError.message;
+ }
+ }
+ throw error;
+ }
handleIdentityError = error;
}
const ownedLock = {
@@ -729,6 +766,175 @@ function pathEntryExists(file) {
}
}
+function captureOwnedStagingFile(registry, filePath, fileBindingRuntime, {
+ subject = 'private-staging-entry',
+ content,
+ expectedLinks = 1,
+} = {}) {
+ const { captureRegularFileBinding } = fileBindingRuntime || {};
+ if (typeof captureRegularFileBinding !== 'function') {
+ throw new Error('The regular-file binding runtime is unavailable.');
+ }
+ let captured = captureRegularFileBinding(filePath, {
+ subject,
+ ...(content ? {
+ expectedSha256: content.sha256,
+ expectedBytes: content.bytes,
+ } : {}),
+ expectedLinks,
+ });
+ if (captured.status === 'unsupported'
+ && String(captured.reason?.code || '').endsWith('-hardlinked')
+ && content) {
+ const observedLinks = Number(captured.reason?.links);
+ if (Number.isSafeInteger(observedLinks) && observedLinks > expectedLinks) {
+ captured = captureRegularFileBinding(filePath, {
+ subject,
+ expectedSha256: content.sha256,
+ expectedBytes: content.bytes,
+ expectedLinks: observedLinks,
+ });
+ expectedLinks = observedLinks;
+ }
+ }
+ if (captured.status !== 'captured') {
+ const error = new Error(`Could not bind the owned staging entry "${filePath}" (${captured.reason?.code || 'unknown state'}).`);
+ error.stagingCapture = captured;
+ throw error;
+ }
+ registry.push({ filePath, binding: captured.binding, subject, expectedLinks });
+ return captured;
+}
+
+function cleanupOwnedStagingDirectory(directory, identity, registry, fileBindingRuntime) {
+ const {
+ quarantineRemoveRegularFileBinding,
+ releaseRegularFileBinding,
+ } = fileBindingRuntime || {};
+ if (typeof quarantineRemoveRegularFileBinding !== 'function'
+ || typeof releaseRegularFileBinding !== 'function') {
+ throw new Error('The regular-file binding runtime is unavailable.');
+ }
+ const failures = [];
+ for (const entry of [...registry].reverse()) {
+ try {
+ const removed = quarantineRemoveRegularFileBinding(entry.binding, entry.filePath, {
+ subject: entry.subject,
+ expectedLinks: entry.expectedLinks,
+ });
+ // A missing path means the transaction already moved or finalized this
+ // owned inode. Every other non-removal result is deliberately preserved:
+ // it may be a concurrent claimant rather than an entry we created.
+ if (removed.status !== 'removed'
+ && !['ENOENT', 'ENOTDIR'].includes(removed.reason?.systemCode)) {
+ failures.push(`${entry.filePath}: ${removed.reason?.code || removed.status}`);
+ }
+ } catch (error) {
+ failures.push(`${entry.filePath}: ${error.message}`);
+ } finally {
+ const released = releaseRegularFileBinding(entry.binding);
+ if (released.status !== 'released') {
+ failures.push(`${entry.filePath}: ${released.reason?.code || released.status}`);
+ }
+ }
+ }
+ registry.length = 0;
+ try {
+ if (!removeOwnedEmptyStagingDirectory(directory, identity, { throwOnFailure: true })) {
+ failures.push(`${directory}: staging directory was retained because its identity changed`);
+ }
+ } catch (error) {
+ failures.push(`${directory}: ${error.message}`);
+ }
+ if (failures.length) throw new Error(failures.join('; '));
+}
+
+function createOwnedEmptyStagingDirectory(prefix) {
+ const directory = fs.mkdtempSync(prefix);
+ const metadata = fs.lstatSync(directory, { bigint: true });
+ if (!metadata.isDirectory() || metadata.isSymbolicLink() || metadata.ino === 0n) {
+ throw new Error(`Private staging directory identity is unavailable: ${directory}`);
+ }
+ return {
+ directory,
+ identity: { device: metadata.dev, inode: metadata.ino },
+ };
+}
+
+function createStagingRetirementQuarantine(parent) {
+ for (let attempt = 0; attempt < 8; attempt += 1) {
+ const directory = path.join(parent, `.archify-staging-remove-${randomUUID()}`);
+ try {
+ fs.mkdirSync(directory, { mode: 0o700 });
+ return directory;
+ } catch (error) {
+ if (error?.code !== 'EEXIST') return undefined;
+ }
+ }
+ return undefined;
+}
+
+function removeOwnedEmptyStagingDirectory(directory, identity, { throwOnFailure = false } = {}) {
+ let current;
+ try {
+ current = fs.lstatSync(directory, { bigint: true });
+ } catch (error) {
+ if (error?.code === 'ENOENT' || error?.code === 'ENOTDIR') return false;
+ throw error;
+ }
+ if (!current.isDirectory()
+ || current.isSymbolicLink()
+ || current.ino === 0n
+ || current.dev !== identity.device
+ || current.ino !== identity.inode) return false;
+ try {
+ if (fs.readdirSync(directory).length !== 0) return false;
+ } catch {
+ return false;
+ }
+ const quarantine = createStagingRetirementQuarantine(path.dirname(directory));
+ if (!quarantine) return false;
+ const movedPath = path.join(quarantine, path.basename(directory));
+ try {
+ fs.renameSync(directory, movedPath);
+ } catch (error) {
+ if (throwOnFailure) throw error;
+ return false;
+ }
+ let moved;
+ try {
+ moved = fs.lstatSync(movedPath, { bigint: true });
+ } catch {
+ return false;
+ }
+ if (!moved.isDirectory()
+ || moved.isSymbolicLink()
+ || moved.ino === 0n
+ || moved.dev !== identity.device
+ || moved.ino !== identity.inode) {
+ // A claimant won the public move boundary. Preserve it under the private
+ // quarantine name; directories have no portable no-clobber restore link.
+ return false;
+ }
+ try {
+ // The unpredictable 0700 quarantine closes the public replacement race.
+ // Never recurse: unexpected contents remain available for recovery.
+ fs.rmdirSync(movedPath);
+ fs.rmdirSync(quarantine);
+ return true;
+ } catch (error) {
+ if (throwOnFailure) throw error;
+ return false;
+ }
+}
+
+function releaseOwnedStagingBindings(registry, fileBindingRuntime) {
+ const { releaseRegularFileBinding } = fileBindingRuntime || {};
+ if (typeof releaseRegularFileBinding !== 'function') return;
+ for (const entry of registry) releaseRegularFileBinding(entry.binding);
+ registry.length = 0;
+}
+
function artifactIdentity(artifact) {
return { sha256: createHash('sha256').update(artifact).digest('hex'), bytes: artifact.byteLength };
}
@@ -777,7 +983,10 @@ function writeDeliveryProvenance(file, value, { beforeReplace, fileBindingRuntim
};
throw error;
}
- const stagingDirectory = fs.mkdtempSync(path.join(path.dirname(file), '.archify-provenance-'));
+ const staging = createOwnedEmptyStagingDirectory(
+ path.join(path.dirname(file), '.archify-provenance-'),
+ );
+ const stagingDirectory = staging.directory;
const temporary = path.join(stagingDirectory, path.basename(file));
const backup = path.join(stagingDirectory, '.previous-journal');
const serialized = Buffer.from(`${JSON.stringify(value, null, 2)}\n`);
@@ -855,7 +1064,15 @@ function writeDeliveryProvenance(file, value, { beforeReplace, fileBindingRuntim
});
if (linked.status !== 'match') throw bindingError(linked, 'verify the published');
}
- fs.unlinkSync(temporary);
+ const retiredCandidate = quarantineRemoveRegularFileBinding(
+ candidateCapture.binding,
+ temporary,
+ { subject: 'delivery-journal-candidate', expectedLinks: 2 },
+ );
+ if (retiredCandidate.status !== 'removed') {
+ retainStaging = true;
+ throw bindingError(retiredCandidate, 'retire the staged');
+ }
candidatePresent = false;
const finalized = verifyRegularFileBinding(candidateCapture.binding, {
filePath: file,
@@ -868,7 +1085,15 @@ function writeDeliveryProvenance(file, value, { beforeReplace, fileBindingRuntim
expectedLinks: 1,
});
if (previous.status !== 'match') throw bindingError(previous, 'verify the previous');
- fs.unlinkSync(backup);
+ const retiredBackup = quarantineRemoveRegularFileBinding(
+ previousCapture.binding,
+ backup,
+ { subject: 'previous-delivery-journal', expectedLinks: 1 },
+ );
+ if (retiredBackup.status !== 'removed') {
+ retainStaging = true;
+ throw bindingError(retiredBackup, 'retire the previous');
+ }
backupPresent = false;
}
return {
@@ -915,7 +1140,17 @@ function writeDeliveryProvenance(file, value, { beforeReplace, fileBindingRuntim
expectedLinks: published ? 2 : 1,
});
if (current.status === 'match') {
- fs.unlinkSync(temporary);
+ const retiredCandidate = quarantineRemoveRegularFileBinding(
+ candidateCapture.binding,
+ temporary,
+ {
+ subject: 'delivery-journal-candidate',
+ expectedLinks: published ? 2 : 1,
+ },
+ );
+ if (retiredCandidate.status !== 'removed') {
+ throw bindingError(retiredCandidate, 'retire the staged');
+ }
candidatePresent = false;
} else {
rollbackErrors.push('the staged journal candidate was replaced before cleanup');
@@ -954,7 +1189,14 @@ function writeDeliveryProvenance(file, value, { beforeReplace, fileBindingRuntim
});
if (restored.status !== 'match') throw bindingError(restored, 'verify the restored');
}
- fs.unlinkSync(backup);
+ const retiredBackup = quarantineRemoveRegularFileBinding(
+ previousCapture.binding,
+ backup,
+ { subject: 'previous-delivery-journal', expectedLinks: 2 },
+ );
+ if (retiredBackup.status !== 'removed') {
+ throw bindingError(retiredBackup, 'retire the restored backup');
+ }
backupPresent = false;
const restored = verifyRegularFileBinding(previousCapture.binding, {
filePath: file,
@@ -998,7 +1240,7 @@ function writeDeliveryProvenance(file, value, { beforeReplace, fileBindingRuntim
} finally {
if (candidateCapture?.binding) releaseRegularFileBinding(candidateCapture.binding);
if (previousCapture?.binding) releaseRegularFileBinding(previousCapture.binding);
- if (!retainStaging) fs.rmSync(stagingDirectory, { recursive: true, force: true });
+ if (!retainStaging) removeOwnedEmptyStagingDirectory(stagingDirectory, staging.identity);
}
}
@@ -1027,7 +1269,10 @@ function writeCapturedDeliveryProvenance(file, value, {
reason: { code: 'atomic-output-runtime-unavailable' },
});
}
- const stagingDirectory = fs.mkdtempSync(path.join(path.dirname(file), '.archify-provenance-'));
+ const staging = createOwnedEmptyStagingDirectory(
+ path.join(path.dirname(file), '.archify-provenance-'),
+ );
+ const stagingDirectory = staging.directory;
const candidate = path.join(stagingDirectory, path.basename(file));
const backup = path.join(stagingDirectory, '.previous-provenance');
let candidateIdentity;
@@ -1116,7 +1361,15 @@ function writeCapturedDeliveryProvenance(file, value, {
throw deliveryTargetStateError(file, 'delivery provenance', linked);
}
}
- fs.unlinkSync(candidate);
+ const retiredCandidate = quarantineRemoveRegularFileBinding(
+ candidateBinding,
+ candidate,
+ { subject: 'delivery-provenance-candidate', expectedLinks: 2 },
+ );
+ if (retiredCandidate.status !== 'removed') {
+ retainStaging = true;
+ throw deliveryTargetStateError(file, 'delivery provenance', retiredCandidate);
+ }
candidatePresent = false;
const finalized = verifyRegularFileBinding(candidateBinding, {
filePath: capture.commitPath,
@@ -1137,7 +1390,15 @@ function writeCapturedDeliveryProvenance(file, value, {
reason: { code: 'backup-identity-changed-before-finalize' },
});
}
- fs.unlinkSync(backup);
+ const retiredBackup = quarantineRemoveRegularFileBinding(
+ previousBinding,
+ backup,
+ { subject: 'previous-delivery-provenance', expectedLinks: 1 },
+ );
+ if (retiredBackup.status !== 'removed') {
+ retainStaging = true;
+ throw deliveryTargetStateError(file, 'delivery provenance', retiredBackup);
+ }
backupPresent = false;
}
} catch (cause) {
@@ -1180,7 +1441,21 @@ function writeCapturedDeliveryProvenance(file, value, {
expectedLinks: published ? 2 : 1,
});
if (current.status === 'match') {
- fs.unlinkSync(candidate);
+ const retiredCandidate = quarantineRemoveRegularFileBinding(
+ candidateBinding,
+ candidate,
+ {
+ subject: 'delivery-provenance-candidate',
+ expectedLinks: published ? 2 : 1,
+ },
+ );
+ if (retiredCandidate.status !== 'removed') {
+ throw deliveryTargetStateError(
+ file,
+ 'delivery provenance',
+ retiredCandidate,
+ );
+ }
candidatePresent = false;
} else {
rollbackErrors.push('the staged provenance candidate was replaced before cleanup');
@@ -1219,7 +1494,14 @@ function writeCapturedDeliveryProvenance(file, value, {
throw new Error('the restored provenance identity could not be verified');
}
}
- fs.unlinkSync(backup);
+ const retiredBackup = quarantineRemoveRegularFileBinding(
+ previousBinding,
+ backup,
+ { subject: 'previous-delivery-provenance', expectedLinks: 2 },
+ );
+ if (retiredBackup.status !== 'removed') {
+ throw deliveryTargetStateError(file, 'delivery provenance', retiredBackup);
+ }
backupPresent = false;
const restoredFinal = verifyRegularFileBinding(previousBinding, {
filePath: capture.commitPath,
@@ -1275,7 +1557,7 @@ function writeCapturedDeliveryProvenance(file, value, {
} finally {
if (candidateBinding) releaseRegularFileBinding(candidateBinding);
if (previousBinding) releaseRegularFileBinding(previousBinding);
- if (!retainStaging) fs.rmSync(stagingDirectory, { recursive: true, force: true });
+ if (!retainStaging) removeOwnedEmptyStagingDirectory(stagingDirectory, staging.identity);
}
}
@@ -1997,7 +2279,6 @@ function extractOutDirArgs(args) {
function rendererEnv(quality, repoRoot, diagnosticJson = false) {
return {
- ARCHIFY_REQUIRE_META_OUTPUT: '1',
...(quality ? { ARCHIFY_QUALITY_PROFILE: quality } : {}),
...(repoRoot ? { ARCHIFY_REPO_ROOT: repoRoot } : {}),
...(diagnosticJson ? { ARCHIFY_DIAGNOSTIC_FORMAT: 'json' } : {}),
@@ -2478,6 +2759,7 @@ function commitComparePair({
const backedUp = [];
const committed = [];
+ let retainSuccessfulBackupBindings = false;
try {
if (typeof backupPublicRegularFileBinding !== 'function'
|| typeof captureRegularFileBinding !== 'function'
@@ -2583,7 +2865,12 @@ function commitComparePair({
expectedLinks: 2,
});
if (staged.status !== 'match') throw targetChanged(item, staged);
- fs.unlinkSync(item.candidate);
+ const retired = quarantineRemoveRegularFileBinding(
+ item.candidateBinding,
+ item.candidate,
+ { subject: 'compare-candidate', expectedLinks: 2 },
+ );
+ if (retired.status !== 'removed') throw targetChanged(item, retired);
item.candidatePresent = false;
}
for (const item of committed) {
@@ -2593,6 +2880,17 @@ function commitComparePair({
});
if (finalized.status !== 'match') throw targetChanged(item, finalized);
}
+ retainSuccessfulBackupBindings = true;
+ return {
+ ownedBackupEntries: backedUp
+ .filter((item) => item.backupPresent)
+ .map((item) => ({
+ filePath: item.backup,
+ binding: item.previousBinding,
+ subject: 'previous-compare-backup',
+ expectedLinks: 1,
+ })),
+ };
} catch (cause) {
const rollbackErrors = [];
const recoveryFiles = targets
@@ -2679,7 +2977,14 @@ function commitComparePair({
throw new Error('the restored target identity could not be verified');
}
}
- fs.unlinkSync(item.backup);
+ const retired = quarantineRemoveRegularFileBinding(
+ item.previousBinding,
+ item.backup,
+ { subject: 'previous-compare-target', expectedLinks: 2 },
+ );
+ if (retired.status !== 'removed') {
+ throw new Error(`the restored backup could not be retired safely (${retired.reason?.code || 'unknown target state'})`);
+ }
item.backupPresent = false;
const finalized = verifyRegularFileBinding(item.previousBinding, {
filePath: item.capture.commitPath,
@@ -2740,7 +3045,10 @@ function commitComparePair({
} finally {
for (const item of targets) {
if (item.candidateBinding) releaseRegularFileBinding(item.candidateBinding);
- if (item.previousBinding) releaseRegularFileBinding(item.previousBinding);
+ if (item.previousBinding
+ && !(retainSuccessfulBackupBindings && item.backupPresent)) {
+ releaseRegularFileBinding(item.previousBinding);
+ }
}
}
}
@@ -2791,6 +3099,7 @@ function commitDeliveryPair({
const backedUp = [];
const retainedBackups = new Set();
const publicRecoveryBackups = [];
+ let retainSuccessfulBackupBindings = false;
const committed = [];
try {
if (typeof backupPublicRegularFileBinding !== 'function'
@@ -2912,7 +3221,14 @@ function commitDeliveryPair({
if (staged.status !== 'match') {
throw deliveryTargetStateError(item.capture.requestedPath, item.label, staged);
}
- fs.unlinkSync(item.candidate);
+ const retired = quarantineRemoveRegularFileBinding(
+ item.candidateBinding,
+ item.candidate,
+ { subject: 'delivery-candidate', expectedLinks: 2 },
+ );
+ if (retired.status !== 'removed') {
+ throw deliveryTargetStateError(item.capture.requestedPath, item.label, retired);
+ }
item.candidatePresent = false;
}
for (const item of committed) {
@@ -2939,11 +3255,20 @@ function commitDeliveryPair({
state.pendingIdentity = undefined;
state.pendingContent = undefined;
state.phase = 'finalized';
+ retainSuccessfulBackupBindings = true;
return {
recoverableBackups: [
...[...retainedBackups].map((item) => ({ label: item.label, path: item.backup })),
...publicRecoveryBackups,
],
+ ownedBackupEntries: backedUp
+ .filter((item) => item.backupPresent)
+ .map((item) => ({
+ filePath: item.backup,
+ binding: item.previousBinding,
+ subject: 'previous-delivery-backup',
+ expectedLinks: 1,
+ })),
};
} catch (cause) {
const recoveryDetails = () => ({
@@ -3041,7 +3366,14 @@ function commitDeliveryPair({
throw new Error('the restored delivery target identity could not be verified');
}
}
- fs.unlinkSync(item.backup);
+ const retired = quarantineRemoveRegularFileBinding(
+ item.previousBinding,
+ item.backup,
+ { subject: 'previous-delivery-target', expectedLinks: 2 },
+ );
+ if (retired.status !== 'removed') {
+ throw new Error(`the restored delivery backup could not be retired safely (${retired.reason?.code || 'unknown target state'})`);
+ }
item.backupPresent = false;
const restoredFinal = verifyRegularFileBinding(item.previousBinding, {
filePath: item.target,
@@ -3103,12 +3435,15 @@ function commitDeliveryPair({
} finally {
for (const item of targets) {
if (item.candidateBinding) releaseRegularFileBinding(item.candidateBinding);
- if (item.previousBinding) releaseRegularFileBinding(item.previousBinding);
+ if (item.previousBinding
+ && !(retainSuccessfulBackupBindings && item.backupPresent)) {
+ releaseRegularFileBinding(item.previousBinding);
+ }
}
}
}
-function renderValidatedArchitecture(inputPath, outputPath, quality, repoRoot) {
+function renderValidatedArchitecture(inputPath, outputPath, quality, repoRoot, captureStagingFile) {
const render = runNode([rendererPath('architecture'), inputPath, outputPath], {
stdio: 'pipe',
env: rendererEnv(quality, repoRoot, true),
@@ -3121,6 +3456,11 @@ function renderValidatedArchitecture(inputPath, outputPath, quality, repoRoot) {
error.diagnostics = failure.diagnostics;
throw error;
}
+ let artifact;
+ if (captureStagingFile) {
+ artifact = fs.readFileSync(outputPath);
+ captureStagingFile(outputPath, artifactIdentity(artifact));
+ }
const check = runNode([path.join(skillRoot, 'scripts/check-render-output.mjs'), outputPath], { stdio: 'pipe' });
if (check.status !== 0) {
const error = new Error('Validated snapshot failed final artifact checks.');
@@ -3134,7 +3474,7 @@ function renderValidatedArchitecture(inputPath, outputPath, quality, repoRoot) {
}
throw error;
}
- const artifact = fs.readFileSync(outputPath);
+ artifact ||= fs.readFileSync(outputPath);
return {
artifact,
html: artifact.toString('utf8'),
@@ -3468,8 +3808,13 @@ async function commandCompare(args) {
outputDirectory = path.dirname(outputPath);
let stagingDirectory;
+ let stagingIdentity;
try {
- stagingDirectory = fs.mkdtempSync(path.join(outputDirectory, '.archify-compare-'));
+ const staging = createOwnedEmptyStagingDirectory(
+ path.join(outputDirectory, '.archify-compare-'),
+ );
+ stagingDirectory = staging.directory;
+ stagingIdentity = staging.identity;
} catch (error) {
reportCompareFailure({ json: options.json, stage: 'prepare', error: `Could not create compare candidate: ${error.message}`, code: 'delta/candidate-directory', details: { reason: error.message } });
return;
@@ -3486,6 +3831,13 @@ async function commandCompare(args) {
const htmlCandidate = path.join(stagingDirectory, path.basename(outputPath));
const receiptCandidate = path.join(stagingDirectory, path.basename(receiptPath));
let preserveRecoveryDirectory = false;
+ const stagingOwnership = [];
+ const captureCompareStagingFile = (filePath, content) => captureOwnedStagingFile(
+ stagingOwnership,
+ filePath,
+ fileBindingRuntime,
+ { subject: 'compare-staging-entry', content },
+ );
try {
let baseResult;
@@ -3496,6 +3848,7 @@ async function commandCompare(args) {
]) {
try {
fs.writeFileSync(snapshotPath, buffer, { flag: 'wx' });
+ captureCompareStagingFile(snapshotPath, artifactIdentity(buffer));
} catch (error) {
const message = `Could not freeze ${side} compare snapshot: ${error.message}`;
reportCompareFailure({
@@ -3514,7 +3867,13 @@ async function commandCompare(args) {
}
}
try {
- renderValidatedArchitecture(rawBaseInput, rawBaseCandidate, qualityArgs.quality, repoArgs.repoRoot);
+ renderValidatedArchitecture(
+ rawBaseInput,
+ rawBaseCandidate,
+ qualityArgs.quality,
+ repoArgs.repoRoot,
+ captureCompareStagingFile,
+ );
} catch (error) {
const diagnosticEntry = error.diagnostics?.[0];
reportCompareFailure({
@@ -3528,7 +3887,13 @@ async function commandCompare(args) {
return;
}
try {
- renderValidatedArchitecture(rawHeadInput, rawHeadCandidate, qualityArgs.quality, repoArgs.repoRoot);
+ renderValidatedArchitecture(
+ rawHeadInput,
+ rawHeadCandidate,
+ qualityArgs.quality,
+ repoArgs.repoRoot,
+ captureCompareStagingFile,
+ );
} catch (error) {
const diagnosticEntry = error.diagnostics?.[0];
reportCompareFailure({
@@ -3549,10 +3914,26 @@ async function commandCompare(args) {
const canonicalHead = canonicalArchitecture(head);
canonicalBase.meta.output = base.meta.output;
canonicalHead.meta.output = head.meta.output;
- fs.writeFileSync(canonicalBaseInput, JSON.stringify(canonicalBase));
- fs.writeFileSync(canonicalHeadInput, JSON.stringify(canonicalHead));
- baseResult = renderValidatedArchitecture(canonicalBaseInput, baseCandidate, qualityArgs.quality, repoArgs.repoRoot);
- headResult = renderValidatedArchitecture(canonicalHeadInput, headCandidate, qualityArgs.quality, repoArgs.repoRoot);
+ const canonicalBaseBytes = Buffer.from(JSON.stringify(canonicalBase));
+ const canonicalHeadBytes = Buffer.from(JSON.stringify(canonicalHead));
+ fs.writeFileSync(canonicalBaseInput, canonicalBaseBytes);
+ captureCompareStagingFile(canonicalBaseInput, artifactIdentity(canonicalBaseBytes));
+ fs.writeFileSync(canonicalHeadInput, canonicalHeadBytes);
+ captureCompareStagingFile(canonicalHeadInput, artifactIdentity(canonicalHeadBytes));
+ baseResult = renderValidatedArchitecture(
+ canonicalBaseInput,
+ baseCandidate,
+ qualityArgs.quality,
+ repoArgs.repoRoot,
+ captureCompareStagingFile,
+ );
+ headResult = renderValidatedArchitecture(
+ canonicalHeadInput,
+ headCandidate,
+ qualityArgs.quality,
+ repoArgs.repoRoot,
+ captureCompareStagingFile,
+ );
const semanticHash = (diagram) => createHash('sha256').update(canonicalArchitectureJson(diagram)).digest('hex');
let compareIr;
@@ -3597,7 +3978,9 @@ async function commandCompare(args) {
});
const deltaValidation = validateArchitectureDeltaHtml(html, artifactIr);
fs.writeFileSync(htmlCandidate, html);
+ if (outputCapture.mode !== null) fs.chmodSync(htmlCandidate, outputCapture.mode);
const artifact = fs.readFileSync(htmlCandidate);
+ captureCompareStagingFile(htmlCandidate, artifactIdentity(artifact));
const baseChecks = baseResult.checks.checks.filter((check) => check.ok).length;
const headChecks = headResult.checks.checks.filter((check) => check.ok).length;
const finalReceipt = {
@@ -3612,6 +3995,8 @@ async function commandCompare(args) {
};
const receiptBytes = Buffer.from(`${JSON.stringify(finalReceipt, null, 2)}\n`);
fs.writeFileSync(receiptCandidate, receiptBytes);
+ if (receiptCapture.mode !== null) fs.chmodSync(receiptCandidate, receiptCapture.mode);
+ captureCompareStagingFile(receiptCandidate, artifactIdentity(receiptBytes));
try {
const currentOutput = resolveOutputPath({
@@ -3643,7 +4028,7 @@ async function commandCompare(args) {
return;
}
- commitComparePair({
+ const committed = commitComparePair({
htmlCandidate,
htmlContent: finalReceipt.artifact,
receiptCandidate,
@@ -3654,6 +4039,7 @@ async function commandCompare(args) {
verifyAtomicOutput,
fileBindingRuntime,
});
+ stagingOwnership.push(...committed.ownedBackupEntries);
if (options.json) console.log(JSON.stringify(finalReceipt, null, 2));
else {
console.log(`compared architecture ${requestedOutputPath}`);
@@ -3677,7 +4063,16 @@ async function commandCompare(args) {
}
} finally {
try {
- if (!preserveRecoveryDirectory) fs.rmSync(stagingDirectory, { recursive: true, force: true });
+ if (!preserveRecoveryDirectory) {
+ cleanupOwnedStagingDirectory(
+ stagingDirectory,
+ stagingIdentity,
+ stagingOwnership,
+ fileBindingRuntime,
+ );
+ } else {
+ releaseOwnedStagingBindings(stagingOwnership, fileBindingRuntime);
+ }
} catch (error) {
console.error(`Warning: could not remove compare staging directory: ${error.message}`);
}
@@ -3861,6 +4256,7 @@ async function commandDeliver(args) {
let deliveryOwnership;
let recoveryRequired = false;
let stagingDirectory;
+ let stagingIdentity;
let deliveryAliasOutput;
const reportDeliveryFailure = (options) => {
const ownership = deliveryOwnership;
@@ -4063,7 +4459,11 @@ async function commandDeliver(args) {
// same-filesystem commit. A render or artifact-check failure never touches
// an existing trusted output.
try {
- stagingDirectory = fs.mkdtempSync(path.join(outputDirectory, '.archify-delivery-'));
+ const staging = createOwnedEmptyStagingDirectory(
+ path.join(outputDirectory, '.archify-delivery-'),
+ );
+ stagingDirectory = staging.directory;
+ stagingIdentity = staging.identity;
} catch (error) {
const message = `Could not create a delivery candidate beside "${outputPath}": ${error.message}`;
reportDeliveryFailure({
@@ -4087,6 +4487,13 @@ async function commandDeliver(args) {
const specificationSnapshotPath = path.join(stagingDirectory, 'specification.snapshot.json');
const provenanceCandidatePath = path.join(stagingDirectory, 'delivery-provenance.json');
let commitRecoveryBackups = [];
+ const stagingOwnership = [];
+ const captureDeliveryStagingFile = (filePath, content) => captureOwnedStagingFile(
+ stagingOwnership,
+ filePath,
+ fileBindingRuntime,
+ { subject: 'delivery-staging-entry', content },
+ );
try {
try {
@@ -4221,6 +4628,10 @@ async function commandDeliver(args) {
try {
fs.writeFileSync(specificationSnapshotPath, specification, { flag: 'wx' });
+ captureDeliveryStagingFile(
+ specificationSnapshotPath,
+ artifactIdentity(Buffer.from(specification)),
+ );
} catch (error) {
const message = `Could not freeze the delivery specification: ${error.message}`;
reportDeliveryFailure({
@@ -4259,6 +4670,16 @@ async function commandDeliver(args) {
});
return;
}
+ try {
+ const renderedCandidate = fs.readFileSync(candidatePath);
+ if (preparedDeliveryTargets.artifact.mode !== null) {
+ fs.chmodSync(candidatePath, preparedDeliveryTargets.artifact.mode);
+ }
+ captureDeliveryStagingFile(candidatePath, artifactIdentity(renderedCandidate));
+ } catch {
+ // The commit path performs the authoritative candidate classification.
+ // Leave an unbound entry untouched during private-directory cleanup.
+ }
const check = runNode([path.join(skillRoot, 'scripts/check-render-output.mjs'), candidatePath], {
stdio: 'pipe',
@@ -4389,6 +4810,18 @@ async function commandDeliver(args) {
const provenanceBytes = Buffer.from(`${JSON.stringify(deliverySuccessProvenance(receipt), null, 2)}\n`);
try {
fs.writeFileSync(provenanceCandidatePath, provenanceBytes, { flag: 'wx' });
+ if (preparedDeliveryTargets.provenance.mode !== null) {
+ fs.chmodSync(provenanceCandidatePath, preparedDeliveryTargets.provenance.mode);
+ }
+ try {
+ captureDeliveryStagingFile(
+ provenanceCandidatePath,
+ artifactIdentity(provenanceBytes),
+ );
+ } catch {
+ // commitDeliveryPair classifies this path against the expected bytes;
+ // cleanup must not claim a candidate that could not be bound here.
+ }
} catch (error) {
reportDeliveryFailure({
json,
@@ -4455,6 +4888,7 @@ async function commandDeliver(args) {
fileBindingRuntime,
});
commitRecoveryBackups = committed.recoverableBackups;
+ stagingOwnership.push(...committed.ownedBackupEntries);
} catch (error) {
if (error.deliveryOwnershipCode === 'delivery/ownership-lost' && !error.deliveryCommitDetails) {
error.deliveryCommitDetails = {
@@ -4603,10 +5037,16 @@ async function commandDeliver(args) {
}
}
if (recoveryRequired) {
+ releaseOwnedStagingBindings(stagingOwnership, fileBindingRuntime);
console.error(`Recovery required: delivery backups were retained at "${stagingDirectory}".`);
} else {
try {
- fs.rmSync(stagingDirectory, { recursive: true, force: true });
+ cleanupOwnedStagingDirectory(
+ stagingDirectory,
+ stagingIdentity,
+ stagingOwnership,
+ fileBindingRuntime,
+ );
} catch (error) {
console.error(`Warning: could not remove delivery staging directory "${stagingDirectory}": ${error.message}`);
}
@@ -5493,8 +5933,10 @@ async function commandMigrate(args) {
}
const { pathsAlias, validateAuthoredOutputPath } = await import('../renderers/shared/output-path.mjs');
const {
+ backupPublicRegularFileBinding,
captureAtomicOutput,
captureRegularFileBinding,
+ quarantineRemoveRegularFileBinding,
releaseRegularFileBinding,
verifyAtomicOutput,
verifyRegularFileBinding,
@@ -5570,6 +6012,7 @@ async function commandMigrate(args) {
const destinationDirectory = path.dirname(destinationPath);
let stagingDirectory;
+ let stagingIdentity;
let destinationCapture;
try {
fs.mkdirSync(destinationDirectory, { recursive: true });
@@ -5589,7 +6032,11 @@ async function commandMigrate(args) {
});
return;
}
- stagingDirectory = fs.mkdtempSync(path.join(destinationDirectory, '.archify-migration-'));
+ const staging = createOwnedEmptyStagingDirectory(
+ path.join(destinationDirectory, '.archify-migration-'),
+ );
+ stagingDirectory = staging.directory;
+ stagingIdentity = staging.identity;
} catch (error) {
reportMigrationFailure({
...migration,
@@ -5608,8 +6055,27 @@ async function commandMigrate(args) {
const artifactPath = path.join(stagingDirectory, 'migration-check.html');
const destinationBytes = Buffer.from(serializeMigratedWorkflow(migration.document));
let candidateBinding = null;
+ let previousDestinationBinding = null;
+ let preserveRecoveryDirectory = false;
+ const fileBindingRuntime = {
+ captureRegularFileBinding,
+ quarantineRemoveRegularFileBinding,
+ releaseRegularFileBinding,
+ };
+ const stagingOwnership = [];
try {
fs.writeFileSync(candidatePath, destinationBytes, { flag: 'wx' });
+ if (destinationCapture.mode !== null) fs.chmodSync(candidatePath, destinationCapture.mode);
+ const candidateCapture = captureOwnedStagingFile(
+ stagingOwnership,
+ candidatePath,
+ fileBindingRuntime,
+ {
+ subject: 'migration-candidate',
+ content: artifactIdentity(destinationBytes),
+ },
+ );
+ candidateBinding = candidateCapture.binding;
const render = runNode([rendererPath('workflow'), candidatePath, artifactPath], {
stdio: 'pipe',
env: rendererEnv(activeQualityProfile, repoArgs.repoRoot, true),
@@ -5623,6 +6089,11 @@ async function commandMigrate(args) {
});
return;
}
+ const migrationArtifact = fs.readFileSync(artifactPath);
+ captureOwnedStagingFile(stagingOwnership, artifactPath, fileBindingRuntime, {
+ subject: 'migration-check-artifact',
+ content: artifactIdentity(migrationArtifact),
+ });
const check = runNode([path.join(skillRoot, 'scripts/check-render-output.mjs'), artifactPath], {
stdio: 'pipe',
@@ -5671,74 +6142,204 @@ async function commandMigrate(args) {
return;
}
- if (destinationCapture.mode !== null) fs.chmodSync(candidatePath, destinationCapture.mode);
- const expectedCandidate = artifactIdentity(destinationBytes);
- const candidateCapture = captureRegularFileBinding(candidatePath, {
- subject: 'migration-candidate',
- expectedSha256: expectedCandidate.sha256,
- expectedBytes: expectedCandidate.bytes,
- ...(destinationCapture.mode === null ? {} : { expectedMode: destinationCapture.mode }),
- expectedLinks: 1,
- });
- if (candidateCapture.status !== 'captured') {
+ const candidateVerification = verifyRegularFileBinding(candidateBinding, { expectedLinks: 1 });
+ if (candidateVerification.status !== 'match') {
reportMigrationFailure({
...migration,
migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
code: 'migration/candidate-changed',
message: 'Workflow migration candidate changed before the destination commit.',
subject: { destination: destinationPath },
- evidence: { candidateState: candidateCapture.reason },
+ evidence: { candidateState: candidateVerification.reason },
supportedFixes: ['retry the migration from a stable workflow source and destination'],
})],
});
return;
}
- candidateBinding = candidateCapture.binding;
- const candidateVerification = verifyRegularFileBinding(candidateBinding, { expectedLinks: 1 });
- if (candidateVerification.status !== 'match') {
+
+ const destinationVerification = verifyAtomicOutput(destinationCapture.snapshot);
+ if (destinationVerification.status !== 'match') {
+ reportMigrationFailure({
+ ...migration,
+ migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
+ code: 'migration/destination-changed',
+ message: 'Workflow migration destination changed while the candidate was being verified.',
+ subject: { destination: destinationPath },
+ evidence: { targetState: destinationVerification.reason },
+ supportedFixes: ['retry only after other processes stop creating, replacing, or redirecting the destination'],
+ })],
+ });
+ return;
+ }
+ const backupPath = path.join(stagingDirectory, '.previous-destination');
+ let backupPresent = false;
+ if (destinationCapture.snapshot.target.kind === 'file') {
+ const expected = destinationCapture.snapshot.target;
+ const previousCapture = captureRegularFileBinding(destinationCapture.commitPath, {
+ subject: 'previous-migration-destination',
+ expectedIdentity: { device: expected.device, inode: expected.inode },
+ expectedMode: expected.mode,
+ expectedLinks: 1,
+ });
+ if (previousCapture.status !== 'captured') {
+ reportMigrationFailure({
+ ...migration,
+ migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
+ code: 'migration/destination-changed',
+ message: 'Workflow migration destination changed before publication.',
+ subject: { destination: destinationPath },
+ evidence: { targetState: previousCapture.reason },
+ supportedFixes: ['retry only after other processes stop changing the destination'],
+ })],
+ });
+ return;
+ }
+ previousDestinationBinding = previousCapture.binding;
+ const backedUp = backupPublicRegularFileBinding(
+ previousDestinationBinding,
+ destinationCapture.commitPath,
+ backupPath,
+ { subject: 'previous-migration-destination' },
+ );
+ backupPresent = backedUp.backupCreated === true;
+ if (backedUp.status !== 'backed-up') {
+ preserveRecoveryDirectory = backupPresent || backedUp.status === 'recovery-required';
+ reportMigrationFailure({
+ ...migration,
+ migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
+ code: 'migration/destination-changed',
+ message: 'Workflow migration destination changed while its previous value was being preserved.',
+ subject: { destination: destinationPath },
+ evidence: {
+ targetState: backedUp.reason,
+ ...(backedUp.recoveryFile ? { recoveryFile: backedUp.recoveryFile } : {}),
+ },
+ supportedFixes: ['inspect the retained recovery entry before retrying'],
+ })],
+ });
+ return;
+ }
+ }
+
+ const candidateBeforePublish = verifyRegularFileBinding(candidateBinding, {
+ filePath: candidatePath,
+ expectedLinks: 1,
+ });
+ if (candidateBeforePublish.status !== 'match') {
+ preserveRecoveryDirectory = backupPresent;
reportMigrationFailure({
...migration,
migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
code: 'migration/candidate-changed',
- message: 'Workflow migration candidate changed before the destination commit.',
+ message: 'Workflow migration candidate changed before publication.',
subject: { destination: destinationPath },
- evidence: { candidateState: candidateVerification.reason },
- supportedFixes: ['retry the migration from a stable workflow source and destination'],
+ evidence: { candidateState: candidateBeforePublish.reason },
+ supportedFixes: ['inspect any retained previous destination, then retry'],
+ })],
+ });
+ return;
+ }
+ try {
+ fs.linkSync(candidatePath, destinationCapture.commitPath);
+ } catch (error) {
+ preserveRecoveryDirectory = backupPresent;
+ reportMigrationFailure({
+ ...migration,
+ migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
+ code: 'migration/destination-changed',
+ message: 'Workflow migration destination was claimed during publication.',
+ subject: { destination: destinationPath },
+ evidence: {
+ ...(error?.code ? { systemCode: error.code } : {}),
+ ...(backupPresent ? { recoveryFile: backupPath } : {}),
+ },
+ supportedFixes: backupPresent
+ ? ['preserve the claimant and inspect the retained previous destination before retrying']
+ : ['preserve the claimant and retry with a different destination'],
})],
});
return;
}
- const candidateRelease = releaseRegularFileBinding(candidateBinding);
- candidateBinding = null;
- if (candidateRelease.status !== 'released') {
+ const published = verifyRegularFileBinding(candidateBinding, {
+ filePath: destinationCapture.commitPath,
+ expectedLinks: 2,
+ });
+ if (published.status !== 'match') {
+ preserveRecoveryDirectory = backupPresent;
+ reportMigrationFailure({
+ ...migration,
+ migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
+ code: 'migration/destination-changed',
+ message: 'Workflow migration destination changed during publication.',
+ subject: { destination: destinationPath },
+ evidence: { targetState: published.reason },
+ supportedFixes: ['preserve the current claimant and inspect any retained recovery entry'],
+ })],
+ });
+ return;
+ }
+ const removedCandidate = quarantineRemoveRegularFileBinding(candidateBinding, candidatePath, {
+ subject: 'migration-candidate',
+ expectedLinks: 2,
+ });
+ if (removedCandidate.status !== 'removed') {
+ preserveRecoveryDirectory = backupPresent || removedCandidate.status === 'recovery-required';
reportMigrationFailure({
...migration,
migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
code: 'migration/candidate-changed',
- message: 'Workflow migration candidate could not be finalized before the destination commit.',
+ message: 'Workflow migration candidate changed while publication was finalized.',
subject: { destination: destinationPath },
- evidence: { candidateState: candidateRelease.reason },
- supportedFixes: ['retry the migration after resolving the candidate filesystem error'],
+ evidence: { candidateState: removedCandidate.reason },
+ supportedFixes: ['preserve the candidate claimant and inspect the published destination'],
})],
});
return;
}
-
- const destinationVerification = verifyAtomicOutput(destinationCapture.snapshot);
- if (destinationVerification.status !== 'match') {
+ const finalized = verifyRegularFileBinding(candidateBinding, {
+ filePath: destinationCapture.commitPath,
+ expectedLinks: 1,
+ });
+ if (finalized.status !== 'match') {
+ preserveRecoveryDirectory = backupPresent;
reportMigrationFailure({
...migration,
migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
code: 'migration/destination-changed',
- message: 'Workflow migration destination changed while the candidate was being verified.',
+ message: 'Published workflow migration changed before final verification.',
subject: { destination: destinationPath },
- evidence: { targetState: destinationVerification.reason },
- supportedFixes: ['retry only after other processes stop creating, replacing, or redirecting the destination'],
+ evidence: { targetState: finalized.reason },
+ supportedFixes: ['preserve the current claimant and inspect any retained recovery entry'],
+ })],
+ });
+ return;
+ }
+ if (backupPresent) {
+ const removedBackup = quarantineRemoveRegularFileBinding(
+ previousDestinationBinding,
+ backupPath,
+ { subject: 'previous-migration-destination', expectedLinks: 1 },
+ );
+ if (removedBackup.status === 'removed') backupPresent = false;
+ }
+ const finalPublishedState = verifyRegularFileBinding(candidateBinding, {
+ filePath: destinationCapture.commitPath,
+ expectedLinks: 1,
+ });
+ if (finalPublishedState.status !== 'match') {
+ preserveRecoveryDirectory = backupPresent;
+ reportMigrationFailure({
+ ...migration,
+ migrationDiagnostics: [...migration.migrationDiagnostics, diagnostic({
+ code: 'migration/destination-changed',
+ message: 'Published workflow migration did not remain stable through finalization.',
+ subject: { destination: destinationPath },
+ evidence: { targetState: finalPublishedState.reason },
+ supportedFixes: ['preserve the current destination and inspect any retained recovery entry'],
})],
});
return;
}
- fs.renameSync(candidatePath, destinationCapture.commitPath);
const report = migrationReport({
...migration,
sourcePath,
@@ -5768,16 +6369,25 @@ async function commandMigrate(args) {
migrationDiagnostics: [...migration.migrationDiagnostics, ...migrationDiagnostics],
});
} finally {
- if (candidateBinding) releaseRegularFileBinding(candidateBinding);
+ if (previousDestinationBinding) releaseRegularFileBinding(previousDestinationBinding);
try {
- fs.rmSync(stagingDirectory, { recursive: true, force: true });
+ if (preserveRecoveryDirectory) {
+ releaseOwnedStagingBindings(stagingOwnership, fileBindingRuntime);
+ } else {
+ cleanupOwnedStagingDirectory(
+ stagingDirectory,
+ stagingIdentity,
+ stagingOwnership,
+ fileBindingRuntime,
+ );
+ }
} catch (error) {
console.error(`Warning: could not remove workflow migration staging directory "${stagingDirectory}": ${error.message}`);
}
}
}
-function commandValidate(args) {
+async function commandValidate(args) {
const qualityArgs = extractQualityArgs(args);
const repoArgs = extractRepoRootArgs(qualityArgs.rest);
args = repoArgs.rest;
@@ -5808,6 +6418,29 @@ function commandValidate(args) {
});
}
+ const inputPath = path.resolve(input);
+ try {
+ const document = JSON.parse(fs.readFileSync(inputPath, 'utf8'));
+ const [{ validateAuthoredOutputPath }, { validateSchema }] = await Promise.all([
+ import('../renderers/shared/output-path.mjs'),
+ import('../renderers/shared/validator.mjs'),
+ ]);
+ if (document?.meta?.output === undefined) validateSchema(type, document);
+ else validateAuthoredOutputPath(document.meta.output);
+ } catch (error) {
+ const diagnostics = error.archifyDiagnostics || [inputDiagnostic(error, inputPath)];
+ reportValidateFailure({
+ json,
+ stage: diagnostics.some((entry) => entry.code.startsWith('input/')) ? 'input' : 'render',
+ type,
+ input: inputPath,
+ error: error.message,
+ diagnostics,
+ status: 1,
+ });
+ return;
+ }
+
if (layoutJson) {
// Layout mode emits JSON without writing HTML; keep its unused target typed.
const layoutOutput = path.join(os.tmpdir(), `archify-layout-${process.pid}-${type}.html`);
@@ -5937,7 +6570,7 @@ try {
await commandPreview(args);
break;
case 'validate':
- commandValidate(args);
+ await commandValidate(args);
break;
case 'migrate':
await commandMigrate(args);
diff --git a/archify/bin/preview.mjs b/archify/bin/preview.mjs
index ee7c7980..4c50befc 100644
--- a/archify/bin/preview.mjs
+++ b/archify/bin/preview.mjs
@@ -11,10 +11,10 @@ import { sameLocation } from '../renderers/shared/path-semantics.mjs';
import {
captureAtomicOutput,
captureRegularFileBinding,
+ publishRegularFileBinding,
releaseRegularFileBinding,
removeOwnedRegularFile,
verifyAtomicOutput,
- verifyRegularFileBinding,
} from '../renderers/shared/atomic-output.mjs';
const here = path.dirname(fileURLToPath(import.meta.url));
@@ -666,12 +666,18 @@ export async function startPreview(options) {
commitCandidateBinding = candidateCapture.binding;
const beforeCommit = verifyAtomicOutput(outputCapture.snapshot);
if (beforeCommit.status !== 'match') throw atomicOutputError(beforeCommit);
- const verifiedCandidate = verifyRegularFileBinding(commitCandidateBinding);
- if (verifiedCandidate.status !== 'match') throw atomicOutputError(verifiedCandidate);
+ const publication = publishRegularFileBinding(
+ commitCandidateBinding,
+ commitCandidatePath,
+ outputCapture.snapshot,
+ { subject: 'candidate' },
+ );
+ if (!['committed', 'committed-with-warning'].includes(publication.status)) {
+ throw atomicOutputError(publication);
+ }
const releasedCandidate = releaseRegularFileBinding(commitCandidateBinding);
commitCandidateBinding = undefined;
if (releasedCandidate.status !== 'released') throw atomicOutputError(releasedCandidate);
- fs.renameSync(commitCandidatePath, outputCapture.commitPath);
commitCandidatePath = undefined;
commitCandidateIdentity = undefined;
artifactBuffer = candidate;
diff --git a/archify/bin/visual-check.mjs b/archify/bin/visual-check.mjs
index 5797c9ae..9943ef6f 100644
--- a/archify/bin/visual-check.mjs
+++ b/archify/bin/visual-check.mjs
@@ -12,6 +12,7 @@ import {
backupPublicRegularFileBinding,
captureAtomicOutput,
captureRegularFileBinding,
+ quarantineRemoveLinkedRegularFileAlias,
quarantineRemoveRegularFileBinding,
releaseRegularFileBinding,
verifyAtomicOutput,
@@ -159,6 +160,30 @@ function resolvedSidecarNamespace(artifact, component) {
throw error;
}
+function portableSidecarComponentKey(component) {
+ return component
+ .normalize('NFC')
+ .toLocaleUpperCase('en-US')
+ .toLocaleLowerCase('en-US')
+ .normalize('NFC');
+}
+
+function targetSidecarNamespace(directory, component) {
+ const namespace = sidecarNamespaceComponentKey(directory, component);
+ if (namespace.status === 'resolved') return namespace.componentKey;
+ if (namespace.reason?.code === 'sidecar-directory-missing') {
+ // A pure path calculation must not create --out-dir. Use the portable
+ // collision envelope until the directory exists and can be probed.
+ return portableSidecarComponentKey(component);
+ }
+ const error = new Error(
+ `Could not establish target sidecar semantics (${namespace.reason?.code || 'unknown'}).`,
+ );
+ error.code = 'ARCHIFY_SIDECAR_NAMESPACE_INDETERMINATE';
+ error.sidecarNamespaceReason = namespace.reason;
+ throw error;
+}
+
export function sidecarPaths(artifactPath, { outDir } = {}) {
let artifact = path.resolve(artifactPath);
try {
@@ -172,12 +197,23 @@ export function sidecarPaths(artifactPath, { outDir } = {}) {
const namespace = resolvedSidecarNamespace(artifact, path.basename(artifact));
artifact = path.join(namespace.directoryPath, path.basename(artifact));
const namespaceStem = sidecarStemFromComponent(namespace.componentKey);
+ const directory = outDir ? path.resolve(outDir) : path.dirname(artifact);
+ const targetComponentKey = outDir
+ ? targetSidecarNamespace(directory, namespace.componentKey)
+ : namespace.componentKey;
+ const portableTargetKey = outDir
+ ? portableSidecarComponentKey(namespace.componentKey)
+ : namespace.componentKey;
+ const targetAliasesSourceSpelling = targetComponentKey !== namespace.componentKey
+ || portableTargetKey !== namespace.componentKey;
const stem = boundedSidecarStem(
namespaceStem.stem,
VISUAL_SIDECAR_SUFFIXES,
- namespaceStem.options,
+ targetAliasesSourceSpelling ? {
+ force: true,
+ hashDomain: `visual-check-artifact\0${artifact}\0target-component\0${portableTargetKey}`,
+ } : namespaceStem.options,
);
- const directory = outDir ? path.resolve(outDir) : path.dirname(artifact);
const base = path.join(directory, `${stem}.visual-check`);
const screenshots = CAPTURE_VIEWPORTS.flatMap(({ width, height }) => THEMES.map((theme) => ({
width,
@@ -367,65 +403,50 @@ function unlinkOwnedEntry(file, identity, {
evidence,
expectedLinks,
} = {}) {
- let stat;
- try {
- stat = fs.lstatSync(file, { bigint: true });
- } catch (error) {
- return error?.code === 'ENOENT'
- ? { status: 'absent' }
- : { status: 'unknown', error };
- }
- if (!identityMatches(stat, identity)
- || (expectedLinks !== undefined && stat.nlink !== BigInt(expectedLinks))) {
- return { status: 'different', reason: 'identity' };
- }
- const verifiedLinks = expectedLinks ?? stat.nlink;
- if (evidence && !currentEvidenceMatches(
- file,
- identity,
- evidence,
- { expectedLinks: verifiedLinks },
- )) {
- return { status: 'different', reason: 'content' };
- }
- try {
- stat = fs.lstatSync(file, { bigint: true });
- } catch (error) {
- return error?.code === 'ENOENT'
- ? { status: 'absent' }
- : { status: 'unknown', error };
- }
- if (!identityMatches(stat, identity) || stat.nlink !== BigInt(verifiedLinks)) {
- return { status: 'different', reason: 'identity' };
- }
- try {
- fs.unlinkSync(file);
- return { status: 'removed' };
- } catch (error) {
- return { status: 'unknown', error };
- }
-}
-
-function quarantineOwnedPublishedEntry(file, identity, evidence, expectedLinks) {
- const captured = captureRegularFileBinding(file, {
- subject: 'published-evidence',
+ const verifiedLinks = Number(expectedLinks ?? identity.links ?? 1);
+ let captured = captureRegularFileBinding(file, {
+ subject: 'visual-cleanup',
expectedIdentity: identity,
expectedMode: identity.mode,
- expectedSha256: evidence.sha256,
- expectedBytes: evidence.bytes,
- expectedLinks,
+ expectedLinks: verifiedLinks,
+ ...(evidence ? {
+ expectedSha256: evidence.sha256,
+ expectedBytes: evidence.bytes,
+ } : {}),
});
+ const reportedLinks = Number(captured.reason?.links);
+ if (captured.status === 'unsupported'
+ && captured.reason?.code === 'visual-cleanup-hardlinked'
+ && Number.isSafeInteger(reportedLinks)
+ && reportedLinks > verifiedLinks) {
+ captured = captureRegularFileBinding(file, {
+ subject: 'visual-cleanup',
+ expectedIdentity: identity,
+ expectedMode: identity.mode,
+ expectedLinks: reportedLinks,
+ ...(evidence ? {
+ expectedSha256: evidence.sha256,
+ expectedBytes: evidence.bytes,
+ } : {}),
+ });
+ }
if (captured.status !== 'captured') {
- return captured.reason?.systemCode === 'ENOENT'
- ? { status: 'absent', reason: captured.reason }
- : captured;
+ if (captured.reason?.systemCode === 'ENOENT') return { status: 'absent' };
+ return {
+ status: captured.status === 'different' || captured.status === 'unsupported'
+ ? 'different'
+ : 'unknown',
+ reason: captured.reason?.code?.includes('content-changed') ? 'content' : 'identity',
+ error: new Error(captured.reason?.code || 'visual cleanup binding failed'),
+ bindingState: captured.reason,
+ };
}
let removal;
let released;
try {
removal = quarantineRemoveRegularFileBinding(captured.binding, file, {
- subject: 'published-evidence',
- expectedLinks,
+ subject: 'visual-cleanup',
+ expectedLinks: captured.identity?.links ? Number(captured.identity.links) : verifiedLinks,
});
} finally {
released = releaseRegularFileBinding(captured.binding);
@@ -433,18 +454,23 @@ function quarantineOwnedPublishedEntry(file, identity, evidence, expectedLinks)
if (released.status !== 'released') {
return {
status: 'unknown',
- reason: released.reason,
- removalStatus: removal?.status,
- ...(removal?.recoveryDirectory
- ? {
- recoveryDirectory: removal.recoveryDirectory,
- recoveryFile: removal.recoveryFile,
- target: removal.target,
- }
- : {}),
+ reason: 'identity',
+ error: new Error(released.reason?.code || 'visual cleanup binding release failed'),
+ bindingState: released.reason,
};
}
- return removal;
+ if (removal.status === 'removed' || removal.status === 'absent') return removal;
+ return {
+ status: removal.status === 'preserved' || removal.status === 'different'
+ || removal.status === 'unsupported' ? 'different' : 'unknown',
+ reason: 'identity',
+ error: new Error(removal.reason?.code || 'visual cleanup quarantine failed'),
+ bindingState: removal.reason,
+ ...(removal.recoveryDirectory ? {
+ recoveryDirectory: removal.recoveryDirectory,
+ recoveryFile: removal.recoveryFile,
+ } : {}),
+ };
}
function backupOwnedPublishedEntry(file, backupPath, identity, evidence) {
@@ -775,15 +801,6 @@ function recordVisualEvidenceFiles(receipt, outputs, ownership) {
receipt.sidecars.files = files;
}
-function currentUniqueEntryMatches(file, identity) {
- try {
- const stat = fs.lstatSync(file, { bigint: true });
- return stat.nlink === 1n && identityMatches(stat, identity);
- } catch {
- return false;
- }
-}
-
function currentEvidenceMatches(file, identity, evidence, {
expectedLinks = identity.links ?? 1,
} = {}) {
@@ -795,19 +812,6 @@ function currentEvidenceMatches(file, identity, evidence, {
&& current.evidence.bytes === evidence.bytes;
}
-function linkedEntriesMatch(stagedPath, finalPath, identity) {
- try {
- const staged = fs.lstatSync(stagedPath, { bigint: true });
- const published = fs.lstatSync(finalPath, { bigint: true });
- return staged.nlink === 2n
- && published.nlink === 2n
- && identityMatches(staged, identity)
- && identityMatches(published, identity);
- } catch {
- return false;
- }
-}
-
function restoreOwnedBackup(backup, errors) {
const expectedLinks = backup.identity.links ?? 1n;
const expectedLinkCount = Number(expectedLinks);
@@ -895,7 +899,10 @@ function restoreOwnedBackup(backup, errors) {
});
return;
}
- const removed = unlinkOwnedEntry(backup.path, backup.identity);
+ const removed = unlinkOwnedEntry(backup.path, backup.identity, {
+ evidence: captured.content,
+ expectedLinks: linkedCount,
+ });
const finalMatches = verifyRegularFileBinding(captured.binding, {
filePath: backup.finalPath,
expectedLinks: expectedLinkCount,
@@ -937,18 +944,43 @@ function commitVisualEvidence(artifactPath, outputs, ownership, desiredPaths) {
}
const desired = new Set(desiredPaths);
+ const stagedBindings = new Map();
+ const releaseStagedBindings = () => {
+ const failures = [];
+ for (const [finalPath, binding] of stagedBindings) {
+ const released = releaseRegularFileBinding(binding);
+ if (released.status !== 'released') {
+ failures.push({ file: finalPath, reason: released.reason?.code });
+ }
+ }
+ stagedBindings.clear();
+ return failures;
+ };
for (const finalPath of desired) {
const staged = ownership.stagedEntries.get(finalPath);
- if (!staged || !currentEvidenceMatches(staged.path, staged.identity, staged.evidence)) {
+ const captured = staged ? captureRegularFileBinding(staged.path, {
+ subject: 'staged-evidence',
+ expectedIdentity: staged.identity,
+ expectedMode: staged.identity.mode,
+ expectedSha256: staged.evidence?.sha256,
+ expectedBytes: staged.evidence?.bytes,
+ expectedLinks: 1,
+ }) : null;
+ if (!staged || captured?.status !== 'captured') {
const failure = evidenceWriteFailure(
artifactPath,
'visual-check could not verify its staged evidence before publication.',
- [{ file: staged?.path || stagedPathFor(ownership, finalPath), reason: 'staged entry missing or changed' }],
+ [{
+ file: staged?.path || stagedPathFor(ownership, finalPath),
+ reason: captured?.reason?.code || 'staged entry missing or changed',
+ }],
);
+ releaseStagedBindings();
cleanupStagedEvidence(ownership, { removeDirectory: true });
ownership.active = false;
return failure;
}
+ stagedBindings.set(finalPath, captured.binding);
}
const backups = [];
@@ -1009,9 +1041,16 @@ function commitVisualEvidence(artifactPath, outputs, ownership, desiredPaths) {
for (const target of publicationOrder) {
const captured = ownership.targets.get(target.path);
const staged = ownership.stagedEntries.get(target.path);
- if (!currentEvidenceMatches(staged.path, staged.identity, staged.evidence)) {
+ const stagedBinding = stagedBindings.get(target.path);
+ const beforeLink = verifyRegularFileBinding(stagedBinding, {
+ filePath: staged.path,
+ expectedLinks: 1,
+ });
+ if (beforeLink.status !== 'match') {
conflict = evidencePathConflict(artifactPath, outputs, target.path, {
- code: 'staged-evidence-content-mismatch',
+ code: beforeLink.reason?.code?.includes('content-changed')
+ ? 'staged-evidence-content-mismatch'
+ : beforeLink.reason?.code || 'staged-evidence-content-mismatch',
});
throw new Error(conflict.error);
}
@@ -1030,40 +1069,43 @@ function commitVisualEvidence(artifactPath, outputs, ownership, desiredPaths) {
stagedPath: staged.path,
identity: staged.identity,
evidence: staged.evidence,
+ binding: stagedBinding,
});
- if (!linkedEntriesMatch(staged.path, captured.commitPath, staged.identity)) {
+ const stagedLinked = verifyRegularFileBinding(stagedBinding, {
+ filePath: staged.path,
+ expectedLinks: 2,
+ });
+ const publishedLinked = verifyRegularFileBinding(stagedBinding, {
+ filePath: captured.commitPath,
+ expectedLinks: 2,
+ });
+ if (stagedLinked.status !== 'match' || publishedLinked.status !== 'match') {
conflict = evidencePathConflict(artifactPath, outputs, target.path, {
code: 'published-entry-identity-mismatch',
+ stagedState: stagedLinked.reason,
+ publishedState: publishedLinked.reason,
});
throw new Error(conflict.error);
}
- if (!currentEvidenceMatches(
- staged.path,
- staged.identity,
- staged.evidence,
- { expectedLinks: 2 },
- )) {
- conflict = evidencePathConflict(artifactPath, outputs, target.path, {
- code: 'published-entry-content-mismatch',
- });
- throw new Error(conflict.error);
- }
- const removed = unlinkOwnedEntry(staged.path, staged.identity, {
- evidence: staged.evidence,
+ const removed = quarantineRemoveRegularFileBinding(stagedBinding, staged.path, {
+ subject: 'staged-evidence',
expectedLinks: 2,
});
- if (removed.status !== 'removed') {
+ if (removed.status !== 'removed' && removed.status !== 'preserved') {
conflict = evidencePathConflict(artifactPath, outputs, target.path, {
- code: removed.reason === 'content'
- ? 'published-entry-content-mismatch'
- : 'published-entry-identity-mismatch',
+ code: removed.reason?.code || 'published-entry-identity-mismatch',
});
throw new Error(`visual-check could not retire staged evidence "${staged.path}".`);
}
- ownership.stagedEntries.delete(target.path);
- if (!currentUniqueEntryMatches(captured.commitPath, staged.identity)) {
+ if (removed.status === 'removed') ownership.stagedEntries.delete(target.path);
+ const finalized = verifyRegularFileBinding(stagedBinding, {
+ filePath: captured.commitPath,
+ expectedLinks: 1,
+ });
+ if (finalized.status !== 'match') {
conflict = evidencePathConflict(artifactPath, outputs, target.path, {
code: 'published-entry-link-count-mismatch',
+ bindingState: finalized.reason,
});
throw new Error(conflict.error);
}
@@ -1073,15 +1115,14 @@ function commitVisualEvidence(artifactPath, outputs, ownership, desiredPaths) {
// Recheck every earlier member afterwards so a writer that replaces a PNG
// or the contact sheet while later members publish cannot yield success.
for (const entry of published) {
- if (!currentUniqueEntryMatches(entry.finalPath, entry.identity)) {
+ const finalState = verifyRegularFileBinding(entry.binding, {
+ filePath: entry.finalPath,
+ expectedLinks: 1,
+ });
+ if (finalState.status !== 'match') {
conflict = evidencePathConflict(artifactPath, outputs, entry.finalPath, {
code: 'published-set-identity-mismatch',
- });
- throw new Error(conflict.error);
- }
- if (!currentEvidenceMatches(entry.finalPath, entry.identity, entry.evidence)) {
- conflict = evidencePathConflict(artifactPath, outputs, entry.finalPath, {
- code: 'published-set-content-mismatch',
+ bindingState: finalState.reason,
});
throw new Error(conflict.error);
}
@@ -1136,49 +1177,55 @@ function commitVisualEvidence(artifactPath, outputs, ownership, desiredPaths) {
};
} catch (error) {
const rollbackErrors = [];
- const conflictReason = conflict?.diagnostic?.evidence?.reason?.code;
for (const entry of [...published].reverse()) {
- let stagingLinkRemains = false;
- try {
- const staged = fs.lstatSync(entry.stagedPath, { bigint: true });
- stagingLinkRemains = identityMatches(staged, entry.identity);
- } catch {}
- const mayRetireHardlinkedPublication = stagingLinkRemains
- && conflictReason === 'published-entry-identity-mismatch';
- let expectedLinks = stagingLinkRemains ? 2 : 1;
let removed;
- if (mayRetireHardlinkedPublication) {
- try {
- const current = fs.lstatSync(entry.finalPath, { bigint: true });
- const currentLinks = Number(current.nlink);
- if (!identityMatches(current, entry.identity)
- || !Number.isSafeInteger(currentLinks)
- || currentLinks < 1) {
- removed = {
- status: 'different',
- reason: { code: 'published-evidence-identity-changed' },
- };
- } else {
- expectedLinks = currentLinks;
+ let ownedMismatch;
+ for (const expectedLinks of [2, 1]) {
+ const matches = verifyRegularFileBinding(entry.binding, {
+ filePath: entry.finalPath,
+ expectedLinks,
+ });
+ if (matches.status === 'match') {
+ removed = quarantineRemoveRegularFileBinding(
+ entry.binding,
+ entry.finalPath,
+ { subject: 'published-evidence', expectedLinks },
+ );
+ break;
+ }
+ if (matches.reason?.code?.includes('content-changed')
+ || matches.reason?.code?.includes('mode-changed')) {
+ ownedMismatch = matches;
+ } else {
+ ownedMismatch ||= matches;
+ }
+ const reportedLinks = Number(matches.reason?.links);
+ if (matches.status === 'unsupported'
+ && matches.reason?.code === 'staged-evidence-hardlinked'
+ && Number.isSafeInteger(reportedLinks)
+ && reportedLinks > expectedLinks) {
+ const current = verifyRegularFileBinding(entry.binding, {
+ filePath: entry.finalPath,
+ expectedLinks: reportedLinks,
+ });
+ if (current.status === 'match') {
+ removed = quarantineRemoveRegularFileBinding(
+ entry.binding,
+ entry.finalPath,
+ { subject: 'published-evidence', expectedLinks: reportedLinks },
+ );
+ break;
}
- } catch (inspectionError) {
- removed = inspectionError?.code === 'ENOENT'
- ? { status: 'absent' }
- : {
- status: 'unknown',
- reason: {
- code: 'published-evidence-inspection-failed',
- ...(inspectionError?.code ? { systemCode: inspectionError.code } : {}),
- },
- };
}
}
- removed ||= quarantineOwnedPublishedEntry(
- entry.finalPath,
- entry.identity,
- entry.evidence,
- expectedLinks,
- );
+ if (!removed) {
+ const claimantRemoval = quarantineRemoveLinkedRegularFileAlias(
+ entry.stagedPath,
+ entry.finalPath,
+ { subject: 'published-evidence-claimant' },
+ );
+ removed = claimantRemoval.status === 'removed' ? claimantRemoval : ownedMismatch;
+ }
if (removed.status !== 'removed' && removed.status !== 'absent') {
rollbackErrors.push(publishedRemovalError(entry.finalPath, removed));
}
@@ -1195,6 +1242,8 @@ function commitVisualEvidence(artifactPath, outputs, ownership, desiredPaths) {
'visual-check could not atomically publish its evidence set.',
[{ reason: error.message }, ...rollbackErrors],
);
+ } finally {
+ releaseStagedBindings();
}
}
diff --git a/archify/references/delivery-contract.md b/archify/references/delivery-contract.md
index 652ebeb6..24b88346 100644
--- a/archify/references/delivery-contract.md
+++ b/archify/references/delivery-contract.md
@@ -81,19 +81,36 @@ contract does not claim distributed-lock correctness on NFS, SMB, or other
network filesystems, and it cannot prevent an external process that ignores
the protocol from replacing shared paths.
-Every atomic HTML publisher (`render`, `deliver`, `compare`, and `preview`)
+Every no-clobber HTML publisher (`render`, `deliver`, `compare`, and `preview`)
captures the requested directory entry, canonical write slot, physical parent,
and existing target type, device/inode identity, and mode before staging, then
revalidates that snapshot immediately before replacement. An existing write
target must be a regular file with exactly one hard-link name. A target with
-multiple hard-link names fails closed with `output/target-hardlinked`: atomic
-rename can replace the requested name, but cannot update unknown sibling names
-without abandoning crash-atomic publication. Hard links remain supported for
-read identity and input/alias collision checks; they are unsupported only as
-write targets. A symbolic link to a single-link regular file remains supported:
-publication preserves the symbolic-link entry and atomically replaces or
-creates its resolved target. Directory, FIFO, socket, device, changing mode,
-new claimant, and indeterminate identity cases fail before replacement.
+multiple hard-link names fails closed with `output/target-hardlinked`: replacing
+the requested name cannot update unknown sibling names as one publication.
+Hard links remain supported for read identity and input/alias collision checks;
+they are unsupported only as write targets. A symbolic link to a single-link regular
+file remains supported: publication preserves the symbolic-link entry and
+applies the same protocol to its resolved target. Directory, FIFO, socket,
+device, changing mode, new claimant, and indeterminate identity cases fail
+before replacement.
+
+Publication is no-clobber and recoverable, not crash-atomic replacement of an
+existing target. To avoid overwriting a claimant that appears after the last
+identity check, Archify first retains the bound old file in a private recovery
+backup, removes the public name through identity-bound quarantine, and then
+creates the new public name with an exclusive hard link. A caught failure rolls
+back when the public slot and recovery binding still permit it. A process
+interruption between those namespace operations can instead leave the public
+path absent while the verified previous bytes remain in an adjacent private
+recovery backup. Single-artifact publication uses
+`.archify-remove-*/previous`; paired flows retain the backup in their private
+transaction staging directory. Preserve and inspect that backup before serial
+recovery; for `deliver`, the pending journal and lock keep strict checkers
+fail-closed. The portable Node.js filesystem API has no pathname
+compare-and-swap that both replaces an existing name atomically and refuses to
+overwrite a late claimant: `rename` would close the visibility gap only by
+overwriting that claimant.
After ownership is established, `deliver` creates the journal before rendering
and keeps it through the recoverable HTML/sidecar pair commit. It removes the
@@ -146,7 +163,7 @@ node bin/archify.mjs visual-check <output.html> --json --require-provenance
Archify intentionally separates durable authored paths from command-line paths:
-- Authored `meta.output` is a portable POSIX-relative path such as
+- Required authored `meta.output` is a portable POSIX-relative path such as
`reports/diagram.html`. It uses `/`, ends in a non-empty `.html` basename,
and cannot contain an absolute or drive-relative prefix, URI, backslash,
empty or dot segment, control character, unpaired UTF-16 surrogate, Windows
@@ -174,8 +191,10 @@ Archify intentionally separates durable authored paths from command-line paths:
and components that exceed its supported bound.
These contracts are not interchangeable: an explicit CLI output does not hide
-an invalid durable `meta.output`, and `validate` and `migrate` check authored
-output syntax even when they do not publish to that path.
+an invalid durable `meta.output` (including a missing value), and `validate` and `migrate` check
+the authored output even when they do not publish to that path. To migrate an
+older v1 document that omitted it, add a portable POSIX-relative `.html` path
+to `meta.output`; no schema-version change is otherwise required.
Use `validate` after every candidate edit. CLI HTML output paths must end in
`.html`, including after symbolic-link resolution. Compare receipt paths must
@@ -317,8 +336,8 @@ unknown evidence and report `viewer/evidence-path-conflict`.
This rule also applies when Chrome is unavailable or provenance fails before
browser inspection: neither path may blindly delete stale-looking evidence. A
-verified owned set may be atomically replaced by a skipped or failed receipt;
-unowned evidence remains intact. These outcomes do not invalidate an already
+verified owned set may be recoverably retired before publishing a skipped or
+failed receipt; unowned evidence remains intact. These outcomes do not invalidate an already
successful deterministic delivery and do not turn a perceptual visual review
into passed or failed. Retry an environmental failure through the supported
command in a browser-capable execution context when practical. Keep the
diff --git a/archify/renderers/dataflow/README.md b/archify/renderers/dataflow/README.md
index d5c43fcb..108a4b15 100644
--- a/archify/renderers/dataflow/README.md
+++ b/archify/renderers/dataflow/README.md
@@ -10,8 +10,8 @@ node archify/renderers/dataflow/render-dataflow.mjs input.dataflow.json output.h
The renderer validates input against `archify/schemas/dataflow.schema.json`
with the bundled standalone validator. No dependency installation is required.
-If `output.html` is omitted, the renderer uses `meta.output` from the JSON file
-or falls back to `dataflow.html` in the current working directory.
+If `output.html` is omitted, the renderer uses the required `meta.output` value
+from the JSON file.
## Input
@@ -23,6 +23,7 @@ Data-flow JSON files must set:
"diagram_type": "dataflow",
"meta": {
"title": "Product Analytics Data Flow",
+ "output": "product-analytics-dataflow.html",
"viewBox": [940, 720]
},
"stages": [],
diff --git a/archify/renderers/lifecycle/README.md b/archify/renderers/lifecycle/README.md
index 733d2960..2b6ef27c 100644
--- a/archify/renderers/lifecycle/README.md
+++ b/archify/renderers/lifecycle/README.md
@@ -10,8 +10,8 @@ node archify/renderers/lifecycle/render-lifecycle.mjs input.lifecycle.json outpu
The renderer validates input against `archify/schemas/lifecycle.schema.json`
with the bundled standalone validator. No dependency installation is required.
-If `output.html` is omitted, the renderer uses `meta.output` from the JSON file
-or falls back to `lifecycle.html` in the current working directory.
+If `output.html` is omitted, the renderer uses the required `meta.output` value
+from the JSON file.
## Input
@@ -23,6 +23,7 @@ Lifecycle JSON files must set:
"diagram_type": "lifecycle",
"meta": {
"title": "Agent Run Lifecycle",
+ "output": "agent-run-lifecycle.html",
"viewBox": [980, 660]
},
"lanes": [],
diff --git a/archify/renderers/sequence/README.md b/archify/renderers/sequence/README.md
index 82cfa166..288db71e 100644
--- a/archify/renderers/sequence/README.md
+++ b/archify/renderers/sequence/README.md
@@ -10,8 +10,8 @@ node archify/renderers/sequence/render-sequence.mjs input.sequence.json output.h
The renderer validates input against `archify/schemas/sequence.schema.json`
with the bundled standalone validator. No dependency installation is required.
-If `output.html` is omitted, the renderer uses `meta.output` from the JSON file
-or falls back to `sequence.html` in the current working directory.
+If `output.html` is omitted, the renderer uses the required `meta.output` value
+from the JSON file.
## Input
@@ -23,6 +23,7 @@ Sequence JSON files must set:
"diagram_type": "sequence",
"meta": {
"title": "Cache Miss Request Sequence",
+ "output": "cache-miss-request.html",
"viewBox": [920, 760]
},
"participants": [],
diff --git a/archify/renderers/shared/atomic-output.mjs b/archify/renderers/shared/atomic-output.mjs
index 42ea7960..87ae85a3 100644
--- a/archify/renderers/shared/atomic-output.mjs
+++ b/archify/renderers/shared/atomic-output.mjs
@@ -739,35 +739,363 @@ export function backupPublicRegularFileBinding(binding, filePath, backupPath, {
};
}
-/** Remove only the directory entry that still names a caller-owned inode. */
-export function removeOwnedRegularFile(filePath, identity, { subject = 'candidate' } = {}) {
- const resolvedPath = path.resolve(filePath);
- let current;
+/**
+ * Remove a hard-link name that this process just introduced while preserving
+ * the source claimant. This is the rollback path when a staged pathname was
+ * swapped after its expected binding was verified but before `linkSync` used
+ * that pathname.
+ */
+export function quarantineRemoveLinkedRegularFileAlias(sourcePath, aliasPath, {
+ subject = 'linked-claimant',
+} = {}) {
+ const source = path.resolve(sourcePath);
+ const alias = path.resolve(aliasPath);
+ const captured = captureRegularFileBinding(source, {
+ subject,
+ expectedLinks: 2,
+ });
+ if (captured.status !== 'captured') return captured;
+ let result;
+ let released;
try {
- current = fs.lstatSync(resolvedPath, { bigint: true });
- } catch (error) {
- if (error.code === 'ENOENT') {
- return relation('absent', `${subject}-already-absent`, { filePath: resolvedPath });
+ const aliasMatches = verifyRegularFileBinding(captured.binding, {
+ filePath: alias,
+ expectedLinks: 2,
+ });
+ if (aliasMatches.status !== 'match') {
+ result = aliasMatches;
+ } else {
+ const removal = quarantineRemoveRegularFileBinding(captured.binding, alias, {
+ subject,
+ expectedLinks: 2,
+ });
+ if (removal.status !== 'removed') {
+ result = removal;
+ } else {
+ const sourceRemains = verifyRegularFileBinding(captured.binding, {
+ filePath: source,
+ expectedLinks: 1,
+ });
+ result = sourceRemains.status === 'match' ? removal : sourceRemains;
+ }
}
- return filesystemFailure(`${subject}-cleanup-inspection-failed`, error, {
- filePath: resolvedPath,
+ } finally {
+ released = releaseRegularFileBinding(captured.binding);
+ }
+ if (released.status !== 'released') {
+ return {
+ ...released,
+ removalStatus: result?.status,
+ ...(result?.recoveryDirectory ? {
+ recoveryDirectory: result.recoveryDirectory,
+ recoveryFile: result.recoveryFile,
+ target: result.target,
+ } : {}),
+ };
+ }
+ return result;
+}
+
+function removePublishedBindingName(binding, filePath, subject) {
+ for (const expectedLinks of [2, 1]) {
+ const matches = verifyRegularFileBinding(binding, { filePath, expectedLinks });
+ if (matches.status === 'match') {
+ return quarantineRemoveRegularFileBinding(binding, filePath, {
+ subject,
+ expectedLinks,
+ });
+ }
+ }
+ return relation('preserved', `${subject}-identity-changed`, { filePath });
+}
+
+function restorePublicationBackup(binding, backupPath, commitPath, subject) {
+ const backupMatches = verifyRegularFileBinding(binding, {
+ filePath: backupPath,
+ expectedLinks: 1,
+ });
+ if (backupMatches.status !== 'match') return backupMatches;
+ try {
+ fs.linkSync(backupPath, commitPath);
+ } catch (error) {
+ return filesystemFailure(
+ error?.code === 'EEXIST'
+ ? `${subject}-restore-blocked`
+ : `${subject}-restore-failed`,
+ error,
+ { backupPath, commitPath },
+ );
+ }
+ for (const linkedPath of [backupPath, commitPath]) {
+ const linked = verifyRegularFileBinding(binding, {
+ filePath: linkedPath,
+ expectedLinks: 2,
});
+ if (linked.status !== 'match') return linked;
}
- if (!current.isFile()
- || current.ino === 0n
- || current.dev !== identity?.device
- || current.ino !== identity?.inode) {
- return relation('preserved', `${subject}-identity-changed`, { filePath: resolvedPath });
+ const retired = quarantineRemoveRegularFileBinding(binding, backupPath, {
+ subject: `${subject}-backup`,
+ expectedLinks: 2,
+ });
+ if (retired.status !== 'removed') return retired;
+ return verifyRegularFileBinding(binding, {
+ filePath: commitPath,
+ expectedLinks: 1,
+ });
+}
+
+/**
+ * Publish a captured candidate without ever replacing an unverified public
+ * entry. Existing output is retained through a bound private backup; the new
+ * name is created with a no-clobber hard link while the candidate descriptor
+ * remains open. Both the staged and public names are then verified through
+ * that descriptor before the staged name is retired via quarantine.
+ * Replacing an existing entry is recoverable but not crash-atomic: the public
+ * name is absent between retiring the verified previous name and linking the
+ * candidate. Portable Node.js exposes no replacement compare-and-swap that
+ * also preserves a late claimant.
+ *
+ * The caller owns `binding` and must release it after this function returns.
+ */
+export function publishRegularFileBinding(binding, candidatePath, snapshot, {
+ subject = 'candidate',
+} = {}) {
+ const candidate = path.resolve(candidatePath);
+ const commitPath = snapshot?.slot?.commitPath;
+ if (typeof commitPath !== 'string') {
+ return relation('unknown', `${subject}-publication-snapshot-unavailable`);
}
+
+ const beforePublish = verifyAtomicOutput(snapshot);
+ if (beforePublish.status !== 'match') return beforePublish;
+ const candidateMatches = verifyRegularFileBinding(binding, {
+ filePath: candidate,
+ expectedLinks: 1,
+ });
+ if (candidateMatches.status !== 'match') return candidateMatches;
+
+ let previousBinding;
+ let recoveryDirectory;
+ let backupPath;
+ let previousBackedUp = false;
+ const finishPrevious = () => {
+ if (!previousBinding) return null;
+ const released = releaseRegularFileBinding(previousBinding);
+ previousBinding = undefined;
+ return released.status === 'released' ? null : released;
+ };
+ const cleanupRecoveryDirectory = () => {
+ if (!recoveryDirectory) return null;
+ const cleanup = removeEmptyQuarantine(recoveryDirectory);
+ if (!cleanup) recoveryDirectory = undefined;
+ return cleanup;
+ };
+ const restorePrevious = () => {
+ if (!previousBinding || !previousBackedUp) return null;
+ return restorePublicationBackup(
+ previousBinding,
+ backupPath,
+ commitPath,
+ 'previous-output',
+ );
+ };
+ const rollback = (failure) => {
+ let publicRemoval = removePublishedBindingName(
+ binding,
+ commitPath,
+ `${subject}-publication`,
+ );
+ if (publicRemoval.status === 'preserved') {
+ const claimantRemoval = quarantineRemoveLinkedRegularFileAlias(
+ candidate,
+ commitPath,
+ { subject: `${subject}-publication-claimant` },
+ );
+ if (claimantRemoval.status === 'removed') publicRemoval = claimantRemoval;
+ }
+ const restored = restorePrevious();
+ const released = finishPrevious();
+ const directoryCleanup = cleanupRecoveryDirectory();
+ return {
+ ...failure,
+ ...(publicRemoval.status !== 'removed' && publicRemoval.status !== 'absent'
+ ? { publicState: publicRemoval.reason } : {}),
+ ...(restored && restored.status !== 'match' ? { restoreState: restored.reason } : {}),
+ ...(released ? { releaseState: released.reason } : {}),
+ ...(directoryCleanup ? {
+ recoveryDirectory: directoryCleanup.reason?.recoveryDirectory || recoveryDirectory,
+ } : {}),
+ ...((restored && restored.status !== 'match') || directoryCleanup
+ ? { recoveryFile: backupPath } : {}),
+ };
+ };
+
+ if (snapshot.target.kind === 'file') {
+ const previous = captureRegularFileBinding(commitPath, {
+ subject: 'previous-output',
+ expectedIdentity: {
+ device: snapshot.target.device,
+ inode: snapshot.target.inode,
+ },
+ expectedMode: snapshot.target.mode,
+ expectedLinks: 1,
+ });
+ if (previous.status !== 'captured') return previous;
+ previousBinding = previous.binding;
+ const quarantine = createRemovalQuarantine(path.dirname(commitPath));
+ if (quarantine.status !== 'created') {
+ const released = finishPrevious();
+ return released || quarantine;
+ }
+ recoveryDirectory = quarantine.directory;
+ backupPath = path.join(recoveryDirectory, 'previous');
+ const backup = backupPublicRegularFileBinding(
+ previousBinding,
+ commitPath,
+ backupPath,
+ { subject: 'previous-output' },
+ );
+ previousBackedUp = backup.status === 'backed-up';
+ if (!previousBackedUp) {
+ const released = finishPrevious();
+ const directoryCleanup = backup.backupCreated ? null : cleanupRecoveryDirectory();
+ return {
+ ...backup,
+ ...(released ? { releaseState: released.reason } : {}),
+ ...(directoryCleanup ? { directoryCleanupState: directoryCleanup.reason } : {}),
+ };
+ }
+ }
+
try {
- fs.unlinkSync(resolvedPath);
- return relation('removed', `${subject}-removed`, { filePath: resolvedPath });
+ fs.linkSync(candidate, commitPath);
} catch (error) {
- if (error.code === 'ENOENT') {
+ return rollback(filesystemFailure(
+ error?.code === 'EEXIST'
+ ? 'target-created-during-commit'
+ : `${subject}-publication-link-failed`,
+ error,
+ { candidatePath: candidate, commitPath },
+ ));
+ }
+
+ const published = verifyRegularFileBinding(binding, {
+ filePath: commitPath,
+ expectedLinks: 2,
+ });
+ const staged = verifyRegularFileBinding(binding, {
+ filePath: candidate,
+ expectedLinks: 2,
+ });
+ if (published.status !== 'match' || staged.status !== 'match') {
+ return rollback(relation('different', `${subject}-identity-changed`, {
+ candidatePath: candidate,
+ commitPath,
+ publishedState: published.reason,
+ stagedState: staged.reason,
+ }));
+ }
+
+ const retired = quarantineRemoveRegularFileBinding(binding, candidate, {
+ subject: `${subject}-staging`,
+ expectedLinks: 2,
+ });
+ if (retired.status !== 'removed' && retired.status !== 'preserved') {
+ return rollback(retired);
+ }
+ const final = verifyRegularFileBinding(binding, {
+ filePath: commitPath,
+ expectedLinks: 1,
+ });
+ if (final.status !== 'match') return rollback(final);
+
+ let cleanupWarning = retired.status === 'preserved' ? retired : undefined;
+ if (previousBinding) {
+ const backupRemoval = quarantineRemoveRegularFileBinding(
+ previousBinding,
+ backupPath,
+ { subject: 'previous-output-backup', expectedLinks: 1 },
+ );
+ if (backupRemoval.status !== 'removed') cleanupWarning = backupRemoval;
+ }
+ const released = finishPrevious();
+ const directoryCleanup = cleanupRecoveryDirectory();
+ cleanupWarning ||= released || directoryCleanup;
+ const recoveryFile = cleanupWarning?.recoveryFile
+ || (retired.status === 'preserved' ? candidate : undefined)
+ || (recoveryDirectory ? backupPath : undefined);
+ return {
+ status: cleanupWarning ? 'committed-with-warning' : 'committed',
+ reason: {
+ code: `${subject}-published`,
+ candidatePath: candidate,
+ commitPath,
+ ...(retired.status === 'preserved' ? { stagedSuccessorPreserved: true } : {}),
+ },
+ ...(cleanupWarning ? {
+ cleanupState: cleanupWarning.reason,
+ ...(recoveryDirectory ? { recoveryDirectory } : {}),
+ ...(recoveryFile ? { recoveryFile } : {}),
+ } : {}),
+ };
+}
+
+/** Remove only the directory entry that still names a caller-owned inode. */
+export function removeOwnedRegularFile(filePath, identity, { subject = 'candidate' } = {}) {
+ const resolvedPath = path.resolve(filePath);
+ let expectedLinks = 1;
+ let captured = captureRegularFileBinding(resolvedPath, {
+ subject,
+ expectedIdentity: identity,
+ expectedLinks,
+ });
+ const reportedLinks = Number(captured.reason?.links);
+ if (captured.status === 'unsupported'
+ && captured.reason?.code === `${subject}-hardlinked`
+ && Number.isSafeInteger(reportedLinks)
+ && reportedLinks > 1) {
+ expectedLinks = reportedLinks;
+ captured = captureRegularFileBinding(resolvedPath, {
+ subject,
+ expectedIdentity: identity,
+ expectedLinks,
+ });
+ }
+ if (captured.status !== 'captured') {
+ if (captured.reason?.systemCode === 'ENOENT') {
return relation('absent', `${subject}-already-absent`, { filePath: resolvedPath });
}
- return filesystemFailure(`${subject}-cleanup-failed`, error, { filePath: resolvedPath });
+ if (captured.status === 'different' || captured.status === 'unsupported') {
+ return relation('preserved', `${subject}-identity-changed`, {
+ filePath: resolvedPath,
+ priorState: captured.reason,
+ });
+ }
+ return captured;
+ }
+
+ let removal;
+ let released;
+ try {
+ removal = quarantineRemoveRegularFileBinding(captured.binding, resolvedPath, {
+ subject,
+ expectedLinks,
+ });
+ } finally {
+ released = releaseRegularFileBinding(captured.binding);
+ }
+ if (released.status !== 'released') {
+ return {
+ ...released,
+ removalStatus: removal?.status,
+ ...(removal?.recoveryDirectory ? {
+ recoveryDirectory: removal.recoveryDirectory,
+ recoveryFile: removal.recoveryFile,
+ target: removal.target,
+ } : {}),
+ };
}
+ return removal;
}
function captureWriteSlot(requestedPath) {
@@ -886,9 +1214,9 @@ function requestedEntryMatches(left, right) {
}
/**
- * Capture the physical directory-entry slot and target identity used by an
- * atomic rename. Hard links are intentionally unsupported: replacing one name
- * cannot update its other names while retaining crash-atomic publication.
+ * Capture the physical directory-entry slot and target identity used by a
+ * verified publication. Hard links are intentionally unsupported: replacing
+ * one name cannot safely update its unknown sibling names.
* `regular-or-absent` additionally rejects requested-entry symlinks and special
* nodes for sidecars whose public name itself must never be followed.
*/
diff --git a/archify/renderers/shared/cli.mjs b/archify/renderers/shared/cli.mjs
index 9ea59822..86e954c1 100644
--- a/archify/renderers/shared/cli.mjs
+++ b/archify/renderers/shared/cli.mjs
@@ -13,10 +13,10 @@ import {
import {
captureAtomicOutput,
captureRegularFileBinding,
+ publishRegularFileBinding,
releaseRegularFileBinding,
removeOwnedRegularFile,
verifyAtomicOutput,
- verifyRegularFileBinding,
} from './atomic-output.mjs';
import { prepareDiagramBrandMarks } from './brand-marks.mjs';
import { resolveLocale, translateMessage } from './i18n.mjs';
@@ -62,9 +62,6 @@ export function loadDiagram({ rendererDir, diagramType, defaultExample, argv = p
const authoredOutput = diagram?.meta?.output;
if (authoredOutput !== undefined) validateAuthoredOutputPath(authoredOutput);
validateSchema(diagramType, diagram);
- if (authoredOutput === undefined && process.env.ARCHIFY_REQUIRE_META_OUTPUT === '1') {
- validateAuthoredOutputPath(authoredOutput);
- }
validateGuidedViews(diagramType, diagram);
validateRelationshipIds(diagramType, diagram);
validateEngineeringProfile(diagramType, diagram);
@@ -259,12 +256,18 @@ export function writeDiagram({ outPath, template, diagramType, meta, svg, cards,
candidateBinding = candidateCapture.binding;
const beforeCommit = verifyAtomicOutput(outputCapture.snapshot);
if (beforeCommit.status !== 'match') throwAtomicOutputFailure(beforeCommit, outPath);
- const verifiedCandidate = verifyRegularFileBinding(candidateBinding);
- if (verifiedCandidate.status !== 'match') throwAtomicOutputFailure(verifiedCandidate, outPath);
+ const publication = publishRegularFileBinding(
+ candidateBinding,
+ candidatePath,
+ outputCapture.snapshot,
+ { subject: 'candidate' },
+ );
+ if (!['committed', 'committed-with-warning'].includes(publication.status)) {
+ throwAtomicOutputFailure(publication, outPath);
+ }
const releasedCandidate = releaseRegularFileBinding(candidateBinding);
candidateBinding = undefined;
if (releasedCandidate.status !== 'released') throwAtomicOutputFailure(releasedCandidate, outPath);
- fs.renameSync(candidatePath, outputCapture.commitPath);
candidatePath = undefined;
candidateIdentity = undefined;
} catch (error) {
diff --git a/archify/renderers/shared/generated-validators.mjs b/archify/renderers/shared/generated-validators.mjs
index 0519c9ca..c49a5024 100644
--- a/archify/renderers/shared/generated-validators.mjs
+++ b/archify/renderers/shared/generated-validators.mjs
@@ -1,6 +1,6 @@
// Generated by scripts/generate-validators.mjs. Do not edit by hand.
import { validatePortablePath } from './portable-path.mjs';
-"use strict";const workflowSchema = validate20;const schema31 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/workflow.schema.json","title":"Archify Workflow Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","lanes","nodes","edges"],"properties":{"schema_version":{"enum":[1,2]},"diagram_type":{"const":"workflow"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"$ref":"common.schema.json#/$defs/portableOutputPath"},"animation":{"enum":["trace","none"]},"visual_preset":{"enum":["classic","signal-flow","blueprint","editorial"]},"quality_profile":{"enum":["standard","showcase"]},"repository":{"$ref":"common.schema.json#/$defs/repository"},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"frontend":{"$ref":"common.schema.json#/$defs/legendEntry"},"backend":{"$ref":"common.schema.json#/$defs/legendEntry"},"database":{"$ref":"common.schema.json#/$defs/legendEntry"},"cloud":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"messagebus":{"$ref":"common.schema.json#/$defs/legendEntry"},"external":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":700},{"type":"number","minimum":240}],"items":false,"minItems":2,"maxItems":2}}},"lanes":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"variant":{"enum":["normal","exception"]}}}},"phases":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","label","fromCol","toCol"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"fromCol":{"type":"integer","minimum":0,"maximum":5},"toCol":{"type":"integer","minimum":0,"maximum":5},"variant":{"enum":["default","emphasis","security","dashed"]}}}},"groups":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","label","lane","fromCol","toCol"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"lane":{"$ref":"common.schema.json#/$defs/id"},"fromCol":{"type":"integer","minimum":0,"maximum":5},"toCol":{"type":"integer","minimum":0,"maximum":5},"variant":{"enum":["default","emphasis","security","dashed"]}}}},"mainPath":{"type":"array","minItems":2,"items":{"$ref":"common.schema.json#/$defs/id"}},"semanticChecks":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"allowedRoots":{"type":"array","items":{"$ref":"common.schema.json#/$defs/id"}},"allowedTerminals":{"type":"array","items":{"$ref":"common.schema.json#/$defs/id"}},"requiredEdges":{"type":"array","items":{"$ref":"#/$defs/semanticRelation"}},"requiredPaths":{"type":"array","items":{"$ref":"#/$defs/semanticRelation"}}}},"nodes":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","lane","col","type","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"lane":{"$ref":"common.schema.json#/$defs/id"},"col":{"type":"integer","minimum":0,"maximum":5},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"sources":{"$ref":"common.schema.json#/$defs/sourceReferences"},"width":{"type":"number","minimum":32},"height":{"type":"number","minimum":32},"yOffset":{"type":"number"}}}},"edges":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"role":{"enum":["main","branch","async","return","error"]},"fromSide":{"$ref":"#/$defs/side"},"toSide":{"$ref":"#/$defs/side"},"route":{"enum":["auto","straight","drop","outside-right","return-left","bottom-channel","up-channel"]},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"channelX":{"type":"number"},"channelY":{"type":"number"},"bias":{"type":"number","minimum":0,"maximum":1},"width":{"type":"number","minimum":0.5}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}},"$defs":{"semanticRelation":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"}}},"side":{"enum":["left","right","top","bottom"]}}};const schema33 = {"enum":["en","zh-CN","es"]};const schema34 = {"description":"A portable POSIX-relative HTML output path. It must be safe to interpret identically on every supported host filesystem.","type":"string","minLength":1,"pattern":"^[^/]+(?:/[^/]+)*$","allOf":[{"pattern":"(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"},{"not":{"pattern":"[\\\\<>:\"|?*\\u0000-\\u001F\\u007F-\\u009F]"}},{"not":{"pattern":"[\\uD800-\\uDFFF]"}},{"not":{"pattern":"(^|/)[.]{1,2}(/|$)"}},{"not":{"pattern":"[. ](/|$)"}},{"not":{"pattern":"(^|/)[^/]{256}"}},{"not":{"pattern":"(^|/)(?:[Cc][Oo][Nn]|[Pp][Rr][Nn]|[Aa][Uu][Xx]|[Nn][Uu][Ll]|[Cc][Oo][Nn][Ii][Nn][$]|[Cc][Oo][Nn][Oo][Uu][Tt][$]|[Cc][Oo][Mm][1-9¹²³]|[Ll][Pp][Tt][1-9¹²³])(?:[.]|/|$)"}},{"not":{"pattern":"(^|/)[^/]*~[1-9][0-9]*(?:[.]|/|$)"}}]};const schema35 = {"type":"object","additionalProperties":false,"required":["url","revision"],"properties":{"url":{"type":"string","minLength":1},"provider":{"enum":["github","gitee"]},"link_mode":{"enum":["web","local-only"]},"revision":{"type":"string","pattern":"^[a-fA-F0-9]{40}$"}}};const schema39 = {"enum":["auto","all","hidden"]};const schema40 = {"type":"object","additionalProperties":false,"minProperties":1,"properties":{"label":{"type":"string","minLength":1,"maxLength":80},"visible":{"type":"boolean"}}};const schema37 = {"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9_-]*$"};const schema59 = {"enum":["frontend","backend","database","cloud","security","messagebus","external"]};const schema60 = {"oneOf":[{"type":"string","minLength":1,"maxLength":2048,"anyOf":[{"maxLength":80,"pattern":"^[^\\r\\n]+$"},{"pattern":"^https?://"}]},{"type":"object","additionalProperties":false,"required":["url","sha256"],"properties":{"url":{"type":"string","minLength":8,"maxLength":2048,"pattern":"^https?://"},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}]};const schema61 = {"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","additionalProperties":false,"required":["path"],"properties":{"path":{"type":"string","minLength":1,"maxLength":240},"line":{"type":"integer","minimum":1},"end_line":{"type":"integer","minimum":1},"label":{"type":"string","minLength":1,"maxLength":48}}}};const schema65 = {"enum":["default","emphasis","security","dashed"]};const schema66 = {"enum":["left","right","top","bottom"]};const schema68 = {"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2};const schema70 = {"type":"array","items":{"type":"object","additionalProperties":false,"required":["dot","title","items"],"properties":{"dot":{"enum":["cyan","emerald","violet","amber","rose","orange","slate"]},"title":{"type":"string","minLength":1},"items":{"type":"array","items":{"type":"string"}}}}};const func1 = Object.prototype.hasOwnProperty;const func3 = function ucs2length(str) {
+"use strict";const workflowSchema = validate20;const schema31 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/workflow.schema.json","title":"Archify Workflow Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","lanes","nodes","edges"],"properties":{"schema_version":{"enum":[1,2]},"diagram_type":{"const":"workflow"},"meta":{"type":"object","additionalProperties":false,"required":["title","output"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"$ref":"common.schema.json#/$defs/portableOutputPath"},"animation":{"enum":["trace","none"]},"visual_preset":{"enum":["classic","signal-flow","blueprint","editorial"]},"quality_profile":{"enum":["standard","showcase"]},"repository":{"$ref":"common.schema.json#/$defs/repository"},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"frontend":{"$ref":"common.schema.json#/$defs/legendEntry"},"backend":{"$ref":"common.schema.json#/$defs/legendEntry"},"database":{"$ref":"common.schema.json#/$defs/legendEntry"},"cloud":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"messagebus":{"$ref":"common.schema.json#/$defs/legendEntry"},"external":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":700},{"type":"number","minimum":240}],"items":false,"minItems":2,"maxItems":2}}},"lanes":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"variant":{"enum":["normal","exception"]}}}},"phases":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","label","fromCol","toCol"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"fromCol":{"type":"integer","minimum":0,"maximum":5},"toCol":{"type":"integer","minimum":0,"maximum":5},"variant":{"enum":["default","emphasis","security","dashed"]}}}},"groups":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","label","lane","fromCol","toCol"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"lane":{"$ref":"common.schema.json#/$defs/id"},"fromCol":{"type":"integer","minimum":0,"maximum":5},"toCol":{"type":"integer","minimum":0,"maximum":5},"variant":{"enum":["default","emphasis","security","dashed"]}}}},"mainPath":{"type":"array","minItems":2,"items":{"$ref":"common.schema.json#/$defs/id"}},"semanticChecks":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"allowedRoots":{"type":"array","items":{"$ref":"common.schema.json#/$defs/id"}},"allowedTerminals":{"type":"array","items":{"$ref":"common.schema.json#/$defs/id"}},"requiredEdges":{"type":"array","items":{"$ref":"#/$defs/semanticRelation"}},"requiredPaths":{"type":"array","items":{"$ref":"#/$defs/semanticRelation"}}}},"nodes":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","lane","col","type","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"lane":{"$ref":"common.schema.json#/$defs/id"},"col":{"type":"integer","minimum":0,"maximum":5},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"sources":{"$ref":"common.schema.json#/$defs/sourceReferences"},"width":{"type":"number","minimum":32},"height":{"type":"number","minimum":32},"yOffset":{"type":"number"}}}},"edges":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"role":{"enum":["main","branch","async","return","error"]},"fromSide":{"$ref":"#/$defs/side"},"toSide":{"$ref":"#/$defs/side"},"route":{"enum":["auto","straight","drop","outside-right","return-left","bottom-channel","up-channel"]},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"channelX":{"type":"number"},"channelY":{"type":"number"},"bias":{"type":"number","minimum":0,"maximum":1},"width":{"type":"number","minimum":0.5}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}},"$defs":{"semanticRelation":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"}}},"side":{"enum":["left","right","top","bottom"]}}};const schema33 = {"enum":["en","zh-CN","es"]};const schema34 = {"description":"A portable POSIX-relative HTML output path. It must be safe to interpret identically on every supported host filesystem.","type":"string","minLength":1,"pattern":"^[^/]+(?:/[^/]+)*$","allOf":[{"pattern":"(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"},{"not":{"pattern":"[\\\\<>:\"|?*\\u0000-\\u001F\\u007F-\\u009F]"}},{"not":{"pattern":"[\\uD800-\\uDFFF]"}},{"not":{"pattern":"(^|/)[.]{1,2}(/|$)"}},{"not":{"pattern":"[. ](/|$)"}},{"not":{"pattern":"(^|/)[^/]{256}"}},{"not":{"pattern":"(^|/)(?:[Cc][Oo][Nn]|[Pp][Rr][Nn]|[Aa][Uu][Xx]|[Nn][Uu][Ll]|[Cc][Oo][Nn][Ii][Nn][$]|[Cc][Oo][Nn][Oo][Uu][Tt][$]|[Cc][Oo][Mm][1-9¹²³]|[Ll][Pp][Tt][1-9¹²³])(?:[.]|/|$)"}},{"not":{"pattern":"(^|/)[^/]*~[1-9][0-9]*(?:[.]|/|$)"}}]};const schema35 = {"type":"object","additionalProperties":false,"required":["url","revision"],"properties":{"url":{"type":"string","minLength":1},"provider":{"enum":["github","gitee"]},"link_mode":{"enum":["web","local-only"]},"revision":{"type":"string","pattern":"^[a-fA-F0-9]{40}$"}}};const schema39 = {"enum":["auto","all","hidden"]};const schema40 = {"type":"object","additionalProperties":false,"minProperties":1,"properties":{"label":{"type":"string","minLength":1,"maxLength":80},"visible":{"type":"boolean"}}};const schema37 = {"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9_-]*$"};const schema59 = {"enum":["frontend","backend","database","cloud","security","messagebus","external"]};const schema60 = {"oneOf":[{"type":"string","minLength":1,"maxLength":2048,"anyOf":[{"maxLength":80,"pattern":"^[^\\r\\n]+$"},{"pattern":"^https?://"}]},{"type":"object","additionalProperties":false,"required":["url","sha256"],"properties":{"url":{"type":"string","minLength":8,"maxLength":2048,"pattern":"^https?://"},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}]};const schema61 = {"type":"array","minItems":1,"maxItems":3,"items":{"type":"object","additionalProperties":false,"required":["path"],"properties":{"path":{"type":"string","minLength":1,"maxLength":240},"line":{"type":"integer","minimum":1},"end_line":{"type":"integer","minimum":1},"label":{"type":"string","minLength":1,"maxLength":48}}}};const schema65 = {"enum":["default","emphasis","security","dashed"]};const schema66 = {"enum":["left","right","top","bottom"]};const schema68 = {"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2};const schema70 = {"type":"array","items":{"type":"object","additionalProperties":false,"required":["dot","title","items"],"properties":{"dot":{"enum":["cyan","emerald","violet","amber","rose","orange","slate"]},"title":{"type":"string","minLength":1},"items":{"type":"array","items":{"type":"string"}}}}};const func1 = Object.prototype.hasOwnProperty;const func3 = function ucs2length(str) {
const len = str.length;
let length = 0;
let pos = 0;
@@ -11,7 +11,7 @@ import { validatePortablePath } from './portable-path.mjs';
&& (str.charCodeAt(pos) & 0xfc00) === 0xdc00) pos += 1;
}
return length;
-};const pattern4 = new RegExp("(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$", "u");const pattern5 = new RegExp("[\\\\<>:\"|?*\\u0000-\\u001F\\u007F-\\u009F]", "u");const pattern6 = new RegExp("[\\uD800-\\uDFFF]", "u");const pattern7 = new RegExp("(^|/)[.]{1,2}(/|$)", "u");const pattern8 = new RegExp("[. ](/|$)", "u");const pattern9 = new RegExp("(^|/)[^/]{256}", "u");const pattern10 = new RegExp("(^|/)(?:[Cc][Oo][Nn]|[Pp][Rr][Nn]|[Aa][Uu][Xx]|[Nn][Uu][Ll]|[Cc][Oo][Nn][Ii][Nn][$]|[Cc][Oo][Nn][Oo][Uu][Tt][$]|[Cc][Oo][Mm][1-9¹²³]|[Ll][Pp][Tt][1-9¹²³])(?:[.]|/|$)", "u");const pattern11 = new RegExp("(^|/)[^/]*~[1-9][0-9]*(?:[.]|/|$)", "u");const pattern12 = new RegExp("^[^/]+(?:/[^/]+)*$", "u");const pattern13 = new RegExp("^[a-fA-F0-9]{40}$", "u");const pattern14 = new RegExp("^[a-zA-Z][a-zA-Z0-9_-]*$", "u");const pattern27 = new RegExp("^[^\\r\\n]+$", "u");const pattern28 = new RegExp("^https?://", "u");const pattern30 = new RegExp("^[a-f0-9]{64}$", "u");const schema36 = {"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["id","label","focus"],"properties":{"id":{"$ref":"#/$defs/id"},"label":{"type":"string","minLength":1,"maxLength":48},"focus":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/id"}},"note":{"type":"string","maxLength":140}}}};function validate22(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate22.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern14.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern14.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate22.errors = vErrors;return errors === 0;}validate22.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};const schema54 = {"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"}}};function validate24(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate24.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.from === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.to === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "from") || (key0 === "to"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.from !== undefined){let data0 = data.from;if(typeof data0 === "string"){if(!pattern14.test(data0)){const err3 = {instancePath:instancePath+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.to !== undefined){let data1 = data.to;if(typeof data1 === "string"){if(!pattern14.test(data1)){const err5 = {instancePath:instancePath+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate24.errors = vErrors;return errors === 0;}validate24.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/workflow.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate20.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.lanes === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lanes"},message:"must have required property '"+"lanes"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.nodes === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "nodes"},message:"must have required property '"+"nodes"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.edges === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "edges"},message:"must have required property '"+"edges"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(func1.call(schema31.properties, key0))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.schema_version !== undefined){let data0 = data.schema_version;if(!((data0 === 1) || (data0 === 2))){const err7 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/enum",keyword:"enum",params:{allowedValues: schema31.properties.schema_version.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.diagram_type !== undefined){if("workflow" !== data.diagram_type){const err8 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "workflow"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key1 in data2){if(!(func1.call(schema31.properties.meta.properties, key1))){const err10 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!(((data4 === "en") || (data4 === "zh-CN")) || (data4 === "es"))){const err13 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err14 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.output !== undefined){let data6 = data2.output;if(typeof data6 === "string"){if(!pattern4.test(data6)){const err15 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/0/pattern",keyword:"pattern",params:{pattern: "(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"},message:"must match pattern \""+"(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"+"\""};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}const _errs18 = errors;const _errs19 = errors;if(typeof data6 === "string"){if(!pattern5.test(data6)){const err16 = {};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}var valid5 = _errs19 === errors;if(valid5){const err17 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/1/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}const _errs21 = errors;const _errs22 = errors;if(typeof data6 === "string"){if(!pattern6.test(data6)){const err18 = {};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}var valid6 = _errs22 === errors;if(valid6){const err19 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/2/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}const _errs24 = errors;const _errs25 = errors;if(typeof data6 === "string"){if(!pattern7.test(data6)){const err20 = {};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}var valid7 = _errs25 === errors;if(valid7){const err21 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/3/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}const _errs27 = errors;const _errs28 = errors;if(typeof data6 === "string"){if(!pattern8.test(data6)){const err22 = {};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}var valid8 = _errs28 === errors;if(valid8){const err23 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/4/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}else {errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}}const _errs30 = errors;const _errs31 = errors;if(typeof data6 === "string"){if(!pattern9.test(data6)){const err24 = {};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}var valid9 = _errs31 === errors;if(valid9){const err25 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/5/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}else {errors = _errs30;if(vErrors !== null){if(_errs30){vErrors.length = _errs30;}else {vErrors = null;}}}const _errs33 = errors;const _errs34 = errors;if(typeof data6 === "string"){if(!pattern10.test(data6)){const err26 = {};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}var valid10 = _errs34 === errors;if(valid10){const err27 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/6/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}else {errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}}const _errs36 = errors;const _errs37 = errors;if(typeof data6 === "string"){if(!pattern11.test(data6)){const err28 = {};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}var valid11 = _errs37 === errors;if(valid11){const err29 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/7/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}else {errors = _errs36;if(vErrors !== null){if(_errs36){vErrors.length = _errs36;}else {vErrors = null;}}}if(typeof data6 === "string"){if(func3(data6) < 1){const err30 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}if(!pattern12.test(data6)){const err31 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/pattern",keyword:"pattern",params:{pattern: "^[^/]+(?:/[^/]+)*$"},message:"must match pattern \""+"^[^/]+(?:/[^/]+)*$"+"\""};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}else {const err32 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err33 = {instancePath:instancePath+"/meta/animation",schemaPath:"#/properties/meta/properties/animation/enum",keyword:"enum",params:{allowedValues: schema31.properties.meta.properties.animation.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err34 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"#/properties/meta/properties/visual_preset/enum",keyword:"enum",params:{allowedValues: schema31.properties.meta.properties.visual_preset.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err35 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"#/properties/meta/properties/quality_profile/enum",keyword:"enum",params:{allowedValues: schema31.properties.meta.properties.quality_profile.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data2.repository !== undefined){let data10 = data2.repository;if(data10 && typeof data10 == "object" && !Array.isArray(data10)){if(data10.url === undefined){const err36 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}if(data10.revision === undefined){const err37 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "revision"},message:"must have required property '"+"revision"+"'"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}for(const key2 in data10){if(!((((key2 === "url") || (key2 === "provider")) || (key2 === "link_mode")) || (key2 === "revision"))){const err38 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}if(data10.url !== undefined){let data11 = data10.url;if(typeof data11 === "string"){if(func3(data11) < 1){const err39 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data10.provider !== undefined){let data12 = data10.provider;if(!((data12 === "github") || (data12 === "gitee"))){const err41 = {instancePath:instancePath+"/meta/repository/provider",schemaPath:"common.schema.json#/$defs/repository/properties/provider/enum",keyword:"enum",params:{allowedValues: schema35.properties.provider.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data10.link_mode !== undefined){let data13 = data10.link_mode;if(!((data13 === "web") || (data13 === "local-only"))){const err42 = {instancePath:instancePath+"/meta/repository/link_mode",schemaPath:"common.schema.json#/$defs/repository/properties/link_mode/enum",keyword:"enum",params:{allowedValues: schema35.properties.link_mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data10.revision !== undefined){let data14 = data10.revision;if(typeof data14 === "string"){if(!pattern13.test(data14)){const err43 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/pattern",keyword:"pattern",params:{pattern: "^[a-fA-F0-9]{40}$"},message:"must match pattern \""+"^[a-fA-F0-9]{40}$"+"\""};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}else {const err44 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}}else {const err45 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data2.views !== undefined){if(!(validate22(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data16 = data2.legend;if(data16 && typeof data16 == "object" && !Array.isArray(data16)){for(const key3 in data16){if(!((key3 === "mode") || (key3 === "entries"))){const err46 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}if(data16.mode !== undefined){let data17 = data16.mode;if(!(((data17 === "auto") || (data17 === "all")) || (data17 === "hidden"))){const err47 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema39.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data16.entries !== undefined){let data18 = data16.entries;if(data18 && typeof data18 == "object" && !Array.isArray(data18)){for(const key4 in data18){if(!(((((((key4 === "frontend") || (key4 === "backend")) || (key4 === "database")) || (key4 === "cloud")) || (key4 === "security")) || (key4 === "messagebus")) || (key4 === "external"))){const err48 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}if(data18.frontend !== undefined){let data19 = data18.frontend;if(data19 && typeof data19 == "object" && !Array.isArray(data19)){if(Object.keys(data19).length < 1){const err49 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}for(const key5 in data19){if(!((key5 === "label") || (key5 === "visible"))){const err50 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}}if(data19.label !== undefined){let data20 = data19.label;if(typeof data20 === "string"){if(func3(data20) > 80){const err51 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}if(func3(data20) < 1){const err52 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}else {const err53 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}if(data19.visible !== undefined){if(typeof data19.visible !== "boolean"){const err54 = {instancePath:instancePath+"/meta/legend/entries/frontend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}}else {const err55 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}if(data18.backend !== undefined){let data22 = data18.backend;if(data22 && typeof data22 == "object" && !Array.isArray(data22)){if(Object.keys(data22).length < 1){const err56 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}for(const key6 in data22){if(!((key6 === "label") || (key6 === "visible"))){const err57 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}if(data22.label !== undefined){let data23 = data22.label;if(typeof data23 === "string"){if(func3(data23) > 80){const err58 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(func3(data23) < 1){const err59 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}}else {const err60 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}if(data22.visible !== undefined){if(typeof data22.visible !== "boolean"){const err61 = {instancePath:instancePath+"/meta/legend/entries/backend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}}else {const err62 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}if(data18.database !== undefined){let data25 = data18.database;if(data25 && typeof data25 == "object" && !Array.isArray(data25)){if(Object.keys(data25).length < 1){const err63 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}for(const key7 in data25){if(!((key7 === "label") || (key7 === "visible"))){const err64 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}}if(data25.label !== undefined){let data26 = data25.label;if(typeof data26 === "string"){if(func3(data26) > 80){const err65 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}if(func3(data26) < 1){const err66 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}else {const err67 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}if(data25.visible !== undefined){if(typeof data25.visible !== "boolean"){const err68 = {instancePath:instancePath+"/meta/legend/entries/database/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}}else {const err69 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}if(data18.cloud !== undefined){let data28 = data18.cloud;if(data28 && typeof data28 == "object" && !Array.isArray(data28)){if(Object.keys(data28).length < 1){const err70 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}for(const key8 in data28){if(!((key8 === "label") || (key8 === "visible"))){const err71 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}if(data28.label !== undefined){let data29 = data28.label;if(typeof data29 === "string"){if(func3(data29) > 80){const err72 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}if(func3(data29) < 1){const err73 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}else {const err74 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}if(data28.visible !== undefined){if(typeof data28.visible !== "boolean"){const err75 = {instancePath:instancePath+"/meta/legend/entries/cloud/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}}else {const err76 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}if(data18.security !== undefined){let data31 = data18.security;if(data31 && typeof data31 == "object" && !Array.isArray(data31)){if(Object.keys(data31).length < 1){const err77 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}for(const key9 in data31){if(!((key9 === "label") || (key9 === "visible"))){const err78 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}}if(data31.label !== undefined){let data32 = data31.label;if(typeof data32 === "string"){if(func3(data32) > 80){const err79 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}if(func3(data32) < 1){const err80 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}}else {const err81 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}if(data31.visible !== undefined){if(typeof data31.visible !== "boolean"){const err82 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}}else {const err83 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}if(data18.messagebus !== undefined){let data34 = data18.messagebus;if(data34 && typeof data34 == "object" && !Array.isArray(data34)){if(Object.keys(data34).length < 1){const err84 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}for(const key10 in data34){if(!((key10 === "label") || (key10 === "visible"))){const err85 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}if(data34.label !== undefined){let data35 = data34.label;if(typeof data35 === "string"){if(func3(data35) > 80){const err86 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}if(func3(data35) < 1){const err87 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}else {const err88 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}if(data34.visible !== undefined){if(typeof data34.visible !== "boolean"){const err89 = {instancePath:instancePath+"/meta/legend/entries/messagebus/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}}else {const err90 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}if(data18.external !== undefined){let data37 = data18.external;if(data37 && typeof data37 == "object" && !Array.isArray(data37)){if(Object.keys(data37).length < 1){const err91 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}for(const key11 in data37){if(!((key11 === "label") || (key11 === "visible"))){const err92 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}if(data37.label !== undefined){let data38 = data37.label;if(typeof data38 === "string"){if(func3(data38) > 80){const err93 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}if(func3(data38) < 1){const err94 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}else {const err95 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}if(data37.visible !== undefined){if(typeof data37.visible !== "boolean"){const err96 = {instancePath:instancePath+"/meta/legend/entries/external/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}}else {const err97 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}else {const err98 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}}else {const err99 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}if(data2.viewBox !== undefined){let data40 = data2.viewBox;if(Array.isArray(data40)){if(data40.length > 2){const err100 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}if(data40.length < 2){const err101 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}const len0 = data40.length;if(len0 > 0){let data41 = data40[0];if((typeof data41 == "number") && (isFinite(data41))){if(data41 < 700 || isNaN(data41)){const err102 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 700},message:"must be >= 700"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}else {const err103 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}if(len0 > 1){let data42 = data40[1];if((typeof data42 == "number") && (isFinite(data42))){if(data42 < 240 || isNaN(data42)){const err104 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 240},message:"must be >= 240"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}else {const err105 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}const len1 = data40.length;if(!(len1 <= 2)){const err106 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}else {const err107 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}}else {const err108 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}if(data.lanes !== undefined){let data43 = data.lanes;if(Array.isArray(data43)){if(data43.length < 1){const err109 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}const len2 = data43.length;for(let i0=0; i0<len2; i0++){let data44 = data43[i0];if(data44 && typeof data44 == "object" && !Array.isArray(data44)){if(data44.id === undefined){const err110 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}if(data44.label === undefined){const err111 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}for(const key12 in data44){if(!(((key12 === "id") || (key12 === "label")) || (key12 === "variant"))){const err112 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}if(data44.id !== undefined){let data45 = data44.id;if(typeof data45 === "string"){if(!pattern14.test(data45)){const err113 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}else {const err114 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}if(data44.label !== undefined){let data46 = data44.label;if(typeof data46 === "string"){if(func3(data46) < 1){const err115 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}else {const err116 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data44.variant !== undefined){let data47 = data44.variant;if(!((data47 === "normal") || (data47 === "exception"))){const err117 = {instancePath:instancePath+"/lanes/" + i0+"/variant",schemaPath:"#/properties/lanes/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema31.properties.lanes.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}}else {const err118 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}}else {const err119 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}if(data.phases !== undefined){let data48 = data.phases;if(Array.isArray(data48)){const len3 = data48.length;for(let i1=0; i1<len3; i1++){let data49 = data48[i1];if(data49 && typeof data49 == "object" && !Array.isArray(data49)){if(data49.id === undefined){const err120 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}if(data49.label === undefined){const err121 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}if(data49.fromCol === undefined){const err122 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "fromCol"},message:"must have required property '"+"fromCol"+"'"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}if(data49.toCol === undefined){const err123 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "toCol"},message:"must have required property '"+"toCol"+"'"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}for(const key13 in data49){if(!(((((key13 === "id") || (key13 === "label")) || (key13 === "fromCol")) || (key13 === "toCol")) || (key13 === "variant"))){const err124 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}if(data49.id !== undefined){let data50 = data49.id;if(typeof data50 === "string"){if(!pattern14.test(data50)){const err125 = {instancePath:instancePath+"/phases/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}else {const err126 = {instancePath:instancePath+"/phases/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}if(data49.label !== undefined){let data51 = data49.label;if(typeof data51 === "string"){if(func3(data51) < 1){const err127 = {instancePath:instancePath+"/phases/" + i1+"/label",schemaPath:"#/properties/phases/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}else {const err128 = {instancePath:instancePath+"/phases/" + i1+"/label",schemaPath:"#/properties/phases/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}if(data49.fromCol !== undefined){let data52 = data49.fromCol;if(!(((typeof data52 == "number") && (!(data52 % 1) && !isNaN(data52))) && (isFinite(data52)))){const err129 = {instancePath:instancePath+"/phases/" + i1+"/fromCol",schemaPath:"#/properties/phases/items/properties/fromCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}if((typeof data52 == "number") && (isFinite(data52))){if(data52 > 5 || isNaN(data52)){const err130 = {instancePath:instancePath+"/phases/" + i1+"/fromCol",schemaPath:"#/properties/phases/items/properties/fromCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}if(data52 < 0 || isNaN(data52)){const err131 = {instancePath:instancePath+"/phases/" + i1+"/fromCol",schemaPath:"#/properties/phases/items/properties/fromCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}}}if(data49.toCol !== undefined){let data53 = data49.toCol;if(!(((typeof data53 == "number") && (!(data53 % 1) && !isNaN(data53))) && (isFinite(data53)))){const err132 = {instancePath:instancePath+"/phases/" + i1+"/toCol",schemaPath:"#/properties/phases/items/properties/toCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}if((typeof data53 == "number") && (isFinite(data53))){if(data53 > 5 || isNaN(data53)){const err133 = {instancePath:instancePath+"/phases/" + i1+"/toCol",schemaPath:"#/properties/phases/items/properties/toCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}if(data53 < 0 || isNaN(data53)){const err134 = {instancePath:instancePath+"/phases/" + i1+"/toCol",schemaPath:"#/properties/phases/items/properties/toCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}}if(data49.variant !== undefined){let data54 = data49.variant;if(!((((data54 === "default") || (data54 === "emphasis")) || (data54 === "security")) || (data54 === "dashed"))){const err135 = {instancePath:instancePath+"/phases/" + i1+"/variant",schemaPath:"#/properties/phases/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema31.properties.phases.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}}else {const err136 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}}else {const err137 = {instancePath:instancePath+"/phases",schemaPath:"#/properties/phases/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}if(data.groups !== undefined){let data55 = data.groups;if(Array.isArray(data55)){const len4 = data55.length;for(let i2=0; i2<len4; i2++){let data56 = data55[i2];if(data56 && typeof data56 == "object" && !Array.isArray(data56)){if(data56.id === undefined){const err138 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}if(data56.label === undefined){const err139 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}if(data56.lane === undefined){const err140 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "lane"},message:"must have required property '"+"lane"+"'"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}if(data56.fromCol === undefined){const err141 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "fromCol"},message:"must have required property '"+"fromCol"+"'"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}if(data56.toCol === undefined){const err142 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "toCol"},message:"must have required property '"+"toCol"+"'"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}for(const key14 in data56){if(!((((((key14 === "id") || (key14 === "label")) || (key14 === "lane")) || (key14 === "fromCol")) || (key14 === "toCol")) || (key14 === "variant"))){const err143 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}if(data56.id !== undefined){let data57 = data56.id;if(typeof data57 === "string"){if(!pattern14.test(data57)){const err144 = {instancePath:instancePath+"/groups/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}else {const err145 = {instancePath:instancePath+"/groups/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}if(data56.label !== undefined){let data58 = data56.label;if(typeof data58 === "string"){if(func3(data58) < 1){const err146 = {instancePath:instancePath+"/groups/" + i2+"/label",schemaPath:"#/properties/groups/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}else {const err147 = {instancePath:instancePath+"/groups/" + i2+"/label",schemaPath:"#/properties/groups/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}if(data56.lane !== undefined){let data59 = data56.lane;if(typeof data59 === "string"){if(!pattern14.test(data59)){const err148 = {instancePath:instancePath+"/groups/" + i2+"/lane",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}}else {const err149 = {instancePath:instancePath+"/groups/" + i2+"/lane",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}}if(data56.fromCol !== undefined){let data60 = data56.fromCol;if(!(((typeof data60 == "number") && (!(data60 % 1) && !isNaN(data60))) && (isFinite(data60)))){const err150 = {instancePath:instancePath+"/groups/" + i2+"/fromCol",schemaPath:"#/properties/groups/items/properties/fromCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}if((typeof data60 == "number") && (isFinite(data60))){if(data60 > 5 || isNaN(data60)){const err151 = {instancePath:instancePath+"/groups/" + i2+"/fromCol",schemaPath:"#/properties/groups/items/properties/fromCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}if(data60 < 0 || isNaN(data60)){const err152 = {instancePath:instancePath+"/groups/" + i2+"/fromCol",schemaPath:"#/properties/groups/items/properties/fromCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}}if(data56.toCol !== undefined){let data61 = data56.toCol;if(!(((typeof data61 == "number") && (!(data61 % 1) && !isNaN(data61))) && (isFinite(data61)))){const err153 = {instancePath:instancePath+"/groups/" + i2+"/toCol",schemaPath:"#/properties/groups/items/properties/toCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}if((typeof data61 == "number") && (isFinite(data61))){if(data61 > 5 || isNaN(data61)){const err154 = {instancePath:instancePath+"/groups/" + i2+"/toCol",schemaPath:"#/properties/groups/items/properties/toCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}if(data61 < 0 || isNaN(data61)){const err155 = {instancePath:instancePath+"/groups/" + i2+"/toCol",schemaPath:"#/properties/groups/items/properties/toCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}}}if(data56.variant !== undefined){let data62 = data56.variant;if(!((((data62 === "default") || (data62 === "emphasis")) || (data62 === "security")) || (data62 === "dashed"))){const err156 = {instancePath:instancePath+"/groups/" + i2+"/variant",schemaPath:"#/properties/groups/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema31.properties.groups.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}}else {const err157 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}}else {const err158 = {instancePath:instancePath+"/groups",schemaPath:"#/properties/groups/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}}if(data.mainPath !== undefined){let data63 = data.mainPath;if(Array.isArray(data63)){if(data63.length < 2){const err159 = {instancePath:instancePath+"/mainPath",schemaPath:"#/properties/mainPath/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}const len5 = data63.length;for(let i3=0; i3<len5; i3++){let data64 = data63[i3];if(typeof data64 === "string"){if(!pattern14.test(data64)){const err160 = {instancePath:instancePath+"/mainPath/" + i3,schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}}else {const err161 = {instancePath:instancePath+"/mainPath/" + i3,schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}}}else {const err162 = {instancePath:instancePath+"/mainPath",schemaPath:"#/properties/mainPath/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}}if(data.semanticChecks !== undefined){let data65 = data.semanticChecks;if(data65 && typeof data65 == "object" && !Array.isArray(data65)){if(Object.keys(data65).length < 1){const err163 = {instancePath:instancePath+"/semanticChecks",schemaPath:"#/properties/semanticChecks/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}for(const key15 in data65){if(!((((key15 === "allowedRoots") || (key15 === "allowedTerminals")) || (key15 === "requiredEdges")) || (key15 === "requiredPaths"))){const err164 = {instancePath:instancePath+"/semanticChecks",schemaPath:"#/properties/semanticChecks/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}}if(data65.allowedRoots !== undefined){let data66 = data65.allowedRoots;if(Array.isArray(data66)){const len6 = data66.length;for(let i4=0; i4<len6; i4++){let data67 = data66[i4];if(typeof data67 === "string"){if(!pattern14.test(data67)){const err165 = {instancePath:instancePath+"/semanticChecks/allowedRoots/" + i4,schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}else {const err166 = {instancePath:instancePath+"/semanticChecks/allowedRoots/" + i4,schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}}else {const err167 = {instancePath:instancePath+"/semanticChecks/allowedRoots",schemaPath:"#/properties/semanticChecks/properties/allowedRoots/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}if(data65.allowedTerminals !== undefined){let data68 = data65.allowedTerminals;if(Array.isArray(data68)){const len7 = data68.length;for(let i5=0; i5<len7; i5++){let data69 = data68[i5];if(typeof data69 === "string"){if(!pattern14.test(data69)){const err168 = {instancePath:instancePath+"/semanticChecks/allowedTerminals/" + i5,schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}else {const err169 = {instancePath:instancePath+"/semanticChecks/allowedTerminals/" + i5,schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}}else {const err170 = {instancePath:instancePath+"/semanticChecks/allowedTerminals",schemaPath:"#/properties/semanticChecks/properties/allowedTerminals/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}if(data65.requiredEdges !== undefined){let data70 = data65.requiredEdges;if(Array.isArray(data70)){const len8 = data70.length;for(let i6=0; i6<len8; i6++){if(!(validate24(data70[i6], {instancePath:instancePath+"/semanticChecks/requiredEdges/" + i6,parentData:data70,parentDataProperty:i6,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate24.errors : vErrors.concat(validate24.errors);errors = vErrors.length;}}}else {const err171 = {instancePath:instancePath+"/semanticChecks/requiredEdges",schemaPath:"#/properties/semanticChecks/properties/requiredEdges/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}if(data65.requiredPaths !== undefined){let data72 = data65.requiredPaths;if(Array.isArray(data72)){const len9 = data72.length;for(let i7=0; i7<len9; i7++){if(!(validate24(data72[i7], {instancePath:instancePath+"/semanticChecks/requiredPaths/" + i7,parentData:data72,parentDataProperty:i7,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate24.errors : vErrors.concat(validate24.errors);errors = vErrors.length;}}}else {const err172 = {instancePath:instancePath+"/semanticChecks/requiredPaths",schemaPath:"#/properties/semanticChecks/properties/requiredPaths/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}}else {const err173 = {instancePath:instancePath+"/semanticChecks",schemaPath:"#/properties/semanticChecks/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}if(data.nodes !== undefined){let data74 = data.nodes;if(Array.isArray(data74)){if(data74.length < 1){const err174 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}const len10 = data74.length;for(let i8=0; i8<len10; i8++){let data75 = data74[i8];if(data75 && typeof data75 == "object" && !Array.isArray(data75)){if(data75.id === undefined){const err175 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}if(data75.lane === undefined){const err176 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "lane"},message:"must have required property '"+"lane"+"'"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}if(data75.col === undefined){const err177 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "col"},message:"must have required property '"+"col"+"'"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}if(data75.type === undefined){const err178 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}if(data75.label === undefined){const err179 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}for(const key16 in data75){if(!(func1.call(schema31.properties.nodes.items.properties, key16))){const err180 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}if(data75.id !== undefined){let data76 = data75.id;if(typeof data76 === "string"){if(!pattern14.test(data76)){const err181 = {instancePath:instancePath+"/nodes/" + i8+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}else {const err182 = {instancePath:instancePath+"/nodes/" + i8+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}if(data75.lane !== undefined){let data77 = data75.lane;if(typeof data77 === "string"){if(!pattern14.test(data77)){const err183 = {instancePath:instancePath+"/nodes/" + i8+"/lane",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}else {const err184 = {instancePath:instancePath+"/nodes/" + i8+"/lane",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}if(data75.col !== undefined){let data78 = data75.col;if(!(((typeof data78 == "number") && (!(data78 % 1) && !isNaN(data78))) && (isFinite(data78)))){const err185 = {instancePath:instancePath+"/nodes/" + i8+"/col",schemaPath:"#/properties/nodes/items/properties/col/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}if((typeof data78 == "number") && (isFinite(data78))){if(data78 > 5 || isNaN(data78)){const err186 = {instancePath:instancePath+"/nodes/" + i8+"/col",schemaPath:"#/properties/nodes/items/properties/col/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}if(data78 < 0 || isNaN(data78)){const err187 = {instancePath:instancePath+"/nodes/" + i8+"/col",schemaPath:"#/properties/nodes/items/properties/col/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}}if(data75.type !== undefined){let data79 = data75.type;if(!(((((((data79 === "frontend") || (data79 === "backend")) || (data79 === "database")) || (data79 === "cloud")) || (data79 === "security")) || (data79 === "messagebus")) || (data79 === "external"))){const err188 = {instancePath:instancePath+"/nodes/" + i8+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema59.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}if(data75.label !== undefined){let data80 = data75.label;if(typeof data80 === "string"){if(func3(data80) < 1){const err189 = {instancePath:instancePath+"/nodes/" + i8+"/label",schemaPath:"#/properties/nodes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}else {const err190 = {instancePath:instancePath+"/nodes/" + i8+"/label",schemaPath:"#/properties/nodes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}if(data75.sublabel !== undefined){if(typeof data75.sublabel !== "string"){const err191 = {instancePath:instancePath+"/nodes/" + i8+"/sublabel",schemaPath:"#/properties/nodes/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}if(data75.tag !== undefined){if(typeof data75.tag !== "string"){const err192 = {instancePath:instancePath+"/nodes/" + i8+"/tag",schemaPath:"#/properties/nodes/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}if(data75.brand !== undefined){let data83 = data75.brand;const _errs213 = errors;let valid66 = false;let passing0 = null;const _errs214 = errors;const _errs216 = errors;let valid67 = false;const _errs217 = errors;if(typeof data83 === "string"){if(func3(data83) > 80){const err193 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}if(!pattern27.test(data83)){const err194 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}var _valid1 = _errs217 === errors;valid67 = valid67 || _valid1;const _errs218 = errors;if(typeof data83 === "string"){if(!pattern28.test(data83)){const err195 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}}var _valid1 = _errs218 === errors;valid67 = valid67 || _valid1;if(!valid67){const err196 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}else {errors = _errs216;if(vErrors !== null){if(_errs216){vErrors.length = _errs216;}else {vErrors = null;}}}if(typeof data83 === "string"){if(func3(data83) > 2048){const err197 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}if(func3(data83) < 1){const err198 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}}else {const err199 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}var _valid0 = _errs214 === errors;if(_valid0){valid66 = true;passing0 = 0;}const _errs219 = errors;if(data83 && typeof data83 == "object" && !Array.isArray(data83)){if(data83.url === undefined){const err200 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}if(data83.sha256 === undefined){const err201 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}for(const key17 in data83){if(!((key17 === "url") || (key17 === "sha256"))){const err202 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key17},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}}if(data83.url !== undefined){let data84 = data83.url;if(typeof data84 === "string"){if(func3(data84) > 2048){const err203 = {instancePath:instancePath+"/nodes/" + i8+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}if(func3(data84) < 8){const err204 = {instancePath:instancePath+"/nodes/" + i8+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}if(!pattern28.test(data84)){const err205 = {instancePath:instancePath+"/nodes/" + i8+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err205];}else {vErrors.push(err205);}errors++;}}else {const err206 = {instancePath:instancePath+"/nodes/" + i8+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err206];}else {vErrors.push(err206);}errors++;}}if(data83.sha256 !== undefined){let data85 = data83.sha256;if(typeof data85 === "string"){if(!pattern30.test(data85)){const err207 = {instancePath:instancePath+"/nodes/" + i8+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err207];}else {vErrors.push(err207);}errors++;}}else {const err208 = {instancePath:instancePath+"/nodes/" + i8+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err208];}else {vErrors.push(err208);}errors++;}}}else {const err209 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err209];}else {vErrors.push(err209);}errors++;}var _valid0 = _errs219 === errors;if(_valid0 && valid66){valid66 = false;passing0 = [passing0, 1];}else {if(_valid0){valid66 = true;passing0 = 1;}}if(!valid66){const err210 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err210];}else {vErrors.push(err210);}errors++;}else {errors = _errs213;if(vErrors !== null){if(_errs213){vErrors.length = _errs213;}else {vErrors = null;}}}}if(data75.sources !== undefined){let data86 = data75.sources;if(Array.isArray(data86)){if(data86.length > 3){const err211 = {instancePath:instancePath+"/nodes/" + i8+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err211];}else {vErrors.push(err211);}errors++;}if(data86.length < 1){const err212 = {instancePath:instancePath+"/nodes/" + i8+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err212];}else {vErrors.push(err212);}errors++;}const len11 = data86.length;for(let i9=0; i9<len11; i9++){let data87 = data86[i9];if(data87 && typeof data87 == "object" && !Array.isArray(data87)){if(data87.path === undefined){const err213 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9,schemaPath:"common.schema.json#/$defs/sourceReferences/items/required",keyword:"required",params:{missingProperty: "path"},message:"must have required property '"+"path"+"'"};if(vErrors === null){vErrors = [err213];}else {vErrors.push(err213);}errors++;}for(const key18 in data87){if(!((((key18 === "path") || (key18 === "line")) || (key18 === "end_line")) || (key18 === "label"))){const err214 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9,schemaPath:"common.schema.json#/$defs/sourceReferences/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key18},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err214];}else {vErrors.push(err214);}errors++;}}if(data87.path !== undefined){let data88 = data87.path;if(typeof data88 === "string"){if(func3(data88) > 240){const err215 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/maxLength",keyword:"maxLength",params:{limit: 240},message:"must NOT have more than 240 characters"};if(vErrors === null){vErrors = [err215];}else {vErrors.push(err215);}errors++;}if(func3(data88) < 1){const err216 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err216];}else {vErrors.push(err216);}errors++;}}else {const err217 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err217];}else {vErrors.push(err217);}errors++;}}if(data87.line !== undefined){let data89 = data87.line;if(!(((typeof data89 == "number") && (!(data89 % 1) && !isNaN(data89))) && (isFinite(data89)))){const err218 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err218];}else {vErrors.push(err218);}errors++;}if((typeof data89 == "number") && (isFinite(data89))){if(data89 < 1 || isNaN(data89)){const err219 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err219];}else {vErrors.push(err219);}errors++;}}}if(data87.end_line !== undefined){let data90 = data87.end_line;if(!(((typeof data90 == "number") && (!(data90 % 1) && !isNaN(data90))) && (isFinite(data90)))){const err220 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err220];}else {vErrors.push(err220);}errors++;}if((typeof data90 == "number") && (isFinite(data90))){if(data90 < 1 || isNaN(data90)){const err221 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err221];}else {vErrors.push(err221);}errors++;}}}if(data87.label !== undefined){let data91 = data87.label;if(typeof data91 === "string"){if(func3(data91) > 48){const err222 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err222];}else {vErrors.push(err222);}errors++;}if(func3(data91) < 1){const err223 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err223];}else {vErrors.push(err223);}errors++;}}else {const err224 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err224];}else {vErrors.push(err224);}errors++;}}}else {const err225 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9,schemaPath:"common.schema.json#/$defs/sourceReferences/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err225];}else {vErrors.push(err225);}errors++;}}}else {const err226 = {instancePath:instancePath+"/nodes/" + i8+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err226];}else {vErrors.push(err226);}errors++;}}if(data75.width !== undefined){let data92 = data75.width;if((typeof data92 == "number") && (isFinite(data92))){if(data92 < 32 || isNaN(data92)){const err227 = {instancePath:instancePath+"/nodes/" + i8+"/width",schemaPath:"#/properties/nodes/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 32},message:"must be >= 32"};if(vErrors === null){vErrors = [err227];}else {vErrors.push(err227);}errors++;}}else {const err228 = {instancePath:instancePath+"/nodes/" + i8+"/width",schemaPath:"#/properties/nodes/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err228];}else {vErrors.push(err228);}errors++;}}if(data75.height !== undefined){let data93 = data75.height;if((typeof data93 == "number") && (isFinite(data93))){if(data93 < 32 || isNaN(data93)){const err229 = {instancePath:instancePath+"/nodes/" + i8+"/height",schemaPath:"#/properties/nodes/items/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 32},message:"must be >= 32"};if(vErrors === null){vErrors = [err229];}else {vErrors.push(err229);}errors++;}}else {const err230 = {instancePath:instancePath+"/nodes/" + i8+"/height",schemaPath:"#/properties/nodes/items/properties/height/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err230];}else {vErrors.push(err230);}errors++;}}if(data75.yOffset !== undefined){let data94 = data75.yOffset;if(!((typeof data94 == "number") && (isFinite(data94)))){const err231 = {instancePath:instancePath+"/nodes/" + i8+"/yOffset",schemaPath:"#/properties/nodes/items/properties/yOffset/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err231];}else {vErrors.push(err231);}errors++;}}}else {const err232 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err232];}else {vErrors.push(err232);}errors++;}}}else {const err233 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err233];}else {vErrors.push(err233);}errors++;}}if(data.edges !== undefined){let data95 = data.edges;if(Array.isArray(data95)){const len12 = data95.length;for(let i10=0; i10<len12; i10++){let data96 = data95[i10];if(data96 && typeof data96 == "object" && !Array.isArray(data96)){if(data96.from === undefined){const err234 = {instancePath:instancePath+"/edges/" + i10,schemaPath:"#/properties/edges/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err234];}else {vErrors.push(err234);}errors++;}if(data96.to === undefined){const err235 = {instancePath:instancePath+"/edges/" + i10,schemaPath:"#/properties/edges/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err235];}else {vErrors.push(err235);}errors++;}for(const key19 in data96){if(!(func1.call(schema31.properties.edges.items.properties, key19))){const err236 = {instancePath:instancePath+"/edges/" + i10,schemaPath:"#/properties/edges/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key19},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err236];}else {vErrors.push(err236);}errors++;}}if(data96.id !== undefined){let data97 = data96.id;if(typeof data97 === "string"){if(!pattern14.test(data97)){const err237 = {instancePath:instancePath+"/edges/" + i10+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err237];}else {vErrors.push(err237);}errors++;}}else {const err238 = {instancePath:instancePath+"/edges/" + i10+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err238];}else {vErrors.push(err238);}errors++;}}if(data96.from !== undefined){let data98 = data96.from;if(typeof data98 === "string"){if(!pattern14.test(data98)){const err239 = {instancePath:instancePath+"/edges/" + i10+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err239];}else {vErrors.push(err239);}errors++;}}else {const err240 = {instancePath:instancePath+"/edges/" + i10+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err240];}else {vErrors.push(err240);}errors++;}}if(data96.to !== undefined){let data99 = data96.to;if(typeof data99 === "string"){if(!pattern14.test(data99)){const err241 = {instancePath:instancePath+"/edges/" + i10+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err241];}else {vErrors.push(err241);}errors++;}}else {const err242 = {instancePath:instancePath+"/edges/" + i10+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err242];}else {vErrors.push(err242);}errors++;}}if(data96.label !== undefined){if(typeof data96.label !== "string"){const err243 = {instancePath:instancePath+"/edges/" + i10+"/label",schemaPath:"#/properties/edges/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err243];}else {vErrors.push(err243);}errors++;}}if(data96.variant !== undefined){let data101 = data96.variant;if(!((((data101 === "default") || (data101 === "emphasis")) || (data101 === "security")) || (data101 === "dashed"))){const err244 = {instancePath:instancePath+"/edges/" + i10+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema65.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err244];}else {vErrors.push(err244);}errors++;}}if(data96.role !== undefined){let data102 = data96.role;if(!(((((data102 === "main") || (data102 === "branch")) || (data102 === "async")) || (data102 === "return")) || (data102 === "error"))){const err245 = {instancePath:instancePath+"/edges/" + i10+"/role",schemaPath:"#/properties/edges/items/properties/role/enum",keyword:"enum",params:{allowedValues: schema31.properties.edges.items.properties.role.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err245];}else {vErrors.push(err245);}errors++;}}if(data96.fromSide !== undefined){let data103 = data96.fromSide;if(!((((data103 === "left") || (data103 === "right")) || (data103 === "top")) || (data103 === "bottom"))){const err246 = {instancePath:instancePath+"/edges/" + i10+"/fromSide",schemaPath:"#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema66.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err246];}else {vErrors.push(err246);}errors++;}}if(data96.toSide !== undefined){let data104 = data96.toSide;if(!((((data104 === "left") || (data104 === "right")) || (data104 === "top")) || (data104 === "bottom"))){const err247 = {instancePath:instancePath+"/edges/" + i10+"/toSide",schemaPath:"#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema66.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err247];}else {vErrors.push(err247);}errors++;}}if(data96.route !== undefined){let data105 = data96.route;if(!(((((((data105 === "auto") || (data105 === "straight")) || (data105 === "drop")) || (data105 === "outside-right")) || (data105 === "return-left")) || (data105 === "bottom-channel")) || (data105 === "up-channel"))){const err248 = {instancePath:instancePath+"/edges/" + i10+"/route",schemaPath:"#/properties/edges/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema31.properties.edges.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err248];}else {vErrors.push(err248);}errors++;}}if(data96.via !== undefined){let data106 = data96.via;if(Array.isArray(data106)){const len13 = data106.length;for(let i11=0; i11<len13; i11++){let data107 = data106[i11];if(Array.isArray(data107)){if(data107.length > 2){const err249 = {instancePath:instancePath+"/edges/" + i10+"/via/" + i11,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err249];}else {vErrors.push(err249);}errors++;}if(data107.length < 2){const err250 = {instancePath:instancePath+"/edges/" + i10+"/via/" + i11,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err250];}else {vErrors.push(err250);}errors++;}const len14 = data107.length;if(len14 > 0){let data108 = data107[0];if(!((typeof data108 == "number") && (isFinite(data108)))){const err251 = {instancePath:instancePath+"/edges/" + i10+"/via/" + i11+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err251];}else {vErrors.push(err251);}errors++;}}if(len14 > 1){let data109 = data107[1];if(!((typeof data109 == "number") && (isFinite(data109)))){const err252 = {instancePath:instancePath+"/edges/" + i10+"/via/" + i11+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err252];}else {vErrors.push(err252);}errors++;}}const len15 = data107.length;if(!(len15 <= 2)){const err253 = {instancePath:instancePath+"/edges/" + i10+"/via/" + i11,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err253];}else {vErrors.push(err253);}errors++;}}else {const err254 = {instancePath:instancePath+"/edges/" + i10+"/via/" + i11,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err254];}else {vErrors.push(err254);}errors++;}}}else {const err255 = {instancePath:instancePath+"/edges/" + i10+"/via",schemaPath:"#/properties/edges/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err255];}else {vErrors.push(err255);}errors++;}}if(data96.labelAt !== undefined){let data110 = data96.labelAt;if(Array.isArray(data110)){if(data110.length > 2){const err256 = {instancePath:instancePath+"/edges/" + i10+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err256];}else {vErrors.push(err256);}errors++;}if(data110.length < 2){const err257 = {instancePath:instancePath+"/edges/" + i10+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err257];}else {vErrors.push(err257);}errors++;}const len16 = data110.length;if(len16 > 0){let data111 = data110[0];if(!((typeof data111 == "number") && (isFinite(data111)))){const err258 = {instancePath:instancePath+"/edges/" + i10+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err258];}else {vErrors.push(err258);}errors++;}}if(len16 > 1){let data112 = data110[1];if(!((typeof data112 == "number") && (isFinite(data112)))){const err259 = {instancePath:instancePath+"/edges/" + i10+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err259];}else {vErrors.push(err259);}errors++;}}const len17 = data110.length;if(!(len17 <= 2)){const err260 = {instancePath:instancePath+"/edges/" + i10+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err260];}else {vErrors.push(err260);}errors++;}}else {const err261 = {instancePath:instancePath+"/edges/" + i10+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err261];}else {vErrors.push(err261);}errors++;}}if(data96.labelDx !== undefined){let data113 = data96.labelDx;if(!((typeof data113 == "number") && (isFinite(data113)))){const err262 = {instancePath:instancePath+"/edges/" + i10+"/labelDx",schemaPath:"#/properties/edges/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err262];}else {vErrors.push(err262);}errors++;}}if(data96.labelDy !== undefined){let data114 = data96.labelDy;if(!((typeof data114 == "number") && (isFinite(data114)))){const err263 = {instancePath:instancePath+"/edges/" + i10+"/labelDy",schemaPath:"#/properties/edges/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err263];}else {vErrors.push(err263);}errors++;}}if(data96.labelSegment !== undefined){let data115 = data96.labelSegment;if(!(((typeof data115 == "number") && (!(data115 % 1) && !isNaN(data115))) && (isFinite(data115)))){const err264 = {instancePath:instancePath+"/edges/" + i10+"/labelSegment",schemaPath:"#/properties/edges/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err264];}else {vErrors.push(err264);}errors++;}if((typeof data115 == "number") && (isFinite(data115))){if(data115 < 0 || isNaN(data115)){const err265 = {instancePath:instancePath+"/edges/" + i10+"/labelSegment",schemaPath:"#/properties/edges/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err265];}else {vErrors.push(err265);}errors++;}}}if(data96.channelX !== undefined){let data116 = data96.channelX;if(!((typeof data116 == "number") && (isFinite(data116)))){const err266 = {instancePath:instancePath+"/edges/" + i10+"/channelX",schemaPath:"#/properties/edges/items/properties/channelX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err266];}else {vErrors.push(err266);}errors++;}}if(data96.channelY !== undefined){let data117 = data96.channelY;if(!((typeof data117 == "number") && (isFinite(data117)))){const err267 = {instancePath:instancePath+"/edges/" + i10+"/channelY",schemaPath:"#/properties/edges/items/properties/channelY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err267];}else {vErrors.push(err267);}errors++;}}if(data96.bias !== undefined){let data118 = data96.bias;if((typeof data118 == "number") && (isFinite(data118))){if(data118 > 1 || isNaN(data118)){const err268 = {instancePath:instancePath+"/edges/" + i10+"/bias",schemaPath:"#/properties/edges/items/properties/bias/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1},message:"must be <= 1"};if(vErrors === null){vErrors = [err268];}else {vErrors.push(err268);}errors++;}if(data118 < 0 || isNaN(data118)){const err269 = {instancePath:instancePath+"/edges/" + i10+"/bias",schemaPath:"#/properties/edges/items/properties/bias/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err269];}else {vErrors.push(err269);}errors++;}}else {const err270 = {instancePath:instancePath+"/edges/" + i10+"/bias",schemaPath:"#/properties/edges/items/properties/bias/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err270];}else {vErrors.push(err270);}errors++;}}if(data96.width !== undefined){let data119 = data96.width;if((typeof data119 == "number") && (isFinite(data119))){if(data119 < 0.5 || isNaN(data119)){const err271 = {instancePath:instancePath+"/edges/" + i10+"/width",schemaPath:"#/properties/edges/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err271];}else {vErrors.push(err271);}errors++;}}else {const err272 = {instancePath:instancePath+"/edges/" + i10+"/width",schemaPath:"#/properties/edges/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err272];}else {vErrors.push(err272);}errors++;}}}else {const err273 = {instancePath:instancePath+"/edges/" + i10,schemaPath:"#/properties/edges/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err273];}else {vErrors.push(err273);}errors++;}}}else {const err274 = {instancePath:instancePath+"/edges",schemaPath:"#/properties/edges/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err274];}else {vErrors.push(err274);}errors++;}}if(data.cards !== undefined){let data120 = data.cards;if(Array.isArray(data120)){const len18 = data120.length;for(let i12=0; i12<len18; i12++){let data121 = data120[i12];if(data121 && typeof data121 == "object" && !Array.isArray(data121)){if(data121.dot === undefined){const err275 = {instancePath:instancePath+"/cards/" + i12,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err275];}else {vErrors.push(err275);}errors++;}if(data121.title === undefined){const err276 = {instancePath:instancePath+"/cards/" + i12,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err276];}else {vErrors.push(err276);}errors++;}if(data121.items === undefined){const err277 = {instancePath:instancePath+"/cards/" + i12,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err277];}else {vErrors.push(err277);}errors++;}for(const key20 in data121){if(!(((key20 === "dot") || (key20 === "title")) || (key20 === "items"))){const err278 = {instancePath:instancePath+"/cards/" + i12,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key20},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err278];}else {vErrors.push(err278);}errors++;}}if(data121.dot !== undefined){let data122 = data121.dot;if(!(((((((data122 === "cyan") || (data122 === "emerald")) || (data122 === "violet")) || (data122 === "amber")) || (data122 === "rose")) || (data122 === "orange")) || (data122 === "slate"))){const err279 = {instancePath:instancePath+"/cards/" + i12+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema70.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err279];}else {vErrors.push(err279);}errors++;}}if(data121.title !== undefined){let data123 = data121.title;if(typeof data123 === "string"){if(func3(data123) < 1){const err280 = {instancePath:instancePath+"/cards/" + i12+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err280];}else {vErrors.push(err280);}errors++;}}else {const err281 = {instancePath:instancePath+"/cards/" + i12+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err281];}else {vErrors.push(err281);}errors++;}}if(data121.items !== undefined){let data124 = data121.items;if(Array.isArray(data124)){const len19 = data124.length;for(let i13=0; i13<len19; i13++){if(typeof data124[i13] !== "string"){const err282 = {instancePath:instancePath+"/cards/" + i12+"/items/" + i13,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err282];}else {vErrors.push(err282);}errors++;}}}else {const err283 = {instancePath:instancePath+"/cards/" + i12+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err283];}else {vErrors.push(err283);}errors++;}}}else {const err284 = {instancePath:instancePath+"/cards/" + i12,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err284];}else {vErrors.push(err284);}errors++;}}}else {const err285 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err285];}else {vErrors.push(err285);}errors++;}}}else {const err286 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err286];}else {vErrors.push(err286);}errors++;}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const sequenceSchema = validate27;const schema71 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/sequence.schema.json","title":"Archify Sequence Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","participants","messages"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"sequence"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"$ref":"common.schema.json#/$defs/portableOutputPath"},"animation":{"$ref":"common.schema.json#/$defs/animation"},"visual_preset":{"$ref":"common.schema.json#/$defs/visualPreset"},"quality_profile":{"$ref":"common.schema.json#/$defs/qualityProfile"},"column_fit":{"description":"Horizontal participant layout. Omit this field or use fixed for the stable 86px boxes and 108px gap. Use spread when a wide viewBox would leave unused horizontal space or meaningful participant labels do not fit the fixed boxes; spread derives wider boxes and gaps from the viewBox without changing participant order or message semantics.","enum":["fixed","spread"]},"repository":{"$ref":"common.schema.json#/$defs/repository"},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"default":{"$ref":"common.schema.json#/$defs/legendEntry"},"emphasis":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"dashed":{"$ref":"common.schema.json#/$defs/legendEntry"},"return":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":480},{"type":"number","minimum":480}],"items":false,"minItems":2,"maxItems":2}}},"participants":{"type":"array","minItems":2,"items":{"type":"object","additionalProperties":false,"required":["id","type","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"sources":{"$ref":"common.schema.json#/$defs/sourceReferences"}}}},"segments":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to","label"],"properties":{"from":{"type":"number"},"to":{"type":"number"},"label":{"type":"string","minLength":1}}}},"messages":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["from","to","y","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"y":{"type":"number","minimum":160},"label":{"type":"string","minLength":1},"variant":{"enum":["default","emphasis","security","dashed","return"]},"note":{"type":"string"}}}},"activations":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["participant","from","to"],"properties":{"participant":{"$ref":"common.schema.json#/$defs/id"},"from":{"type":"number"},"to":{"type":"number"},"type":{"$ref":"common.schema.json#/$defs/componentType"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};const schema74 = {"enum":["trace","none"]};const schema75 = {"enum":["classic","signal-flow","blueprint","editorial"]};const schema76 = {"enum":["standard","showcase"]};function validate28(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate28.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern14.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern14.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate28.errors = vErrors;return errors === 0;}validate28.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate27(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/sequence.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate27.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.participants === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "participants"},message:"must have required property '"+"participants"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.messages === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "messages"},message:"must have required property '"+"messages"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}for(const key0 in data){if(!((((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "participants")) || (key0 === "segments")) || (key0 === "messages")) || (key0 === "activations")) || (key0 === "cards"))){const err5 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err6 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.diagram_type !== undefined){if("sequence" !== data.diagram_type){const err7 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "sequence"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err8 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}for(const key1 in data2){if(!(func1.call(schema71.properties.meta.properties, key1))){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err10 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!(((data4 === "en") || (data4 === "zh-CN")) || (data4 === "es"))){const err12 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err13 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.output !== undefined){let data6 = data2.output;if(typeof data6 === "string"){if(!pattern4.test(data6)){const err14 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/0/pattern",keyword:"pattern",params:{pattern: "(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"},message:"must match pattern \""+"(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"+"\""};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}const _errs18 = errors;const _errs19 = errors;if(typeof data6 === "string"){if(!pattern5.test(data6)){const err15 = {};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}var valid5 = _errs19 === errors;if(valid5){const err16 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/1/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}const _errs21 = errors;const _errs22 = errors;if(typeof data6 === "string"){if(!pattern6.test(data6)){const err17 = {};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}var valid6 = _errs22 === errors;if(valid6){const err18 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/2/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}const _errs24 = errors;const _errs25 = errors;if(typeof data6 === "string"){if(!pattern7.test(data6)){const err19 = {};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}var valid7 = _errs25 === errors;if(valid7){const err20 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/3/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}const _errs27 = errors;const _errs28 = errors;if(typeof data6 === "string"){if(!pattern8.test(data6)){const err21 = {};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}var valid8 = _errs28 === errors;if(valid8){const err22 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/4/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}else {errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}}const _errs30 = errors;const _errs31 = errors;if(typeof data6 === "string"){if(!pattern9.test(data6)){const err23 = {};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}var valid9 = _errs31 === errors;if(valid9){const err24 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/5/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}else {errors = _errs30;if(vErrors !== null){if(_errs30){vErrors.length = _errs30;}else {vErrors = null;}}}const _errs33 = errors;const _errs34 = errors;if(typeof data6 === "string"){if(!pattern10.test(data6)){const err25 = {};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}var valid10 = _errs34 === errors;if(valid10){const err26 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/6/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}else {errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}}const _errs36 = errors;const _errs37 = errors;if(typeof data6 === "string"){if(!pattern11.test(data6)){const err27 = {};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}var valid11 = _errs37 === errors;if(valid11){const err28 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/7/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}else {errors = _errs36;if(vErrors !== null){if(_errs36){vErrors.length = _errs36;}else {vErrors = null;}}}if(typeof data6 === "string"){if(func3(data6) < 1){const err29 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}if(!pattern12.test(data6)){const err30 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/pattern",keyword:"pattern",params:{pattern: "^[^/]+(?:/[^/]+)*$"},message:"must match pattern \""+"^[^/]+(?:/[^/]+)*$"+"\""};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}else {const err31 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err32 = {instancePath:instancePath+"/meta/animation",schemaPath:"common.schema.json#/$defs/animation/enum",keyword:"enum",params:{allowedValues: schema74.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err33 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"common.schema.json#/$defs/visualPreset/enum",keyword:"enum",params:{allowedValues: schema75.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err34 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"common.schema.json#/$defs/qualityProfile/enum",keyword:"enum",params:{allowedValues: schema76.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data2.column_fit !== undefined){let data10 = data2.column_fit;if(!((data10 === "fixed") || (data10 === "spread"))){const err35 = {instancePath:instancePath+"/meta/column_fit",schemaPath:"#/properties/meta/properties/column_fit/enum",keyword:"enum",params:{allowedValues: schema71.properties.meta.properties.column_fit.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data2.repository !== undefined){let data11 = data2.repository;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){if(data11.url === undefined){const err36 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}if(data11.revision === undefined){const err37 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "revision"},message:"must have required property '"+"revision"+"'"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}for(const key2 in data11){if(!((((key2 === "url") || (key2 === "provider")) || (key2 === "link_mode")) || (key2 === "revision"))){const err38 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}if(data11.url !== undefined){let data12 = data11.url;if(typeof data12 === "string"){if(func3(data12) < 1){const err39 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data11.provider !== undefined){let data13 = data11.provider;if(!((data13 === "github") || (data13 === "gitee"))){const err41 = {instancePath:instancePath+"/meta/repository/provider",schemaPath:"common.schema.json#/$defs/repository/properties/provider/enum",keyword:"enum",params:{allowedValues: schema35.properties.provider.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data11.link_mode !== undefined){let data14 = data11.link_mode;if(!((data14 === "web") || (data14 === "local-only"))){const err42 = {instancePath:instancePath+"/meta/repository/link_mode",schemaPath:"common.schema.json#/$defs/repository/properties/link_mode/enum",keyword:"enum",params:{allowedValues: schema35.properties.link_mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data11.revision !== undefined){let data15 = data11.revision;if(typeof data15 === "string"){if(!pattern13.test(data15)){const err43 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/pattern",keyword:"pattern",params:{pattern: "^[a-fA-F0-9]{40}$"},message:"must match pattern \""+"^[a-fA-F0-9]{40}$"+"\""};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}else {const err44 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}}else {const err45 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data2.views !== undefined){if(!(validate28(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate28.errors : vErrors.concat(validate28.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data17 = data2.legend;if(data17 && typeof data17 == "object" && !Array.isArray(data17)){for(const key3 in data17){if(!((key3 === "mode") || (key3 === "entries"))){const err46 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}if(data17.mode !== undefined){let data18 = data17.mode;if(!(((data18 === "auto") || (data18 === "all")) || (data18 === "hidden"))){const err47 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema39.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data17.entries !== undefined){let data19 = data17.entries;if(data19 && typeof data19 == "object" && !Array.isArray(data19)){for(const key4 in data19){if(!(((((key4 === "default") || (key4 === "emphasis")) || (key4 === "security")) || (key4 === "dashed")) || (key4 === "return"))){const err48 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}if(data19.default !== undefined){let data20 = data19.default;if(data20 && typeof data20 == "object" && !Array.isArray(data20)){if(Object.keys(data20).length < 1){const err49 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}for(const key5 in data20){if(!((key5 === "label") || (key5 === "visible"))){const err50 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}}if(data20.label !== undefined){let data21 = data20.label;if(typeof data21 === "string"){if(func3(data21) > 80){const err51 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}if(func3(data21) < 1){const err52 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}else {const err53 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}if(data20.visible !== undefined){if(typeof data20.visible !== "boolean"){const err54 = {instancePath:instancePath+"/meta/legend/entries/default/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}}else {const err55 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}if(data19.emphasis !== undefined){let data23 = data19.emphasis;if(data23 && typeof data23 == "object" && !Array.isArray(data23)){if(Object.keys(data23).length < 1){const err56 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}for(const key6 in data23){if(!((key6 === "label") || (key6 === "visible"))){const err57 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}if(data23.label !== undefined){let data24 = data23.label;if(typeof data24 === "string"){if(func3(data24) > 80){const err58 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(func3(data24) < 1){const err59 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}}else {const err60 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}if(data23.visible !== undefined){if(typeof data23.visible !== "boolean"){const err61 = {instancePath:instancePath+"/meta/legend/entries/emphasis/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}}else {const err62 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}if(data19.security !== undefined){let data26 = data19.security;if(data26 && typeof data26 == "object" && !Array.isArray(data26)){if(Object.keys(data26).length < 1){const err63 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}for(const key7 in data26){if(!((key7 === "label") || (key7 === "visible"))){const err64 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}}if(data26.label !== undefined){let data27 = data26.label;if(typeof data27 === "string"){if(func3(data27) > 80){const err65 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}if(func3(data27) < 1){const err66 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}else {const err67 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}if(data26.visible !== undefined){if(typeof data26.visible !== "boolean"){const err68 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}}else {const err69 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}if(data19.dashed !== undefined){let data29 = data19.dashed;if(data29 && typeof data29 == "object" && !Array.isArray(data29)){if(Object.keys(data29).length < 1){const err70 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}for(const key8 in data29){if(!((key8 === "label") || (key8 === "visible"))){const err71 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}if(data29.label !== undefined){let data30 = data29.label;if(typeof data30 === "string"){if(func3(data30) > 80){const err72 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}if(func3(data30) < 1){const err73 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}else {const err74 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}if(data29.visible !== undefined){if(typeof data29.visible !== "boolean"){const err75 = {instancePath:instancePath+"/meta/legend/entries/dashed/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}}else {const err76 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}if(data19.return !== undefined){let data32 = data19.return;if(data32 && typeof data32 == "object" && !Array.isArray(data32)){if(Object.keys(data32).length < 1){const err77 = {instancePath:instancePath+"/meta/legend/entries/return",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}for(const key9 in data32){if(!((key9 === "label") || (key9 === "visible"))){const err78 = {instancePath:instancePath+"/meta/legend/entries/return",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}}if(data32.label !== undefined){let data33 = data32.label;if(typeof data33 === "string"){if(func3(data33) > 80){const err79 = {instancePath:instancePath+"/meta/legend/entries/return/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}if(func3(data33) < 1){const err80 = {instancePath:instancePath+"/meta/legend/entries/return/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}}else {const err81 = {instancePath:instancePath+"/meta/legend/entries/return/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}if(data32.visible !== undefined){if(typeof data32.visible !== "boolean"){const err82 = {instancePath:instancePath+"/meta/legend/entries/return/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}}else {const err83 = {instancePath:instancePath+"/meta/legend/entries/return",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}}else {const err84 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}}else {const err85 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}if(data2.viewBox !== undefined){let data35 = data2.viewBox;if(Array.isArray(data35)){if(data35.length > 2){const err86 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}if(data35.length < 2){const err87 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}const len0 = data35.length;if(len0 > 0){let data36 = data35[0];if((typeof data36 == "number") && (isFinite(data36))){if(data36 < 480 || isNaN(data36)){const err88 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 480},message:"must be >= 480"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}else {const err89 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}if(len0 > 1){let data37 = data35[1];if((typeof data37 == "number") && (isFinite(data37))){if(data37 < 480 || isNaN(data37)){const err90 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 480},message:"must be >= 480"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}else {const err91 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}const len1 = data35.length;if(!(len1 <= 2)){const err92 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}else {const err93 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}}else {const err94 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(data.participants !== undefined){let data38 = data.participants;if(Array.isArray(data38)){if(data38.length < 2){const err95 = {instancePath:instancePath+"/participants",schemaPath:"#/properties/participants/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}const len2 = data38.length;for(let i0=0; i0<len2; i0++){let data39 = data38[i0];if(data39 && typeof data39 == "object" && !Array.isArray(data39)){if(data39.id === undefined){const err96 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}if(data39.type === undefined){const err97 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}if(data39.label === undefined){const err98 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}for(const key10 in data39){if(!((((((key10 === "id") || (key10 === "type")) || (key10 === "label")) || (key10 === "sublabel")) || (key10 === "brand")) || (key10 === "sources"))){const err99 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}if(data39.id !== undefined){let data40 = data39.id;if(typeof data40 === "string"){if(!pattern14.test(data40)){const err100 = {instancePath:instancePath+"/participants/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}else {const err101 = {instancePath:instancePath+"/participants/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}if(data39.type !== undefined){let data41 = data39.type;if(!(((((((data41 === "frontend") || (data41 === "backend")) || (data41 === "database")) || (data41 === "cloud")) || (data41 === "security")) || (data41 === "messagebus")) || (data41 === "external"))){const err102 = {instancePath:instancePath+"/participants/" + i0+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema59.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}if(data39.label !== undefined){let data42 = data39.label;if(typeof data42 === "string"){if(func3(data42) < 1){const err103 = {instancePath:instancePath+"/participants/" + i0+"/label",schemaPath:"#/properties/participants/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}else {const err104 = {instancePath:instancePath+"/participants/" + i0+"/label",schemaPath:"#/properties/participants/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}if(data39.sublabel !== undefined){if(typeof data39.sublabel !== "string"){const err105 = {instancePath:instancePath+"/participants/" + i0+"/sublabel",schemaPath:"#/properties/participants/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}if(data39.brand !== undefined){let data44 = data39.brand;const _errs126 = errors;let valid37 = false;let passing0 = null;const _errs127 = errors;const _errs129 = errors;let valid38 = false;const _errs130 = errors;if(typeof data44 === "string"){if(func3(data44) > 80){const err106 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}if(!pattern27.test(data44)){const err107 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}var _valid1 = _errs130 === errors;valid38 = valid38 || _valid1;const _errs131 = errors;if(typeof data44 === "string"){if(!pattern28.test(data44)){const err108 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}var _valid1 = _errs131 === errors;valid38 = valid38 || _valid1;if(!valid38){const err109 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}else {errors = _errs129;if(vErrors !== null){if(_errs129){vErrors.length = _errs129;}else {vErrors = null;}}}if(typeof data44 === "string"){if(func3(data44) > 2048){const err110 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}if(func3(data44) < 1){const err111 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}else {const err112 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}var _valid0 = _errs127 === errors;if(_valid0){valid37 = true;passing0 = 0;}const _errs132 = errors;if(data44 && typeof data44 == "object" && !Array.isArray(data44)){if(data44.url === undefined){const err113 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}if(data44.sha256 === undefined){const err114 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}for(const key11 in data44){if(!((key11 === "url") || (key11 === "sha256"))){const err115 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}if(data44.url !== undefined){let data45 = data44.url;if(typeof data45 === "string"){if(func3(data45) > 2048){const err116 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}if(func3(data45) < 8){const err117 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}if(!pattern28.test(data45)){const err118 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}else {const err119 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}if(data44.sha256 !== undefined){let data46 = data44.sha256;if(typeof data46 === "string"){if(!pattern30.test(data46)){const err120 = {instancePath:instancePath+"/participants/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}else {const err121 = {instancePath:instancePath+"/participants/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}}else {const err122 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}var _valid0 = _errs132 === errors;if(_valid0 && valid37){valid37 = false;passing0 = [passing0, 1];}else {if(_valid0){valid37 = true;passing0 = 1;}}if(!valid37){const err123 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}else {errors = _errs126;if(vErrors !== null){if(_errs126){vErrors.length = _errs126;}else {vErrors = null;}}}}if(data39.sources !== undefined){let data47 = data39.sources;if(Array.isArray(data47)){if(data47.length > 3){const err124 = {instancePath:instancePath+"/participants/" + i0+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}if(data47.length < 1){const err125 = {instancePath:instancePath+"/participants/" + i0+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}const len3 = data47.length;for(let i1=0; i1<len3; i1++){let data48 = data47[i1];if(data48 && typeof data48 == "object" && !Array.isArray(data48)){if(data48.path === undefined){const err126 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1,schemaPath:"common.schema.json#/$defs/sourceReferences/items/required",keyword:"required",params:{missingProperty: "path"},message:"must have required property '"+"path"+"'"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}for(const key12 in data48){if(!((((key12 === "path") || (key12 === "line")) || (key12 === "end_line")) || (key12 === "label"))){const err127 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1,schemaPath:"common.schema.json#/$defs/sourceReferences/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}if(data48.path !== undefined){let data49 = data48.path;if(typeof data49 === "string"){if(func3(data49) > 240){const err128 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/maxLength",keyword:"maxLength",params:{limit: 240},message:"must NOT have more than 240 characters"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}if(func3(data49) < 1){const err129 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}}else {const err130 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}}if(data48.line !== undefined){let data50 = data48.line;if(!(((typeof data50 == "number") && (!(data50 % 1) && !isNaN(data50))) && (isFinite(data50)))){const err131 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}if((typeof data50 == "number") && (isFinite(data50))){if(data50 < 1 || isNaN(data50)){const err132 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}}}if(data48.end_line !== undefined){let data51 = data48.end_line;if(!(((typeof data51 == "number") && (!(data51 % 1) && !isNaN(data51))) && (isFinite(data51)))){const err133 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}if((typeof data51 == "number") && (isFinite(data51))){if(data51 < 1 || isNaN(data51)){const err134 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}}if(data48.label !== undefined){let data52 = data48.label;if(typeof data52 === "string"){if(func3(data52) > 48){const err135 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}if(func3(data52) < 1){const err136 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}else {const err137 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}}else {const err138 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1,schemaPath:"common.schema.json#/$defs/sourceReferences/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}}else {const err139 = {instancePath:instancePath+"/participants/" + i0+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}}else {const err140 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}}else {const err141 = {instancePath:instancePath+"/participants",schemaPath:"#/properties/participants/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}}if(data.segments !== undefined){let data53 = data.segments;if(Array.isArray(data53)){const len4 = data53.length;for(let i2=0; i2<len4; i2++){let data54 = data53[i2];if(data54 && typeof data54 == "object" && !Array.isArray(data54)){if(data54.from === undefined){const err142 = {instancePath:instancePath+"/segments/" + i2,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}if(data54.to === undefined){const err143 = {instancePath:instancePath+"/segments/" + i2,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}if(data54.label === undefined){const err144 = {instancePath:instancePath+"/segments/" + i2,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}for(const key13 in data54){if(!(((key13 === "from") || (key13 === "to")) || (key13 === "label"))){const err145 = {instancePath:instancePath+"/segments/" + i2,schemaPath:"#/properties/segments/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}if(data54.from !== undefined){let data55 = data54.from;if(!((typeof data55 == "number") && (isFinite(data55)))){const err146 = {instancePath:instancePath+"/segments/" + i2+"/from",schemaPath:"#/properties/segments/items/properties/from/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}if(data54.to !== undefined){let data56 = data54.to;if(!((typeof data56 == "number") && (isFinite(data56)))){const err147 = {instancePath:instancePath+"/segments/" + i2+"/to",schemaPath:"#/properties/segments/items/properties/to/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}if(data54.label !== undefined){let data57 = data54.label;if(typeof data57 === "string"){if(func3(data57) < 1){const err148 = {instancePath:instancePath+"/segments/" + i2+"/label",schemaPath:"#/properties/segments/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}}else {const err149 = {instancePath:instancePath+"/segments/" + i2+"/label",schemaPath:"#/properties/segments/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}}}else {const err150 = {instancePath:instancePath+"/segments/" + i2,schemaPath:"#/properties/segments/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}}else {const err151 = {instancePath:instancePath+"/segments",schemaPath:"#/properties/segments/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}if(data.messages !== undefined){let data58 = data.messages;if(Array.isArray(data58)){if(data58.length < 1){const err152 = {instancePath:instancePath+"/messages",schemaPath:"#/properties/messages/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}const len5 = data58.length;for(let i3=0; i3<len5; i3++){let data59 = data58[i3];if(data59 && typeof data59 == "object" && !Array.isArray(data59)){if(data59.from === undefined){const err153 = {instancePath:instancePath+"/messages/" + i3,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}if(data59.to === undefined){const err154 = {instancePath:instancePath+"/messages/" + i3,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}if(data59.y === undefined){const err155 = {instancePath:instancePath+"/messages/" + i3,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "y"},message:"must have required property '"+"y"+"'"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}if(data59.label === undefined){const err156 = {instancePath:instancePath+"/messages/" + i3,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}for(const key14 in data59){if(!(((((((key14 === "id") || (key14 === "from")) || (key14 === "to")) || (key14 === "y")) || (key14 === "label")) || (key14 === "variant")) || (key14 === "note"))){const err157 = {instancePath:instancePath+"/messages/" + i3,schemaPath:"#/properties/messages/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}if(data59.id !== undefined){let data60 = data59.id;if(typeof data60 === "string"){if(!pattern14.test(data60)){const err158 = {instancePath:instancePath+"/messages/" + i3+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}}else {const err159 = {instancePath:instancePath+"/messages/" + i3+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}}if(data59.from !== undefined){let data61 = data59.from;if(typeof data61 === "string"){if(!pattern14.test(data61)){const err160 = {instancePath:instancePath+"/messages/" + i3+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}}else {const err161 = {instancePath:instancePath+"/messages/" + i3+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}}if(data59.to !== undefined){let data62 = data59.to;if(typeof data62 === "string"){if(!pattern14.test(data62)){const err162 = {instancePath:instancePath+"/messages/" + i3+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}}else {const err163 = {instancePath:instancePath+"/messages/" + i3+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}}if(data59.y !== undefined){let data63 = data59.y;if((typeof data63 == "number") && (isFinite(data63))){if(data63 < 160 || isNaN(data63)){const err164 = {instancePath:instancePath+"/messages/" + i3+"/y",schemaPath:"#/properties/messages/items/properties/y/minimum",keyword:"minimum",params:{comparison: ">=", limit: 160},message:"must be >= 160"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}}else {const err165 = {instancePath:instancePath+"/messages/" + i3+"/y",schemaPath:"#/properties/messages/items/properties/y/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}if(data59.label !== undefined){let data64 = data59.label;if(typeof data64 === "string"){if(func3(data64) < 1){const err166 = {instancePath:instancePath+"/messages/" + i3+"/label",schemaPath:"#/properties/messages/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}else {const err167 = {instancePath:instancePath+"/messages/" + i3+"/label",schemaPath:"#/properties/messages/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}if(data59.variant !== undefined){let data65 = data59.variant;if(!(((((data65 === "default") || (data65 === "emphasis")) || (data65 === "security")) || (data65 === "dashed")) || (data65 === "return"))){const err168 = {instancePath:instancePath+"/messages/" + i3+"/variant",schemaPath:"#/properties/messages/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema71.properties.messages.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}if(data59.note !== undefined){if(typeof data59.note !== "string"){const err169 = {instancePath:instancePath+"/messages/" + i3+"/note",schemaPath:"#/properties/messages/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}}else {const err170 = {instancePath:instancePath+"/messages/" + i3,schemaPath:"#/properties/messages/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}}else {const err171 = {instancePath:instancePath+"/messages",schemaPath:"#/properties/messages/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}if(data.activations !== undefined){let data67 = data.activations;if(Array.isArray(data67)){const len6 = data67.length;for(let i4=0; i4<len6; i4++){let data68 = data67[i4];if(data68 && typeof data68 == "object" && !Array.isArray(data68)){if(data68.participant === undefined){const err172 = {instancePath:instancePath+"/activations/" + i4,schemaPath:"#/properties/activations/items/required",keyword:"required",params:{missingProperty: "participant"},message:"must have required property '"+"participant"+"'"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}if(data68.from === undefined){const err173 = {instancePath:instancePath+"/activations/" + i4,schemaPath:"#/properties/activations/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}if(data68.to === undefined){const err174 = {instancePath:instancePath+"/activations/" + i4,schemaPath:"#/properties/activations/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}for(const key15 in data68){if(!((((key15 === "participant") || (key15 === "from")) || (key15 === "to")) || (key15 === "type"))){const err175 = {instancePath:instancePath+"/activations/" + i4,schemaPath:"#/properties/activations/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}}if(data68.participant !== undefined){let data69 = data68.participant;if(typeof data69 === "string"){if(!pattern14.test(data69)){const err176 = {instancePath:instancePath+"/activations/" + i4+"/participant",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}}else {const err177 = {instancePath:instancePath+"/activations/" + i4+"/participant",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}}if(data68.from !== undefined){let data70 = data68.from;if(!((typeof data70 == "number") && (isFinite(data70)))){const err178 = {instancePath:instancePath+"/activations/" + i4+"/from",schemaPath:"#/properties/activations/items/properties/from/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}if(data68.to !== undefined){let data71 = data68.to;if(!((typeof data71 == "number") && (isFinite(data71)))){const err179 = {instancePath:instancePath+"/activations/" + i4+"/to",schemaPath:"#/properties/activations/items/properties/to/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}if(data68.type !== undefined){let data72 = data68.type;if(!(((((((data72 === "frontend") || (data72 === "backend")) || (data72 === "database")) || (data72 === "cloud")) || (data72 === "security")) || (data72 === "messagebus")) || (data72 === "external"))){const err180 = {instancePath:instancePath+"/activations/" + i4+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema59.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}}else {const err181 = {instancePath:instancePath+"/activations/" + i4,schemaPath:"#/properties/activations/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}}else {const err182 = {instancePath:instancePath+"/activations",schemaPath:"#/properties/activations/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}if(data.cards !== undefined){let data73 = data.cards;if(Array.isArray(data73)){const len7 = data73.length;for(let i5=0; i5<len7; i5++){let data74 = data73[i5];if(data74 && typeof data74 == "object" && !Array.isArray(data74)){if(data74.dot === undefined){const err183 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}if(data74.title === undefined){const err184 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}if(data74.items === undefined){const err185 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}for(const key16 in data74){if(!(((key16 === "dot") || (key16 === "title")) || (key16 === "items"))){const err186 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}}if(data74.dot !== undefined){let data75 = data74.dot;if(!(((((((data75 === "cyan") || (data75 === "emerald")) || (data75 === "violet")) || (data75 === "amber")) || (data75 === "rose")) || (data75 === "orange")) || (data75 === "slate"))){const err187 = {instancePath:instancePath+"/cards/" + i5+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema70.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}if(data74.title !== undefined){let data76 = data74.title;if(typeof data76 === "string"){if(func3(data76) < 1){const err188 = {instancePath:instancePath+"/cards/" + i5+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}else {const err189 = {instancePath:instancePath+"/cards/" + i5+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}if(data74.items !== undefined){let data77 = data74.items;if(Array.isArray(data77)){const len8 = data77.length;for(let i6=0; i6<len8; i6++){if(typeof data77[i6] !== "string"){const err190 = {instancePath:instancePath+"/cards/" + i5+"/items/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}}else {const err191 = {instancePath:instancePath+"/cards/" + i5+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}}else {const err192 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}}else {const err193 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}}else {const err194 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}validate27.errors = vErrors;return errors === 0;}validate27.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const dataflowSchema = validate30;const schema97 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/dataflow.schema.json","title":"Archify Data Flow Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","stages","nodes","flows"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"dataflow"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"$ref":"common.schema.json#/$defs/portableOutputPath"},"animation":{"$ref":"common.schema.json#/$defs/animation"},"visual_preset":{"$ref":"common.schema.json#/$defs/visualPreset"},"quality_profile":{"$ref":"common.schema.json#/$defs/qualityProfile"},"repository":{"$ref":"common.schema.json#/$defs/repository"},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"default":{"$ref":"common.schema.json#/$defs/legendEntry"},"emphasis":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"dashed":{"$ref":"common.schema.json#/$defs/legendEntry"},"database":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":360},{"type":"number","minimum":360}],"items":false,"minItems":2,"maxItems":2}}},"stages":{"type":"array","minItems":2,"maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["label"],"properties":{"label":{"type":"string","minLength":1}}}},"nodes":{"type":"array","minItems":2,"items":{"type":"object","additionalProperties":false,"required":["id","type","label","stage","row"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"sources":{"$ref":"common.schema.json#/$defs/sourceReferences"},"stage":{"type":"integer","minimum":0},"row":{"type":"integer","minimum":0},"width":{"type":"number","minimum":48},"height":{"type":"number","minimum":36},"yOffset":{"type":"number"}}}},"flows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"classification":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"route":{"enum":["auto","straight","vertical-channel","bottom-channel","top-channel"]},"fromSide":{"$ref":"common.schema.json#/$defs/side"},"toSide":{"$ref":"common.schema.json#/$defs/side"},"channelX":{"type":"number"},"channelY":{"type":"number"},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"width":{"$ref":"common.schema.json#/$defs/relationshipWidth"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};const schema121 = {"enum":["left","right","top","bottom"]};const schema125 = {"type":"number","minimum":0.5};function validate31(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate31.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern14.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern14.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate31.errors = vErrors;return errors === 0;}validate31.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate30(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/dataflow.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate30.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.stages === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "stages"},message:"must have required property '"+"stages"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.nodes === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "nodes"},message:"must have required property '"+"nodes"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.flows === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "flows"},message:"must have required property '"+"flows"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "stages")) || (key0 === "nodes")) || (key0 === "flows")) || (key0 === "cards"))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err7 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.diagram_type !== undefined){if("dataflow" !== data.diagram_type){const err8 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "dataflow"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key1 in data2){if(!(func1.call(schema97.properties.meta.properties, key1))){const err10 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!(((data4 === "en") || (data4 === "zh-CN")) || (data4 === "es"))){const err13 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err14 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.output !== undefined){let data6 = data2.output;if(typeof data6 === "string"){if(!pattern4.test(data6)){const err15 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/0/pattern",keyword:"pattern",params:{pattern: "(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"},message:"must match pattern \""+"(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"+"\""};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}const _errs18 = errors;const _errs19 = errors;if(typeof data6 === "string"){if(!pattern5.test(data6)){const err16 = {};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}var valid5 = _errs19 === errors;if(valid5){const err17 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/1/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}const _errs21 = errors;const _errs22 = errors;if(typeof data6 === "string"){if(!pattern6.test(data6)){const err18 = {};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}var valid6 = _errs22 === errors;if(valid6){const err19 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/2/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}const _errs24 = errors;const _errs25 = errors;if(typeof data6 === "string"){if(!pattern7.test(data6)){const err20 = {};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}var valid7 = _errs25 === errors;if(valid7){const err21 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/3/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}const _errs27 = errors;const _errs28 = errors;if(typeof data6 === "string"){if(!pattern8.test(data6)){const err22 = {};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}var valid8 = _errs28 === errors;if(valid8){const err23 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/4/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}else {errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}}const _errs30 = errors;const _errs31 = errors;if(typeof data6 === "string"){if(!pattern9.test(data6)){const err24 = {};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}var valid9 = _errs31 === errors;if(valid9){const err25 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/5/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}else {errors = _errs30;if(vErrors !== null){if(_errs30){vErrors.length = _errs30;}else {vErrors = null;}}}const _errs33 = errors;const _errs34 = errors;if(typeof data6 === "string"){if(!pattern10.test(data6)){const err26 = {};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}var valid10 = _errs34 === errors;if(valid10){const err27 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/6/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}else {errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}}const _errs36 = errors;const _errs37 = errors;if(typeof data6 === "string"){if(!pattern11.test(data6)){const err28 = {};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}var valid11 = _errs37 === errors;if(valid11){const err29 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/7/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}else {errors = _errs36;if(vErrors !== null){if(_errs36){vErrors.length = _errs36;}else {vErrors = null;}}}if(typeof data6 === "string"){if(func3(data6) < 1){const err30 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}if(!pattern12.test(data6)){const err31 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/pattern",keyword:"pattern",params:{pattern: "^[^/]+(?:/[^/]+)*$"},message:"must match pattern \""+"^[^/]+(?:/[^/]+)*$"+"\""};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}else {const err32 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err33 = {instancePath:instancePath+"/meta/animation",schemaPath:"common.schema.json#/$defs/animation/enum",keyword:"enum",params:{allowedValues: schema74.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err34 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"common.schema.json#/$defs/visualPreset/enum",keyword:"enum",params:{allowedValues: schema75.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err35 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"common.schema.json#/$defs/qualityProfile/enum",keyword:"enum",params:{allowedValues: schema76.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data2.repository !== undefined){let data10 = data2.repository;if(data10 && typeof data10 == "object" && !Array.isArray(data10)){if(data10.url === undefined){const err36 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}if(data10.revision === undefined){const err37 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "revision"},message:"must have required property '"+"revision"+"'"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}for(const key2 in data10){if(!((((key2 === "url") || (key2 === "provider")) || (key2 === "link_mode")) || (key2 === "revision"))){const err38 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}if(data10.url !== undefined){let data11 = data10.url;if(typeof data11 === "string"){if(func3(data11) < 1){const err39 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data10.provider !== undefined){let data12 = data10.provider;if(!((data12 === "github") || (data12 === "gitee"))){const err41 = {instancePath:instancePath+"/meta/repository/provider",schemaPath:"common.schema.json#/$defs/repository/properties/provider/enum",keyword:"enum",params:{allowedValues: schema35.properties.provider.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data10.link_mode !== undefined){let data13 = data10.link_mode;if(!((data13 === "web") || (data13 === "local-only"))){const err42 = {instancePath:instancePath+"/meta/repository/link_mode",schemaPath:"common.schema.json#/$defs/repository/properties/link_mode/enum",keyword:"enum",params:{allowedValues: schema35.properties.link_mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data10.revision !== undefined){let data14 = data10.revision;if(typeof data14 === "string"){if(!pattern13.test(data14)){const err43 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/pattern",keyword:"pattern",params:{pattern: "^[a-fA-F0-9]{40}$"},message:"must match pattern \""+"^[a-fA-F0-9]{40}$"+"\""};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}else {const err44 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}}else {const err45 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data2.views !== undefined){if(!(validate31(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate31.errors : vErrors.concat(validate31.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data16 = data2.legend;if(data16 && typeof data16 == "object" && !Array.isArray(data16)){for(const key3 in data16){if(!((key3 === "mode") || (key3 === "entries"))){const err46 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}if(data16.mode !== undefined){let data17 = data16.mode;if(!(((data17 === "auto") || (data17 === "all")) || (data17 === "hidden"))){const err47 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema39.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data16.entries !== undefined){let data18 = data16.entries;if(data18 && typeof data18 == "object" && !Array.isArray(data18)){for(const key4 in data18){if(!(((((key4 === "default") || (key4 === "emphasis")) || (key4 === "security")) || (key4 === "dashed")) || (key4 === "database"))){const err48 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}if(data18.default !== undefined){let data19 = data18.default;if(data19 && typeof data19 == "object" && !Array.isArray(data19)){if(Object.keys(data19).length < 1){const err49 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}for(const key5 in data19){if(!((key5 === "label") || (key5 === "visible"))){const err50 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}}if(data19.label !== undefined){let data20 = data19.label;if(typeof data20 === "string"){if(func3(data20) > 80){const err51 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}if(func3(data20) < 1){const err52 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}else {const err53 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}if(data19.visible !== undefined){if(typeof data19.visible !== "boolean"){const err54 = {instancePath:instancePath+"/meta/legend/entries/default/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}}else {const err55 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}if(data18.emphasis !== undefined){let data22 = data18.emphasis;if(data22 && typeof data22 == "object" && !Array.isArray(data22)){if(Object.keys(data22).length < 1){const err56 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}for(const key6 in data22){if(!((key6 === "label") || (key6 === "visible"))){const err57 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}if(data22.label !== undefined){let data23 = data22.label;if(typeof data23 === "string"){if(func3(data23) > 80){const err58 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(func3(data23) < 1){const err59 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}}else {const err60 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}if(data22.visible !== undefined){if(typeof data22.visible !== "boolean"){const err61 = {instancePath:instancePath+"/meta/legend/entries/emphasis/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}}else {const err62 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}if(data18.security !== undefined){let data25 = data18.security;if(data25 && typeof data25 == "object" && !Array.isArray(data25)){if(Object.keys(data25).length < 1){const err63 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}for(const key7 in data25){if(!((key7 === "label") || (key7 === "visible"))){const err64 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}}if(data25.label !== undefined){let data26 = data25.label;if(typeof data26 === "string"){if(func3(data26) > 80){const err65 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}if(func3(data26) < 1){const err66 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}else {const err67 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}if(data25.visible !== undefined){if(typeof data25.visible !== "boolean"){const err68 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}}else {const err69 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}if(data18.dashed !== undefined){let data28 = data18.dashed;if(data28 && typeof data28 == "object" && !Array.isArray(data28)){if(Object.keys(data28).length < 1){const err70 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}for(const key8 in data28){if(!((key8 === "label") || (key8 === "visible"))){const err71 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}if(data28.label !== undefined){let data29 = data28.label;if(typeof data29 === "string"){if(func3(data29) > 80){const err72 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}if(func3(data29) < 1){const err73 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}else {const err74 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}if(data28.visible !== undefined){if(typeof data28.visible !== "boolean"){const err75 = {instancePath:instancePath+"/meta/legend/entries/dashed/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}}else {const err76 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}if(data18.database !== undefined){let data31 = data18.database;if(data31 && typeof data31 == "object" && !Array.isArray(data31)){if(Object.keys(data31).length < 1){const err77 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}for(const key9 in data31){if(!((key9 === "label") || (key9 === "visible"))){const err78 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}}if(data31.label !== undefined){let data32 = data31.label;if(typeof data32 === "string"){if(func3(data32) > 80){const err79 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}if(func3(data32) < 1){const err80 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}}else {const err81 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}if(data31.visible !== undefined){if(typeof data31.visible !== "boolean"){const err82 = {instancePath:instancePath+"/meta/legend/entries/database/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}}else {const err83 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}}else {const err84 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}}else {const err85 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}if(data2.viewBox !== undefined){let data34 = data2.viewBox;if(Array.isArray(data34)){if(data34.length > 2){const err86 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}if(data34.length < 2){const err87 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}const len0 = data34.length;if(len0 > 0){let data35 = data34[0];if((typeof data35 == "number") && (isFinite(data35))){if(data35 < 360 || isNaN(data35)){const err88 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 360},message:"must be >= 360"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}else {const err89 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}if(len0 > 1){let data36 = data34[1];if((typeof data36 == "number") && (isFinite(data36))){if(data36 < 360 || isNaN(data36)){const err90 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 360},message:"must be >= 360"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}else {const err91 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}const len1 = data34.length;if(!(len1 <= 2)){const err92 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}else {const err93 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}}else {const err94 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(data.stages !== undefined){let data37 = data.stages;if(Array.isArray(data37)){if(data37.length > 5){const err95 = {instancePath:instancePath+"/stages",schemaPath:"#/properties/stages/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}if(data37.length < 2){const err96 = {instancePath:instancePath+"/stages",schemaPath:"#/properties/stages/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}const len2 = data37.length;for(let i0=0; i0<len2; i0++){let data38 = data37[i0];if(data38 && typeof data38 == "object" && !Array.isArray(data38)){if(data38.label === undefined){const err97 = {instancePath:instancePath+"/stages/" + i0,schemaPath:"#/properties/stages/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}for(const key10 in data38){if(!(key10 === "label")){const err98 = {instancePath:instancePath+"/stages/" + i0,schemaPath:"#/properties/stages/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}if(data38.label !== undefined){let data39 = data38.label;if(typeof data39 === "string"){if(func3(data39) < 1){const err99 = {instancePath:instancePath+"/stages/" + i0+"/label",schemaPath:"#/properties/stages/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}else {const err100 = {instancePath:instancePath+"/stages/" + i0+"/label",schemaPath:"#/properties/stages/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}}else {const err101 = {instancePath:instancePath+"/stages/" + i0,schemaPath:"#/properties/stages/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}}else {const err102 = {instancePath:instancePath+"/stages",schemaPath:"#/properties/stages/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}if(data.nodes !== undefined){let data40 = data.nodes;if(Array.isArray(data40)){if(data40.length < 2){const err103 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}const len3 = data40.length;for(let i1=0; i1<len3; i1++){let data41 = data40[i1];if(data41 && typeof data41 == "object" && !Array.isArray(data41)){if(data41.id === undefined){const err104 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}if(data41.type === undefined){const err105 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}if(data41.label === undefined){const err106 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}if(data41.stage === undefined){const err107 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "stage"},message:"must have required property '"+"stage"+"'"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}if(data41.row === undefined){const err108 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "row"},message:"must have required property '"+"row"+"'"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}for(const key11 in data41){if(!(func1.call(schema97.properties.nodes.items.properties, key11))){const err109 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}if(data41.id !== undefined){let data42 = data41.id;if(typeof data42 === "string"){if(!pattern14.test(data42)){const err110 = {instancePath:instancePath+"/nodes/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}else {const err111 = {instancePath:instancePath+"/nodes/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}if(data41.type !== undefined){let data43 = data41.type;if(!(((((((data43 === "frontend") || (data43 === "backend")) || (data43 === "database")) || (data43 === "cloud")) || (data43 === "security")) || (data43 === "messagebus")) || (data43 === "external"))){const err112 = {instancePath:instancePath+"/nodes/" + i1+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema59.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}if(data41.label !== undefined){let data44 = data41.label;if(typeof data44 === "string"){if(func3(data44) < 1){const err113 = {instancePath:instancePath+"/nodes/" + i1+"/label",schemaPath:"#/properties/nodes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}else {const err114 = {instancePath:instancePath+"/nodes/" + i1+"/label",schemaPath:"#/properties/nodes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}if(data41.sublabel !== undefined){if(typeof data41.sublabel !== "string"){const err115 = {instancePath:instancePath+"/nodes/" + i1+"/sublabel",schemaPath:"#/properties/nodes/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}if(data41.tag !== undefined){if(typeof data41.tag !== "string"){const err116 = {instancePath:instancePath+"/nodes/" + i1+"/tag",schemaPath:"#/properties/nodes/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data41.brand !== undefined){let data47 = data41.brand;const _errs134 = errors;let valid40 = false;let passing0 = null;const _errs135 = errors;const _errs137 = errors;let valid41 = false;const _errs138 = errors;if(typeof data47 === "string"){if(func3(data47) > 80){const err117 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}if(!pattern27.test(data47)){const err118 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}var _valid1 = _errs138 === errors;valid41 = valid41 || _valid1;const _errs139 = errors;if(typeof data47 === "string"){if(!pattern28.test(data47)){const err119 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}var _valid1 = _errs139 === errors;valid41 = valid41 || _valid1;if(!valid41){const err120 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}else {errors = _errs137;if(vErrors !== null){if(_errs137){vErrors.length = _errs137;}else {vErrors = null;}}}if(typeof data47 === "string"){if(func3(data47) > 2048){const err121 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}if(func3(data47) < 1){const err122 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}else {const err123 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}var _valid0 = _errs135 === errors;if(_valid0){valid40 = true;passing0 = 0;}const _errs140 = errors;if(data47 && typeof data47 == "object" && !Array.isArray(data47)){if(data47.url === undefined){const err124 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}if(data47.sha256 === undefined){const err125 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}for(const key12 in data47){if(!((key12 === "url") || (key12 === "sha256"))){const err126 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}if(data47.url !== undefined){let data48 = data47.url;if(typeof data48 === "string"){if(func3(data48) > 2048){const err127 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}if(func3(data48) < 8){const err128 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}if(!pattern28.test(data48)){const err129 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}}else {const err130 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}}if(data47.sha256 !== undefined){let data49 = data47.sha256;if(typeof data49 === "string"){if(!pattern30.test(data49)){const err131 = {instancePath:instancePath+"/nodes/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}}else {const err132 = {instancePath:instancePath+"/nodes/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}}}else {const err133 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}var _valid0 = _errs140 === errors;if(_valid0 && valid40){valid40 = false;passing0 = [passing0, 1];}else {if(_valid0){valid40 = true;passing0 = 1;}}if(!valid40){const err134 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}else {errors = _errs134;if(vErrors !== null){if(_errs134){vErrors.length = _errs134;}else {vErrors = null;}}}}if(data41.sources !== undefined){let data50 = data41.sources;if(Array.isArray(data50)){if(data50.length > 3){const err135 = {instancePath:instancePath+"/nodes/" + i1+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}if(data50.length < 1){const err136 = {instancePath:instancePath+"/nodes/" + i1+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}const len4 = data50.length;for(let i2=0; i2<len4; i2++){let data51 = data50[i2];if(data51 && typeof data51 == "object" && !Array.isArray(data51)){if(data51.path === undefined){const err137 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2,schemaPath:"common.schema.json#/$defs/sourceReferences/items/required",keyword:"required",params:{missingProperty: "path"},message:"must have required property '"+"path"+"'"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}for(const key13 in data51){if(!((((key13 === "path") || (key13 === "line")) || (key13 === "end_line")) || (key13 === "label"))){const err138 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2,schemaPath:"common.schema.json#/$defs/sourceReferences/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}if(data51.path !== undefined){let data52 = data51.path;if(typeof data52 === "string"){if(func3(data52) > 240){const err139 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/maxLength",keyword:"maxLength",params:{limit: 240},message:"must NOT have more than 240 characters"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}if(func3(data52) < 1){const err140 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}else {const err141 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}}if(data51.line !== undefined){let data53 = data51.line;if(!(((typeof data53 == "number") && (!(data53 % 1) && !isNaN(data53))) && (isFinite(data53)))){const err142 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}if((typeof data53 == "number") && (isFinite(data53))){if(data53 < 1 || isNaN(data53)){const err143 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}}if(data51.end_line !== undefined){let data54 = data51.end_line;if(!(((typeof data54 == "number") && (!(data54 % 1) && !isNaN(data54))) && (isFinite(data54)))){const err144 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}if((typeof data54 == "number") && (isFinite(data54))){if(data54 < 1 || isNaN(data54)){const err145 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}}if(data51.label !== undefined){let data55 = data51.label;if(typeof data55 === "string"){if(func3(data55) > 48){const err146 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}if(func3(data55) < 1){const err147 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}else {const err148 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}}}else {const err149 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2,schemaPath:"common.schema.json#/$defs/sourceReferences/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}}}else {const err150 = {instancePath:instancePath+"/nodes/" + i1+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}if(data41.stage !== undefined){let data56 = data41.stage;if(!(((typeof data56 == "number") && (!(data56 % 1) && !isNaN(data56))) && (isFinite(data56)))){const err151 = {instancePath:instancePath+"/nodes/" + i1+"/stage",schemaPath:"#/properties/nodes/items/properties/stage/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}if((typeof data56 == "number") && (isFinite(data56))){if(data56 < 0 || isNaN(data56)){const err152 = {instancePath:instancePath+"/nodes/" + i1+"/stage",schemaPath:"#/properties/nodes/items/properties/stage/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}}if(data41.row !== undefined){let data57 = data41.row;if(!(((typeof data57 == "number") && (!(data57 % 1) && !isNaN(data57))) && (isFinite(data57)))){const err153 = {instancePath:instancePath+"/nodes/" + i1+"/row",schemaPath:"#/properties/nodes/items/properties/row/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}if((typeof data57 == "number") && (isFinite(data57))){if(data57 < 0 || isNaN(data57)){const err154 = {instancePath:instancePath+"/nodes/" + i1+"/row",schemaPath:"#/properties/nodes/items/properties/row/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}}if(data41.width !== undefined){let data58 = data41.width;if((typeof data58 == "number") && (isFinite(data58))){if(data58 < 48 || isNaN(data58)){const err155 = {instancePath:instancePath+"/nodes/" + i1+"/width",schemaPath:"#/properties/nodes/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 48},message:"must be >= 48"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}}else {const err156 = {instancePath:instancePath+"/nodes/" + i1+"/width",schemaPath:"#/properties/nodes/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}if(data41.height !== undefined){let data59 = data41.height;if((typeof data59 == "number") && (isFinite(data59))){if(data59 < 36 || isNaN(data59)){const err157 = {instancePath:instancePath+"/nodes/" + i1+"/height",schemaPath:"#/properties/nodes/items/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 36},message:"must be >= 36"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}else {const err158 = {instancePath:instancePath+"/nodes/" + i1+"/height",schemaPath:"#/properties/nodes/items/properties/height/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}}if(data41.yOffset !== undefined){let data60 = data41.yOffset;if(!((typeof data60 == "number") && (isFinite(data60)))){const err159 = {instancePath:instancePath+"/nodes/" + i1+"/yOffset",schemaPath:"#/properties/nodes/items/properties/yOffset/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}}}else {const err160 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}}}else {const err161 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}}if(data.flows !== undefined){let data61 = data.flows;if(Array.isArray(data61)){const len5 = data61.length;for(let i3=0; i3<len5; i3++){let data62 = data61[i3];if(data62 && typeof data62 == "object" && !Array.isArray(data62)){if(data62.from === undefined){const err162 = {instancePath:instancePath+"/flows/" + i3,schemaPath:"#/properties/flows/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}if(data62.to === undefined){const err163 = {instancePath:instancePath+"/flows/" + i3,schemaPath:"#/properties/flows/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}if(data62.label === undefined){const err164 = {instancePath:instancePath+"/flows/" + i3,schemaPath:"#/properties/flows/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}for(const key14 in data62){if(!(func1.call(schema97.properties.flows.items.properties, key14))){const err165 = {instancePath:instancePath+"/flows/" + i3,schemaPath:"#/properties/flows/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}if(data62.id !== undefined){let data63 = data62.id;if(typeof data63 === "string"){if(!pattern14.test(data63)){const err166 = {instancePath:instancePath+"/flows/" + i3+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}else {const err167 = {instancePath:instancePath+"/flows/" + i3+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}if(data62.from !== undefined){let data64 = data62.from;if(typeof data64 === "string"){if(!pattern14.test(data64)){const err168 = {instancePath:instancePath+"/flows/" + i3+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}else {const err169 = {instancePath:instancePath+"/flows/" + i3+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}if(data62.to !== undefined){let data65 = data62.to;if(typeof data65 === "string"){if(!pattern14.test(data65)){const err170 = {instancePath:instancePath+"/flows/" + i3+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}else {const err171 = {instancePath:instancePath+"/flows/" + i3+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}if(data62.label !== undefined){let data66 = data62.label;if(typeof data66 === "string"){if(func3(data66) < 1){const err172 = {instancePath:instancePath+"/flows/" + i3+"/label",schemaPath:"#/properties/flows/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}else {const err173 = {instancePath:instancePath+"/flows/" + i3+"/label",schemaPath:"#/properties/flows/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}if(data62.classification !== undefined){if(typeof data62.classification !== "string"){const err174 = {instancePath:instancePath+"/flows/" + i3+"/classification",schemaPath:"#/properties/flows/items/properties/classification/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}}if(data62.variant !== undefined){let data68 = data62.variant;if(!((((data68 === "default") || (data68 === "emphasis")) || (data68 === "security")) || (data68 === "dashed"))){const err175 = {instancePath:instancePath+"/flows/" + i3+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema65.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}}if(data62.route !== undefined){let data69 = data62.route;if(!(((((data69 === "auto") || (data69 === "straight")) || (data69 === "vertical-channel")) || (data69 === "bottom-channel")) || (data69 === "top-channel"))){const err176 = {instancePath:instancePath+"/flows/" + i3+"/route",schemaPath:"#/properties/flows/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema97.properties.flows.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}}if(data62.fromSide !== undefined){let data70 = data62.fromSide;if(!((((data70 === "left") || (data70 === "right")) || (data70 === "top")) || (data70 === "bottom"))){const err177 = {instancePath:instancePath+"/flows/" + i3+"/fromSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema121.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}}if(data62.toSide !== undefined){let data71 = data62.toSide;if(!((((data71 === "left") || (data71 === "right")) || (data71 === "top")) || (data71 === "bottom"))){const err178 = {instancePath:instancePath+"/flows/" + i3+"/toSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema121.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}if(data62.channelX !== undefined){let data72 = data62.channelX;if(!((typeof data72 == "number") && (isFinite(data72)))){const err179 = {instancePath:instancePath+"/flows/" + i3+"/channelX",schemaPath:"#/properties/flows/items/properties/channelX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}if(data62.channelY !== undefined){let data73 = data62.channelY;if(!((typeof data73 == "number") && (isFinite(data73)))){const err180 = {instancePath:instancePath+"/flows/" + i3+"/channelY",schemaPath:"#/properties/flows/items/properties/channelY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}if(data62.labelAt !== undefined){let data74 = data62.labelAt;if(Array.isArray(data74)){if(data74.length > 2){const err181 = {instancePath:instancePath+"/flows/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}if(data74.length < 2){const err182 = {instancePath:instancePath+"/flows/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}const len6 = data74.length;if(len6 > 0){let data75 = data74[0];if(!((typeof data75 == "number") && (isFinite(data75)))){const err183 = {instancePath:instancePath+"/flows/" + i3+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}if(len6 > 1){let data76 = data74[1];if(!((typeof data76 == "number") && (isFinite(data76)))){const err184 = {instancePath:instancePath+"/flows/" + i3+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}const len7 = data74.length;if(!(len7 <= 2)){const err185 = {instancePath:instancePath+"/flows/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}else {const err186 = {instancePath:instancePath+"/flows/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}}if(data62.labelDx !== undefined){let data77 = data62.labelDx;if(!((typeof data77 == "number") && (isFinite(data77)))){const err187 = {instancePath:instancePath+"/flows/" + i3+"/labelDx",schemaPath:"#/properties/flows/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}if(data62.labelDy !== undefined){let data78 = data62.labelDy;if(!((typeof data78 == "number") && (isFinite(data78)))){const err188 = {instancePath:instancePath+"/flows/" + i3+"/labelDy",schemaPath:"#/properties/flows/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}if(data62.labelSegment !== undefined){let data79 = data62.labelSegment;if(!(((typeof data79 == "number") && (!(data79 % 1) && !isNaN(data79))) && (isFinite(data79)))){const err189 = {instancePath:instancePath+"/flows/" + i3+"/labelSegment",schemaPath:"#/properties/flows/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}if((typeof data79 == "number") && (isFinite(data79))){if(data79 < 0 || isNaN(data79)){const err190 = {instancePath:instancePath+"/flows/" + i3+"/labelSegment",schemaPath:"#/properties/flows/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}}if(data62.via !== undefined){let data80 = data62.via;if(Array.isArray(data80)){const len8 = data80.length;for(let i4=0; i4<len8; i4++){let data81 = data80[i4];if(Array.isArray(data81)){if(data81.length > 2){const err191 = {instancePath:instancePath+"/flows/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}if(data81.length < 2){const err192 = {instancePath:instancePath+"/flows/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}const len9 = data81.length;if(len9 > 0){let data82 = data81[0];if(!((typeof data82 == "number") && (isFinite(data82)))){const err193 = {instancePath:instancePath+"/flows/" + i3+"/via/" + i4+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}if(len9 > 1){let data83 = data81[1];if(!((typeof data83 == "number") && (isFinite(data83)))){const err194 = {instancePath:instancePath+"/flows/" + i3+"/via/" + i4+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}const len10 = data81.length;if(!(len10 <= 2)){const err195 = {instancePath:instancePath+"/flows/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}}else {const err196 = {instancePath:instancePath+"/flows/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}}}else {const err197 = {instancePath:instancePath+"/flows/" + i3+"/via",schemaPath:"#/properties/flows/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}}if(data62.width !== undefined){let data84 = data62.width;if((typeof data84 == "number") && (isFinite(data84))){if(data84 < 0.5 || isNaN(data84)){const err198 = {instancePath:instancePath+"/flows/" + i3+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}}else {const err199 = {instancePath:instancePath+"/flows/" + i3+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}}}else {const err200 = {instancePath:instancePath+"/flows/" + i3,schemaPath:"#/properties/flows/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}}}else {const err201 = {instancePath:instancePath+"/flows",schemaPath:"#/properties/flows/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}}if(data.cards !== undefined){let data85 = data.cards;if(Array.isArray(data85)){const len11 = data85.length;for(let i5=0; i5<len11; i5++){let data86 = data85[i5];if(data86 && typeof data86 == "object" && !Array.isArray(data86)){if(data86.dot === undefined){const err202 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}if(data86.title === undefined){const err203 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}if(data86.items === undefined){const err204 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}for(const key15 in data86){if(!(((key15 === "dot") || (key15 === "title")) || (key15 === "items"))){const err205 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err205];}else {vErrors.push(err205);}errors++;}}if(data86.dot !== undefined){let data87 = data86.dot;if(!(((((((data87 === "cyan") || (data87 === "emerald")) || (data87 === "violet")) || (data87 === "amber")) || (data87 === "rose")) || (data87 === "orange")) || (data87 === "slate"))){const err206 = {instancePath:instancePath+"/cards/" + i5+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema70.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err206];}else {vErrors.push(err206);}errors++;}}if(data86.title !== undefined){let data88 = data86.title;if(typeof data88 === "string"){if(func3(data88) < 1){const err207 = {instancePath:instancePath+"/cards/" + i5+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err207];}else {vErrors.push(err207);}errors++;}}else {const err208 = {instancePath:instancePath+"/cards/" + i5+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err208];}else {vErrors.push(err208);}errors++;}}if(data86.items !== undefined){let data89 = data86.items;if(Array.isArray(data89)){const len12 = data89.length;for(let i6=0; i6<len12; i6++){if(typeof data89[i6] !== "string"){const err209 = {instancePath:instancePath+"/cards/" + i5+"/items/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err209];}else {vErrors.push(err209);}errors++;}}}else {const err210 = {instancePath:instancePath+"/cards/" + i5+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err210];}else {vErrors.push(err210);}errors++;}}}else {const err211 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err211];}else {vErrors.push(err211);}errors++;}}}else {const err212 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err212];}else {vErrors.push(err212);}errors++;}}}else {const err213 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err213];}else {vErrors.push(err213);}errors++;}validate30.errors = vErrors;return errors === 0;}validate30.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const lifecycleSchema = validate33;const schema127 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/lifecycle.schema.json","title":"Archify Lifecycle Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","lanes","states","transitions"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"lifecycle"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"$ref":"common.schema.json#/$defs/portableOutputPath"},"animation":{"$ref":"common.schema.json#/$defs/animation"},"visual_preset":{"$ref":"common.schema.json#/$defs/visualPreset"},"quality_profile":{"$ref":"common.schema.json#/$defs/qualityProfile"},"repository":{"$ref":"common.schema.json#/$defs/repository"},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"start":{"$ref":"common.schema.json#/$defs/legendEntry"},"active":{"$ref":"common.schema.json#/$defs/legendEntry"},"waiting":{"$ref":"common.schema.json#/$defs/legendEntry"},"decision":{"$ref":"common.schema.json#/$defs/legendEntry"},"success":{"$ref":"common.schema.json#/$defs/legendEntry"},"failure":{"$ref":"common.schema.json#/$defs/legendEntry"},"neutral":{"$ref":"common.schema.json#/$defs/legendEntry"},"external":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":420},{"type":"number","minimum":566}],"items":false,"minItems":2,"maxItems":2}}},"lanes":{"type":"array","minItems":1,"maxItems":4,"items":{"type":"object","additionalProperties":false,"required":["id","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1}}}},"states":{"type":"array","minItems":2,"items":{"type":"object","additionalProperties":false,"required":["id","type","label","lane","col"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"enum":["start","active","waiting","decision","success","failure","neutral","external"]},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"sources":{"$ref":"common.schema.json#/$defs/sourceReferences"},"step":{"type":"string"},"lane":{"$ref":"common.schema.json#/$defs/id"},"col":{"type":"integer","minimum":0,"maximum":4},"width":{"type":"number","minimum":48},"height":{"type":"number","minimum":36},"yOffset":{"type":"number"}}}},"transitions":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string"},"note":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"route":{"enum":["auto","straight","drop","bottom-channel","top-channel","right-channel","left-channel"]},"fromSide":{"$ref":"common.schema.json#/$defs/side"},"toSide":{"$ref":"common.schema.json#/$defs/side"},"channelX":{"type":"number"},"channelY":{"type":"number"},"cornerRadius":{"type":"number","minimum":0},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"width":{"$ref":"common.schema.json#/$defs/relationshipWidth"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};function validate34(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate34.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern14.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern14.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate34.errors = vErrors;return errors === 0;}validate34.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate33(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/lifecycle.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate33.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.lanes === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lanes"},message:"must have required property '"+"lanes"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.states === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "states"},message:"must have required property '"+"states"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.transitions === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "transitions"},message:"must have required property '"+"transitions"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "lanes")) || (key0 === "states")) || (key0 === "transitions")) || (key0 === "cards"))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err7 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.diagram_type !== undefined){if("lifecycle" !== data.diagram_type){const err8 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "lifecycle"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key1 in data2){if(!(func1.call(schema127.properties.meta.properties, key1))){const err10 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!(((data4 === "en") || (data4 === "zh-CN")) || (data4 === "es"))){const err13 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err14 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.output !== undefined){let data6 = data2.output;if(typeof data6 === "string"){if(!pattern4.test(data6)){const err15 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/0/pattern",keyword:"pattern",params:{pattern: "(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"},message:"must match pattern \""+"(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"+"\""};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}const _errs18 = errors;const _errs19 = errors;if(typeof data6 === "string"){if(!pattern5.test(data6)){const err16 = {};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}var valid5 = _errs19 === errors;if(valid5){const err17 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/1/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}const _errs21 = errors;const _errs22 = errors;if(typeof data6 === "string"){if(!pattern6.test(data6)){const err18 = {};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}var valid6 = _errs22 === errors;if(valid6){const err19 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/2/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}const _errs24 = errors;const _errs25 = errors;if(typeof data6 === "string"){if(!pattern7.test(data6)){const err20 = {};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}var valid7 = _errs25 === errors;if(valid7){const err21 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/3/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}const _errs27 = errors;const _errs28 = errors;if(typeof data6 === "string"){if(!pattern8.test(data6)){const err22 = {};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}var valid8 = _errs28 === errors;if(valid8){const err23 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/4/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}else {errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}}const _errs30 = errors;const _errs31 = errors;if(typeof data6 === "string"){if(!pattern9.test(data6)){const err24 = {};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}var valid9 = _errs31 === errors;if(valid9){const err25 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/5/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}else {errors = _errs30;if(vErrors !== null){if(_errs30){vErrors.length = _errs30;}else {vErrors = null;}}}const _errs33 = errors;const _errs34 = errors;if(typeof data6 === "string"){if(!pattern10.test(data6)){const err26 = {};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}var valid10 = _errs34 === errors;if(valid10){const err27 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/6/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}else {errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}}const _errs36 = errors;const _errs37 = errors;if(typeof data6 === "string"){if(!pattern11.test(data6)){const err28 = {};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}var valid11 = _errs37 === errors;if(valid11){const err29 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/7/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}else {errors = _errs36;if(vErrors !== null){if(_errs36){vErrors.length = _errs36;}else {vErrors = null;}}}if(typeof data6 === "string"){if(func3(data6) < 1){const err30 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}if(!pattern12.test(data6)){const err31 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/pattern",keyword:"pattern",params:{pattern: "^[^/]+(?:/[^/]+)*$"},message:"must match pattern \""+"^[^/]+(?:/[^/]+)*$"+"\""};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}else {const err32 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err33 = {instancePath:instancePath+"/meta/animation",schemaPath:"common.schema.json#/$defs/animation/enum",keyword:"enum",params:{allowedValues: schema74.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err34 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"common.schema.json#/$defs/visualPreset/enum",keyword:"enum",params:{allowedValues: schema75.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err35 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"common.schema.json#/$defs/qualityProfile/enum",keyword:"enum",params:{allowedValues: schema76.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data2.repository !== undefined){let data10 = data2.repository;if(data10 && typeof data10 == "object" && !Array.isArray(data10)){if(data10.url === undefined){const err36 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}if(data10.revision === undefined){const err37 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "revision"},message:"must have required property '"+"revision"+"'"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}for(const key2 in data10){if(!((((key2 === "url") || (key2 === "provider")) || (key2 === "link_mode")) || (key2 === "revision"))){const err38 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}if(data10.url !== undefined){let data11 = data10.url;if(typeof data11 === "string"){if(func3(data11) < 1){const err39 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data10.provider !== undefined){let data12 = data10.provider;if(!((data12 === "github") || (data12 === "gitee"))){const err41 = {instancePath:instancePath+"/meta/repository/provider",schemaPath:"common.schema.json#/$defs/repository/properties/provider/enum",keyword:"enum",params:{allowedValues: schema35.properties.provider.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data10.link_mode !== undefined){let data13 = data10.link_mode;if(!((data13 === "web") || (data13 === "local-only"))){const err42 = {instancePath:instancePath+"/meta/repository/link_mode",schemaPath:"common.schema.json#/$defs/repository/properties/link_mode/enum",keyword:"enum",params:{allowedValues: schema35.properties.link_mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data10.revision !== undefined){let data14 = data10.revision;if(typeof data14 === "string"){if(!pattern13.test(data14)){const err43 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/pattern",keyword:"pattern",params:{pattern: "^[a-fA-F0-9]{40}$"},message:"must match pattern \""+"^[a-fA-F0-9]{40}$"+"\""};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}else {const err44 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}}else {const err45 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data2.views !== undefined){if(!(validate34(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data16 = data2.legend;if(data16 && typeof data16 == "object" && !Array.isArray(data16)){for(const key3 in data16){if(!((key3 === "mode") || (key3 === "entries"))){const err46 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}if(data16.mode !== undefined){let data17 = data16.mode;if(!(((data17 === "auto") || (data17 === "all")) || (data17 === "hidden"))){const err47 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema39.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data16.entries !== undefined){let data18 = data16.entries;if(data18 && typeof data18 == "object" && !Array.isArray(data18)){for(const key4 in data18){if(!((((((((key4 === "start") || (key4 === "active")) || (key4 === "waiting")) || (key4 === "decision")) || (key4 === "success")) || (key4 === "failure")) || (key4 === "neutral")) || (key4 === "external"))){const err48 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}if(data18.start !== undefined){let data19 = data18.start;if(data19 && typeof data19 == "object" && !Array.isArray(data19)){if(Object.keys(data19).length < 1){const err49 = {instancePath:instancePath+"/meta/legend/entries/start",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}for(const key5 in data19){if(!((key5 === "label") || (key5 === "visible"))){const err50 = {instancePath:instancePath+"/meta/legend/entries/start",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}}if(data19.label !== undefined){let data20 = data19.label;if(typeof data20 === "string"){if(func3(data20) > 80){const err51 = {instancePath:instancePath+"/meta/legend/entries/start/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}if(func3(data20) < 1){const err52 = {instancePath:instancePath+"/meta/legend/entries/start/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}else {const err53 = {instancePath:instancePath+"/meta/legend/entries/start/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}if(data19.visible !== undefined){if(typeof data19.visible !== "boolean"){const err54 = {instancePath:instancePath+"/meta/legend/entries/start/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}}else {const err55 = {instancePath:instancePath+"/meta/legend/entries/start",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}if(data18.active !== undefined){let data22 = data18.active;if(data22 && typeof data22 == "object" && !Array.isArray(data22)){if(Object.keys(data22).length < 1){const err56 = {instancePath:instancePath+"/meta/legend/entries/active",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}for(const key6 in data22){if(!((key6 === "label") || (key6 === "visible"))){const err57 = {instancePath:instancePath+"/meta/legend/entries/active",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}if(data22.label !== undefined){let data23 = data22.label;if(typeof data23 === "string"){if(func3(data23) > 80){const err58 = {instancePath:instancePath+"/meta/legend/entries/active/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(func3(data23) < 1){const err59 = {instancePath:instancePath+"/meta/legend/entries/active/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}}else {const err60 = {instancePath:instancePath+"/meta/legend/entries/active/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}if(data22.visible !== undefined){if(typeof data22.visible !== "boolean"){const err61 = {instancePath:instancePath+"/meta/legend/entries/active/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}}else {const err62 = {instancePath:instancePath+"/meta/legend/entries/active",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}if(data18.waiting !== undefined){let data25 = data18.waiting;if(data25 && typeof data25 == "object" && !Array.isArray(data25)){if(Object.keys(data25).length < 1){const err63 = {instancePath:instancePath+"/meta/legend/entries/waiting",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}for(const key7 in data25){if(!((key7 === "label") || (key7 === "visible"))){const err64 = {instancePath:instancePath+"/meta/legend/entries/waiting",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}}if(data25.label !== undefined){let data26 = data25.label;if(typeof data26 === "string"){if(func3(data26) > 80){const err65 = {instancePath:instancePath+"/meta/legend/entries/waiting/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}if(func3(data26) < 1){const err66 = {instancePath:instancePath+"/meta/legend/entries/waiting/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}else {const err67 = {instancePath:instancePath+"/meta/legend/entries/waiting/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}if(data25.visible !== undefined){if(typeof data25.visible !== "boolean"){const err68 = {instancePath:instancePath+"/meta/legend/entries/waiting/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}}else {const err69 = {instancePath:instancePath+"/meta/legend/entries/waiting",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}if(data18.decision !== undefined){let data28 = data18.decision;if(data28 && typeof data28 == "object" && !Array.isArray(data28)){if(Object.keys(data28).length < 1){const err70 = {instancePath:instancePath+"/meta/legend/entries/decision",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}for(const key8 in data28){if(!((key8 === "label") || (key8 === "visible"))){const err71 = {instancePath:instancePath+"/meta/legend/entries/decision",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}if(data28.label !== undefined){let data29 = data28.label;if(typeof data29 === "string"){if(func3(data29) > 80){const err72 = {instancePath:instancePath+"/meta/legend/entries/decision/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}if(func3(data29) < 1){const err73 = {instancePath:instancePath+"/meta/legend/entries/decision/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}else {const err74 = {instancePath:instancePath+"/meta/legend/entries/decision/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}if(data28.visible !== undefined){if(typeof data28.visible !== "boolean"){const err75 = {instancePath:instancePath+"/meta/legend/entries/decision/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}}else {const err76 = {instancePath:instancePath+"/meta/legend/entries/decision",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}if(data18.success !== undefined){let data31 = data18.success;if(data31 && typeof data31 == "object" && !Array.isArray(data31)){if(Object.keys(data31).length < 1){const err77 = {instancePath:instancePath+"/meta/legend/entries/success",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}for(const key9 in data31){if(!((key9 === "label") || (key9 === "visible"))){const err78 = {instancePath:instancePath+"/meta/legend/entries/success",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}}if(data31.label !== undefined){let data32 = data31.label;if(typeof data32 === "string"){if(func3(data32) > 80){const err79 = {instancePath:instancePath+"/meta/legend/entries/success/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}if(func3(data32) < 1){const err80 = {instancePath:instancePath+"/meta/legend/entries/success/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}}else {const err81 = {instancePath:instancePath+"/meta/legend/entries/success/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}if(data31.visible !== undefined){if(typeof data31.visible !== "boolean"){const err82 = {instancePath:instancePath+"/meta/legend/entries/success/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}}else {const err83 = {instancePath:instancePath+"/meta/legend/entries/success",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}if(data18.failure !== undefined){let data34 = data18.failure;if(data34 && typeof data34 == "object" && !Array.isArray(data34)){if(Object.keys(data34).length < 1){const err84 = {instancePath:instancePath+"/meta/legend/entries/failure",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}for(const key10 in data34){if(!((key10 === "label") || (key10 === "visible"))){const err85 = {instancePath:instancePath+"/meta/legend/entries/failure",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}if(data34.label !== undefined){let data35 = data34.label;if(typeof data35 === "string"){if(func3(data35) > 80){const err86 = {instancePath:instancePath+"/meta/legend/entries/failure/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}if(func3(data35) < 1){const err87 = {instancePath:instancePath+"/meta/legend/entries/failure/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}else {const err88 = {instancePath:instancePath+"/meta/legend/entries/failure/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}if(data34.visible !== undefined){if(typeof data34.visible !== "boolean"){const err89 = {instancePath:instancePath+"/meta/legend/entries/failure/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}}else {const err90 = {instancePath:instancePath+"/meta/legend/entries/failure",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}if(data18.neutral !== undefined){let data37 = data18.neutral;if(data37 && typeof data37 == "object" && !Array.isArray(data37)){if(Object.keys(data37).length < 1){const err91 = {instancePath:instancePath+"/meta/legend/entries/neutral",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}for(const key11 in data37){if(!((key11 === "label") || (key11 === "visible"))){const err92 = {instancePath:instancePath+"/meta/legend/entries/neutral",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}if(data37.label !== undefined){let data38 = data37.label;if(typeof data38 === "string"){if(func3(data38) > 80){const err93 = {instancePath:instancePath+"/meta/legend/entries/neutral/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}if(func3(data38) < 1){const err94 = {instancePath:instancePath+"/meta/legend/entries/neutral/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}else {const err95 = {instancePath:instancePath+"/meta/legend/entries/neutral/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}if(data37.visible !== undefined){if(typeof data37.visible !== "boolean"){const err96 = {instancePath:instancePath+"/meta/legend/entries/neutral/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}}else {const err97 = {instancePath:instancePath+"/meta/legend/entries/neutral",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}if(data18.external !== undefined){let data40 = data18.external;if(data40 && typeof data40 == "object" && !Array.isArray(data40)){if(Object.keys(data40).length < 1){const err98 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}for(const key12 in data40){if(!((key12 === "label") || (key12 === "visible"))){const err99 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}if(data40.label !== undefined){let data41 = data40.label;if(typeof data41 === "string"){if(func3(data41) > 80){const err100 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}if(func3(data41) < 1){const err101 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}else {const err102 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}if(data40.visible !== undefined){if(typeof data40.visible !== "boolean"){const err103 = {instancePath:instancePath+"/meta/legend/entries/external/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}}else {const err104 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}}else {const err105 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}}else {const err106 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}if(data2.viewBox !== undefined){let data43 = data2.viewBox;if(Array.isArray(data43)){if(data43.length > 2){const err107 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}if(data43.length < 2){const err108 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}const len0 = data43.length;if(len0 > 0){let data44 = data43[0];if((typeof data44 == "number") && (isFinite(data44))){if(data44 < 420 || isNaN(data44)){const err109 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 420},message:"must be >= 420"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}else {const err110 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}if(len0 > 1){let data45 = data43[1];if((typeof data45 == "number") && (isFinite(data45))){if(data45 < 566 || isNaN(data45)){const err111 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 566},message:"must be >= 566"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}else {const err112 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}const len1 = data43.length;if(!(len1 <= 2)){const err113 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}else {const err114 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}}else {const err115 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}if(data.lanes !== undefined){let data46 = data.lanes;if(Array.isArray(data46)){if(data46.length > 4){const err116 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/maxItems",keyword:"maxItems",params:{limit: 4},message:"must NOT have more than 4 items"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}if(data46.length < 1){const err117 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}const len2 = data46.length;for(let i0=0; i0<len2; i0++){let data47 = data46[i0];if(data47 && typeof data47 == "object" && !Array.isArray(data47)){if(data47.id === undefined){const err118 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}if(data47.label === undefined){const err119 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}for(const key13 in data47){if(!((key13 === "id") || (key13 === "label"))){const err120 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data47.id !== undefined){let data48 = data47.id;if(typeof data48 === "string"){if(!pattern14.test(data48)){const err121 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}else {const err122 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}if(data47.label !== undefined){let data49 = data47.label;if(typeof data49 === "string"){if(func3(data49) < 1){const err123 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}else {const err124 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}}else {const err125 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}}else {const err126 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}if(data.states !== undefined){let data50 = data.states;if(Array.isArray(data50)){if(data50.length < 2){const err127 = {instancePath:instancePath+"/states",schemaPath:"#/properties/states/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}const len3 = data50.length;for(let i1=0; i1<len3; i1++){let data51 = data50[i1];if(data51 && typeof data51 == "object" && !Array.isArray(data51)){if(data51.id === undefined){const err128 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}if(data51.type === undefined){const err129 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}if(data51.label === undefined){const err130 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}if(data51.lane === undefined){const err131 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "lane"},message:"must have required property '"+"lane"+"'"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}if(data51.col === undefined){const err132 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "col"},message:"must have required property '"+"col"+"'"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}for(const key14 in data51){if(!(func1.call(schema127.properties.states.items.properties, key14))){const err133 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}if(data51.id !== undefined){let data52 = data51.id;if(typeof data52 === "string"){if(!pattern14.test(data52)){const err134 = {instancePath:instancePath+"/states/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}else {const err135 = {instancePath:instancePath+"/states/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}if(data51.type !== undefined){let data53 = data51.type;if(!((((((((data53 === "start") || (data53 === "active")) || (data53 === "waiting")) || (data53 === "decision")) || (data53 === "success")) || (data53 === "failure")) || (data53 === "neutral")) || (data53 === "external"))){const err136 = {instancePath:instancePath+"/states/" + i1+"/type",schemaPath:"#/properties/states/items/properties/type/enum",keyword:"enum",params:{allowedValues: schema127.properties.states.items.properties.type.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}if(data51.label !== undefined){let data54 = data51.label;if(typeof data54 === "string"){if(func3(data54) < 1){const err137 = {instancePath:instancePath+"/states/" + i1+"/label",schemaPath:"#/properties/states/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}else {const err138 = {instancePath:instancePath+"/states/" + i1+"/label",schemaPath:"#/properties/states/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}if(data51.sublabel !== undefined){if(typeof data51.sublabel !== "string"){const err139 = {instancePath:instancePath+"/states/" + i1+"/sublabel",schemaPath:"#/properties/states/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}if(data51.tag !== undefined){if(typeof data51.tag !== "string"){const err140 = {instancePath:instancePath+"/states/" + i1+"/tag",schemaPath:"#/properties/states/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}if(data51.brand !== undefined){let data57 = data51.brand;const _errs160 = errors;let valid46 = false;let passing0 = null;const _errs161 = errors;const _errs163 = errors;let valid47 = false;const _errs164 = errors;if(typeof data57 === "string"){if(func3(data57) > 80){const err141 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}if(!pattern27.test(data57)){const err142 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}}var _valid1 = _errs164 === errors;valid47 = valid47 || _valid1;const _errs165 = errors;if(typeof data57 === "string"){if(!pattern28.test(data57)){const err143 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}var _valid1 = _errs165 === errors;valid47 = valid47 || _valid1;if(!valid47){const err144 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}else {errors = _errs163;if(vErrors !== null){if(_errs163){vErrors.length = _errs163;}else {vErrors = null;}}}if(typeof data57 === "string"){if(func3(data57) > 2048){const err145 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}if(func3(data57) < 1){const err146 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}else {const err147 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}var _valid0 = _errs161 === errors;if(_valid0){valid46 = true;passing0 = 0;}const _errs166 = errors;if(data57 && typeof data57 == "object" && !Array.isArray(data57)){if(data57.url === undefined){const err148 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}if(data57.sha256 === undefined){const err149 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}for(const key15 in data57){if(!((key15 === "url") || (key15 === "sha256"))){const err150 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}if(data57.url !== undefined){let data58 = data57.url;if(typeof data58 === "string"){if(func3(data58) > 2048){const err151 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}if(func3(data58) < 8){const err152 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}if(!pattern28.test(data58)){const err153 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}else {const err154 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}if(data57.sha256 !== undefined){let data59 = data57.sha256;if(typeof data59 === "string"){if(!pattern30.test(data59)){const err155 = {instancePath:instancePath+"/states/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}}else {const err156 = {instancePath:instancePath+"/states/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}}else {const err157 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}var _valid0 = _errs166 === errors;if(_valid0 && valid46){valid46 = false;passing0 = [passing0, 1];}else {if(_valid0){valid46 = true;passing0 = 1;}}if(!valid46){const err158 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}else {errors = _errs160;if(vErrors !== null){if(_errs160){vErrors.length = _errs160;}else {vErrors = null;}}}}if(data51.sources !== undefined){let data60 = data51.sources;if(Array.isArray(data60)){if(data60.length > 3){const err159 = {instancePath:instancePath+"/states/" + i1+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}if(data60.length < 1){const err160 = {instancePath:instancePath+"/states/" + i1+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}const len4 = data60.length;for(let i2=0; i2<len4; i2++){let data61 = data60[i2];if(data61 && typeof data61 == "object" && !Array.isArray(data61)){if(data61.path === undefined){const err161 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2,schemaPath:"common.schema.json#/$defs/sourceReferences/items/required",keyword:"required",params:{missingProperty: "path"},message:"must have required property '"+"path"+"'"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}for(const key16 in data61){if(!((((key16 === "path") || (key16 === "line")) || (key16 === "end_line")) || (key16 === "label"))){const err162 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2,schemaPath:"common.schema.json#/$defs/sourceReferences/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}}if(data61.path !== undefined){let data62 = data61.path;if(typeof data62 === "string"){if(func3(data62) > 240){const err163 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/maxLength",keyword:"maxLength",params:{limit: 240},message:"must NOT have more than 240 characters"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}if(func3(data62) < 1){const err164 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}}else {const err165 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}if(data61.line !== undefined){let data63 = data61.line;if(!(((typeof data63 == "number") && (!(data63 % 1) && !isNaN(data63))) && (isFinite(data63)))){const err166 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}if((typeof data63 == "number") && (isFinite(data63))){if(data63 < 1 || isNaN(data63)){const err167 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}}if(data61.end_line !== undefined){let data64 = data61.end_line;if(!(((typeof data64 == "number") && (!(data64 % 1) && !isNaN(data64))) && (isFinite(data64)))){const err168 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}if((typeof data64 == "number") && (isFinite(data64))){if(data64 < 1 || isNaN(data64)){const err169 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}}if(data61.label !== undefined){let data65 = data61.label;if(typeof data65 === "string"){if(func3(data65) > 48){const err170 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}if(func3(data65) < 1){const err171 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}else {const err172 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}}else {const err173 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2,schemaPath:"common.schema.json#/$defs/sourceReferences/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}}else {const err174 = {instancePath:instancePath+"/states/" + i1+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}}if(data51.step !== undefined){if(typeof data51.step !== "string"){const err175 = {instancePath:instancePath+"/states/" + i1+"/step",schemaPath:"#/properties/states/items/properties/step/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}}if(data51.lane !== undefined){let data67 = data51.lane;if(typeof data67 === "string"){if(!pattern14.test(data67)){const err176 = {instancePath:instancePath+"/states/" + i1+"/lane",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}}else {const err177 = {instancePath:instancePath+"/states/" + i1+"/lane",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}}if(data51.col !== undefined){let data68 = data51.col;if(!(((typeof data68 == "number") && (!(data68 % 1) && !isNaN(data68))) && (isFinite(data68)))){const err178 = {instancePath:instancePath+"/states/" + i1+"/col",schemaPath:"#/properties/states/items/properties/col/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}if((typeof data68 == "number") && (isFinite(data68))){if(data68 > 4 || isNaN(data68)){const err179 = {instancePath:instancePath+"/states/" + i1+"/col",schemaPath:"#/properties/states/items/properties/col/maximum",keyword:"maximum",params:{comparison: "<=", limit: 4},message:"must be <= 4"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}if(data68 < 0 || isNaN(data68)){const err180 = {instancePath:instancePath+"/states/" + i1+"/col",schemaPath:"#/properties/states/items/properties/col/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}}if(data51.width !== undefined){let data69 = data51.width;if((typeof data69 == "number") && (isFinite(data69))){if(data69 < 48 || isNaN(data69)){const err181 = {instancePath:instancePath+"/states/" + i1+"/width",schemaPath:"#/properties/states/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 48},message:"must be >= 48"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}else {const err182 = {instancePath:instancePath+"/states/" + i1+"/width",schemaPath:"#/properties/states/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}if(data51.height !== undefined){let data70 = data51.height;if((typeof data70 == "number") && (isFinite(data70))){if(data70 < 36 || isNaN(data70)){const err183 = {instancePath:instancePath+"/states/" + i1+"/height",schemaPath:"#/properties/states/items/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 36},message:"must be >= 36"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}else {const err184 = {instancePath:instancePath+"/states/" + i1+"/height",schemaPath:"#/properties/states/items/properties/height/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}if(data51.yOffset !== undefined){let data71 = data51.yOffset;if(!((typeof data71 == "number") && (isFinite(data71)))){const err185 = {instancePath:instancePath+"/states/" + i1+"/yOffset",schemaPath:"#/properties/states/items/properties/yOffset/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}}else {const err186 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}}}else {const err187 = {instancePath:instancePath+"/states",schemaPath:"#/properties/states/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}if(data.transitions !== undefined){let data72 = data.transitions;if(Array.isArray(data72)){const len5 = data72.length;for(let i3=0; i3<len5; i3++){let data73 = data72[i3];if(data73 && typeof data73 == "object" && !Array.isArray(data73)){if(data73.from === undefined){const err188 = {instancePath:instancePath+"/transitions/" + i3,schemaPath:"#/properties/transitions/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}if(data73.to === undefined){const err189 = {instancePath:instancePath+"/transitions/" + i3,schemaPath:"#/properties/transitions/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}for(const key17 in data73){if(!(func1.call(schema127.properties.transitions.items.properties, key17))){const err190 = {instancePath:instancePath+"/transitions/" + i3,schemaPath:"#/properties/transitions/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key17},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}if(data73.id !== undefined){let data74 = data73.id;if(typeof data74 === "string"){if(!pattern14.test(data74)){const err191 = {instancePath:instancePath+"/transitions/" + i3+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}else {const err192 = {instancePath:instancePath+"/transitions/" + i3+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}if(data73.from !== undefined){let data75 = data73.from;if(typeof data75 === "string"){if(!pattern14.test(data75)){const err193 = {instancePath:instancePath+"/transitions/" + i3+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}else {const err194 = {instancePath:instancePath+"/transitions/" + i3+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}if(data73.to !== undefined){let data76 = data73.to;if(typeof data76 === "string"){if(!pattern14.test(data76)){const err195 = {instancePath:instancePath+"/transitions/" + i3+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}}else {const err196 = {instancePath:instancePath+"/transitions/" + i3+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}}if(data73.label !== undefined){if(typeof data73.label !== "string"){const err197 = {instancePath:instancePath+"/transitions/" + i3+"/label",schemaPath:"#/properties/transitions/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}}if(data73.note !== undefined){if(typeof data73.note !== "string"){const err198 = {instancePath:instancePath+"/transitions/" + i3+"/note",schemaPath:"#/properties/transitions/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}}if(data73.variant !== undefined){let data79 = data73.variant;if(!((((data79 === "default") || (data79 === "emphasis")) || (data79 === "security")) || (data79 === "dashed"))){const err199 = {instancePath:instancePath+"/transitions/" + i3+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema65.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}}if(data73.route !== undefined){let data80 = data73.route;if(!(((((((data80 === "auto") || (data80 === "straight")) || (data80 === "drop")) || (data80 === "bottom-channel")) || (data80 === "top-channel")) || (data80 === "right-channel")) || (data80 === "left-channel"))){const err200 = {instancePath:instancePath+"/transitions/" + i3+"/route",schemaPath:"#/properties/transitions/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema127.properties.transitions.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}}if(data73.fromSide !== undefined){let data81 = data73.fromSide;if(!((((data81 === "left") || (data81 === "right")) || (data81 === "top")) || (data81 === "bottom"))){const err201 = {instancePath:instancePath+"/transitions/" + i3+"/fromSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema121.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}}if(data73.toSide !== undefined){let data82 = data73.toSide;if(!((((data82 === "left") || (data82 === "right")) || (data82 === "top")) || (data82 === "bottom"))){const err202 = {instancePath:instancePath+"/transitions/" + i3+"/toSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema121.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}}if(data73.channelX !== undefined){let data83 = data73.channelX;if(!((typeof data83 == "number") && (isFinite(data83)))){const err203 = {instancePath:instancePath+"/transitions/" + i3+"/channelX",schemaPath:"#/properties/transitions/items/properties/channelX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}}if(data73.channelY !== undefined){let data84 = data73.channelY;if(!((typeof data84 == "number") && (isFinite(data84)))){const err204 = {instancePath:instancePath+"/transitions/" + i3+"/channelY",schemaPath:"#/properties/transitions/items/properties/channelY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}}if(data73.cornerRadius !== undefined){let data85 = data73.cornerRadius;if((typeof data85 == "number") && (isFinite(data85))){if(data85 < 0 || isNaN(data85)){const err205 = {instancePath:instancePath+"/transitions/" + i3+"/cornerRadius",schemaPath:"#/properties/transitions/items/properties/cornerRadius/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err205];}else {vErrors.push(err205);}errors++;}}else {const err206 = {instancePath:instancePath+"/transitions/" + i3+"/cornerRadius",schemaPath:"#/properties/transitions/items/properties/cornerRadius/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err206];}else {vErrors.push(err206);}errors++;}}if(data73.labelAt !== undefined){let data86 = data73.labelAt;if(Array.isArray(data86)){if(data86.length > 2){const err207 = {instancePath:instancePath+"/transitions/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err207];}else {vErrors.push(err207);}errors++;}if(data86.length < 2){const err208 = {instancePath:instancePath+"/transitions/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err208];}else {vErrors.push(err208);}errors++;}const len6 = data86.length;if(len6 > 0){let data87 = data86[0];if(!((typeof data87 == "number") && (isFinite(data87)))){const err209 = {instancePath:instancePath+"/transitions/" + i3+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err209];}else {vErrors.push(err209);}errors++;}}if(len6 > 1){let data88 = data86[1];if(!((typeof data88 == "number") && (isFinite(data88)))){const err210 = {instancePath:instancePath+"/transitions/" + i3+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err210];}else {vErrors.push(err210);}errors++;}}const len7 = data86.length;if(!(len7 <= 2)){const err211 = {instancePath:instancePath+"/transitions/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err211];}else {vErrors.push(err211);}errors++;}}else {const err212 = {instancePath:instancePath+"/transitions/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err212];}else {vErrors.push(err212);}errors++;}}if(data73.labelDx !== undefined){let data89 = data73.labelDx;if(!((typeof data89 == "number") && (isFinite(data89)))){const err213 = {instancePath:instancePath+"/transitions/" + i3+"/labelDx",schemaPath:"#/properties/transitions/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err213];}else {vErrors.push(err213);}errors++;}}if(data73.labelDy !== undefined){let data90 = data73.labelDy;if(!((typeof data90 == "number") && (isFinite(data90)))){const err214 = {instancePath:instancePath+"/transitions/" + i3+"/labelDy",schemaPath:"#/properties/transitions/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err214];}else {vErrors.push(err214);}errors++;}}if(data73.labelSegment !== undefined){let data91 = data73.labelSegment;if(!(((typeof data91 == "number") && (!(data91 % 1) && !isNaN(data91))) && (isFinite(data91)))){const err215 = {instancePath:instancePath+"/transitions/" + i3+"/labelSegment",schemaPath:"#/properties/transitions/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err215];}else {vErrors.push(err215);}errors++;}if((typeof data91 == "number") && (isFinite(data91))){if(data91 < 0 || isNaN(data91)){const err216 = {instancePath:instancePath+"/transitions/" + i3+"/labelSegment",schemaPath:"#/properties/transitions/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err216];}else {vErrors.push(err216);}errors++;}}}if(data73.via !== undefined){let data92 = data73.via;if(Array.isArray(data92)){const len8 = data92.length;for(let i4=0; i4<len8; i4++){let data93 = data92[i4];if(Array.isArray(data93)){if(data93.length > 2){const err217 = {instancePath:instancePath+"/transitions/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err217];}else {vErrors.push(err217);}errors++;}if(data93.length < 2){const err218 = {instancePath:instancePath+"/transitions/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err218];}else {vErrors.push(err218);}errors++;}const len9 = data93.length;if(len9 > 0){let data94 = data93[0];if(!((typeof data94 == "number") && (isFinite(data94)))){const err219 = {instancePath:instancePath+"/transitions/" + i3+"/via/" + i4+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err219];}else {vErrors.push(err219);}errors++;}}if(len9 > 1){let data95 = data93[1];if(!((typeof data95 == "number") && (isFinite(data95)))){const err220 = {instancePath:instancePath+"/transitions/" + i3+"/via/" + i4+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err220];}else {vErrors.push(err220);}errors++;}}const len10 = data93.length;if(!(len10 <= 2)){const err221 = {instancePath:instancePath+"/transitions/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err221];}else {vErrors.push(err221);}errors++;}}else {const err222 = {instancePath:instancePath+"/transitions/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err222];}else {vErrors.push(err222);}errors++;}}}else {const err223 = {instancePath:instancePath+"/transitions/" + i3+"/via",schemaPath:"#/properties/transitions/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err223];}else {vErrors.push(err223);}errors++;}}if(data73.width !== undefined){let data96 = data73.width;if((typeof data96 == "number") && (isFinite(data96))){if(data96 < 0.5 || isNaN(data96)){const err224 = {instancePath:instancePath+"/transitions/" + i3+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err224];}else {vErrors.push(err224);}errors++;}}else {const err225 = {instancePath:instancePath+"/transitions/" + i3+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err225];}else {vErrors.push(err225);}errors++;}}}else {const err226 = {instancePath:instancePath+"/transitions/" + i3,schemaPath:"#/properties/transitions/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err226];}else {vErrors.push(err226);}errors++;}}}else {const err227 = {instancePath:instancePath+"/transitions",schemaPath:"#/properties/transitions/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err227];}else {vErrors.push(err227);}errors++;}}if(data.cards !== undefined){let data97 = data.cards;if(Array.isArray(data97)){const len11 = data97.length;for(let i5=0; i5<len11; i5++){let data98 = data97[i5];if(data98 && typeof data98 == "object" && !Array.isArray(data98)){if(data98.dot === undefined){const err228 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err228];}else {vErrors.push(err228);}errors++;}if(data98.title === undefined){const err229 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err229];}else {vErrors.push(err229);}errors++;}if(data98.items === undefined){const err230 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err230];}else {vErrors.push(err230);}errors++;}for(const key18 in data98){if(!(((key18 === "dot") || (key18 === "title")) || (key18 === "items"))){const err231 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key18},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err231];}else {vErrors.push(err231);}errors++;}}if(data98.dot !== undefined){let data99 = data98.dot;if(!(((((((data99 === "cyan") || (data99 === "emerald")) || (data99 === "violet")) || (data99 === "amber")) || (data99 === "rose")) || (data99 === "orange")) || (data99 === "slate"))){const err232 = {instancePath:instancePath+"/cards/" + i5+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema70.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err232];}else {vErrors.push(err232);}errors++;}}if(data98.title !== undefined){let data100 = data98.title;if(typeof data100 === "string"){if(func3(data100) < 1){const err233 = {instancePath:instancePath+"/cards/" + i5+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err233];}else {vErrors.push(err233);}errors++;}}else {const err234 = {instancePath:instancePath+"/cards/" + i5+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err234];}else {vErrors.push(err234);}errors++;}}if(data98.items !== undefined){let data101 = data98.items;if(Array.isArray(data101)){const len12 = data101.length;for(let i6=0; i6<len12; i6++){if(typeof data101[i6] !== "string"){const err235 = {instancePath:instancePath+"/cards/" + i5+"/items/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err235];}else {vErrors.push(err235);}errors++;}}}else {const err236 = {instancePath:instancePath+"/cards/" + i5+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err236];}else {vErrors.push(err236);}errors++;}}}else {const err237 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err237];}else {vErrors.push(err237);}errors++;}}}else {const err238 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err238];}else {vErrors.push(err238);}errors++;}}}else {const err239 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err239];}else {vErrors.push(err239);}errors++;}validate33.errors = vErrors;return errors === 0;}validate33.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const architectureSchema = validate36;const schema161 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/architecture.schema.json","title":"Archify Architecture Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","components"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"architecture"},"meta":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"$ref":"common.schema.json#/$defs/portableOutputPath"},"animation":{"$ref":"common.schema.json#/$defs/animation"},"visual_preset":{"$ref":"common.schema.json#/$defs/visualPreset"},"quality_profile":{"$ref":"common.schema.json#/$defs/qualityProfile"},"engineering_profile":{"enum":["deployment-ownership"]},"repository":{"$ref":"common.schema.json#/$defs/repository"},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"frontend":{"$ref":"common.schema.json#/$defs/legendEntry"},"backend":{"$ref":"common.schema.json#/$defs/legendEntry"},"database":{"$ref":"common.schema.json#/$defs/legendEntry"},"cloud":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"messagebus":{"$ref":"common.schema.json#/$defs/legendEntry"},"external":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":320},{"type":"number","minimum":240}],"items":false,"minItems":2,"maxItems":2}}},"layout":{"type":"object","additionalProperties":false,"required":["mode"],"properties":{"mode":{"enum":["grid"]},"origin":{"$ref":"common.schema.json#/$defs/point"},"cols":{"type":"integer","minimum":1,"maximum":12},"gapX":{"type":"number","minimum":0},"gapY":{"type":"number","minimum":0},"cellW":{"type":"number","minimum":40},"cellH":{"type":"number","minimum":24}}},"components":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","type","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"sources":{"$ref":"common.schema.json#/$defs/sourceReferences"},"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0},"pos":{"$ref":"common.schema.json#/$defs/point"},"size":{"type":"array","prefixItems":[{"type":"number","exclusiveMinimum":0},{"type":"number","exclusiveMinimum":0}],"items":false,"minItems":2,"maxItems":2}}}},"boundaries":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["kind","label","wraps"],"properties":{"kind":{"enum":["region","security-group"]},"label":{"type":"string","minLength":1},"wraps":{"type":"array","minItems":1,"items":{"$ref":"common.schema.json#/$defs/id"}},"pad":{"type":"number","minimum":0}}}},"connections":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"fromSide":{"$ref":"common.schema.json#/$defs/side"},"toSide":{"$ref":"common.schema.json#/$defs/side"},"route":{"enum":["auto","straight","orthogonal-h","orthogonal-v"]},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"width":{"$ref":"common.schema.json#/$defs/relationshipWidth"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};function validate37(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate37.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern14.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern14.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate37.errors = vErrors;return errors === 0;}validate37.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate36(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/architecture.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate36.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.components === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "components"},message:"must have required property '"+"components"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data){if(!((((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "layout")) || (key0 === "components")) || (key0 === "boundaries")) || (key0 === "connections")) || (key0 === "cards"))){const err4 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err5 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.diagram_type !== undefined){if("architecture" !== data.diagram_type){const err6 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "architecture"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err7 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}for(const key1 in data2){if(!(func1.call(schema161.properties.meta.properties, key1))){const err8 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err9 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!(((data4 === "en") || (data4 === "zh-CN")) || (data4 === "es"))){const err11 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err12 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.output !== undefined){let data6 = data2.output;if(typeof data6 === "string"){if(!pattern4.test(data6)){const err13 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/0/pattern",keyword:"pattern",params:{pattern: "(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"},message:"must match pattern \""+"(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"+"\""};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}const _errs18 = errors;const _errs19 = errors;if(typeof data6 === "string"){if(!pattern5.test(data6)){const err14 = {};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}var valid5 = _errs19 === errors;if(valid5){const err15 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/1/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}const _errs21 = errors;const _errs22 = errors;if(typeof data6 === "string"){if(!pattern6.test(data6)){const err16 = {};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}var valid6 = _errs22 === errors;if(valid6){const err17 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/2/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}const _errs24 = errors;const _errs25 = errors;if(typeof data6 === "string"){if(!pattern7.test(data6)){const err18 = {};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}var valid7 = _errs25 === errors;if(valid7){const err19 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/3/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}const _errs27 = errors;const _errs28 = errors;if(typeof data6 === "string"){if(!pattern8.test(data6)){const err20 = {};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}var valid8 = _errs28 === errors;if(valid8){const err21 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/4/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}else {errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}}const _errs30 = errors;const _errs31 = errors;if(typeof data6 === "string"){if(!pattern9.test(data6)){const err22 = {};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}var valid9 = _errs31 === errors;if(valid9){const err23 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/5/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}else {errors = _errs30;if(vErrors !== null){if(_errs30){vErrors.length = _errs30;}else {vErrors = null;}}}const _errs33 = errors;const _errs34 = errors;if(typeof data6 === "string"){if(!pattern10.test(data6)){const err24 = {};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}var valid10 = _errs34 === errors;if(valid10){const err25 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/6/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}else {errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}}const _errs36 = errors;const _errs37 = errors;if(typeof data6 === "string"){if(!pattern11.test(data6)){const err26 = {};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}var valid11 = _errs37 === errors;if(valid11){const err27 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/7/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}else {errors = _errs36;if(vErrors !== null){if(_errs36){vErrors.length = _errs36;}else {vErrors = null;}}}if(typeof data6 === "string"){if(func3(data6) < 1){const err28 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}if(!pattern12.test(data6)){const err29 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/pattern",keyword:"pattern",params:{pattern: "^[^/]+(?:/[^/]+)*$"},message:"must match pattern \""+"^[^/]+(?:/[^/]+)*$"+"\""};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}else {const err30 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err31 = {instancePath:instancePath+"/meta/animation",schemaPath:"common.schema.json#/$defs/animation/enum",keyword:"enum",params:{allowedValues: schema74.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err32 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"common.schema.json#/$defs/visualPreset/enum",keyword:"enum",params:{allowedValues: schema75.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err33 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"common.schema.json#/$defs/qualityProfile/enum",keyword:"enum",params:{allowedValues: schema76.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data2.engineering_profile !== undefined){if(!(data2.engineering_profile === "deployment-ownership")){const err34 = {instancePath:instancePath+"/meta/engineering_profile",schemaPath:"#/properties/meta/properties/engineering_profile/enum",keyword:"enum",params:{allowedValues: schema161.properties.meta.properties.engineering_profile.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data2.repository !== undefined){let data11 = data2.repository;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){if(data11.url === undefined){const err35 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if(data11.revision === undefined){const err36 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "revision"},message:"must have required property '"+"revision"+"'"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}for(const key2 in data11){if(!((((key2 === "url") || (key2 === "provider")) || (key2 === "link_mode")) || (key2 === "revision"))){const err37 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data11.url !== undefined){let data12 = data11.url;if(typeof data12 === "string"){if(func3(data12) < 1){const err38 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}else {const err39 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}if(data11.provider !== undefined){let data13 = data11.provider;if(!((data13 === "github") || (data13 === "gitee"))){const err40 = {instancePath:instancePath+"/meta/repository/provider",schemaPath:"common.schema.json#/$defs/repository/properties/provider/enum",keyword:"enum",params:{allowedValues: schema35.properties.provider.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data11.link_mode !== undefined){let data14 = data11.link_mode;if(!((data14 === "web") || (data14 === "local-only"))){const err41 = {instancePath:instancePath+"/meta/repository/link_mode",schemaPath:"common.schema.json#/$defs/repository/properties/link_mode/enum",keyword:"enum",params:{allowedValues: schema35.properties.link_mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data11.revision !== undefined){let data15 = data11.revision;if(typeof data15 === "string"){if(!pattern13.test(data15)){const err42 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/pattern",keyword:"pattern",params:{pattern: "^[a-fA-F0-9]{40}$"},message:"must match pattern \""+"^[a-fA-F0-9]{40}$"+"\""};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}else {const err43 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}}else {const err44 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}if(data2.views !== undefined){if(!(validate37(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate37.errors : vErrors.concat(validate37.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data17 = data2.legend;if(data17 && typeof data17 == "object" && !Array.isArray(data17)){for(const key3 in data17){if(!((key3 === "mode") || (key3 === "entries"))){const err45 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data17.mode !== undefined){let data18 = data17.mode;if(!(((data18 === "auto") || (data18 === "all")) || (data18 === "hidden"))){const err46 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema39.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}if(data17.entries !== undefined){let data19 = data17.entries;if(data19 && typeof data19 == "object" && !Array.isArray(data19)){for(const key4 in data19){if(!(((((((key4 === "frontend") || (key4 === "backend")) || (key4 === "database")) || (key4 === "cloud")) || (key4 === "security")) || (key4 === "messagebus")) || (key4 === "external"))){const err47 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data19.frontend !== undefined){let data20 = data19.frontend;if(data20 && typeof data20 == "object" && !Array.isArray(data20)){if(Object.keys(data20).length < 1){const err48 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}for(const key5 in data20){if(!((key5 === "label") || (key5 === "visible"))){const err49 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data20.label !== undefined){let data21 = data20.label;if(typeof data21 === "string"){if(func3(data21) > 80){const err50 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}if(func3(data21) < 1){const err51 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}else {const err52 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}if(data20.visible !== undefined){if(typeof data20.visible !== "boolean"){const err53 = {instancePath:instancePath+"/meta/legend/entries/frontend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data19.backend !== undefined){let data23 = data19.backend;if(data23 && typeof data23 == "object" && !Array.isArray(data23)){if(Object.keys(data23).length < 1){const err55 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}for(const key6 in data23){if(!((key6 === "label") || (key6 === "visible"))){const err56 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}if(data23.label !== undefined){let data24 = data23.label;if(typeof data24 === "string"){if(func3(data24) > 80){const err57 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}if(func3(data24) < 1){const err58 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}else {const err59 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}}if(data23.visible !== undefined){if(typeof data23.visible !== "boolean"){const err60 = {instancePath:instancePath+"/meta/legend/entries/backend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}}else {const err61 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data19.database !== undefined){let data26 = data19.database;if(data26 && typeof data26 == "object" && !Array.isArray(data26)){if(Object.keys(data26).length < 1){const err62 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}for(const key7 in data26){if(!((key7 === "label") || (key7 === "visible"))){const err63 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}if(data26.label !== undefined){let data27 = data26.label;if(typeof data27 === "string"){if(func3(data27) > 80){const err64 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}if(func3(data27) < 1){const err65 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}else {const err66 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}if(data26.visible !== undefined){if(typeof data26.visible !== "boolean"){const err67 = {instancePath:instancePath+"/meta/legend/entries/database/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}}else {const err68 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}if(data19.cloud !== undefined){let data29 = data19.cloud;if(data29 && typeof data29 == "object" && !Array.isArray(data29)){if(Object.keys(data29).length < 1){const err69 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}for(const key8 in data29){if(!((key8 === "label") || (key8 === "visible"))){const err70 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data29.label !== undefined){let data30 = data29.label;if(typeof data30 === "string"){if(func3(data30) > 80){const err71 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}if(func3(data30) < 1){const err72 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}else {const err73 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}if(data29.visible !== undefined){if(typeof data29.visible !== "boolean"){const err74 = {instancePath:instancePath+"/meta/legend/entries/cloud/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}}else {const err75 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data19.security !== undefined){let data32 = data19.security;if(data32 && typeof data32 == "object" && !Array.isArray(data32)){if(Object.keys(data32).length < 1){const err76 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}for(const key9 in data32){if(!((key9 === "label") || (key9 === "visible"))){const err77 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}if(data32.label !== undefined){let data33 = data32.label;if(typeof data33 === "string"){if(func3(data33) > 80){const err78 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}if(func3(data33) < 1){const err79 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}else {const err80 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}}if(data32.visible !== undefined){if(typeof data32.visible !== "boolean"){const err81 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}}else {const err82 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}if(data19.messagebus !== undefined){let data35 = data19.messagebus;if(data35 && typeof data35 == "object" && !Array.isArray(data35)){if(Object.keys(data35).length < 1){const err83 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}for(const key10 in data35){if(!((key10 === "label") || (key10 === "visible"))){const err84 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}if(data35.label !== undefined){let data36 = data35.label;if(typeof data36 === "string"){if(func3(data36) > 80){const err85 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}if(func3(data36) < 1){const err86 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}else {const err87 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}if(data35.visible !== undefined){if(typeof data35.visible !== "boolean"){const err88 = {instancePath:instancePath+"/meta/legend/entries/messagebus/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}}else {const err89 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}if(data19.external !== undefined){let data38 = data19.external;if(data38 && typeof data38 == "object" && !Array.isArray(data38)){if(Object.keys(data38).length < 1){const err90 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}for(const key11 in data38){if(!((key11 === "label") || (key11 === "visible"))){const err91 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}if(data38.label !== undefined){let data39 = data38.label;if(typeof data39 === "string"){if(func3(data39) > 80){const err92 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}if(func3(data39) < 1){const err93 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}else {const err94 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(data38.visible !== undefined){if(typeof data38.visible !== "boolean"){const err95 = {instancePath:instancePath+"/meta/legend/entries/external/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}}else {const err96 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}}else {const err97 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}else {const err98 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}if(data2.viewBox !== undefined){let data41 = data2.viewBox;if(Array.isArray(data41)){if(data41.length > 2){const err99 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}if(data41.length < 2){const err100 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}const len0 = data41.length;if(len0 > 0){let data42 = data41[0];if((typeof data42 == "number") && (isFinite(data42))){if(data42 < 320 || isNaN(data42)){const err101 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 320},message:"must be >= 320"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}else {const err102 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}if(len0 > 1){let data43 = data41[1];if((typeof data43 == "number") && (isFinite(data43))){if(data43 < 240 || isNaN(data43)){const err103 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 240},message:"must be >= 240"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}else {const err104 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}const len1 = data41.length;if(!(len1 <= 2)){const err105 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}else {const err106 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}}else {const err107 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}if(data.layout !== undefined){let data44 = data.layout;if(data44 && typeof data44 == "object" && !Array.isArray(data44)){if(data44.mode === undefined){const err108 = {instancePath:instancePath+"/layout",schemaPath:"#/properties/layout/required",keyword:"required",params:{missingProperty: "mode"},message:"must have required property '"+"mode"+"'"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}for(const key12 in data44){if(!(((((((key12 === "mode") || (key12 === "origin")) || (key12 === "cols")) || (key12 === "gapX")) || (key12 === "gapY")) || (key12 === "cellW")) || (key12 === "cellH"))){const err109 = {instancePath:instancePath+"/layout",schemaPath:"#/properties/layout/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}if(data44.mode !== undefined){if(!(data44.mode === "grid")){const err110 = {instancePath:instancePath+"/layout/mode",schemaPath:"#/properties/layout/properties/mode/enum",keyword:"enum",params:{allowedValues: schema161.properties.layout.properties.mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}if(data44.origin !== undefined){let data46 = data44.origin;if(Array.isArray(data46)){if(data46.length > 2){const err111 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}if(data46.length < 2){const err112 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}const len2 = data46.length;if(len2 > 0){let data47 = data46[0];if(!((typeof data47 == "number") && (isFinite(data47)))){const err113 = {instancePath:instancePath+"/layout/origin/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}if(len2 > 1){let data48 = data46[1];if(!((typeof data48 == "number") && (isFinite(data48)))){const err114 = {instancePath:instancePath+"/layout/origin/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}const len3 = data46.length;if(!(len3 <= 2)){const err115 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}else {const err116 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data44.cols !== undefined){let data49 = data44.cols;if(!(((typeof data49 == "number") && (!(data49 % 1) && !isNaN(data49))) && (isFinite(data49)))){const err117 = {instancePath:instancePath+"/layout/cols",schemaPath:"#/properties/layout/properties/cols/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}if((typeof data49 == "number") && (isFinite(data49))){if(data49 > 12 || isNaN(data49)){const err118 = {instancePath:instancePath+"/layout/cols",schemaPath:"#/properties/layout/properties/cols/maximum",keyword:"maximum",params:{comparison: "<=", limit: 12},message:"must be <= 12"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}if(data49 < 1 || isNaN(data49)){const err119 = {instancePath:instancePath+"/layout/cols",schemaPath:"#/properties/layout/properties/cols/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}}if(data44.gapX !== undefined){let data50 = data44.gapX;if((typeof data50 == "number") && (isFinite(data50))){if(data50 < 0 || isNaN(data50)){const err120 = {instancePath:instancePath+"/layout/gapX",schemaPath:"#/properties/layout/properties/gapX/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}else {const err121 = {instancePath:instancePath+"/layout/gapX",schemaPath:"#/properties/layout/properties/gapX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}if(data44.gapY !== undefined){let data51 = data44.gapY;if((typeof data51 == "number") && (isFinite(data51))){if(data51 < 0 || isNaN(data51)){const err122 = {instancePath:instancePath+"/layout/gapY",schemaPath:"#/properties/layout/properties/gapY/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}else {const err123 = {instancePath:instancePath+"/layout/gapY",schemaPath:"#/properties/layout/properties/gapY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}if(data44.cellW !== undefined){let data52 = data44.cellW;if((typeof data52 == "number") && (isFinite(data52))){if(data52 < 40 || isNaN(data52)){const err124 = {instancePath:instancePath+"/layout/cellW",schemaPath:"#/properties/layout/properties/cellW/minimum",keyword:"minimum",params:{comparison: ">=", limit: 40},message:"must be >= 40"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}else {const err125 = {instancePath:instancePath+"/layout/cellW",schemaPath:"#/properties/layout/properties/cellW/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}if(data44.cellH !== undefined){let data53 = data44.cellH;if((typeof data53 == "number") && (isFinite(data53))){if(data53 < 24 || isNaN(data53)){const err126 = {instancePath:instancePath+"/layout/cellH",schemaPath:"#/properties/layout/properties/cellH/minimum",keyword:"minimum",params:{comparison: ">=", limit: 24},message:"must be >= 24"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}else {const err127 = {instancePath:instancePath+"/layout/cellH",schemaPath:"#/properties/layout/properties/cellH/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}}else {const err128 = {instancePath:instancePath+"/layout",schemaPath:"#/properties/layout/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}if(data.components !== undefined){let data54 = data.components;if(Array.isArray(data54)){if(data54.length < 1){const err129 = {instancePath:instancePath+"/components",schemaPath:"#/properties/components/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}const len4 = data54.length;for(let i0=0; i0<len4; i0++){let data55 = data54[i0];if(data55 && typeof data55 == "object" && !Array.isArray(data55)){if(data55.id === undefined){const err130 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}if(data55.type === undefined){const err131 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}if(data55.label === undefined){const err132 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}for(const key13 in data55){if(!(func1.call(schema161.properties.components.items.properties, key13))){const err133 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}if(data55.id !== undefined){let data56 = data55.id;if(typeof data56 === "string"){if(!pattern14.test(data56)){const err134 = {instancePath:instancePath+"/components/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}else {const err135 = {instancePath:instancePath+"/components/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}if(data55.type !== undefined){let data57 = data55.type;if(!(((((((data57 === "frontend") || (data57 === "backend")) || (data57 === "database")) || (data57 === "cloud")) || (data57 === "security")) || (data57 === "messagebus")) || (data57 === "external"))){const err136 = {instancePath:instancePath+"/components/" + i0+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema59.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}if(data55.label !== undefined){let data58 = data55.label;if(typeof data58 === "string"){if(func3(data58) < 1){const err137 = {instancePath:instancePath+"/components/" + i0+"/label",schemaPath:"#/properties/components/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}else {const err138 = {instancePath:instancePath+"/components/" + i0+"/label",schemaPath:"#/properties/components/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}if(data55.sublabel !== undefined){if(typeof data55.sublabel !== "string"){const err139 = {instancePath:instancePath+"/components/" + i0+"/sublabel",schemaPath:"#/properties/components/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}if(data55.tag !== undefined){if(typeof data55.tag !== "string"){const err140 = {instancePath:instancePath+"/components/" + i0+"/tag",schemaPath:"#/properties/components/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}if(data55.brand !== undefined){let data61 = data55.brand;const _errs165 = errors;let valid44 = false;let passing0 = null;const _errs166 = errors;const _errs168 = errors;let valid45 = false;const _errs169 = errors;if(typeof data61 === "string"){if(func3(data61) > 80){const err141 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}if(!pattern27.test(data61)){const err142 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}}var _valid1 = _errs169 === errors;valid45 = valid45 || _valid1;const _errs170 = errors;if(typeof data61 === "string"){if(!pattern28.test(data61)){const err143 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}var _valid1 = _errs170 === errors;valid45 = valid45 || _valid1;if(!valid45){const err144 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}else {errors = _errs168;if(vErrors !== null){if(_errs168){vErrors.length = _errs168;}else {vErrors = null;}}}if(typeof data61 === "string"){if(func3(data61) > 2048){const err145 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}if(func3(data61) < 1){const err146 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}else {const err147 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}var _valid0 = _errs166 === errors;if(_valid0){valid44 = true;passing0 = 0;}const _errs171 = errors;if(data61 && typeof data61 == "object" && !Array.isArray(data61)){if(data61.url === undefined){const err148 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}if(data61.sha256 === undefined){const err149 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}for(const key14 in data61){if(!((key14 === "url") || (key14 === "sha256"))){const err150 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}if(data61.url !== undefined){let data62 = data61.url;if(typeof data62 === "string"){if(func3(data62) > 2048){const err151 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}if(func3(data62) < 8){const err152 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}if(!pattern28.test(data62)){const err153 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}else {const err154 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}if(data61.sha256 !== undefined){let data63 = data61.sha256;if(typeof data63 === "string"){if(!pattern30.test(data63)){const err155 = {instancePath:instancePath+"/components/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}}else {const err156 = {instancePath:instancePath+"/components/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}}else {const err157 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}var _valid0 = _errs171 === errors;if(_valid0 && valid44){valid44 = false;passing0 = [passing0, 1];}else {if(_valid0){valid44 = true;passing0 = 1;}}if(!valid44){const err158 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}else {errors = _errs165;if(vErrors !== null){if(_errs165){vErrors.length = _errs165;}else {vErrors = null;}}}}if(data55.sources !== undefined){let data64 = data55.sources;if(Array.isArray(data64)){if(data64.length > 3){const err159 = {instancePath:instancePath+"/components/" + i0+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}if(data64.length < 1){const err160 = {instancePath:instancePath+"/components/" + i0+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}const len5 = data64.length;for(let i1=0; i1<len5; i1++){let data65 = data64[i1];if(data65 && typeof data65 == "object" && !Array.isArray(data65)){if(data65.path === undefined){const err161 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1,schemaPath:"common.schema.json#/$defs/sourceReferences/items/required",keyword:"required",params:{missingProperty: "path"},message:"must have required property '"+"path"+"'"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}for(const key15 in data65){if(!((((key15 === "path") || (key15 === "line")) || (key15 === "end_line")) || (key15 === "label"))){const err162 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1,schemaPath:"common.schema.json#/$defs/sourceReferences/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}}if(data65.path !== undefined){let data66 = data65.path;if(typeof data66 === "string"){if(func3(data66) > 240){const err163 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/maxLength",keyword:"maxLength",params:{limit: 240},message:"must NOT have more than 240 characters"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}if(func3(data66) < 1){const err164 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}}else {const err165 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}if(data65.line !== undefined){let data67 = data65.line;if(!(((typeof data67 == "number") && (!(data67 % 1) && !isNaN(data67))) && (isFinite(data67)))){const err166 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}if((typeof data67 == "number") && (isFinite(data67))){if(data67 < 1 || isNaN(data67)){const err167 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}}if(data65.end_line !== undefined){let data68 = data65.end_line;if(!(((typeof data68 == "number") && (!(data68 % 1) && !isNaN(data68))) && (isFinite(data68)))){const err168 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}if((typeof data68 == "number") && (isFinite(data68))){if(data68 < 1 || isNaN(data68)){const err169 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}}if(data65.label !== undefined){let data69 = data65.label;if(typeof data69 === "string"){if(func3(data69) > 48){const err170 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}if(func3(data69) < 1){const err171 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}else {const err172 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}}else {const err173 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1,schemaPath:"common.schema.json#/$defs/sourceReferences/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}}else {const err174 = {instancePath:instancePath+"/components/" + i0+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}}if(data55.row !== undefined){let data70 = data55.row;if(!(((typeof data70 == "number") && (!(data70 % 1) && !isNaN(data70))) && (isFinite(data70)))){const err175 = {instancePath:instancePath+"/components/" + i0+"/row",schemaPath:"#/properties/components/items/properties/row/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}if((typeof data70 == "number") && (isFinite(data70))){if(data70 < 0 || isNaN(data70)){const err176 = {instancePath:instancePath+"/components/" + i0+"/row",schemaPath:"#/properties/components/items/properties/row/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}}}if(data55.col !== undefined){let data71 = data55.col;if(!(((typeof data71 == "number") && (!(data71 % 1) && !isNaN(data71))) && (isFinite(data71)))){const err177 = {instancePath:instancePath+"/components/" + i0+"/col",schemaPath:"#/properties/components/items/properties/col/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}if((typeof data71 == "number") && (isFinite(data71))){if(data71 < 0 || isNaN(data71)){const err178 = {instancePath:instancePath+"/components/" + i0+"/col",schemaPath:"#/properties/components/items/properties/col/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}}if(data55.pos !== undefined){let data72 = data55.pos;if(Array.isArray(data72)){if(data72.length > 2){const err179 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}if(data72.length < 2){const err180 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}const len6 = data72.length;if(len6 > 0){let data73 = data72[0];if(!((typeof data73 == "number") && (isFinite(data73)))){const err181 = {instancePath:instancePath+"/components/" + i0+"/pos/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}if(len6 > 1){let data74 = data72[1];if(!((typeof data74 == "number") && (isFinite(data74)))){const err182 = {instancePath:instancePath+"/components/" + i0+"/pos/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}const len7 = data72.length;if(!(len7 <= 2)){const err183 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}else {const err184 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}if(data55.size !== undefined){let data75 = data55.size;if(Array.isArray(data75)){if(data75.length > 2){const err185 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}if(data75.length < 2){const err186 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}const len8 = data75.length;if(len8 > 0){let data76 = data75[0];if((typeof data76 == "number") && (isFinite(data76))){if(data76 <= 0 || isNaN(data76)){const err187 = {instancePath:instancePath+"/components/" + i0+"/size/0",schemaPath:"#/properties/components/items/properties/size/prefixItems/0/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison: ">", limit: 0},message:"must be > 0"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}else {const err188 = {instancePath:instancePath+"/components/" + i0+"/size/0",schemaPath:"#/properties/components/items/properties/size/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}if(len8 > 1){let data77 = data75[1];if((typeof data77 == "number") && (isFinite(data77))){if(data77 <= 0 || isNaN(data77)){const err189 = {instancePath:instancePath+"/components/" + i0+"/size/1",schemaPath:"#/properties/components/items/properties/size/prefixItems/1/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison: ">", limit: 0},message:"must be > 0"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}else {const err190 = {instancePath:instancePath+"/components/" + i0+"/size/1",schemaPath:"#/properties/components/items/properties/size/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}const len9 = data75.length;if(!(len9 <= 2)){const err191 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}else {const err192 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}}else {const err193 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}}else {const err194 = {instancePath:instancePath+"/components",schemaPath:"#/properties/components/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}if(data.boundaries !== undefined){let data78 = data.boundaries;if(Array.isArray(data78)){const len10 = data78.length;for(let i2=0; i2<len10; i2++){let data79 = data78[i2];if(data79 && typeof data79 == "object" && !Array.isArray(data79)){if(data79.kind === undefined){const err195 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}if(data79.label === undefined){const err196 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}if(data79.wraps === undefined){const err197 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/required",keyword:"required",params:{missingProperty: "wraps"},message:"must have required property '"+"wraps"+"'"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}for(const key16 in data79){if(!((((key16 === "kind") || (key16 === "label")) || (key16 === "wraps")) || (key16 === "pad"))){const err198 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}}if(data79.kind !== undefined){let data80 = data79.kind;if(!((data80 === "region") || (data80 === "security-group"))){const err199 = {instancePath:instancePath+"/boundaries/" + i2+"/kind",schemaPath:"#/properties/boundaries/items/properties/kind/enum",keyword:"enum",params:{allowedValues: schema161.properties.boundaries.items.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}}if(data79.label !== undefined){let data81 = data79.label;if(typeof data81 === "string"){if(func3(data81) < 1){const err200 = {instancePath:instancePath+"/boundaries/" + i2+"/label",schemaPath:"#/properties/boundaries/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}}else {const err201 = {instancePath:instancePath+"/boundaries/" + i2+"/label",schemaPath:"#/properties/boundaries/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}}if(data79.wraps !== undefined){let data82 = data79.wraps;if(Array.isArray(data82)){if(data82.length < 1){const err202 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps",schemaPath:"#/properties/boundaries/items/properties/wraps/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}const len11 = data82.length;for(let i3=0; i3<len11; i3++){let data83 = data82[i3];if(typeof data83 === "string"){if(!pattern14.test(data83)){const err203 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps/" + i3,schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}}else {const err204 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps/" + i3,schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}}}else {const err205 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps",schemaPath:"#/properties/boundaries/items/properties/wraps/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err205];}else {vErrors.push(err205);}errors++;}}if(data79.pad !== undefined){let data84 = data79.pad;if((typeof data84 == "number") && (isFinite(data84))){if(data84 < 0 || isNaN(data84)){const err206 = {instancePath:instancePath+"/boundaries/" + i2+"/pad",schemaPath:"#/properties/boundaries/items/properties/pad/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err206];}else {vErrors.push(err206);}errors++;}}else {const err207 = {instancePath:instancePath+"/boundaries/" + i2+"/pad",schemaPath:"#/properties/boundaries/items/properties/pad/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err207];}else {vErrors.push(err207);}errors++;}}}else {const err208 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err208];}else {vErrors.push(err208);}errors++;}}}else {const err209 = {instancePath:instancePath+"/boundaries",schemaPath:"#/properties/boundaries/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err209];}else {vErrors.push(err209);}errors++;}}if(data.connections !== undefined){let data85 = data.connections;if(Array.isArray(data85)){const len12 = data85.length;for(let i4=0; i4<len12; i4++){let data86 = data85[i4];if(data86 && typeof data86 == "object" && !Array.isArray(data86)){if(data86.from === undefined){const err210 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err210];}else {vErrors.push(err210);}errors++;}if(data86.to === undefined){const err211 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err211];}else {vErrors.push(err211);}errors++;}for(const key17 in data86){if(!(func1.call(schema161.properties.connections.items.properties, key17))){const err212 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key17},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err212];}else {vErrors.push(err212);}errors++;}}if(data86.id !== undefined){let data87 = data86.id;if(typeof data87 === "string"){if(!pattern14.test(data87)){const err213 = {instancePath:instancePath+"/connections/" + i4+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err213];}else {vErrors.push(err213);}errors++;}}else {const err214 = {instancePath:instancePath+"/connections/" + i4+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err214];}else {vErrors.push(err214);}errors++;}}if(data86.from !== undefined){let data88 = data86.from;if(typeof data88 === "string"){if(!pattern14.test(data88)){const err215 = {instancePath:instancePath+"/connections/" + i4+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err215];}else {vErrors.push(err215);}errors++;}}else {const err216 = {instancePath:instancePath+"/connections/" + i4+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err216];}else {vErrors.push(err216);}errors++;}}if(data86.to !== undefined){let data89 = data86.to;if(typeof data89 === "string"){if(!pattern14.test(data89)){const err217 = {instancePath:instancePath+"/connections/" + i4+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err217];}else {vErrors.push(err217);}errors++;}}else {const err218 = {instancePath:instancePath+"/connections/" + i4+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err218];}else {vErrors.push(err218);}errors++;}}if(data86.label !== undefined){if(typeof data86.label !== "string"){const err219 = {instancePath:instancePath+"/connections/" + i4+"/label",schemaPath:"#/properties/connections/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err219];}else {vErrors.push(err219);}errors++;}}if(data86.variant !== undefined){let data91 = data86.variant;if(!((((data91 === "default") || (data91 === "emphasis")) || (data91 === "security")) || (data91 === "dashed"))){const err220 = {instancePath:instancePath+"/connections/" + i4+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema65.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err220];}else {vErrors.push(err220);}errors++;}}if(data86.fromSide !== undefined){let data92 = data86.fromSide;if(!((((data92 === "left") || (data92 === "right")) || (data92 === "top")) || (data92 === "bottom"))){const err221 = {instancePath:instancePath+"/connections/" + i4+"/fromSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema121.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err221];}else {vErrors.push(err221);}errors++;}}if(data86.toSide !== undefined){let data93 = data86.toSide;if(!((((data93 === "left") || (data93 === "right")) || (data93 === "top")) || (data93 === "bottom"))){const err222 = {instancePath:instancePath+"/connections/" + i4+"/toSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema121.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err222];}else {vErrors.push(err222);}errors++;}}if(data86.route !== undefined){let data94 = data86.route;if(!((((data94 === "auto") || (data94 === "straight")) || (data94 === "orthogonal-h")) || (data94 === "orthogonal-v"))){const err223 = {instancePath:instancePath+"/connections/" + i4+"/route",schemaPath:"#/properties/connections/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema161.properties.connections.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err223];}else {vErrors.push(err223);}errors++;}}if(data86.via !== undefined){let data95 = data86.via;if(Array.isArray(data95)){const len13 = data95.length;for(let i5=0; i5<len13; i5++){let data96 = data95[i5];if(Array.isArray(data96)){if(data96.length > 2){const err224 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err224];}else {vErrors.push(err224);}errors++;}if(data96.length < 2){const err225 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err225];}else {vErrors.push(err225);}errors++;}const len14 = data96.length;if(len14 > 0){let data97 = data96[0];if(!((typeof data97 == "number") && (isFinite(data97)))){const err226 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err226];}else {vErrors.push(err226);}errors++;}}if(len14 > 1){let data98 = data96[1];if(!((typeof data98 == "number") && (isFinite(data98)))){const err227 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err227];}else {vErrors.push(err227);}errors++;}}const len15 = data96.length;if(!(len15 <= 2)){const err228 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err228];}else {vErrors.push(err228);}errors++;}}else {const err229 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err229];}else {vErrors.push(err229);}errors++;}}}else {const err230 = {instancePath:instancePath+"/connections/" + i4+"/via",schemaPath:"#/properties/connections/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err230];}else {vErrors.push(err230);}errors++;}}if(data86.labelAt !== undefined){let data99 = data86.labelAt;if(Array.isArray(data99)){if(data99.length > 2){const err231 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err231];}else {vErrors.push(err231);}errors++;}if(data99.length < 2){const err232 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err232];}else {vErrors.push(err232);}errors++;}const len16 = data99.length;if(len16 > 0){let data100 = data99[0];if(!((typeof data100 == "number") && (isFinite(data100)))){const err233 = {instancePath:instancePath+"/connections/" + i4+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err233];}else {vErrors.push(err233);}errors++;}}if(len16 > 1){let data101 = data99[1];if(!((typeof data101 == "number") && (isFinite(data101)))){const err234 = {instancePath:instancePath+"/connections/" + i4+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err234];}else {vErrors.push(err234);}errors++;}}const len17 = data99.length;if(!(len17 <= 2)){const err235 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err235];}else {vErrors.push(err235);}errors++;}}else {const err236 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err236];}else {vErrors.push(err236);}errors++;}}if(data86.labelDx !== undefined){let data102 = data86.labelDx;if(!((typeof data102 == "number") && (isFinite(data102)))){const err237 = {instancePath:instancePath+"/connections/" + i4+"/labelDx",schemaPath:"#/properties/connections/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err237];}else {vErrors.push(err237);}errors++;}}if(data86.labelDy !== undefined){let data103 = data86.labelDy;if(!((typeof data103 == "number") && (isFinite(data103)))){const err238 = {instancePath:instancePath+"/connections/" + i4+"/labelDy",schemaPath:"#/properties/connections/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err238];}else {vErrors.push(err238);}errors++;}}if(data86.labelSegment !== undefined){let data104 = data86.labelSegment;if(!(((typeof data104 == "number") && (!(data104 % 1) && !isNaN(data104))) && (isFinite(data104)))){const err239 = {instancePath:instancePath+"/connections/" + i4+"/labelSegment",schemaPath:"#/properties/connections/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err239];}else {vErrors.push(err239);}errors++;}if((typeof data104 == "number") && (isFinite(data104))){if(data104 < 0 || isNaN(data104)){const err240 = {instancePath:instancePath+"/connections/" + i4+"/labelSegment",schemaPath:"#/properties/connections/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err240];}else {vErrors.push(err240);}errors++;}}}if(data86.width !== undefined){let data105 = data86.width;if((typeof data105 == "number") && (isFinite(data105))){if(data105 < 0.5 || isNaN(data105)){const err241 = {instancePath:instancePath+"/connections/" + i4+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err241];}else {vErrors.push(err241);}errors++;}}else {const err242 = {instancePath:instancePath+"/connections/" + i4+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err242];}else {vErrors.push(err242);}errors++;}}}else {const err243 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err243];}else {vErrors.push(err243);}errors++;}}}else {const err244 = {instancePath:instancePath+"/connections",schemaPath:"#/properties/connections/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err244];}else {vErrors.push(err244);}errors++;}}if(data.cards !== undefined){let data106 = data.cards;if(Array.isArray(data106)){const len18 = data106.length;for(let i6=0; i6<len18; i6++){let data107 = data106[i6];if(data107 && typeof data107 == "object" && !Array.isArray(data107)){if(data107.dot === undefined){const err245 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err245];}else {vErrors.push(err245);}errors++;}if(data107.title === undefined){const err246 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err246];}else {vErrors.push(err246);}errors++;}if(data107.items === undefined){const err247 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err247];}else {vErrors.push(err247);}errors++;}for(const key18 in data107){if(!(((key18 === "dot") || (key18 === "title")) || (key18 === "items"))){const err248 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key18},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err248];}else {vErrors.push(err248);}errors++;}}if(data107.dot !== undefined){let data108 = data107.dot;if(!(((((((data108 === "cyan") || (data108 === "emerald")) || (data108 === "violet")) || (data108 === "amber")) || (data108 === "rose")) || (data108 === "orange")) || (data108 === "slate"))){const err249 = {instancePath:instancePath+"/cards/" + i6+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema70.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err249];}else {vErrors.push(err249);}errors++;}}if(data107.title !== undefined){let data109 = data107.title;if(typeof data109 === "string"){if(func3(data109) < 1){const err250 = {instancePath:instancePath+"/cards/" + i6+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err250];}else {vErrors.push(err250);}errors++;}}else {const err251 = {instancePath:instancePath+"/cards/" + i6+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err251];}else {vErrors.push(err251);}errors++;}}if(data107.items !== undefined){let data110 = data107.items;if(Array.isArray(data110)){const len19 = data110.length;for(let i7=0; i7<len19; i7++){if(typeof data110[i7] !== "string"){const err252 = {instancePath:instancePath+"/cards/" + i6+"/items/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err252];}else {vErrors.push(err252);}errors++;}}}else {const err253 = {instancePath:instancePath+"/cards/" + i6+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err253];}else {vErrors.push(err253);}errors++;}}}else {const err254 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err254];}else {vErrors.push(err254);}errors++;}}}else {const err255 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err255];}else {vErrors.push(err255);}errors++;}}}else {const err256 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err256];}else {vErrors.push(err256);}errors++;}validate36.errors = vErrors;return errors === 0;}validate36.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};
+};const pattern4 = new RegExp("(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$", "u");const pattern5 = new RegExp("[\\\\<>:\"|?*\\u0000-\\u001F\\u007F-\\u009F]", "u");const pattern6 = new RegExp("[\\uD800-\\uDFFF]", "u");const pattern7 = new RegExp("(^|/)[.]{1,2}(/|$)", "u");const pattern8 = new RegExp("[. ](/|$)", "u");const pattern9 = new RegExp("(^|/)[^/]{256}", "u");const pattern10 = new RegExp("(^|/)(?:[Cc][Oo][Nn]|[Pp][Rr][Nn]|[Aa][Uu][Xx]|[Nn][Uu][Ll]|[Cc][Oo][Nn][Ii][Nn][$]|[Cc][Oo][Nn][Oo][Uu][Tt][$]|[Cc][Oo][Mm][1-9¹²³]|[Ll][Pp][Tt][1-9¹²³])(?:[.]|/|$)", "u");const pattern11 = new RegExp("(^|/)[^/]*~[1-9][0-9]*(?:[.]|/|$)", "u");const pattern12 = new RegExp("^[^/]+(?:/[^/]+)*$", "u");const pattern13 = new RegExp("^[a-fA-F0-9]{40}$", "u");const pattern14 = new RegExp("^[a-zA-Z][a-zA-Z0-9_-]*$", "u");const pattern27 = new RegExp("^[^\\r\\n]+$", "u");const pattern28 = new RegExp("^https?://", "u");const pattern30 = new RegExp("^[a-f0-9]{64}$", "u");const schema36 = {"type":"array","maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["id","label","focus"],"properties":{"id":{"$ref":"#/$defs/id"},"label":{"type":"string","minLength":1,"maxLength":48},"focus":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/id"}},"note":{"type":"string","maxLength":140}}}};function validate22(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate22.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern14.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern14.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate22.errors = vErrors;return errors === 0;}validate22.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};const schema54 = {"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"}}};function validate24(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate24.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.from === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.to === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "from") || (key0 === "to"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.from !== undefined){let data0 = data.from;if(typeof data0 === "string"){if(!pattern14.test(data0)){const err3 = {instancePath:instancePath+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.to !== undefined){let data1 = data.to;if(typeof data1 === "string"){if(!pattern14.test(data1)){const err5 = {instancePath:instancePath+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate24.errors = vErrors;return errors === 0;}validate24.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/workflow.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate20.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.lanes === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lanes"},message:"must have required property '"+"lanes"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.nodes === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "nodes"},message:"must have required property '"+"nodes"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.edges === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "edges"},message:"must have required property '"+"edges"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(func1.call(schema31.properties, key0))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.schema_version !== undefined){let data0 = data.schema_version;if(!((data0 === 1) || (data0 === 2))){const err7 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/enum",keyword:"enum",params:{allowedValues: schema31.properties.schema_version.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.diagram_type !== undefined){if("workflow" !== data.diagram_type){const err8 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "workflow"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data2.output === undefined){const err10 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "output"},message:"must have required property '"+"output"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}for(const key1 in data2){if(!(func1.call(schema31.properties.meta.properties, key1))){const err11 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err12 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!(((data4 === "en") || (data4 === "zh-CN")) || (data4 === "es"))){const err14 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err15 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data2.output !== undefined){let data6 = data2.output;if(typeof data6 === "string"){if(!pattern4.test(data6)){const err16 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/0/pattern",keyword:"pattern",params:{pattern: "(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"},message:"must match pattern \""+"(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"+"\""};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}const _errs18 = errors;const _errs19 = errors;if(typeof data6 === "string"){if(!pattern5.test(data6)){const err17 = {};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}var valid5 = _errs19 === errors;if(valid5){const err18 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/1/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}const _errs21 = errors;const _errs22 = errors;if(typeof data6 === "string"){if(!pattern6.test(data6)){const err19 = {};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}var valid6 = _errs22 === errors;if(valid6){const err20 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/2/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}const _errs24 = errors;const _errs25 = errors;if(typeof data6 === "string"){if(!pattern7.test(data6)){const err21 = {};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}var valid7 = _errs25 === errors;if(valid7){const err22 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/3/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}const _errs27 = errors;const _errs28 = errors;if(typeof data6 === "string"){if(!pattern8.test(data6)){const err23 = {};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}var valid8 = _errs28 === errors;if(valid8){const err24 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/4/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}else {errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}}const _errs30 = errors;const _errs31 = errors;if(typeof data6 === "string"){if(!pattern9.test(data6)){const err25 = {};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}var valid9 = _errs31 === errors;if(valid9){const err26 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/5/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}else {errors = _errs30;if(vErrors !== null){if(_errs30){vErrors.length = _errs30;}else {vErrors = null;}}}const _errs33 = errors;const _errs34 = errors;if(typeof data6 === "string"){if(!pattern10.test(data6)){const err27 = {};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}var valid10 = _errs34 === errors;if(valid10){const err28 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/6/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}else {errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}}const _errs36 = errors;const _errs37 = errors;if(typeof data6 === "string"){if(!pattern11.test(data6)){const err29 = {};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}var valid11 = _errs37 === errors;if(valid11){const err30 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/7/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}else {errors = _errs36;if(vErrors !== null){if(_errs36){vErrors.length = _errs36;}else {vErrors = null;}}}if(typeof data6 === "string"){if(func3(data6) < 1){const err31 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(!pattern12.test(data6)){const err32 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/pattern",keyword:"pattern",params:{pattern: "^[^/]+(?:/[^/]+)*$"},message:"must match pattern \""+"^[^/]+(?:/[^/]+)*$"+"\""};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err34 = {instancePath:instancePath+"/meta/animation",schemaPath:"#/properties/meta/properties/animation/enum",keyword:"enum",params:{allowedValues: schema31.properties.meta.properties.animation.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err35 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"#/properties/meta/properties/visual_preset/enum",keyword:"enum",params:{allowedValues: schema31.properties.meta.properties.visual_preset.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err36 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"#/properties/meta/properties/quality_profile/enum",keyword:"enum",params:{allowedValues: schema31.properties.meta.properties.quality_profile.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}if(data2.repository !== undefined){let data10 = data2.repository;if(data10 && typeof data10 == "object" && !Array.isArray(data10)){if(data10.url === undefined){const err37 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}if(data10.revision === undefined){const err38 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "revision"},message:"must have required property '"+"revision"+"'"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}for(const key2 in data10){if(!((((key2 === "url") || (key2 === "provider")) || (key2 === "link_mode")) || (key2 === "revision"))){const err39 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}if(data10.url !== undefined){let data11 = data10.url;if(typeof data11 === "string"){if(func3(data11) < 1){const err40 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}else {const err41 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data10.provider !== undefined){let data12 = data10.provider;if(!((data12 === "github") || (data12 === "gitee"))){const err42 = {instancePath:instancePath+"/meta/repository/provider",schemaPath:"common.schema.json#/$defs/repository/properties/provider/enum",keyword:"enum",params:{allowedValues: schema35.properties.provider.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data10.link_mode !== undefined){let data13 = data10.link_mode;if(!((data13 === "web") || (data13 === "local-only"))){const err43 = {instancePath:instancePath+"/meta/repository/link_mode",schemaPath:"common.schema.json#/$defs/repository/properties/link_mode/enum",keyword:"enum",params:{allowedValues: schema35.properties.link_mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}if(data10.revision !== undefined){let data14 = data10.revision;if(typeof data14 === "string"){if(!pattern13.test(data14)){const err44 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/pattern",keyword:"pattern",params:{pattern: "^[a-fA-F0-9]{40}$"},message:"must match pattern \""+"^[a-fA-F0-9]{40}$"+"\""};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}else {const err45 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}}else {const err46 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}if(data2.views !== undefined){if(!(validate22(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data16 = data2.legend;if(data16 && typeof data16 == "object" && !Array.isArray(data16)){for(const key3 in data16){if(!((key3 === "mode") || (key3 === "entries"))){const err47 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data16.mode !== undefined){let data17 = data16.mode;if(!(((data17 === "auto") || (data17 === "all")) || (data17 === "hidden"))){const err48 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema39.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}if(data16.entries !== undefined){let data18 = data16.entries;if(data18 && typeof data18 == "object" && !Array.isArray(data18)){for(const key4 in data18){if(!(((((((key4 === "frontend") || (key4 === "backend")) || (key4 === "database")) || (key4 === "cloud")) || (key4 === "security")) || (key4 === "messagebus")) || (key4 === "external"))){const err49 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data18.frontend !== undefined){let data19 = data18.frontend;if(data19 && typeof data19 == "object" && !Array.isArray(data19)){if(Object.keys(data19).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key5 in data19){if(!((key5 === "label") || (key5 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data19.label !== undefined){let data20 = data19.label;if(typeof data20 === "string"){if(func3(data20) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data20) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data19.visible !== undefined){if(typeof data19.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/frontend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}if(data18.backend !== undefined){let data22 = data18.backend;if(data22 && typeof data22 == "object" && !Array.isArray(data22)){if(Object.keys(data22).length < 1){const err57 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}for(const key6 in data22){if(!((key6 === "label") || (key6 === "visible"))){const err58 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data22.label !== undefined){let data23 = data22.label;if(typeof data23 === "string"){if(func3(data23) > 80){const err59 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(func3(data23) < 1){const err60 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}else {const err61 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data22.visible !== undefined){if(typeof data22.visible !== "boolean"){const err62 = {instancePath:instancePath+"/meta/legend/entries/backend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}}else {const err63 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}if(data18.database !== undefined){let data25 = data18.database;if(data25 && typeof data25 == "object" && !Array.isArray(data25)){if(Object.keys(data25).length < 1){const err64 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}for(const key7 in data25){if(!((key7 === "label") || (key7 === "visible"))){const err65 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data25.label !== undefined){let data26 = data25.label;if(typeof data26 === "string"){if(func3(data26) > 80){const err66 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}if(func3(data26) < 1){const err67 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}else {const err68 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}if(data25.visible !== undefined){if(typeof data25.visible !== "boolean"){const err69 = {instancePath:instancePath+"/meta/legend/entries/database/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}}else {const err70 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data18.cloud !== undefined){let data28 = data18.cloud;if(data28 && typeof data28 == "object" && !Array.isArray(data28)){if(Object.keys(data28).length < 1){const err71 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}for(const key8 in data28){if(!((key8 === "label") || (key8 === "visible"))){const err72 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data28.label !== undefined){let data29 = data28.label;if(typeof data29 === "string"){if(func3(data29) > 80){const err73 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}if(func3(data29) < 1){const err74 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}else {const err75 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data28.visible !== undefined){if(typeof data28.visible !== "boolean"){const err76 = {instancePath:instancePath+"/meta/legend/entries/cloud/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}}else {const err77 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}if(data18.security !== undefined){let data31 = data18.security;if(data31 && typeof data31 == "object" && !Array.isArray(data31)){if(Object.keys(data31).length < 1){const err78 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}for(const key9 in data31){if(!((key9 === "label") || (key9 === "visible"))){const err79 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}if(data31.label !== undefined){let data32 = data31.label;if(typeof data32 === "string"){if(func3(data32) > 80){const err80 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}if(func3(data32) < 1){const err81 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}else {const err82 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}if(data31.visible !== undefined){if(typeof data31.visible !== "boolean"){const err83 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}}else {const err84 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}if(data18.messagebus !== undefined){let data34 = data18.messagebus;if(data34 && typeof data34 == "object" && !Array.isArray(data34)){if(Object.keys(data34).length < 1){const err85 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}for(const key10 in data34){if(!((key10 === "label") || (key10 === "visible"))){const err86 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}if(data34.label !== undefined){let data35 = data34.label;if(typeof data35 === "string"){if(func3(data35) > 80){const err87 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}if(func3(data35) < 1){const err88 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}else {const err89 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}if(data34.visible !== undefined){if(typeof data34.visible !== "boolean"){const err90 = {instancePath:instancePath+"/meta/legend/entries/messagebus/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}}else {const err91 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}if(data18.external !== undefined){let data37 = data18.external;if(data37 && typeof data37 == "object" && !Array.isArray(data37)){if(Object.keys(data37).length < 1){const err92 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}for(const key11 in data37){if(!((key11 === "label") || (key11 === "visible"))){const err93 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}if(data37.label !== undefined){let data38 = data37.label;if(typeof data38 === "string"){if(func3(data38) > 80){const err94 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}if(func3(data38) < 1){const err95 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}else {const err96 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}if(data37.visible !== undefined){if(typeof data37.visible !== "boolean"){const err97 = {instancePath:instancePath+"/meta/legend/entries/external/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}else {const err98 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}}else {const err99 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}}else {const err100 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}if(data2.viewBox !== undefined){let data40 = data2.viewBox;if(Array.isArray(data40)){if(data40.length > 2){const err101 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}if(data40.length < 2){const err102 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}const len0 = data40.length;if(len0 > 0){let data41 = data40[0];if((typeof data41 == "number") && (isFinite(data41))){if(data41 < 700 || isNaN(data41)){const err103 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 700},message:"must be >= 700"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}else {const err104 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}if(len0 > 1){let data42 = data40[1];if((typeof data42 == "number") && (isFinite(data42))){if(data42 < 240 || isNaN(data42)){const err105 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 240},message:"must be >= 240"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}else {const err106 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}const len1 = data40.length;if(!(len1 <= 2)){const err107 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}else {const err108 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}}else {const err109 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}if(data.lanes !== undefined){let data43 = data.lanes;if(Array.isArray(data43)){if(data43.length < 1){const err110 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}const len2 = data43.length;for(let i0=0; i0<len2; i0++){let data44 = data43[i0];if(data44 && typeof data44 == "object" && !Array.isArray(data44)){if(data44.id === undefined){const err111 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}if(data44.label === undefined){const err112 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}for(const key12 in data44){if(!(((key12 === "id") || (key12 === "label")) || (key12 === "variant"))){const err113 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}if(data44.id !== undefined){let data45 = data44.id;if(typeof data45 === "string"){if(!pattern14.test(data45)){const err114 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}else {const err115 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}if(data44.label !== undefined){let data46 = data44.label;if(typeof data46 === "string"){if(func3(data46) < 1){const err116 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}else {const err117 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}if(data44.variant !== undefined){let data47 = data44.variant;if(!((data47 === "normal") || (data47 === "exception"))){const err118 = {instancePath:instancePath+"/lanes/" + i0+"/variant",schemaPath:"#/properties/lanes/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema31.properties.lanes.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}}else {const err119 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}}else {const err120 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data.phases !== undefined){let data48 = data.phases;if(Array.isArray(data48)){const len3 = data48.length;for(let i1=0; i1<len3; i1++){let data49 = data48[i1];if(data49 && typeof data49 == "object" && !Array.isArray(data49)){if(data49.id === undefined){const err121 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}if(data49.label === undefined){const err122 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}if(data49.fromCol === undefined){const err123 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "fromCol"},message:"must have required property '"+"fromCol"+"'"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}if(data49.toCol === undefined){const err124 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/required",keyword:"required",params:{missingProperty: "toCol"},message:"must have required property '"+"toCol"+"'"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}for(const key13 in data49){if(!(((((key13 === "id") || (key13 === "label")) || (key13 === "fromCol")) || (key13 === "toCol")) || (key13 === "variant"))){const err125 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}if(data49.id !== undefined){let data50 = data49.id;if(typeof data50 === "string"){if(!pattern14.test(data50)){const err126 = {instancePath:instancePath+"/phases/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}else {const err127 = {instancePath:instancePath+"/phases/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}if(data49.label !== undefined){let data51 = data49.label;if(typeof data51 === "string"){if(func3(data51) < 1){const err128 = {instancePath:instancePath+"/phases/" + i1+"/label",schemaPath:"#/properties/phases/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}else {const err129 = {instancePath:instancePath+"/phases/" + i1+"/label",schemaPath:"#/properties/phases/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}}if(data49.fromCol !== undefined){let data52 = data49.fromCol;if(!(((typeof data52 == "number") && (!(data52 % 1) && !isNaN(data52))) && (isFinite(data52)))){const err130 = {instancePath:instancePath+"/phases/" + i1+"/fromCol",schemaPath:"#/properties/phases/items/properties/fromCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}if((typeof data52 == "number") && (isFinite(data52))){if(data52 > 5 || isNaN(data52)){const err131 = {instancePath:instancePath+"/phases/" + i1+"/fromCol",schemaPath:"#/properties/phases/items/properties/fromCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}if(data52 < 0 || isNaN(data52)){const err132 = {instancePath:instancePath+"/phases/" + i1+"/fromCol",schemaPath:"#/properties/phases/items/properties/fromCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}}}if(data49.toCol !== undefined){let data53 = data49.toCol;if(!(((typeof data53 == "number") && (!(data53 % 1) && !isNaN(data53))) && (isFinite(data53)))){const err133 = {instancePath:instancePath+"/phases/" + i1+"/toCol",schemaPath:"#/properties/phases/items/properties/toCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}if((typeof data53 == "number") && (isFinite(data53))){if(data53 > 5 || isNaN(data53)){const err134 = {instancePath:instancePath+"/phases/" + i1+"/toCol",schemaPath:"#/properties/phases/items/properties/toCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}if(data53 < 0 || isNaN(data53)){const err135 = {instancePath:instancePath+"/phases/" + i1+"/toCol",schemaPath:"#/properties/phases/items/properties/toCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}}if(data49.variant !== undefined){let data54 = data49.variant;if(!((((data54 === "default") || (data54 === "emphasis")) || (data54 === "security")) || (data54 === "dashed"))){const err136 = {instancePath:instancePath+"/phases/" + i1+"/variant",schemaPath:"#/properties/phases/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema31.properties.phases.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}}else {const err137 = {instancePath:instancePath+"/phases/" + i1,schemaPath:"#/properties/phases/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}}else {const err138 = {instancePath:instancePath+"/phases",schemaPath:"#/properties/phases/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}if(data.groups !== undefined){let data55 = data.groups;if(Array.isArray(data55)){const len4 = data55.length;for(let i2=0; i2<len4; i2++){let data56 = data55[i2];if(data56 && typeof data56 == "object" && !Array.isArray(data56)){if(data56.id === undefined){const err139 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}if(data56.label === undefined){const err140 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}if(data56.lane === undefined){const err141 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "lane"},message:"must have required property '"+"lane"+"'"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}if(data56.fromCol === undefined){const err142 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "fromCol"},message:"must have required property '"+"fromCol"+"'"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}if(data56.toCol === undefined){const err143 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/required",keyword:"required",params:{missingProperty: "toCol"},message:"must have required property '"+"toCol"+"'"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}for(const key14 in data56){if(!((((((key14 === "id") || (key14 === "label")) || (key14 === "lane")) || (key14 === "fromCol")) || (key14 === "toCol")) || (key14 === "variant"))){const err144 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}if(data56.id !== undefined){let data57 = data56.id;if(typeof data57 === "string"){if(!pattern14.test(data57)){const err145 = {instancePath:instancePath+"/groups/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}else {const err146 = {instancePath:instancePath+"/groups/" + i2+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}if(data56.label !== undefined){let data58 = data56.label;if(typeof data58 === "string"){if(func3(data58) < 1){const err147 = {instancePath:instancePath+"/groups/" + i2+"/label",schemaPath:"#/properties/groups/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}else {const err148 = {instancePath:instancePath+"/groups/" + i2+"/label",schemaPath:"#/properties/groups/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}}if(data56.lane !== undefined){let data59 = data56.lane;if(typeof data59 === "string"){if(!pattern14.test(data59)){const err149 = {instancePath:instancePath+"/groups/" + i2+"/lane",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}}else {const err150 = {instancePath:instancePath+"/groups/" + i2+"/lane",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}if(data56.fromCol !== undefined){let data60 = data56.fromCol;if(!(((typeof data60 == "number") && (!(data60 % 1) && !isNaN(data60))) && (isFinite(data60)))){const err151 = {instancePath:instancePath+"/groups/" + i2+"/fromCol",schemaPath:"#/properties/groups/items/properties/fromCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}if((typeof data60 == "number") && (isFinite(data60))){if(data60 > 5 || isNaN(data60)){const err152 = {instancePath:instancePath+"/groups/" + i2+"/fromCol",schemaPath:"#/properties/groups/items/properties/fromCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}if(data60 < 0 || isNaN(data60)){const err153 = {instancePath:instancePath+"/groups/" + i2+"/fromCol",schemaPath:"#/properties/groups/items/properties/fromCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}}if(data56.toCol !== undefined){let data61 = data56.toCol;if(!(((typeof data61 == "number") && (!(data61 % 1) && !isNaN(data61))) && (isFinite(data61)))){const err154 = {instancePath:instancePath+"/groups/" + i2+"/toCol",schemaPath:"#/properties/groups/items/properties/toCol/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}if((typeof data61 == "number") && (isFinite(data61))){if(data61 > 5 || isNaN(data61)){const err155 = {instancePath:instancePath+"/groups/" + i2+"/toCol",schemaPath:"#/properties/groups/items/properties/toCol/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}if(data61 < 0 || isNaN(data61)){const err156 = {instancePath:instancePath+"/groups/" + i2+"/toCol",schemaPath:"#/properties/groups/items/properties/toCol/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}}if(data56.variant !== undefined){let data62 = data56.variant;if(!((((data62 === "default") || (data62 === "emphasis")) || (data62 === "security")) || (data62 === "dashed"))){const err157 = {instancePath:instancePath+"/groups/" + i2+"/variant",schemaPath:"#/properties/groups/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema31.properties.groups.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}}else {const err158 = {instancePath:instancePath+"/groups/" + i2,schemaPath:"#/properties/groups/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}}}else {const err159 = {instancePath:instancePath+"/groups",schemaPath:"#/properties/groups/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}}if(data.mainPath !== undefined){let data63 = data.mainPath;if(Array.isArray(data63)){if(data63.length < 2){const err160 = {instancePath:instancePath+"/mainPath",schemaPath:"#/properties/mainPath/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}const len5 = data63.length;for(let i3=0; i3<len5; i3++){let data64 = data63[i3];if(typeof data64 === "string"){if(!pattern14.test(data64)){const err161 = {instancePath:instancePath+"/mainPath/" + i3,schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}}else {const err162 = {instancePath:instancePath+"/mainPath/" + i3,schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}}}else {const err163 = {instancePath:instancePath+"/mainPath",schemaPath:"#/properties/mainPath/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}}if(data.semanticChecks !== undefined){let data65 = data.semanticChecks;if(data65 && typeof data65 == "object" && !Array.isArray(data65)){if(Object.keys(data65).length < 1){const err164 = {instancePath:instancePath+"/semanticChecks",schemaPath:"#/properties/semanticChecks/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}for(const key15 in data65){if(!((((key15 === "allowedRoots") || (key15 === "allowedTerminals")) || (key15 === "requiredEdges")) || (key15 === "requiredPaths"))){const err165 = {instancePath:instancePath+"/semanticChecks",schemaPath:"#/properties/semanticChecks/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}if(data65.allowedRoots !== undefined){let data66 = data65.allowedRoots;if(Array.isArray(data66)){const len6 = data66.length;for(let i4=0; i4<len6; i4++){let data67 = data66[i4];if(typeof data67 === "string"){if(!pattern14.test(data67)){const err166 = {instancePath:instancePath+"/semanticChecks/allowedRoots/" + i4,schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}else {const err167 = {instancePath:instancePath+"/semanticChecks/allowedRoots/" + i4,schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}}else {const err168 = {instancePath:instancePath+"/semanticChecks/allowedRoots",schemaPath:"#/properties/semanticChecks/properties/allowedRoots/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}if(data65.allowedTerminals !== undefined){let data68 = data65.allowedTerminals;if(Array.isArray(data68)){const len7 = data68.length;for(let i5=0; i5<len7; i5++){let data69 = data68[i5];if(typeof data69 === "string"){if(!pattern14.test(data69)){const err169 = {instancePath:instancePath+"/semanticChecks/allowedTerminals/" + i5,schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}else {const err170 = {instancePath:instancePath+"/semanticChecks/allowedTerminals/" + i5,schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}}else {const err171 = {instancePath:instancePath+"/semanticChecks/allowedTerminals",schemaPath:"#/properties/semanticChecks/properties/allowedTerminals/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}if(data65.requiredEdges !== undefined){let data70 = data65.requiredEdges;if(Array.isArray(data70)){const len8 = data70.length;for(let i6=0; i6<len8; i6++){if(!(validate24(data70[i6], {instancePath:instancePath+"/semanticChecks/requiredEdges/" + i6,parentData:data70,parentDataProperty:i6,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate24.errors : vErrors.concat(validate24.errors);errors = vErrors.length;}}}else {const err172 = {instancePath:instancePath+"/semanticChecks/requiredEdges",schemaPath:"#/properties/semanticChecks/properties/requiredEdges/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}if(data65.requiredPaths !== undefined){let data72 = data65.requiredPaths;if(Array.isArray(data72)){const len9 = data72.length;for(let i7=0; i7<len9; i7++){if(!(validate24(data72[i7], {instancePath:instancePath+"/semanticChecks/requiredPaths/" + i7,parentData:data72,parentDataProperty:i7,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate24.errors : vErrors.concat(validate24.errors);errors = vErrors.length;}}}else {const err173 = {instancePath:instancePath+"/semanticChecks/requiredPaths",schemaPath:"#/properties/semanticChecks/properties/requiredPaths/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}}else {const err174 = {instancePath:instancePath+"/semanticChecks",schemaPath:"#/properties/semanticChecks/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}}if(data.nodes !== undefined){let data74 = data.nodes;if(Array.isArray(data74)){if(data74.length < 1){const err175 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}const len10 = data74.length;for(let i8=0; i8<len10; i8++){let data75 = data74[i8];if(data75 && typeof data75 == "object" && !Array.isArray(data75)){if(data75.id === undefined){const err176 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}if(data75.lane === undefined){const err177 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "lane"},message:"must have required property '"+"lane"+"'"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}if(data75.col === undefined){const err178 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "col"},message:"must have required property '"+"col"+"'"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}if(data75.type === undefined){const err179 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}if(data75.label === undefined){const err180 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}for(const key16 in data75){if(!(func1.call(schema31.properties.nodes.items.properties, key16))){const err181 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}if(data75.id !== undefined){let data76 = data75.id;if(typeof data76 === "string"){if(!pattern14.test(data76)){const err182 = {instancePath:instancePath+"/nodes/" + i8+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}else {const err183 = {instancePath:instancePath+"/nodes/" + i8+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}if(data75.lane !== undefined){let data77 = data75.lane;if(typeof data77 === "string"){if(!pattern14.test(data77)){const err184 = {instancePath:instancePath+"/nodes/" + i8+"/lane",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}else {const err185 = {instancePath:instancePath+"/nodes/" + i8+"/lane",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}if(data75.col !== undefined){let data78 = data75.col;if(!(((typeof data78 == "number") && (!(data78 % 1) && !isNaN(data78))) && (isFinite(data78)))){const err186 = {instancePath:instancePath+"/nodes/" + i8+"/col",schemaPath:"#/properties/nodes/items/properties/col/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}if((typeof data78 == "number") && (isFinite(data78))){if(data78 > 5 || isNaN(data78)){const err187 = {instancePath:instancePath+"/nodes/" + i8+"/col",schemaPath:"#/properties/nodes/items/properties/col/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}if(data78 < 0 || isNaN(data78)){const err188 = {instancePath:instancePath+"/nodes/" + i8+"/col",schemaPath:"#/properties/nodes/items/properties/col/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}}if(data75.type !== undefined){let data79 = data75.type;if(!(((((((data79 === "frontend") || (data79 === "backend")) || (data79 === "database")) || (data79 === "cloud")) || (data79 === "security")) || (data79 === "messagebus")) || (data79 === "external"))){const err189 = {instancePath:instancePath+"/nodes/" + i8+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema59.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}if(data75.label !== undefined){let data80 = data75.label;if(typeof data80 === "string"){if(func3(data80) < 1){const err190 = {instancePath:instancePath+"/nodes/" + i8+"/label",schemaPath:"#/properties/nodes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}else {const err191 = {instancePath:instancePath+"/nodes/" + i8+"/label",schemaPath:"#/properties/nodes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}if(data75.sublabel !== undefined){if(typeof data75.sublabel !== "string"){const err192 = {instancePath:instancePath+"/nodes/" + i8+"/sublabel",schemaPath:"#/properties/nodes/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}if(data75.tag !== undefined){if(typeof data75.tag !== "string"){const err193 = {instancePath:instancePath+"/nodes/" + i8+"/tag",schemaPath:"#/properties/nodes/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}if(data75.brand !== undefined){let data83 = data75.brand;const _errs213 = errors;let valid66 = false;let passing0 = null;const _errs214 = errors;const _errs216 = errors;let valid67 = false;const _errs217 = errors;if(typeof data83 === "string"){if(func3(data83) > 80){const err194 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}if(!pattern27.test(data83)){const err195 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}}var _valid1 = _errs217 === errors;valid67 = valid67 || _valid1;const _errs218 = errors;if(typeof data83 === "string"){if(!pattern28.test(data83)){const err196 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}}var _valid1 = _errs218 === errors;valid67 = valid67 || _valid1;if(!valid67){const err197 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}else {errors = _errs216;if(vErrors !== null){if(_errs216){vErrors.length = _errs216;}else {vErrors = null;}}}if(typeof data83 === "string"){if(func3(data83) > 2048){const err198 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}if(func3(data83) < 1){const err199 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}}else {const err200 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}var _valid0 = _errs214 === errors;if(_valid0){valid66 = true;passing0 = 0;}const _errs219 = errors;if(data83 && typeof data83 == "object" && !Array.isArray(data83)){if(data83.url === undefined){const err201 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}if(data83.sha256 === undefined){const err202 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}for(const key17 in data83){if(!((key17 === "url") || (key17 === "sha256"))){const err203 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key17},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}}if(data83.url !== undefined){let data84 = data83.url;if(typeof data84 === "string"){if(func3(data84) > 2048){const err204 = {instancePath:instancePath+"/nodes/" + i8+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}if(func3(data84) < 8){const err205 = {instancePath:instancePath+"/nodes/" + i8+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err205];}else {vErrors.push(err205);}errors++;}if(!pattern28.test(data84)){const err206 = {instancePath:instancePath+"/nodes/" + i8+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err206];}else {vErrors.push(err206);}errors++;}}else {const err207 = {instancePath:instancePath+"/nodes/" + i8+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err207];}else {vErrors.push(err207);}errors++;}}if(data83.sha256 !== undefined){let data85 = data83.sha256;if(typeof data85 === "string"){if(!pattern30.test(data85)){const err208 = {instancePath:instancePath+"/nodes/" + i8+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err208];}else {vErrors.push(err208);}errors++;}}else {const err209 = {instancePath:instancePath+"/nodes/" + i8+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err209];}else {vErrors.push(err209);}errors++;}}}else {const err210 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err210];}else {vErrors.push(err210);}errors++;}var _valid0 = _errs219 === errors;if(_valid0 && valid66){valid66 = false;passing0 = [passing0, 1];}else {if(_valid0){valid66 = true;passing0 = 1;}}if(!valid66){const err211 = {instancePath:instancePath+"/nodes/" + i8+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err211];}else {vErrors.push(err211);}errors++;}else {errors = _errs213;if(vErrors !== null){if(_errs213){vErrors.length = _errs213;}else {vErrors = null;}}}}if(data75.sources !== undefined){let data86 = data75.sources;if(Array.isArray(data86)){if(data86.length > 3){const err212 = {instancePath:instancePath+"/nodes/" + i8+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err212];}else {vErrors.push(err212);}errors++;}if(data86.length < 1){const err213 = {instancePath:instancePath+"/nodes/" + i8+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err213];}else {vErrors.push(err213);}errors++;}const len11 = data86.length;for(let i9=0; i9<len11; i9++){let data87 = data86[i9];if(data87 && typeof data87 == "object" && !Array.isArray(data87)){if(data87.path === undefined){const err214 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9,schemaPath:"common.schema.json#/$defs/sourceReferences/items/required",keyword:"required",params:{missingProperty: "path"},message:"must have required property '"+"path"+"'"};if(vErrors === null){vErrors = [err214];}else {vErrors.push(err214);}errors++;}for(const key18 in data87){if(!((((key18 === "path") || (key18 === "line")) || (key18 === "end_line")) || (key18 === "label"))){const err215 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9,schemaPath:"common.schema.json#/$defs/sourceReferences/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key18},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err215];}else {vErrors.push(err215);}errors++;}}if(data87.path !== undefined){let data88 = data87.path;if(typeof data88 === "string"){if(func3(data88) > 240){const err216 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/maxLength",keyword:"maxLength",params:{limit: 240},message:"must NOT have more than 240 characters"};if(vErrors === null){vErrors = [err216];}else {vErrors.push(err216);}errors++;}if(func3(data88) < 1){const err217 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err217];}else {vErrors.push(err217);}errors++;}}else {const err218 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err218];}else {vErrors.push(err218);}errors++;}}if(data87.line !== undefined){let data89 = data87.line;if(!(((typeof data89 == "number") && (!(data89 % 1) && !isNaN(data89))) && (isFinite(data89)))){const err219 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err219];}else {vErrors.push(err219);}errors++;}if((typeof data89 == "number") && (isFinite(data89))){if(data89 < 1 || isNaN(data89)){const err220 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err220];}else {vErrors.push(err220);}errors++;}}}if(data87.end_line !== undefined){let data90 = data87.end_line;if(!(((typeof data90 == "number") && (!(data90 % 1) && !isNaN(data90))) && (isFinite(data90)))){const err221 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err221];}else {vErrors.push(err221);}errors++;}if((typeof data90 == "number") && (isFinite(data90))){if(data90 < 1 || isNaN(data90)){const err222 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err222];}else {vErrors.push(err222);}errors++;}}}if(data87.label !== undefined){let data91 = data87.label;if(typeof data91 === "string"){if(func3(data91) > 48){const err223 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err223];}else {vErrors.push(err223);}errors++;}if(func3(data91) < 1){const err224 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err224];}else {vErrors.push(err224);}errors++;}}else {const err225 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err225];}else {vErrors.push(err225);}errors++;}}}else {const err226 = {instancePath:instancePath+"/nodes/" + i8+"/sources/" + i9,schemaPath:"common.schema.json#/$defs/sourceReferences/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err226];}else {vErrors.push(err226);}errors++;}}}else {const err227 = {instancePath:instancePath+"/nodes/" + i8+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err227];}else {vErrors.push(err227);}errors++;}}if(data75.width !== undefined){let data92 = data75.width;if((typeof data92 == "number") && (isFinite(data92))){if(data92 < 32 || isNaN(data92)){const err228 = {instancePath:instancePath+"/nodes/" + i8+"/width",schemaPath:"#/properties/nodes/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 32},message:"must be >= 32"};if(vErrors === null){vErrors = [err228];}else {vErrors.push(err228);}errors++;}}else {const err229 = {instancePath:instancePath+"/nodes/" + i8+"/width",schemaPath:"#/properties/nodes/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err229];}else {vErrors.push(err229);}errors++;}}if(data75.height !== undefined){let data93 = data75.height;if((typeof data93 == "number") && (isFinite(data93))){if(data93 < 32 || isNaN(data93)){const err230 = {instancePath:instancePath+"/nodes/" + i8+"/height",schemaPath:"#/properties/nodes/items/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 32},message:"must be >= 32"};if(vErrors === null){vErrors = [err230];}else {vErrors.push(err230);}errors++;}}else {const err231 = {instancePath:instancePath+"/nodes/" + i8+"/height",schemaPath:"#/properties/nodes/items/properties/height/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err231];}else {vErrors.push(err231);}errors++;}}if(data75.yOffset !== undefined){let data94 = data75.yOffset;if(!((typeof data94 == "number") && (isFinite(data94)))){const err232 = {instancePath:instancePath+"/nodes/" + i8+"/yOffset",schemaPath:"#/properties/nodes/items/properties/yOffset/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err232];}else {vErrors.push(err232);}errors++;}}}else {const err233 = {instancePath:instancePath+"/nodes/" + i8,schemaPath:"#/properties/nodes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err233];}else {vErrors.push(err233);}errors++;}}}else {const err234 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err234];}else {vErrors.push(err234);}errors++;}}if(data.edges !== undefined){let data95 = data.edges;if(Array.isArray(data95)){const len12 = data95.length;for(let i10=0; i10<len12; i10++){let data96 = data95[i10];if(data96 && typeof data96 == "object" && !Array.isArray(data96)){if(data96.from === undefined){const err235 = {instancePath:instancePath+"/edges/" + i10,schemaPath:"#/properties/edges/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err235];}else {vErrors.push(err235);}errors++;}if(data96.to === undefined){const err236 = {instancePath:instancePath+"/edges/" + i10,schemaPath:"#/properties/edges/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err236];}else {vErrors.push(err236);}errors++;}for(const key19 in data96){if(!(func1.call(schema31.properties.edges.items.properties, key19))){const err237 = {instancePath:instancePath+"/edges/" + i10,schemaPath:"#/properties/edges/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key19},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err237];}else {vErrors.push(err237);}errors++;}}if(data96.id !== undefined){let data97 = data96.id;if(typeof data97 === "string"){if(!pattern14.test(data97)){const err238 = {instancePath:instancePath+"/edges/" + i10+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err238];}else {vErrors.push(err238);}errors++;}}else {const err239 = {instancePath:instancePath+"/edges/" + i10+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err239];}else {vErrors.push(err239);}errors++;}}if(data96.from !== undefined){let data98 = data96.from;if(typeof data98 === "string"){if(!pattern14.test(data98)){const err240 = {instancePath:instancePath+"/edges/" + i10+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err240];}else {vErrors.push(err240);}errors++;}}else {const err241 = {instancePath:instancePath+"/edges/" + i10+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err241];}else {vErrors.push(err241);}errors++;}}if(data96.to !== undefined){let data99 = data96.to;if(typeof data99 === "string"){if(!pattern14.test(data99)){const err242 = {instancePath:instancePath+"/edges/" + i10+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err242];}else {vErrors.push(err242);}errors++;}}else {const err243 = {instancePath:instancePath+"/edges/" + i10+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err243];}else {vErrors.push(err243);}errors++;}}if(data96.label !== undefined){if(typeof data96.label !== "string"){const err244 = {instancePath:instancePath+"/edges/" + i10+"/label",schemaPath:"#/properties/edges/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err244];}else {vErrors.push(err244);}errors++;}}if(data96.variant !== undefined){let data101 = data96.variant;if(!((((data101 === "default") || (data101 === "emphasis")) || (data101 === "security")) || (data101 === "dashed"))){const err245 = {instancePath:instancePath+"/edges/" + i10+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema65.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err245];}else {vErrors.push(err245);}errors++;}}if(data96.role !== undefined){let data102 = data96.role;if(!(((((data102 === "main") || (data102 === "branch")) || (data102 === "async")) || (data102 === "return")) || (data102 === "error"))){const err246 = {instancePath:instancePath+"/edges/" + i10+"/role",schemaPath:"#/properties/edges/items/properties/role/enum",keyword:"enum",params:{allowedValues: schema31.properties.edges.items.properties.role.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err246];}else {vErrors.push(err246);}errors++;}}if(data96.fromSide !== undefined){let data103 = data96.fromSide;if(!((((data103 === "left") || (data103 === "right")) || (data103 === "top")) || (data103 === "bottom"))){const err247 = {instancePath:instancePath+"/edges/" + i10+"/fromSide",schemaPath:"#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema66.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err247];}else {vErrors.push(err247);}errors++;}}if(data96.toSide !== undefined){let data104 = data96.toSide;if(!((((data104 === "left") || (data104 === "right")) || (data104 === "top")) || (data104 === "bottom"))){const err248 = {instancePath:instancePath+"/edges/" + i10+"/toSide",schemaPath:"#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema66.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err248];}else {vErrors.push(err248);}errors++;}}if(data96.route !== undefined){let data105 = data96.route;if(!(((((((data105 === "auto") || (data105 === "straight")) || (data105 === "drop")) || (data105 === "outside-right")) || (data105 === "return-left")) || (data105 === "bottom-channel")) || (data105 === "up-channel"))){const err249 = {instancePath:instancePath+"/edges/" + i10+"/route",schemaPath:"#/properties/edges/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema31.properties.edges.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err249];}else {vErrors.push(err249);}errors++;}}if(data96.via !== undefined){let data106 = data96.via;if(Array.isArray(data106)){const len13 = data106.length;for(let i11=0; i11<len13; i11++){let data107 = data106[i11];if(Array.isArray(data107)){if(data107.length > 2){const err250 = {instancePath:instancePath+"/edges/" + i10+"/via/" + i11,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err250];}else {vErrors.push(err250);}errors++;}if(data107.length < 2){const err251 = {instancePath:instancePath+"/edges/" + i10+"/via/" + i11,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err251];}else {vErrors.push(err251);}errors++;}const len14 = data107.length;if(len14 > 0){let data108 = data107[0];if(!((typeof data108 == "number") && (isFinite(data108)))){const err252 = {instancePath:instancePath+"/edges/" + i10+"/via/" + i11+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err252];}else {vErrors.push(err252);}errors++;}}if(len14 > 1){let data109 = data107[1];if(!((typeof data109 == "number") && (isFinite(data109)))){const err253 = {instancePath:instancePath+"/edges/" + i10+"/via/" + i11+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err253];}else {vErrors.push(err253);}errors++;}}const len15 = data107.length;if(!(len15 <= 2)){const err254 = {instancePath:instancePath+"/edges/" + i10+"/via/" + i11,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err254];}else {vErrors.push(err254);}errors++;}}else {const err255 = {instancePath:instancePath+"/edges/" + i10+"/via/" + i11,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err255];}else {vErrors.push(err255);}errors++;}}}else {const err256 = {instancePath:instancePath+"/edges/" + i10+"/via",schemaPath:"#/properties/edges/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err256];}else {vErrors.push(err256);}errors++;}}if(data96.labelAt !== undefined){let data110 = data96.labelAt;if(Array.isArray(data110)){if(data110.length > 2){const err257 = {instancePath:instancePath+"/edges/" + i10+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err257];}else {vErrors.push(err257);}errors++;}if(data110.length < 2){const err258 = {instancePath:instancePath+"/edges/" + i10+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err258];}else {vErrors.push(err258);}errors++;}const len16 = data110.length;if(len16 > 0){let data111 = data110[0];if(!((typeof data111 == "number") && (isFinite(data111)))){const err259 = {instancePath:instancePath+"/edges/" + i10+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err259];}else {vErrors.push(err259);}errors++;}}if(len16 > 1){let data112 = data110[1];if(!((typeof data112 == "number") && (isFinite(data112)))){const err260 = {instancePath:instancePath+"/edges/" + i10+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err260];}else {vErrors.push(err260);}errors++;}}const len17 = data110.length;if(!(len17 <= 2)){const err261 = {instancePath:instancePath+"/edges/" + i10+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err261];}else {vErrors.push(err261);}errors++;}}else {const err262 = {instancePath:instancePath+"/edges/" + i10+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err262];}else {vErrors.push(err262);}errors++;}}if(data96.labelDx !== undefined){let data113 = data96.labelDx;if(!((typeof data113 == "number") && (isFinite(data113)))){const err263 = {instancePath:instancePath+"/edges/" + i10+"/labelDx",schemaPath:"#/properties/edges/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err263];}else {vErrors.push(err263);}errors++;}}if(data96.labelDy !== undefined){let data114 = data96.labelDy;if(!((typeof data114 == "number") && (isFinite(data114)))){const err264 = {instancePath:instancePath+"/edges/" + i10+"/labelDy",schemaPath:"#/properties/edges/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err264];}else {vErrors.push(err264);}errors++;}}if(data96.labelSegment !== undefined){let data115 = data96.labelSegment;if(!(((typeof data115 == "number") && (!(data115 % 1) && !isNaN(data115))) && (isFinite(data115)))){const err265 = {instancePath:instancePath+"/edges/" + i10+"/labelSegment",schemaPath:"#/properties/edges/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err265];}else {vErrors.push(err265);}errors++;}if((typeof data115 == "number") && (isFinite(data115))){if(data115 < 0 || isNaN(data115)){const err266 = {instancePath:instancePath+"/edges/" + i10+"/labelSegment",schemaPath:"#/properties/edges/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err266];}else {vErrors.push(err266);}errors++;}}}if(data96.channelX !== undefined){let data116 = data96.channelX;if(!((typeof data116 == "number") && (isFinite(data116)))){const err267 = {instancePath:instancePath+"/edges/" + i10+"/channelX",schemaPath:"#/properties/edges/items/properties/channelX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err267];}else {vErrors.push(err267);}errors++;}}if(data96.channelY !== undefined){let data117 = data96.channelY;if(!((typeof data117 == "number") && (isFinite(data117)))){const err268 = {instancePath:instancePath+"/edges/" + i10+"/channelY",schemaPath:"#/properties/edges/items/properties/channelY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err268];}else {vErrors.push(err268);}errors++;}}if(data96.bias !== undefined){let data118 = data96.bias;if((typeof data118 == "number") && (isFinite(data118))){if(data118 > 1 || isNaN(data118)){const err269 = {instancePath:instancePath+"/edges/" + i10+"/bias",schemaPath:"#/properties/edges/items/properties/bias/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1},message:"must be <= 1"};if(vErrors === null){vErrors = [err269];}else {vErrors.push(err269);}errors++;}if(data118 < 0 || isNaN(data118)){const err270 = {instancePath:instancePath+"/edges/" + i10+"/bias",schemaPath:"#/properties/edges/items/properties/bias/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err270];}else {vErrors.push(err270);}errors++;}}else {const err271 = {instancePath:instancePath+"/edges/" + i10+"/bias",schemaPath:"#/properties/edges/items/properties/bias/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err271];}else {vErrors.push(err271);}errors++;}}if(data96.width !== undefined){let data119 = data96.width;if((typeof data119 == "number") && (isFinite(data119))){if(data119 < 0.5 || isNaN(data119)){const err272 = {instancePath:instancePath+"/edges/" + i10+"/width",schemaPath:"#/properties/edges/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err272];}else {vErrors.push(err272);}errors++;}}else {const err273 = {instancePath:instancePath+"/edges/" + i10+"/width",schemaPath:"#/properties/edges/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err273];}else {vErrors.push(err273);}errors++;}}}else {const err274 = {instancePath:instancePath+"/edges/" + i10,schemaPath:"#/properties/edges/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err274];}else {vErrors.push(err274);}errors++;}}}else {const err275 = {instancePath:instancePath+"/edges",schemaPath:"#/properties/edges/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err275];}else {vErrors.push(err275);}errors++;}}if(data.cards !== undefined){let data120 = data.cards;if(Array.isArray(data120)){const len18 = data120.length;for(let i12=0; i12<len18; i12++){let data121 = data120[i12];if(data121 && typeof data121 == "object" && !Array.isArray(data121)){if(data121.dot === undefined){const err276 = {instancePath:instancePath+"/cards/" + i12,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err276];}else {vErrors.push(err276);}errors++;}if(data121.title === undefined){const err277 = {instancePath:instancePath+"/cards/" + i12,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err277];}else {vErrors.push(err277);}errors++;}if(data121.items === undefined){const err278 = {instancePath:instancePath+"/cards/" + i12,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err278];}else {vErrors.push(err278);}errors++;}for(const key20 in data121){if(!(((key20 === "dot") || (key20 === "title")) || (key20 === "items"))){const err279 = {instancePath:instancePath+"/cards/" + i12,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key20},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err279];}else {vErrors.push(err279);}errors++;}}if(data121.dot !== undefined){let data122 = data121.dot;if(!(((((((data122 === "cyan") || (data122 === "emerald")) || (data122 === "violet")) || (data122 === "amber")) || (data122 === "rose")) || (data122 === "orange")) || (data122 === "slate"))){const err280 = {instancePath:instancePath+"/cards/" + i12+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema70.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err280];}else {vErrors.push(err280);}errors++;}}if(data121.title !== undefined){let data123 = data121.title;if(typeof data123 === "string"){if(func3(data123) < 1){const err281 = {instancePath:instancePath+"/cards/" + i12+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err281];}else {vErrors.push(err281);}errors++;}}else {const err282 = {instancePath:instancePath+"/cards/" + i12+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err282];}else {vErrors.push(err282);}errors++;}}if(data121.items !== undefined){let data124 = data121.items;if(Array.isArray(data124)){const len19 = data124.length;for(let i13=0; i13<len19; i13++){if(typeof data124[i13] !== "string"){const err283 = {instancePath:instancePath+"/cards/" + i12+"/items/" + i13,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err283];}else {vErrors.push(err283);}errors++;}}}else {const err284 = {instancePath:instancePath+"/cards/" + i12+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err284];}else {vErrors.push(err284);}errors++;}}}else {const err285 = {instancePath:instancePath+"/cards/" + i12,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err285];}else {vErrors.push(err285);}errors++;}}}else {const err286 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err286];}else {vErrors.push(err286);}errors++;}}}else {const err287 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err287];}else {vErrors.push(err287);}errors++;}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const sequenceSchema = validate27;const schema71 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/sequence.schema.json","title":"Archify Sequence Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","participants","messages"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"sequence"},"meta":{"type":"object","additionalProperties":false,"required":["title","output"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"$ref":"common.schema.json#/$defs/portableOutputPath"},"animation":{"$ref":"common.schema.json#/$defs/animation"},"visual_preset":{"$ref":"common.schema.json#/$defs/visualPreset"},"quality_profile":{"$ref":"common.schema.json#/$defs/qualityProfile"},"column_fit":{"description":"Horizontal participant layout. Omit this field or use fixed for the stable 86px boxes and 108px gap. Use spread when a wide viewBox would leave unused horizontal space or meaningful participant labels do not fit the fixed boxes; spread derives wider boxes and gaps from the viewBox without changing participant order or message semantics.","enum":["fixed","spread"]},"repository":{"$ref":"common.schema.json#/$defs/repository"},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"default":{"$ref":"common.schema.json#/$defs/legendEntry"},"emphasis":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"dashed":{"$ref":"common.schema.json#/$defs/legendEntry"},"return":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":480},{"type":"number","minimum":480}],"items":false,"minItems":2,"maxItems":2}}},"participants":{"type":"array","minItems":2,"items":{"type":"object","additionalProperties":false,"required":["id","type","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"sources":{"$ref":"common.schema.json#/$defs/sourceReferences"}}}},"segments":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to","label"],"properties":{"from":{"type":"number"},"to":{"type":"number"},"label":{"type":"string","minLength":1}}}},"messages":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["from","to","y","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"y":{"type":"number","minimum":160},"label":{"type":"string","minLength":1},"variant":{"enum":["default","emphasis","security","dashed","return"]},"note":{"type":"string"}}}},"activations":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["participant","from","to"],"properties":{"participant":{"$ref":"common.schema.json#/$defs/id"},"from":{"type":"number"},"to":{"type":"number"},"type":{"$ref":"common.schema.json#/$defs/componentType"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};const schema74 = {"enum":["trace","none"]};const schema75 = {"enum":["classic","signal-flow","blueprint","editorial"]};const schema76 = {"enum":["standard","showcase"]};function validate28(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate28.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern14.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern14.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate28.errors = vErrors;return errors === 0;}validate28.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate27(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/sequence.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate27.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.participants === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "participants"},message:"must have required property '"+"participants"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.messages === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "messages"},message:"must have required property '"+"messages"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}for(const key0 in data){if(!((((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "participants")) || (key0 === "segments")) || (key0 === "messages")) || (key0 === "activations")) || (key0 === "cards"))){const err5 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err6 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.diagram_type !== undefined){if("sequence" !== data.diagram_type){const err7 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "sequence"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err8 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data2.output === undefined){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "output"},message:"must have required property '"+"output"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key1 in data2){if(!(func1.call(schema71.properties.meta.properties, key1))){const err10 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!(((data4 === "en") || (data4 === "zh-CN")) || (data4 === "es"))){const err13 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err14 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.output !== undefined){let data6 = data2.output;if(typeof data6 === "string"){if(!pattern4.test(data6)){const err15 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/0/pattern",keyword:"pattern",params:{pattern: "(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"},message:"must match pattern \""+"(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"+"\""};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}const _errs18 = errors;const _errs19 = errors;if(typeof data6 === "string"){if(!pattern5.test(data6)){const err16 = {};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}var valid5 = _errs19 === errors;if(valid5){const err17 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/1/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}const _errs21 = errors;const _errs22 = errors;if(typeof data6 === "string"){if(!pattern6.test(data6)){const err18 = {};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}var valid6 = _errs22 === errors;if(valid6){const err19 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/2/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}const _errs24 = errors;const _errs25 = errors;if(typeof data6 === "string"){if(!pattern7.test(data6)){const err20 = {};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}var valid7 = _errs25 === errors;if(valid7){const err21 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/3/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}const _errs27 = errors;const _errs28 = errors;if(typeof data6 === "string"){if(!pattern8.test(data6)){const err22 = {};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}var valid8 = _errs28 === errors;if(valid8){const err23 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/4/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}else {errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}}const _errs30 = errors;const _errs31 = errors;if(typeof data6 === "string"){if(!pattern9.test(data6)){const err24 = {};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}var valid9 = _errs31 === errors;if(valid9){const err25 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/5/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}else {errors = _errs30;if(vErrors !== null){if(_errs30){vErrors.length = _errs30;}else {vErrors = null;}}}const _errs33 = errors;const _errs34 = errors;if(typeof data6 === "string"){if(!pattern10.test(data6)){const err26 = {};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}var valid10 = _errs34 === errors;if(valid10){const err27 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/6/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}else {errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}}const _errs36 = errors;const _errs37 = errors;if(typeof data6 === "string"){if(!pattern11.test(data6)){const err28 = {};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}var valid11 = _errs37 === errors;if(valid11){const err29 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/7/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}else {errors = _errs36;if(vErrors !== null){if(_errs36){vErrors.length = _errs36;}else {vErrors = null;}}}if(typeof data6 === "string"){if(func3(data6) < 1){const err30 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}if(!pattern12.test(data6)){const err31 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/pattern",keyword:"pattern",params:{pattern: "^[^/]+(?:/[^/]+)*$"},message:"must match pattern \""+"^[^/]+(?:/[^/]+)*$"+"\""};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}else {const err32 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err33 = {instancePath:instancePath+"/meta/animation",schemaPath:"common.schema.json#/$defs/animation/enum",keyword:"enum",params:{allowedValues: schema74.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err34 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"common.schema.json#/$defs/visualPreset/enum",keyword:"enum",params:{allowedValues: schema75.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err35 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"common.schema.json#/$defs/qualityProfile/enum",keyword:"enum",params:{allowedValues: schema76.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data2.column_fit !== undefined){let data10 = data2.column_fit;if(!((data10 === "fixed") || (data10 === "spread"))){const err36 = {instancePath:instancePath+"/meta/column_fit",schemaPath:"#/properties/meta/properties/column_fit/enum",keyword:"enum",params:{allowedValues: schema71.properties.meta.properties.column_fit.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}if(data2.repository !== undefined){let data11 = data2.repository;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){if(data11.url === undefined){const err37 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}if(data11.revision === undefined){const err38 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "revision"},message:"must have required property '"+"revision"+"'"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}for(const key2 in data11){if(!((((key2 === "url") || (key2 === "provider")) || (key2 === "link_mode")) || (key2 === "revision"))){const err39 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}if(data11.url !== undefined){let data12 = data11.url;if(typeof data12 === "string"){if(func3(data12) < 1){const err40 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}else {const err41 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data11.provider !== undefined){let data13 = data11.provider;if(!((data13 === "github") || (data13 === "gitee"))){const err42 = {instancePath:instancePath+"/meta/repository/provider",schemaPath:"common.schema.json#/$defs/repository/properties/provider/enum",keyword:"enum",params:{allowedValues: schema35.properties.provider.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data11.link_mode !== undefined){let data14 = data11.link_mode;if(!((data14 === "web") || (data14 === "local-only"))){const err43 = {instancePath:instancePath+"/meta/repository/link_mode",schemaPath:"common.schema.json#/$defs/repository/properties/link_mode/enum",keyword:"enum",params:{allowedValues: schema35.properties.link_mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}if(data11.revision !== undefined){let data15 = data11.revision;if(typeof data15 === "string"){if(!pattern13.test(data15)){const err44 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/pattern",keyword:"pattern",params:{pattern: "^[a-fA-F0-9]{40}$"},message:"must match pattern \""+"^[a-fA-F0-9]{40}$"+"\""};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}else {const err45 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}}else {const err46 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}if(data2.views !== undefined){if(!(validate28(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate28.errors : vErrors.concat(validate28.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data17 = data2.legend;if(data17 && typeof data17 == "object" && !Array.isArray(data17)){for(const key3 in data17){if(!((key3 === "mode") || (key3 === "entries"))){const err47 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data17.mode !== undefined){let data18 = data17.mode;if(!(((data18 === "auto") || (data18 === "all")) || (data18 === "hidden"))){const err48 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema39.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}if(data17.entries !== undefined){let data19 = data17.entries;if(data19 && typeof data19 == "object" && !Array.isArray(data19)){for(const key4 in data19){if(!(((((key4 === "default") || (key4 === "emphasis")) || (key4 === "security")) || (key4 === "dashed")) || (key4 === "return"))){const err49 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data19.default !== undefined){let data20 = data19.default;if(data20 && typeof data20 == "object" && !Array.isArray(data20)){if(Object.keys(data20).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key5 in data20){if(!((key5 === "label") || (key5 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data20.label !== undefined){let data21 = data20.label;if(typeof data21 === "string"){if(func3(data21) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data21) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data20.visible !== undefined){if(typeof data20.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/default/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}if(data19.emphasis !== undefined){let data23 = data19.emphasis;if(data23 && typeof data23 == "object" && !Array.isArray(data23)){if(Object.keys(data23).length < 1){const err57 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}for(const key6 in data23){if(!((key6 === "label") || (key6 === "visible"))){const err58 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data23.label !== undefined){let data24 = data23.label;if(typeof data24 === "string"){if(func3(data24) > 80){const err59 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(func3(data24) < 1){const err60 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}else {const err61 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data23.visible !== undefined){if(typeof data23.visible !== "boolean"){const err62 = {instancePath:instancePath+"/meta/legend/entries/emphasis/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}}else {const err63 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}if(data19.security !== undefined){let data26 = data19.security;if(data26 && typeof data26 == "object" && !Array.isArray(data26)){if(Object.keys(data26).length < 1){const err64 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}for(const key7 in data26){if(!((key7 === "label") || (key7 === "visible"))){const err65 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data26.label !== undefined){let data27 = data26.label;if(typeof data27 === "string"){if(func3(data27) > 80){const err66 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}if(func3(data27) < 1){const err67 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}else {const err68 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}if(data26.visible !== undefined){if(typeof data26.visible !== "boolean"){const err69 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}}else {const err70 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data19.dashed !== undefined){let data29 = data19.dashed;if(data29 && typeof data29 == "object" && !Array.isArray(data29)){if(Object.keys(data29).length < 1){const err71 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}for(const key8 in data29){if(!((key8 === "label") || (key8 === "visible"))){const err72 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data29.label !== undefined){let data30 = data29.label;if(typeof data30 === "string"){if(func3(data30) > 80){const err73 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}if(func3(data30) < 1){const err74 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}else {const err75 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data29.visible !== undefined){if(typeof data29.visible !== "boolean"){const err76 = {instancePath:instancePath+"/meta/legend/entries/dashed/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}}else {const err77 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}if(data19.return !== undefined){let data32 = data19.return;if(data32 && typeof data32 == "object" && !Array.isArray(data32)){if(Object.keys(data32).length < 1){const err78 = {instancePath:instancePath+"/meta/legend/entries/return",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}for(const key9 in data32){if(!((key9 === "label") || (key9 === "visible"))){const err79 = {instancePath:instancePath+"/meta/legend/entries/return",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}if(data32.label !== undefined){let data33 = data32.label;if(typeof data33 === "string"){if(func3(data33) > 80){const err80 = {instancePath:instancePath+"/meta/legend/entries/return/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}if(func3(data33) < 1){const err81 = {instancePath:instancePath+"/meta/legend/entries/return/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}else {const err82 = {instancePath:instancePath+"/meta/legend/entries/return/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}if(data32.visible !== undefined){if(typeof data32.visible !== "boolean"){const err83 = {instancePath:instancePath+"/meta/legend/entries/return/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}}else {const err84 = {instancePath:instancePath+"/meta/legend/entries/return",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}}else {const err85 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}}else {const err86 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}if(data2.viewBox !== undefined){let data35 = data2.viewBox;if(Array.isArray(data35)){if(data35.length > 2){const err87 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}if(data35.length < 2){const err88 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}const len0 = data35.length;if(len0 > 0){let data36 = data35[0];if((typeof data36 == "number") && (isFinite(data36))){if(data36 < 480 || isNaN(data36)){const err89 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 480},message:"must be >= 480"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}else {const err90 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}if(len0 > 1){let data37 = data35[1];if((typeof data37 == "number") && (isFinite(data37))){if(data37 < 480 || isNaN(data37)){const err91 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 480},message:"must be >= 480"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}else {const err92 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}const len1 = data35.length;if(!(len1 <= 2)){const err93 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}else {const err94 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}}else {const err95 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}if(data.participants !== undefined){let data38 = data.participants;if(Array.isArray(data38)){if(data38.length < 2){const err96 = {instancePath:instancePath+"/participants",schemaPath:"#/properties/participants/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}const len2 = data38.length;for(let i0=0; i0<len2; i0++){let data39 = data38[i0];if(data39 && typeof data39 == "object" && !Array.isArray(data39)){if(data39.id === undefined){const err97 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}if(data39.type === undefined){const err98 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}if(data39.label === undefined){const err99 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}for(const key10 in data39){if(!((((((key10 === "id") || (key10 === "type")) || (key10 === "label")) || (key10 === "sublabel")) || (key10 === "brand")) || (key10 === "sources"))){const err100 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}if(data39.id !== undefined){let data40 = data39.id;if(typeof data40 === "string"){if(!pattern14.test(data40)){const err101 = {instancePath:instancePath+"/participants/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}else {const err102 = {instancePath:instancePath+"/participants/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}if(data39.type !== undefined){let data41 = data39.type;if(!(((((((data41 === "frontend") || (data41 === "backend")) || (data41 === "database")) || (data41 === "cloud")) || (data41 === "security")) || (data41 === "messagebus")) || (data41 === "external"))){const err103 = {instancePath:instancePath+"/participants/" + i0+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema59.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}if(data39.label !== undefined){let data42 = data39.label;if(typeof data42 === "string"){if(func3(data42) < 1){const err104 = {instancePath:instancePath+"/participants/" + i0+"/label",schemaPath:"#/properties/participants/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}else {const err105 = {instancePath:instancePath+"/participants/" + i0+"/label",schemaPath:"#/properties/participants/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}if(data39.sublabel !== undefined){if(typeof data39.sublabel !== "string"){const err106 = {instancePath:instancePath+"/participants/" + i0+"/sublabel",schemaPath:"#/properties/participants/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}if(data39.brand !== undefined){let data44 = data39.brand;const _errs126 = errors;let valid37 = false;let passing0 = null;const _errs127 = errors;const _errs129 = errors;let valid38 = false;const _errs130 = errors;if(typeof data44 === "string"){if(func3(data44) > 80){const err107 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}if(!pattern27.test(data44)){const err108 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}var _valid1 = _errs130 === errors;valid38 = valid38 || _valid1;const _errs131 = errors;if(typeof data44 === "string"){if(!pattern28.test(data44)){const err109 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}var _valid1 = _errs131 === errors;valid38 = valid38 || _valid1;if(!valid38){const err110 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}else {errors = _errs129;if(vErrors !== null){if(_errs129){vErrors.length = _errs129;}else {vErrors = null;}}}if(typeof data44 === "string"){if(func3(data44) > 2048){const err111 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}if(func3(data44) < 1){const err112 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}else {const err113 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}var _valid0 = _errs127 === errors;if(_valid0){valid37 = true;passing0 = 0;}const _errs132 = errors;if(data44 && typeof data44 == "object" && !Array.isArray(data44)){if(data44.url === undefined){const err114 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}if(data44.sha256 === undefined){const err115 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}for(const key11 in data44){if(!((key11 === "url") || (key11 === "sha256"))){const err116 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data44.url !== undefined){let data45 = data44.url;if(typeof data45 === "string"){if(func3(data45) > 2048){const err117 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}if(func3(data45) < 8){const err118 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}if(!pattern28.test(data45)){const err119 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}else {const err120 = {instancePath:instancePath+"/participants/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data44.sha256 !== undefined){let data46 = data44.sha256;if(typeof data46 === "string"){if(!pattern30.test(data46)){const err121 = {instancePath:instancePath+"/participants/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}else {const err122 = {instancePath:instancePath+"/participants/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}}else {const err123 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}var _valid0 = _errs132 === errors;if(_valid0 && valid37){valid37 = false;passing0 = [passing0, 1];}else {if(_valid0){valid37 = true;passing0 = 1;}}if(!valid37){const err124 = {instancePath:instancePath+"/participants/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}else {errors = _errs126;if(vErrors !== null){if(_errs126){vErrors.length = _errs126;}else {vErrors = null;}}}}if(data39.sources !== undefined){let data47 = data39.sources;if(Array.isArray(data47)){if(data47.length > 3){const err125 = {instancePath:instancePath+"/participants/" + i0+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}if(data47.length < 1){const err126 = {instancePath:instancePath+"/participants/" + i0+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}const len3 = data47.length;for(let i1=0; i1<len3; i1++){let data48 = data47[i1];if(data48 && typeof data48 == "object" && !Array.isArray(data48)){if(data48.path === undefined){const err127 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1,schemaPath:"common.schema.json#/$defs/sourceReferences/items/required",keyword:"required",params:{missingProperty: "path"},message:"must have required property '"+"path"+"'"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}for(const key12 in data48){if(!((((key12 === "path") || (key12 === "line")) || (key12 === "end_line")) || (key12 === "label"))){const err128 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1,schemaPath:"common.schema.json#/$defs/sourceReferences/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}if(data48.path !== undefined){let data49 = data48.path;if(typeof data49 === "string"){if(func3(data49) > 240){const err129 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/maxLength",keyword:"maxLength",params:{limit: 240},message:"must NOT have more than 240 characters"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}if(func3(data49) < 1){const err130 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}}else {const err131 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}}if(data48.line !== undefined){let data50 = data48.line;if(!(((typeof data50 == "number") && (!(data50 % 1) && !isNaN(data50))) && (isFinite(data50)))){const err132 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}if((typeof data50 == "number") && (isFinite(data50))){if(data50 < 1 || isNaN(data50)){const err133 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}}if(data48.end_line !== undefined){let data51 = data48.end_line;if(!(((typeof data51 == "number") && (!(data51 % 1) && !isNaN(data51))) && (isFinite(data51)))){const err134 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}if((typeof data51 == "number") && (isFinite(data51))){if(data51 < 1 || isNaN(data51)){const err135 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}}if(data48.label !== undefined){let data52 = data48.label;if(typeof data52 === "string"){if(func3(data52) > 48){const err136 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}if(func3(data52) < 1){const err137 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}else {const err138 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}}else {const err139 = {instancePath:instancePath+"/participants/" + i0+"/sources/" + i1,schemaPath:"common.schema.json#/$defs/sourceReferences/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}}else {const err140 = {instancePath:instancePath+"/participants/" + i0+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}}else {const err141 = {instancePath:instancePath+"/participants/" + i0,schemaPath:"#/properties/participants/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}}}else {const err142 = {instancePath:instancePath+"/participants",schemaPath:"#/properties/participants/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}}if(data.segments !== undefined){let data53 = data.segments;if(Array.isArray(data53)){const len4 = data53.length;for(let i2=0; i2<len4; i2++){let data54 = data53[i2];if(data54 && typeof data54 == "object" && !Array.isArray(data54)){if(data54.from === undefined){const err143 = {instancePath:instancePath+"/segments/" + i2,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}if(data54.to === undefined){const err144 = {instancePath:instancePath+"/segments/" + i2,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}if(data54.label === undefined){const err145 = {instancePath:instancePath+"/segments/" + i2,schemaPath:"#/properties/segments/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}for(const key13 in data54){if(!(((key13 === "from") || (key13 === "to")) || (key13 === "label"))){const err146 = {instancePath:instancePath+"/segments/" + i2,schemaPath:"#/properties/segments/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}if(data54.from !== undefined){let data55 = data54.from;if(!((typeof data55 == "number") && (isFinite(data55)))){const err147 = {instancePath:instancePath+"/segments/" + i2+"/from",schemaPath:"#/properties/segments/items/properties/from/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}if(data54.to !== undefined){let data56 = data54.to;if(!((typeof data56 == "number") && (isFinite(data56)))){const err148 = {instancePath:instancePath+"/segments/" + i2+"/to",schemaPath:"#/properties/segments/items/properties/to/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}}if(data54.label !== undefined){let data57 = data54.label;if(typeof data57 === "string"){if(func3(data57) < 1){const err149 = {instancePath:instancePath+"/segments/" + i2+"/label",schemaPath:"#/properties/segments/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}}else {const err150 = {instancePath:instancePath+"/segments/" + i2+"/label",schemaPath:"#/properties/segments/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}}else {const err151 = {instancePath:instancePath+"/segments/" + i2,schemaPath:"#/properties/segments/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}}else {const err152 = {instancePath:instancePath+"/segments",schemaPath:"#/properties/segments/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}if(data.messages !== undefined){let data58 = data.messages;if(Array.isArray(data58)){if(data58.length < 1){const err153 = {instancePath:instancePath+"/messages",schemaPath:"#/properties/messages/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}const len5 = data58.length;for(let i3=0; i3<len5; i3++){let data59 = data58[i3];if(data59 && typeof data59 == "object" && !Array.isArray(data59)){if(data59.from === undefined){const err154 = {instancePath:instancePath+"/messages/" + i3,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}if(data59.to === undefined){const err155 = {instancePath:instancePath+"/messages/" + i3,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}if(data59.y === undefined){const err156 = {instancePath:instancePath+"/messages/" + i3,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "y"},message:"must have required property '"+"y"+"'"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}if(data59.label === undefined){const err157 = {instancePath:instancePath+"/messages/" + i3,schemaPath:"#/properties/messages/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}for(const key14 in data59){if(!(((((((key14 === "id") || (key14 === "from")) || (key14 === "to")) || (key14 === "y")) || (key14 === "label")) || (key14 === "variant")) || (key14 === "note"))){const err158 = {instancePath:instancePath+"/messages/" + i3,schemaPath:"#/properties/messages/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}}if(data59.id !== undefined){let data60 = data59.id;if(typeof data60 === "string"){if(!pattern14.test(data60)){const err159 = {instancePath:instancePath+"/messages/" + i3+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}}else {const err160 = {instancePath:instancePath+"/messages/" + i3+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}}if(data59.from !== undefined){let data61 = data59.from;if(typeof data61 === "string"){if(!pattern14.test(data61)){const err161 = {instancePath:instancePath+"/messages/" + i3+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}}else {const err162 = {instancePath:instancePath+"/messages/" + i3+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}}if(data59.to !== undefined){let data62 = data59.to;if(typeof data62 === "string"){if(!pattern14.test(data62)){const err163 = {instancePath:instancePath+"/messages/" + i3+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}}else {const err164 = {instancePath:instancePath+"/messages/" + i3+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}}if(data59.y !== undefined){let data63 = data59.y;if((typeof data63 == "number") && (isFinite(data63))){if(data63 < 160 || isNaN(data63)){const err165 = {instancePath:instancePath+"/messages/" + i3+"/y",schemaPath:"#/properties/messages/items/properties/y/minimum",keyword:"minimum",params:{comparison: ">=", limit: 160},message:"must be >= 160"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}else {const err166 = {instancePath:instancePath+"/messages/" + i3+"/y",schemaPath:"#/properties/messages/items/properties/y/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}if(data59.label !== undefined){let data64 = data59.label;if(typeof data64 === "string"){if(func3(data64) < 1){const err167 = {instancePath:instancePath+"/messages/" + i3+"/label",schemaPath:"#/properties/messages/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}else {const err168 = {instancePath:instancePath+"/messages/" + i3+"/label",schemaPath:"#/properties/messages/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}if(data59.variant !== undefined){let data65 = data59.variant;if(!(((((data65 === "default") || (data65 === "emphasis")) || (data65 === "security")) || (data65 === "dashed")) || (data65 === "return"))){const err169 = {instancePath:instancePath+"/messages/" + i3+"/variant",schemaPath:"#/properties/messages/items/properties/variant/enum",keyword:"enum",params:{allowedValues: schema71.properties.messages.items.properties.variant.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}if(data59.note !== undefined){if(typeof data59.note !== "string"){const err170 = {instancePath:instancePath+"/messages/" + i3+"/note",schemaPath:"#/properties/messages/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}}else {const err171 = {instancePath:instancePath+"/messages/" + i3,schemaPath:"#/properties/messages/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}}else {const err172 = {instancePath:instancePath+"/messages",schemaPath:"#/properties/messages/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}if(data.activations !== undefined){let data67 = data.activations;if(Array.isArray(data67)){const len6 = data67.length;for(let i4=0; i4<len6; i4++){let data68 = data67[i4];if(data68 && typeof data68 == "object" && !Array.isArray(data68)){if(data68.participant === undefined){const err173 = {instancePath:instancePath+"/activations/" + i4,schemaPath:"#/properties/activations/items/required",keyword:"required",params:{missingProperty: "participant"},message:"must have required property '"+"participant"+"'"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}if(data68.from === undefined){const err174 = {instancePath:instancePath+"/activations/" + i4,schemaPath:"#/properties/activations/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}if(data68.to === undefined){const err175 = {instancePath:instancePath+"/activations/" + i4,schemaPath:"#/properties/activations/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}for(const key15 in data68){if(!((((key15 === "participant") || (key15 === "from")) || (key15 === "to")) || (key15 === "type"))){const err176 = {instancePath:instancePath+"/activations/" + i4,schemaPath:"#/properties/activations/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}}if(data68.participant !== undefined){let data69 = data68.participant;if(typeof data69 === "string"){if(!pattern14.test(data69)){const err177 = {instancePath:instancePath+"/activations/" + i4+"/participant",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}}else {const err178 = {instancePath:instancePath+"/activations/" + i4+"/participant",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}if(data68.from !== undefined){let data70 = data68.from;if(!((typeof data70 == "number") && (isFinite(data70)))){const err179 = {instancePath:instancePath+"/activations/" + i4+"/from",schemaPath:"#/properties/activations/items/properties/from/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}if(data68.to !== undefined){let data71 = data68.to;if(!((typeof data71 == "number") && (isFinite(data71)))){const err180 = {instancePath:instancePath+"/activations/" + i4+"/to",schemaPath:"#/properties/activations/items/properties/to/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}if(data68.type !== undefined){let data72 = data68.type;if(!(((((((data72 === "frontend") || (data72 === "backend")) || (data72 === "database")) || (data72 === "cloud")) || (data72 === "security")) || (data72 === "messagebus")) || (data72 === "external"))){const err181 = {instancePath:instancePath+"/activations/" + i4+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema59.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}}else {const err182 = {instancePath:instancePath+"/activations/" + i4,schemaPath:"#/properties/activations/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}}else {const err183 = {instancePath:instancePath+"/activations",schemaPath:"#/properties/activations/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}if(data.cards !== undefined){let data73 = data.cards;if(Array.isArray(data73)){const len7 = data73.length;for(let i5=0; i5<len7; i5++){let data74 = data73[i5];if(data74 && typeof data74 == "object" && !Array.isArray(data74)){if(data74.dot === undefined){const err184 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}if(data74.title === undefined){const err185 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}if(data74.items === undefined){const err186 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}for(const key16 in data74){if(!(((key16 === "dot") || (key16 === "title")) || (key16 === "items"))){const err187 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}if(data74.dot !== undefined){let data75 = data74.dot;if(!(((((((data75 === "cyan") || (data75 === "emerald")) || (data75 === "violet")) || (data75 === "amber")) || (data75 === "rose")) || (data75 === "orange")) || (data75 === "slate"))){const err188 = {instancePath:instancePath+"/cards/" + i5+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema70.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}if(data74.title !== undefined){let data76 = data74.title;if(typeof data76 === "string"){if(func3(data76) < 1){const err189 = {instancePath:instancePath+"/cards/" + i5+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}else {const err190 = {instancePath:instancePath+"/cards/" + i5+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}if(data74.items !== undefined){let data77 = data74.items;if(Array.isArray(data77)){const len8 = data77.length;for(let i6=0; i6<len8; i6++){if(typeof data77[i6] !== "string"){const err191 = {instancePath:instancePath+"/cards/" + i5+"/items/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}}else {const err192 = {instancePath:instancePath+"/cards/" + i5+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}}else {const err193 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}}else {const err194 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}}else {const err195 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}validate27.errors = vErrors;return errors === 0;}validate27.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const dataflowSchema = validate30;const schema97 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/dataflow.schema.json","title":"Archify Data Flow Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","stages","nodes","flows"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"dataflow"},"meta":{"type":"object","additionalProperties":false,"required":["title","output"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"$ref":"common.schema.json#/$defs/portableOutputPath"},"animation":{"$ref":"common.schema.json#/$defs/animation"},"visual_preset":{"$ref":"common.schema.json#/$defs/visualPreset"},"quality_profile":{"$ref":"common.schema.json#/$defs/qualityProfile"},"repository":{"$ref":"common.schema.json#/$defs/repository"},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"default":{"$ref":"common.schema.json#/$defs/legendEntry"},"emphasis":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"dashed":{"$ref":"common.schema.json#/$defs/legendEntry"},"database":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":360},{"type":"number","minimum":360}],"items":false,"minItems":2,"maxItems":2}}},"stages":{"type":"array","minItems":2,"maxItems":5,"items":{"type":"object","additionalProperties":false,"required":["label"],"properties":{"label":{"type":"string","minLength":1}}}},"nodes":{"type":"array","minItems":2,"items":{"type":"object","additionalProperties":false,"required":["id","type","label","stage","row"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"sources":{"$ref":"common.schema.json#/$defs/sourceReferences"},"stage":{"type":"integer","minimum":0},"row":{"type":"integer","minimum":0},"width":{"type":"number","minimum":48},"height":{"type":"number","minimum":36},"yOffset":{"type":"number"}}}},"flows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1},"classification":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"route":{"enum":["auto","straight","vertical-channel","bottom-channel","top-channel"]},"fromSide":{"$ref":"common.schema.json#/$defs/side"},"toSide":{"$ref":"common.schema.json#/$defs/side"},"channelX":{"type":"number"},"channelY":{"type":"number"},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"width":{"$ref":"common.schema.json#/$defs/relationshipWidth"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};const schema121 = {"enum":["left","right","top","bottom"]};const schema125 = {"type":"number","minimum":0.5};function validate31(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate31.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern14.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern14.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate31.errors = vErrors;return errors === 0;}validate31.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate30(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/dataflow.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate30.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.stages === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "stages"},message:"must have required property '"+"stages"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.nodes === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "nodes"},message:"must have required property '"+"nodes"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.flows === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "flows"},message:"must have required property '"+"flows"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "stages")) || (key0 === "nodes")) || (key0 === "flows")) || (key0 === "cards"))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err7 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.diagram_type !== undefined){if("dataflow" !== data.diagram_type){const err8 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "dataflow"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data2.output === undefined){const err10 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "output"},message:"must have required property '"+"output"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}for(const key1 in data2){if(!(func1.call(schema97.properties.meta.properties, key1))){const err11 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err12 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!(((data4 === "en") || (data4 === "zh-CN")) || (data4 === "es"))){const err14 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err15 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data2.output !== undefined){let data6 = data2.output;if(typeof data6 === "string"){if(!pattern4.test(data6)){const err16 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/0/pattern",keyword:"pattern",params:{pattern: "(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"},message:"must match pattern \""+"(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"+"\""};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}const _errs18 = errors;const _errs19 = errors;if(typeof data6 === "string"){if(!pattern5.test(data6)){const err17 = {};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}var valid5 = _errs19 === errors;if(valid5){const err18 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/1/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}const _errs21 = errors;const _errs22 = errors;if(typeof data6 === "string"){if(!pattern6.test(data6)){const err19 = {};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}var valid6 = _errs22 === errors;if(valid6){const err20 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/2/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}const _errs24 = errors;const _errs25 = errors;if(typeof data6 === "string"){if(!pattern7.test(data6)){const err21 = {};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}var valid7 = _errs25 === errors;if(valid7){const err22 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/3/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}const _errs27 = errors;const _errs28 = errors;if(typeof data6 === "string"){if(!pattern8.test(data6)){const err23 = {};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}var valid8 = _errs28 === errors;if(valid8){const err24 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/4/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}else {errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}}const _errs30 = errors;const _errs31 = errors;if(typeof data6 === "string"){if(!pattern9.test(data6)){const err25 = {};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}var valid9 = _errs31 === errors;if(valid9){const err26 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/5/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}else {errors = _errs30;if(vErrors !== null){if(_errs30){vErrors.length = _errs30;}else {vErrors = null;}}}const _errs33 = errors;const _errs34 = errors;if(typeof data6 === "string"){if(!pattern10.test(data6)){const err27 = {};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}var valid10 = _errs34 === errors;if(valid10){const err28 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/6/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}else {errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}}const _errs36 = errors;const _errs37 = errors;if(typeof data6 === "string"){if(!pattern11.test(data6)){const err29 = {};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}var valid11 = _errs37 === errors;if(valid11){const err30 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/7/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}else {errors = _errs36;if(vErrors !== null){if(_errs36){vErrors.length = _errs36;}else {vErrors = null;}}}if(typeof data6 === "string"){if(func3(data6) < 1){const err31 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(!pattern12.test(data6)){const err32 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/pattern",keyword:"pattern",params:{pattern: "^[^/]+(?:/[^/]+)*$"},message:"must match pattern \""+"^[^/]+(?:/[^/]+)*$"+"\""};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err34 = {instancePath:instancePath+"/meta/animation",schemaPath:"common.schema.json#/$defs/animation/enum",keyword:"enum",params:{allowedValues: schema74.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err35 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"common.schema.json#/$defs/visualPreset/enum",keyword:"enum",params:{allowedValues: schema75.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err36 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"common.schema.json#/$defs/qualityProfile/enum",keyword:"enum",params:{allowedValues: schema76.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}if(data2.repository !== undefined){let data10 = data2.repository;if(data10 && typeof data10 == "object" && !Array.isArray(data10)){if(data10.url === undefined){const err37 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}if(data10.revision === undefined){const err38 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "revision"},message:"must have required property '"+"revision"+"'"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}for(const key2 in data10){if(!((((key2 === "url") || (key2 === "provider")) || (key2 === "link_mode")) || (key2 === "revision"))){const err39 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}if(data10.url !== undefined){let data11 = data10.url;if(typeof data11 === "string"){if(func3(data11) < 1){const err40 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}else {const err41 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data10.provider !== undefined){let data12 = data10.provider;if(!((data12 === "github") || (data12 === "gitee"))){const err42 = {instancePath:instancePath+"/meta/repository/provider",schemaPath:"common.schema.json#/$defs/repository/properties/provider/enum",keyword:"enum",params:{allowedValues: schema35.properties.provider.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data10.link_mode !== undefined){let data13 = data10.link_mode;if(!((data13 === "web") || (data13 === "local-only"))){const err43 = {instancePath:instancePath+"/meta/repository/link_mode",schemaPath:"common.schema.json#/$defs/repository/properties/link_mode/enum",keyword:"enum",params:{allowedValues: schema35.properties.link_mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}if(data10.revision !== undefined){let data14 = data10.revision;if(typeof data14 === "string"){if(!pattern13.test(data14)){const err44 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/pattern",keyword:"pattern",params:{pattern: "^[a-fA-F0-9]{40}$"},message:"must match pattern \""+"^[a-fA-F0-9]{40}$"+"\""};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}else {const err45 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}}else {const err46 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}if(data2.views !== undefined){if(!(validate31(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate31.errors : vErrors.concat(validate31.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data16 = data2.legend;if(data16 && typeof data16 == "object" && !Array.isArray(data16)){for(const key3 in data16){if(!((key3 === "mode") || (key3 === "entries"))){const err47 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data16.mode !== undefined){let data17 = data16.mode;if(!(((data17 === "auto") || (data17 === "all")) || (data17 === "hidden"))){const err48 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema39.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}if(data16.entries !== undefined){let data18 = data16.entries;if(data18 && typeof data18 == "object" && !Array.isArray(data18)){for(const key4 in data18){if(!(((((key4 === "default") || (key4 === "emphasis")) || (key4 === "security")) || (key4 === "dashed")) || (key4 === "database"))){const err49 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data18.default !== undefined){let data19 = data18.default;if(data19 && typeof data19 == "object" && !Array.isArray(data19)){if(Object.keys(data19).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key5 in data19){if(!((key5 === "label") || (key5 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data19.label !== undefined){let data20 = data19.label;if(typeof data20 === "string"){if(func3(data20) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data20) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/default/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data19.visible !== undefined){if(typeof data19.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/default/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/default",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}if(data18.emphasis !== undefined){let data22 = data18.emphasis;if(data22 && typeof data22 == "object" && !Array.isArray(data22)){if(Object.keys(data22).length < 1){const err57 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}for(const key6 in data22){if(!((key6 === "label") || (key6 === "visible"))){const err58 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data22.label !== undefined){let data23 = data22.label;if(typeof data23 === "string"){if(func3(data23) > 80){const err59 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(func3(data23) < 1){const err60 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}else {const err61 = {instancePath:instancePath+"/meta/legend/entries/emphasis/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data22.visible !== undefined){if(typeof data22.visible !== "boolean"){const err62 = {instancePath:instancePath+"/meta/legend/entries/emphasis/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}}else {const err63 = {instancePath:instancePath+"/meta/legend/entries/emphasis",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}if(data18.security !== undefined){let data25 = data18.security;if(data25 && typeof data25 == "object" && !Array.isArray(data25)){if(Object.keys(data25).length < 1){const err64 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}for(const key7 in data25){if(!((key7 === "label") || (key7 === "visible"))){const err65 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data25.label !== undefined){let data26 = data25.label;if(typeof data26 === "string"){if(func3(data26) > 80){const err66 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}if(func3(data26) < 1){const err67 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}else {const err68 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}if(data25.visible !== undefined){if(typeof data25.visible !== "boolean"){const err69 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}}else {const err70 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data18.dashed !== undefined){let data28 = data18.dashed;if(data28 && typeof data28 == "object" && !Array.isArray(data28)){if(Object.keys(data28).length < 1){const err71 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}for(const key8 in data28){if(!((key8 === "label") || (key8 === "visible"))){const err72 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data28.label !== undefined){let data29 = data28.label;if(typeof data29 === "string"){if(func3(data29) > 80){const err73 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}if(func3(data29) < 1){const err74 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}else {const err75 = {instancePath:instancePath+"/meta/legend/entries/dashed/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data28.visible !== undefined){if(typeof data28.visible !== "boolean"){const err76 = {instancePath:instancePath+"/meta/legend/entries/dashed/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}}else {const err77 = {instancePath:instancePath+"/meta/legend/entries/dashed",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}if(data18.database !== undefined){let data31 = data18.database;if(data31 && typeof data31 == "object" && !Array.isArray(data31)){if(Object.keys(data31).length < 1){const err78 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}for(const key9 in data31){if(!((key9 === "label") || (key9 === "visible"))){const err79 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}if(data31.label !== undefined){let data32 = data31.label;if(typeof data32 === "string"){if(func3(data32) > 80){const err80 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}if(func3(data32) < 1){const err81 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}else {const err82 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}if(data31.visible !== undefined){if(typeof data31.visible !== "boolean"){const err83 = {instancePath:instancePath+"/meta/legend/entries/database/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}}else {const err84 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}}else {const err85 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}}else {const err86 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}if(data2.viewBox !== undefined){let data34 = data2.viewBox;if(Array.isArray(data34)){if(data34.length > 2){const err87 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}if(data34.length < 2){const err88 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}const len0 = data34.length;if(len0 > 0){let data35 = data34[0];if((typeof data35 == "number") && (isFinite(data35))){if(data35 < 360 || isNaN(data35)){const err89 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 360},message:"must be >= 360"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}else {const err90 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}if(len0 > 1){let data36 = data34[1];if((typeof data36 == "number") && (isFinite(data36))){if(data36 < 360 || isNaN(data36)){const err91 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 360},message:"must be >= 360"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}else {const err92 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}const len1 = data34.length;if(!(len1 <= 2)){const err93 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}else {const err94 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}}else {const err95 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}if(data.stages !== undefined){let data37 = data.stages;if(Array.isArray(data37)){if(data37.length > 5){const err96 = {instancePath:instancePath+"/stages",schemaPath:"#/properties/stages/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}if(data37.length < 2){const err97 = {instancePath:instancePath+"/stages",schemaPath:"#/properties/stages/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}const len2 = data37.length;for(let i0=0; i0<len2; i0++){let data38 = data37[i0];if(data38 && typeof data38 == "object" && !Array.isArray(data38)){if(data38.label === undefined){const err98 = {instancePath:instancePath+"/stages/" + i0,schemaPath:"#/properties/stages/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}for(const key10 in data38){if(!(key10 === "label")){const err99 = {instancePath:instancePath+"/stages/" + i0,schemaPath:"#/properties/stages/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}if(data38.label !== undefined){let data39 = data38.label;if(typeof data39 === "string"){if(func3(data39) < 1){const err100 = {instancePath:instancePath+"/stages/" + i0+"/label",schemaPath:"#/properties/stages/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}else {const err101 = {instancePath:instancePath+"/stages/" + i0+"/label",schemaPath:"#/properties/stages/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}}else {const err102 = {instancePath:instancePath+"/stages/" + i0,schemaPath:"#/properties/stages/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}}else {const err103 = {instancePath:instancePath+"/stages",schemaPath:"#/properties/stages/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}if(data.nodes !== undefined){let data40 = data.nodes;if(Array.isArray(data40)){if(data40.length < 2){const err104 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}const len3 = data40.length;for(let i1=0; i1<len3; i1++){let data41 = data40[i1];if(data41 && typeof data41 == "object" && !Array.isArray(data41)){if(data41.id === undefined){const err105 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}if(data41.type === undefined){const err106 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}if(data41.label === undefined){const err107 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}if(data41.stage === undefined){const err108 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "stage"},message:"must have required property '"+"stage"+"'"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}if(data41.row === undefined){const err109 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/required",keyword:"required",params:{missingProperty: "row"},message:"must have required property '"+"row"+"'"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}for(const key11 in data41){if(!(func1.call(schema97.properties.nodes.items.properties, key11))){const err110 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}if(data41.id !== undefined){let data42 = data41.id;if(typeof data42 === "string"){if(!pattern14.test(data42)){const err111 = {instancePath:instancePath+"/nodes/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}else {const err112 = {instancePath:instancePath+"/nodes/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}if(data41.type !== undefined){let data43 = data41.type;if(!(((((((data43 === "frontend") || (data43 === "backend")) || (data43 === "database")) || (data43 === "cloud")) || (data43 === "security")) || (data43 === "messagebus")) || (data43 === "external"))){const err113 = {instancePath:instancePath+"/nodes/" + i1+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema59.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}if(data41.label !== undefined){let data44 = data41.label;if(typeof data44 === "string"){if(func3(data44) < 1){const err114 = {instancePath:instancePath+"/nodes/" + i1+"/label",schemaPath:"#/properties/nodes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}else {const err115 = {instancePath:instancePath+"/nodes/" + i1+"/label",schemaPath:"#/properties/nodes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}if(data41.sublabel !== undefined){if(typeof data41.sublabel !== "string"){const err116 = {instancePath:instancePath+"/nodes/" + i1+"/sublabel",schemaPath:"#/properties/nodes/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data41.tag !== undefined){if(typeof data41.tag !== "string"){const err117 = {instancePath:instancePath+"/nodes/" + i1+"/tag",schemaPath:"#/properties/nodes/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}if(data41.brand !== undefined){let data47 = data41.brand;const _errs134 = errors;let valid40 = false;let passing0 = null;const _errs135 = errors;const _errs137 = errors;let valid41 = false;const _errs138 = errors;if(typeof data47 === "string"){if(func3(data47) > 80){const err118 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}if(!pattern27.test(data47)){const err119 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}var _valid1 = _errs138 === errors;valid41 = valid41 || _valid1;const _errs139 = errors;if(typeof data47 === "string"){if(!pattern28.test(data47)){const err120 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}var _valid1 = _errs139 === errors;valid41 = valid41 || _valid1;if(!valid41){const err121 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}else {errors = _errs137;if(vErrors !== null){if(_errs137){vErrors.length = _errs137;}else {vErrors = null;}}}if(typeof data47 === "string"){if(func3(data47) > 2048){const err122 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}if(func3(data47) < 1){const err123 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}else {const err124 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}var _valid0 = _errs135 === errors;if(_valid0){valid40 = true;passing0 = 0;}const _errs140 = errors;if(data47 && typeof data47 == "object" && !Array.isArray(data47)){if(data47.url === undefined){const err125 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}if(data47.sha256 === undefined){const err126 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}for(const key12 in data47){if(!((key12 === "url") || (key12 === "sha256"))){const err127 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}if(data47.url !== undefined){let data48 = data47.url;if(typeof data48 === "string"){if(func3(data48) > 2048){const err128 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}if(func3(data48) < 8){const err129 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}if(!pattern28.test(data48)){const err130 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}}else {const err131 = {instancePath:instancePath+"/nodes/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}}if(data47.sha256 !== undefined){let data49 = data47.sha256;if(typeof data49 === "string"){if(!pattern30.test(data49)){const err132 = {instancePath:instancePath+"/nodes/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}}else {const err133 = {instancePath:instancePath+"/nodes/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}}else {const err134 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}var _valid0 = _errs140 === errors;if(_valid0 && valid40){valid40 = false;passing0 = [passing0, 1];}else {if(_valid0){valid40 = true;passing0 = 1;}}if(!valid40){const err135 = {instancePath:instancePath+"/nodes/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}else {errors = _errs134;if(vErrors !== null){if(_errs134){vErrors.length = _errs134;}else {vErrors = null;}}}}if(data41.sources !== undefined){let data50 = data41.sources;if(Array.isArray(data50)){if(data50.length > 3){const err136 = {instancePath:instancePath+"/nodes/" + i1+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}if(data50.length < 1){const err137 = {instancePath:instancePath+"/nodes/" + i1+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}const len4 = data50.length;for(let i2=0; i2<len4; i2++){let data51 = data50[i2];if(data51 && typeof data51 == "object" && !Array.isArray(data51)){if(data51.path === undefined){const err138 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2,schemaPath:"common.schema.json#/$defs/sourceReferences/items/required",keyword:"required",params:{missingProperty: "path"},message:"must have required property '"+"path"+"'"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}for(const key13 in data51){if(!((((key13 === "path") || (key13 === "line")) || (key13 === "end_line")) || (key13 === "label"))){const err139 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2,schemaPath:"common.schema.json#/$defs/sourceReferences/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}if(data51.path !== undefined){let data52 = data51.path;if(typeof data52 === "string"){if(func3(data52) > 240){const err140 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/maxLength",keyword:"maxLength",params:{limit: 240},message:"must NOT have more than 240 characters"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}if(func3(data52) < 1){const err141 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}}else {const err142 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}}if(data51.line !== undefined){let data53 = data51.line;if(!(((typeof data53 == "number") && (!(data53 % 1) && !isNaN(data53))) && (isFinite(data53)))){const err143 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}if((typeof data53 == "number") && (isFinite(data53))){if(data53 < 1 || isNaN(data53)){const err144 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}}if(data51.end_line !== undefined){let data54 = data51.end_line;if(!(((typeof data54 == "number") && (!(data54 % 1) && !isNaN(data54))) && (isFinite(data54)))){const err145 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}if((typeof data54 == "number") && (isFinite(data54))){if(data54 < 1 || isNaN(data54)){const err146 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}}if(data51.label !== undefined){let data55 = data51.label;if(typeof data55 === "string"){if(func3(data55) > 48){const err147 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}if(func3(data55) < 1){const err148 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}}else {const err149 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}}}else {const err150 = {instancePath:instancePath+"/nodes/" + i1+"/sources/" + i2,schemaPath:"common.schema.json#/$defs/sourceReferences/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}}else {const err151 = {instancePath:instancePath+"/nodes/" + i1+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}if(data41.stage !== undefined){let data56 = data41.stage;if(!(((typeof data56 == "number") && (!(data56 % 1) && !isNaN(data56))) && (isFinite(data56)))){const err152 = {instancePath:instancePath+"/nodes/" + i1+"/stage",schemaPath:"#/properties/nodes/items/properties/stage/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}if((typeof data56 == "number") && (isFinite(data56))){if(data56 < 0 || isNaN(data56)){const err153 = {instancePath:instancePath+"/nodes/" + i1+"/stage",schemaPath:"#/properties/nodes/items/properties/stage/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}}if(data41.row !== undefined){let data57 = data41.row;if(!(((typeof data57 == "number") && (!(data57 % 1) && !isNaN(data57))) && (isFinite(data57)))){const err154 = {instancePath:instancePath+"/nodes/" + i1+"/row",schemaPath:"#/properties/nodes/items/properties/row/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}if((typeof data57 == "number") && (isFinite(data57))){if(data57 < 0 || isNaN(data57)){const err155 = {instancePath:instancePath+"/nodes/" + i1+"/row",schemaPath:"#/properties/nodes/items/properties/row/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}}}if(data41.width !== undefined){let data58 = data41.width;if((typeof data58 == "number") && (isFinite(data58))){if(data58 < 48 || isNaN(data58)){const err156 = {instancePath:instancePath+"/nodes/" + i1+"/width",schemaPath:"#/properties/nodes/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 48},message:"must be >= 48"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}else {const err157 = {instancePath:instancePath+"/nodes/" + i1+"/width",schemaPath:"#/properties/nodes/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}if(data41.height !== undefined){let data59 = data41.height;if((typeof data59 == "number") && (isFinite(data59))){if(data59 < 36 || isNaN(data59)){const err158 = {instancePath:instancePath+"/nodes/" + i1+"/height",schemaPath:"#/properties/nodes/items/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 36},message:"must be >= 36"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}}else {const err159 = {instancePath:instancePath+"/nodes/" + i1+"/height",schemaPath:"#/properties/nodes/items/properties/height/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}}if(data41.yOffset !== undefined){let data60 = data41.yOffset;if(!((typeof data60 == "number") && (isFinite(data60)))){const err160 = {instancePath:instancePath+"/nodes/" + i1+"/yOffset",schemaPath:"#/properties/nodes/items/properties/yOffset/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}}}else {const err161 = {instancePath:instancePath+"/nodes/" + i1,schemaPath:"#/properties/nodes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}}}else {const err162 = {instancePath:instancePath+"/nodes",schemaPath:"#/properties/nodes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}}if(data.flows !== undefined){let data61 = data.flows;if(Array.isArray(data61)){const len5 = data61.length;for(let i3=0; i3<len5; i3++){let data62 = data61[i3];if(data62 && typeof data62 == "object" && !Array.isArray(data62)){if(data62.from === undefined){const err163 = {instancePath:instancePath+"/flows/" + i3,schemaPath:"#/properties/flows/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}if(data62.to === undefined){const err164 = {instancePath:instancePath+"/flows/" + i3,schemaPath:"#/properties/flows/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}if(data62.label === undefined){const err165 = {instancePath:instancePath+"/flows/" + i3,schemaPath:"#/properties/flows/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}for(const key14 in data62){if(!(func1.call(schema97.properties.flows.items.properties, key14))){const err166 = {instancePath:instancePath+"/flows/" + i3,schemaPath:"#/properties/flows/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}if(data62.id !== undefined){let data63 = data62.id;if(typeof data63 === "string"){if(!pattern14.test(data63)){const err167 = {instancePath:instancePath+"/flows/" + i3+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}else {const err168 = {instancePath:instancePath+"/flows/" + i3+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}if(data62.from !== undefined){let data64 = data62.from;if(typeof data64 === "string"){if(!pattern14.test(data64)){const err169 = {instancePath:instancePath+"/flows/" + i3+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}else {const err170 = {instancePath:instancePath+"/flows/" + i3+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}if(data62.to !== undefined){let data65 = data62.to;if(typeof data65 === "string"){if(!pattern14.test(data65)){const err171 = {instancePath:instancePath+"/flows/" + i3+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}else {const err172 = {instancePath:instancePath+"/flows/" + i3+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}if(data62.label !== undefined){let data66 = data62.label;if(typeof data66 === "string"){if(func3(data66) < 1){const err173 = {instancePath:instancePath+"/flows/" + i3+"/label",schemaPath:"#/properties/flows/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}else {const err174 = {instancePath:instancePath+"/flows/" + i3+"/label",schemaPath:"#/properties/flows/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}}if(data62.classification !== undefined){if(typeof data62.classification !== "string"){const err175 = {instancePath:instancePath+"/flows/" + i3+"/classification",schemaPath:"#/properties/flows/items/properties/classification/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}}if(data62.variant !== undefined){let data68 = data62.variant;if(!((((data68 === "default") || (data68 === "emphasis")) || (data68 === "security")) || (data68 === "dashed"))){const err176 = {instancePath:instancePath+"/flows/" + i3+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema65.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}}if(data62.route !== undefined){let data69 = data62.route;if(!(((((data69 === "auto") || (data69 === "straight")) || (data69 === "vertical-channel")) || (data69 === "bottom-channel")) || (data69 === "top-channel"))){const err177 = {instancePath:instancePath+"/flows/" + i3+"/route",schemaPath:"#/properties/flows/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema97.properties.flows.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}}if(data62.fromSide !== undefined){let data70 = data62.fromSide;if(!((((data70 === "left") || (data70 === "right")) || (data70 === "top")) || (data70 === "bottom"))){const err178 = {instancePath:instancePath+"/flows/" + i3+"/fromSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema121.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}if(data62.toSide !== undefined){let data71 = data62.toSide;if(!((((data71 === "left") || (data71 === "right")) || (data71 === "top")) || (data71 === "bottom"))){const err179 = {instancePath:instancePath+"/flows/" + i3+"/toSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema121.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}if(data62.channelX !== undefined){let data72 = data62.channelX;if(!((typeof data72 == "number") && (isFinite(data72)))){const err180 = {instancePath:instancePath+"/flows/" + i3+"/channelX",schemaPath:"#/properties/flows/items/properties/channelX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}if(data62.channelY !== undefined){let data73 = data62.channelY;if(!((typeof data73 == "number") && (isFinite(data73)))){const err181 = {instancePath:instancePath+"/flows/" + i3+"/channelY",schemaPath:"#/properties/flows/items/properties/channelY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}if(data62.labelAt !== undefined){let data74 = data62.labelAt;if(Array.isArray(data74)){if(data74.length > 2){const err182 = {instancePath:instancePath+"/flows/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}if(data74.length < 2){const err183 = {instancePath:instancePath+"/flows/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}const len6 = data74.length;if(len6 > 0){let data75 = data74[0];if(!((typeof data75 == "number") && (isFinite(data75)))){const err184 = {instancePath:instancePath+"/flows/" + i3+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}if(len6 > 1){let data76 = data74[1];if(!((typeof data76 == "number") && (isFinite(data76)))){const err185 = {instancePath:instancePath+"/flows/" + i3+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}const len7 = data74.length;if(!(len7 <= 2)){const err186 = {instancePath:instancePath+"/flows/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}}else {const err187 = {instancePath:instancePath+"/flows/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}if(data62.labelDx !== undefined){let data77 = data62.labelDx;if(!((typeof data77 == "number") && (isFinite(data77)))){const err188 = {instancePath:instancePath+"/flows/" + i3+"/labelDx",schemaPath:"#/properties/flows/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}if(data62.labelDy !== undefined){let data78 = data62.labelDy;if(!((typeof data78 == "number") && (isFinite(data78)))){const err189 = {instancePath:instancePath+"/flows/" + i3+"/labelDy",schemaPath:"#/properties/flows/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}if(data62.labelSegment !== undefined){let data79 = data62.labelSegment;if(!(((typeof data79 == "number") && (!(data79 % 1) && !isNaN(data79))) && (isFinite(data79)))){const err190 = {instancePath:instancePath+"/flows/" + i3+"/labelSegment",schemaPath:"#/properties/flows/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}if((typeof data79 == "number") && (isFinite(data79))){if(data79 < 0 || isNaN(data79)){const err191 = {instancePath:instancePath+"/flows/" + i3+"/labelSegment",schemaPath:"#/properties/flows/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}}if(data62.via !== undefined){let data80 = data62.via;if(Array.isArray(data80)){const len8 = data80.length;for(let i4=0; i4<len8; i4++){let data81 = data80[i4];if(Array.isArray(data81)){if(data81.length > 2){const err192 = {instancePath:instancePath+"/flows/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}if(data81.length < 2){const err193 = {instancePath:instancePath+"/flows/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}const len9 = data81.length;if(len9 > 0){let data82 = data81[0];if(!((typeof data82 == "number") && (isFinite(data82)))){const err194 = {instancePath:instancePath+"/flows/" + i3+"/via/" + i4+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}if(len9 > 1){let data83 = data81[1];if(!((typeof data83 == "number") && (isFinite(data83)))){const err195 = {instancePath:instancePath+"/flows/" + i3+"/via/" + i4+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}}const len10 = data81.length;if(!(len10 <= 2)){const err196 = {instancePath:instancePath+"/flows/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}}else {const err197 = {instancePath:instancePath+"/flows/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}}}else {const err198 = {instancePath:instancePath+"/flows/" + i3+"/via",schemaPath:"#/properties/flows/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}}if(data62.width !== undefined){let data84 = data62.width;if((typeof data84 == "number") && (isFinite(data84))){if(data84 < 0.5 || isNaN(data84)){const err199 = {instancePath:instancePath+"/flows/" + i3+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}}else {const err200 = {instancePath:instancePath+"/flows/" + i3+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}}}else {const err201 = {instancePath:instancePath+"/flows/" + i3,schemaPath:"#/properties/flows/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}}}else {const err202 = {instancePath:instancePath+"/flows",schemaPath:"#/properties/flows/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}}if(data.cards !== undefined){let data85 = data.cards;if(Array.isArray(data85)){const len11 = data85.length;for(let i5=0; i5<len11; i5++){let data86 = data85[i5];if(data86 && typeof data86 == "object" && !Array.isArray(data86)){if(data86.dot === undefined){const err203 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}if(data86.title === undefined){const err204 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}if(data86.items === undefined){const err205 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err205];}else {vErrors.push(err205);}errors++;}for(const key15 in data86){if(!(((key15 === "dot") || (key15 === "title")) || (key15 === "items"))){const err206 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err206];}else {vErrors.push(err206);}errors++;}}if(data86.dot !== undefined){let data87 = data86.dot;if(!(((((((data87 === "cyan") || (data87 === "emerald")) || (data87 === "violet")) || (data87 === "amber")) || (data87 === "rose")) || (data87 === "orange")) || (data87 === "slate"))){const err207 = {instancePath:instancePath+"/cards/" + i5+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema70.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err207];}else {vErrors.push(err207);}errors++;}}if(data86.title !== undefined){let data88 = data86.title;if(typeof data88 === "string"){if(func3(data88) < 1){const err208 = {instancePath:instancePath+"/cards/" + i5+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err208];}else {vErrors.push(err208);}errors++;}}else {const err209 = {instancePath:instancePath+"/cards/" + i5+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err209];}else {vErrors.push(err209);}errors++;}}if(data86.items !== undefined){let data89 = data86.items;if(Array.isArray(data89)){const len12 = data89.length;for(let i6=0; i6<len12; i6++){if(typeof data89[i6] !== "string"){const err210 = {instancePath:instancePath+"/cards/" + i5+"/items/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err210];}else {vErrors.push(err210);}errors++;}}}else {const err211 = {instancePath:instancePath+"/cards/" + i5+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err211];}else {vErrors.push(err211);}errors++;}}}else {const err212 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err212];}else {vErrors.push(err212);}errors++;}}}else {const err213 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err213];}else {vErrors.push(err213);}errors++;}}}else {const err214 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err214];}else {vErrors.push(err214);}errors++;}validate30.errors = vErrors;return errors === 0;}validate30.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const lifecycleSchema = validate33;const schema127 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/lifecycle.schema.json","title":"Archify Lifecycle Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","lanes","states","transitions"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"lifecycle"},"meta":{"type":"object","additionalProperties":false,"required":["title","output"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"$ref":"common.schema.json#/$defs/portableOutputPath"},"animation":{"$ref":"common.schema.json#/$defs/animation"},"visual_preset":{"$ref":"common.schema.json#/$defs/visualPreset"},"quality_profile":{"$ref":"common.schema.json#/$defs/qualityProfile"},"repository":{"$ref":"common.schema.json#/$defs/repository"},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"start":{"$ref":"common.schema.json#/$defs/legendEntry"},"active":{"$ref":"common.schema.json#/$defs/legendEntry"},"waiting":{"$ref":"common.schema.json#/$defs/legendEntry"},"decision":{"$ref":"common.schema.json#/$defs/legendEntry"},"success":{"$ref":"common.schema.json#/$defs/legendEntry"},"failure":{"$ref":"common.schema.json#/$defs/legendEntry"},"neutral":{"$ref":"common.schema.json#/$defs/legendEntry"},"external":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":420},{"type":"number","minimum":566}],"items":false,"minItems":2,"maxItems":2}}},"lanes":{"type":"array","minItems":1,"maxItems":4,"items":{"type":"object","additionalProperties":false,"required":["id","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string","minLength":1}}}},"states":{"type":"array","minItems":2,"items":{"type":"object","additionalProperties":false,"required":["id","type","label","lane","col"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"enum":["start","active","waiting","decision","success","failure","neutral","external"]},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"sources":{"$ref":"common.schema.json#/$defs/sourceReferences"},"step":{"type":"string"},"lane":{"$ref":"common.schema.json#/$defs/id"},"col":{"type":"integer","minimum":0,"maximum":4},"width":{"type":"number","minimum":48},"height":{"type":"number","minimum":36},"yOffset":{"type":"number"}}}},"transitions":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string"},"note":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"route":{"enum":["auto","straight","drop","bottom-channel","top-channel","right-channel","left-channel"]},"fromSide":{"$ref":"common.schema.json#/$defs/side"},"toSide":{"$ref":"common.schema.json#/$defs/side"},"channelX":{"type":"number"},"channelY":{"type":"number"},"cornerRadius":{"type":"number","minimum":0},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"width":{"$ref":"common.schema.json#/$defs/relationshipWidth"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};function validate34(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate34.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern14.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern14.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate34.errors = vErrors;return errors === 0;}validate34.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate33(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/lifecycle.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate33.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.lanes === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lanes"},message:"must have required property '"+"lanes"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.states === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "states"},message:"must have required property '"+"states"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.transitions === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "transitions"},message:"must have required property '"+"transitions"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "lanes")) || (key0 === "states")) || (key0 === "transitions")) || (key0 === "cards"))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err7 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.diagram_type !== undefined){if("lifecycle" !== data.diagram_type){const err8 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "lifecycle"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data2.output === undefined){const err10 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "output"},message:"must have required property '"+"output"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}for(const key1 in data2){if(!(func1.call(schema127.properties.meta.properties, key1))){const err11 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err12 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!(((data4 === "en") || (data4 === "zh-CN")) || (data4 === "es"))){const err14 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err15 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data2.output !== undefined){let data6 = data2.output;if(typeof data6 === "string"){if(!pattern4.test(data6)){const err16 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/0/pattern",keyword:"pattern",params:{pattern: "(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"},message:"must match pattern \""+"(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"+"\""};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}const _errs18 = errors;const _errs19 = errors;if(typeof data6 === "string"){if(!pattern5.test(data6)){const err17 = {};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}var valid5 = _errs19 === errors;if(valid5){const err18 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/1/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}const _errs21 = errors;const _errs22 = errors;if(typeof data6 === "string"){if(!pattern6.test(data6)){const err19 = {};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}var valid6 = _errs22 === errors;if(valid6){const err20 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/2/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}const _errs24 = errors;const _errs25 = errors;if(typeof data6 === "string"){if(!pattern7.test(data6)){const err21 = {};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}var valid7 = _errs25 === errors;if(valid7){const err22 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/3/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}const _errs27 = errors;const _errs28 = errors;if(typeof data6 === "string"){if(!pattern8.test(data6)){const err23 = {};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}var valid8 = _errs28 === errors;if(valid8){const err24 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/4/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}else {errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}}const _errs30 = errors;const _errs31 = errors;if(typeof data6 === "string"){if(!pattern9.test(data6)){const err25 = {};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}var valid9 = _errs31 === errors;if(valid9){const err26 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/5/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}else {errors = _errs30;if(vErrors !== null){if(_errs30){vErrors.length = _errs30;}else {vErrors = null;}}}const _errs33 = errors;const _errs34 = errors;if(typeof data6 === "string"){if(!pattern10.test(data6)){const err27 = {};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}var valid10 = _errs34 === errors;if(valid10){const err28 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/6/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}else {errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}}const _errs36 = errors;const _errs37 = errors;if(typeof data6 === "string"){if(!pattern11.test(data6)){const err29 = {};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}var valid11 = _errs37 === errors;if(valid11){const err30 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/7/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}else {errors = _errs36;if(vErrors !== null){if(_errs36){vErrors.length = _errs36;}else {vErrors = null;}}}if(typeof data6 === "string"){if(func3(data6) < 1){const err31 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(!pattern12.test(data6)){const err32 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/pattern",keyword:"pattern",params:{pattern: "^[^/]+(?:/[^/]+)*$"},message:"must match pattern \""+"^[^/]+(?:/[^/]+)*$"+"\""};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err34 = {instancePath:instancePath+"/meta/animation",schemaPath:"common.schema.json#/$defs/animation/enum",keyword:"enum",params:{allowedValues: schema74.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err35 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"common.schema.json#/$defs/visualPreset/enum",keyword:"enum",params:{allowedValues: schema75.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err36 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"common.schema.json#/$defs/qualityProfile/enum",keyword:"enum",params:{allowedValues: schema76.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}if(data2.repository !== undefined){let data10 = data2.repository;if(data10 && typeof data10 == "object" && !Array.isArray(data10)){if(data10.url === undefined){const err37 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}if(data10.revision === undefined){const err38 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "revision"},message:"must have required property '"+"revision"+"'"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}for(const key2 in data10){if(!((((key2 === "url") || (key2 === "provider")) || (key2 === "link_mode")) || (key2 === "revision"))){const err39 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}if(data10.url !== undefined){let data11 = data10.url;if(typeof data11 === "string"){if(func3(data11) < 1){const err40 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}else {const err41 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data10.provider !== undefined){let data12 = data10.provider;if(!((data12 === "github") || (data12 === "gitee"))){const err42 = {instancePath:instancePath+"/meta/repository/provider",schemaPath:"common.schema.json#/$defs/repository/properties/provider/enum",keyword:"enum",params:{allowedValues: schema35.properties.provider.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data10.link_mode !== undefined){let data13 = data10.link_mode;if(!((data13 === "web") || (data13 === "local-only"))){const err43 = {instancePath:instancePath+"/meta/repository/link_mode",schemaPath:"common.schema.json#/$defs/repository/properties/link_mode/enum",keyword:"enum",params:{allowedValues: schema35.properties.link_mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}if(data10.revision !== undefined){let data14 = data10.revision;if(typeof data14 === "string"){if(!pattern13.test(data14)){const err44 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/pattern",keyword:"pattern",params:{pattern: "^[a-fA-F0-9]{40}$"},message:"must match pattern \""+"^[a-fA-F0-9]{40}$"+"\""};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}else {const err45 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}}else {const err46 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}if(data2.views !== undefined){if(!(validate34(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data16 = data2.legend;if(data16 && typeof data16 == "object" && !Array.isArray(data16)){for(const key3 in data16){if(!((key3 === "mode") || (key3 === "entries"))){const err47 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data16.mode !== undefined){let data17 = data16.mode;if(!(((data17 === "auto") || (data17 === "all")) || (data17 === "hidden"))){const err48 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema39.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}if(data16.entries !== undefined){let data18 = data16.entries;if(data18 && typeof data18 == "object" && !Array.isArray(data18)){for(const key4 in data18){if(!((((((((key4 === "start") || (key4 === "active")) || (key4 === "waiting")) || (key4 === "decision")) || (key4 === "success")) || (key4 === "failure")) || (key4 === "neutral")) || (key4 === "external"))){const err49 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data18.start !== undefined){let data19 = data18.start;if(data19 && typeof data19 == "object" && !Array.isArray(data19)){if(Object.keys(data19).length < 1){const err50 = {instancePath:instancePath+"/meta/legend/entries/start",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}for(const key5 in data19){if(!((key5 === "label") || (key5 === "visible"))){const err51 = {instancePath:instancePath+"/meta/legend/entries/start",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data19.label !== undefined){let data20 = data19.label;if(typeof data20 === "string"){if(func3(data20) > 80){const err52 = {instancePath:instancePath+"/meta/legend/entries/start/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data20) < 1){const err53 = {instancePath:instancePath+"/meta/legend/entries/start/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/meta/legend/entries/start/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data19.visible !== undefined){if(typeof data19.visible !== "boolean"){const err55 = {instancePath:instancePath+"/meta/legend/entries/start/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}}else {const err56 = {instancePath:instancePath+"/meta/legend/entries/start",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}if(data18.active !== undefined){let data22 = data18.active;if(data22 && typeof data22 == "object" && !Array.isArray(data22)){if(Object.keys(data22).length < 1){const err57 = {instancePath:instancePath+"/meta/legend/entries/active",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}for(const key6 in data22){if(!((key6 === "label") || (key6 === "visible"))){const err58 = {instancePath:instancePath+"/meta/legend/entries/active",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data22.label !== undefined){let data23 = data22.label;if(typeof data23 === "string"){if(func3(data23) > 80){const err59 = {instancePath:instancePath+"/meta/legend/entries/active/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(func3(data23) < 1){const err60 = {instancePath:instancePath+"/meta/legend/entries/active/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}else {const err61 = {instancePath:instancePath+"/meta/legend/entries/active/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data22.visible !== undefined){if(typeof data22.visible !== "boolean"){const err62 = {instancePath:instancePath+"/meta/legend/entries/active/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}}else {const err63 = {instancePath:instancePath+"/meta/legend/entries/active",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}if(data18.waiting !== undefined){let data25 = data18.waiting;if(data25 && typeof data25 == "object" && !Array.isArray(data25)){if(Object.keys(data25).length < 1){const err64 = {instancePath:instancePath+"/meta/legend/entries/waiting",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}for(const key7 in data25){if(!((key7 === "label") || (key7 === "visible"))){const err65 = {instancePath:instancePath+"/meta/legend/entries/waiting",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data25.label !== undefined){let data26 = data25.label;if(typeof data26 === "string"){if(func3(data26) > 80){const err66 = {instancePath:instancePath+"/meta/legend/entries/waiting/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}if(func3(data26) < 1){const err67 = {instancePath:instancePath+"/meta/legend/entries/waiting/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}else {const err68 = {instancePath:instancePath+"/meta/legend/entries/waiting/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}if(data25.visible !== undefined){if(typeof data25.visible !== "boolean"){const err69 = {instancePath:instancePath+"/meta/legend/entries/waiting/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}}else {const err70 = {instancePath:instancePath+"/meta/legend/entries/waiting",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data18.decision !== undefined){let data28 = data18.decision;if(data28 && typeof data28 == "object" && !Array.isArray(data28)){if(Object.keys(data28).length < 1){const err71 = {instancePath:instancePath+"/meta/legend/entries/decision",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}for(const key8 in data28){if(!((key8 === "label") || (key8 === "visible"))){const err72 = {instancePath:instancePath+"/meta/legend/entries/decision",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data28.label !== undefined){let data29 = data28.label;if(typeof data29 === "string"){if(func3(data29) > 80){const err73 = {instancePath:instancePath+"/meta/legend/entries/decision/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}if(func3(data29) < 1){const err74 = {instancePath:instancePath+"/meta/legend/entries/decision/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}else {const err75 = {instancePath:instancePath+"/meta/legend/entries/decision/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data28.visible !== undefined){if(typeof data28.visible !== "boolean"){const err76 = {instancePath:instancePath+"/meta/legend/entries/decision/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}}else {const err77 = {instancePath:instancePath+"/meta/legend/entries/decision",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}if(data18.success !== undefined){let data31 = data18.success;if(data31 && typeof data31 == "object" && !Array.isArray(data31)){if(Object.keys(data31).length < 1){const err78 = {instancePath:instancePath+"/meta/legend/entries/success",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}for(const key9 in data31){if(!((key9 === "label") || (key9 === "visible"))){const err79 = {instancePath:instancePath+"/meta/legend/entries/success",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}if(data31.label !== undefined){let data32 = data31.label;if(typeof data32 === "string"){if(func3(data32) > 80){const err80 = {instancePath:instancePath+"/meta/legend/entries/success/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}if(func3(data32) < 1){const err81 = {instancePath:instancePath+"/meta/legend/entries/success/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}else {const err82 = {instancePath:instancePath+"/meta/legend/entries/success/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}if(data31.visible !== undefined){if(typeof data31.visible !== "boolean"){const err83 = {instancePath:instancePath+"/meta/legend/entries/success/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}}else {const err84 = {instancePath:instancePath+"/meta/legend/entries/success",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}if(data18.failure !== undefined){let data34 = data18.failure;if(data34 && typeof data34 == "object" && !Array.isArray(data34)){if(Object.keys(data34).length < 1){const err85 = {instancePath:instancePath+"/meta/legend/entries/failure",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}for(const key10 in data34){if(!((key10 === "label") || (key10 === "visible"))){const err86 = {instancePath:instancePath+"/meta/legend/entries/failure",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}if(data34.label !== undefined){let data35 = data34.label;if(typeof data35 === "string"){if(func3(data35) > 80){const err87 = {instancePath:instancePath+"/meta/legend/entries/failure/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}if(func3(data35) < 1){const err88 = {instancePath:instancePath+"/meta/legend/entries/failure/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}else {const err89 = {instancePath:instancePath+"/meta/legend/entries/failure/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}if(data34.visible !== undefined){if(typeof data34.visible !== "boolean"){const err90 = {instancePath:instancePath+"/meta/legend/entries/failure/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}}else {const err91 = {instancePath:instancePath+"/meta/legend/entries/failure",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}if(data18.neutral !== undefined){let data37 = data18.neutral;if(data37 && typeof data37 == "object" && !Array.isArray(data37)){if(Object.keys(data37).length < 1){const err92 = {instancePath:instancePath+"/meta/legend/entries/neutral",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}for(const key11 in data37){if(!((key11 === "label") || (key11 === "visible"))){const err93 = {instancePath:instancePath+"/meta/legend/entries/neutral",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}if(data37.label !== undefined){let data38 = data37.label;if(typeof data38 === "string"){if(func3(data38) > 80){const err94 = {instancePath:instancePath+"/meta/legend/entries/neutral/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}if(func3(data38) < 1){const err95 = {instancePath:instancePath+"/meta/legend/entries/neutral/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}else {const err96 = {instancePath:instancePath+"/meta/legend/entries/neutral/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}if(data37.visible !== undefined){if(typeof data37.visible !== "boolean"){const err97 = {instancePath:instancePath+"/meta/legend/entries/neutral/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}else {const err98 = {instancePath:instancePath+"/meta/legend/entries/neutral",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}if(data18.external !== undefined){let data40 = data18.external;if(data40 && typeof data40 == "object" && !Array.isArray(data40)){if(Object.keys(data40).length < 1){const err99 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}for(const key12 in data40){if(!((key12 === "label") || (key12 === "visible"))){const err100 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}if(data40.label !== undefined){let data41 = data40.label;if(typeof data41 === "string"){if(func3(data41) > 80){const err101 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}if(func3(data41) < 1){const err102 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}else {const err103 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}if(data40.visible !== undefined){if(typeof data40.visible !== "boolean"){const err104 = {instancePath:instancePath+"/meta/legend/entries/external/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}}else {const err105 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}}else {const err106 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}}else {const err107 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}if(data2.viewBox !== undefined){let data43 = data2.viewBox;if(Array.isArray(data43)){if(data43.length > 2){const err108 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}if(data43.length < 2){const err109 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}const len0 = data43.length;if(len0 > 0){let data44 = data43[0];if((typeof data44 == "number") && (isFinite(data44))){if(data44 < 420 || isNaN(data44)){const err110 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 420},message:"must be >= 420"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}else {const err111 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}if(len0 > 1){let data45 = data43[1];if((typeof data45 == "number") && (isFinite(data45))){if(data45 < 566 || isNaN(data45)){const err112 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 566},message:"must be >= 566"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}else {const err113 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}const len1 = data43.length;if(!(len1 <= 2)){const err114 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}else {const err115 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}}else {const err116 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data.lanes !== undefined){let data46 = data.lanes;if(Array.isArray(data46)){if(data46.length > 4){const err117 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/maxItems",keyword:"maxItems",params:{limit: 4},message:"must NOT have more than 4 items"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}if(data46.length < 1){const err118 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}const len2 = data46.length;for(let i0=0; i0<len2; i0++){let data47 = data46[i0];if(data47 && typeof data47 == "object" && !Array.isArray(data47)){if(data47.id === undefined){const err119 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}if(data47.label === undefined){const err120 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}for(const key13 in data47){if(!((key13 === "id") || (key13 === "label"))){const err121 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}if(data47.id !== undefined){let data48 = data47.id;if(typeof data48 === "string"){if(!pattern14.test(data48)){const err122 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}else {const err123 = {instancePath:instancePath+"/lanes/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}if(data47.label !== undefined){let data49 = data47.label;if(typeof data49 === "string"){if(func3(data49) < 1){const err124 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}else {const err125 = {instancePath:instancePath+"/lanes/" + i0+"/label",schemaPath:"#/properties/lanes/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}}else {const err126 = {instancePath:instancePath+"/lanes/" + i0,schemaPath:"#/properties/lanes/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}}else {const err127 = {instancePath:instancePath+"/lanes",schemaPath:"#/properties/lanes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}if(data.states !== undefined){let data50 = data.states;if(Array.isArray(data50)){if(data50.length < 2){const err128 = {instancePath:instancePath+"/states",schemaPath:"#/properties/states/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}const len3 = data50.length;for(let i1=0; i1<len3; i1++){let data51 = data50[i1];if(data51 && typeof data51 == "object" && !Array.isArray(data51)){if(data51.id === undefined){const err129 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}if(data51.type === undefined){const err130 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}if(data51.label === undefined){const err131 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}if(data51.lane === undefined){const err132 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "lane"},message:"must have required property '"+"lane"+"'"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}if(data51.col === undefined){const err133 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/required",keyword:"required",params:{missingProperty: "col"},message:"must have required property '"+"col"+"'"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}for(const key14 in data51){if(!(func1.call(schema127.properties.states.items.properties, key14))){const err134 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}if(data51.id !== undefined){let data52 = data51.id;if(typeof data52 === "string"){if(!pattern14.test(data52)){const err135 = {instancePath:instancePath+"/states/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}else {const err136 = {instancePath:instancePath+"/states/" + i1+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}if(data51.type !== undefined){let data53 = data51.type;if(!((((((((data53 === "start") || (data53 === "active")) || (data53 === "waiting")) || (data53 === "decision")) || (data53 === "success")) || (data53 === "failure")) || (data53 === "neutral")) || (data53 === "external"))){const err137 = {instancePath:instancePath+"/states/" + i1+"/type",schemaPath:"#/properties/states/items/properties/type/enum",keyword:"enum",params:{allowedValues: schema127.properties.states.items.properties.type.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}if(data51.label !== undefined){let data54 = data51.label;if(typeof data54 === "string"){if(func3(data54) < 1){const err138 = {instancePath:instancePath+"/states/" + i1+"/label",schemaPath:"#/properties/states/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}else {const err139 = {instancePath:instancePath+"/states/" + i1+"/label",schemaPath:"#/properties/states/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}if(data51.sublabel !== undefined){if(typeof data51.sublabel !== "string"){const err140 = {instancePath:instancePath+"/states/" + i1+"/sublabel",schemaPath:"#/properties/states/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}if(data51.tag !== undefined){if(typeof data51.tag !== "string"){const err141 = {instancePath:instancePath+"/states/" + i1+"/tag",schemaPath:"#/properties/states/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}}if(data51.brand !== undefined){let data57 = data51.brand;const _errs160 = errors;let valid46 = false;let passing0 = null;const _errs161 = errors;const _errs163 = errors;let valid47 = false;const _errs164 = errors;if(typeof data57 === "string"){if(func3(data57) > 80){const err142 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}if(!pattern27.test(data57)){const err143 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}var _valid1 = _errs164 === errors;valid47 = valid47 || _valid1;const _errs165 = errors;if(typeof data57 === "string"){if(!pattern28.test(data57)){const err144 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}var _valid1 = _errs165 === errors;valid47 = valid47 || _valid1;if(!valid47){const err145 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}else {errors = _errs163;if(vErrors !== null){if(_errs163){vErrors.length = _errs163;}else {vErrors = null;}}}if(typeof data57 === "string"){if(func3(data57) > 2048){const err146 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}if(func3(data57) < 1){const err147 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}else {const err148 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}var _valid0 = _errs161 === errors;if(_valid0){valid46 = true;passing0 = 0;}const _errs166 = errors;if(data57 && typeof data57 == "object" && !Array.isArray(data57)){if(data57.url === undefined){const err149 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}if(data57.sha256 === undefined){const err150 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}for(const key15 in data57){if(!((key15 === "url") || (key15 === "sha256"))){const err151 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}if(data57.url !== undefined){let data58 = data57.url;if(typeof data58 === "string"){if(func3(data58) > 2048){const err152 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}if(func3(data58) < 8){const err153 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}if(!pattern28.test(data58)){const err154 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}else {const err155 = {instancePath:instancePath+"/states/" + i1+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}}if(data57.sha256 !== undefined){let data59 = data57.sha256;if(typeof data59 === "string"){if(!pattern30.test(data59)){const err156 = {instancePath:instancePath+"/states/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}else {const err157 = {instancePath:instancePath+"/states/" + i1+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}}else {const err158 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}var _valid0 = _errs166 === errors;if(_valid0 && valid46){valid46 = false;passing0 = [passing0, 1];}else {if(_valid0){valid46 = true;passing0 = 1;}}if(!valid46){const err159 = {instancePath:instancePath+"/states/" + i1+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}else {errors = _errs160;if(vErrors !== null){if(_errs160){vErrors.length = _errs160;}else {vErrors = null;}}}}if(data51.sources !== undefined){let data60 = data51.sources;if(Array.isArray(data60)){if(data60.length > 3){const err160 = {instancePath:instancePath+"/states/" + i1+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}if(data60.length < 1){const err161 = {instancePath:instancePath+"/states/" + i1+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}const len4 = data60.length;for(let i2=0; i2<len4; i2++){let data61 = data60[i2];if(data61 && typeof data61 == "object" && !Array.isArray(data61)){if(data61.path === undefined){const err162 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2,schemaPath:"common.schema.json#/$defs/sourceReferences/items/required",keyword:"required",params:{missingProperty: "path"},message:"must have required property '"+"path"+"'"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}for(const key16 in data61){if(!((((key16 === "path") || (key16 === "line")) || (key16 === "end_line")) || (key16 === "label"))){const err163 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2,schemaPath:"common.schema.json#/$defs/sourceReferences/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}}if(data61.path !== undefined){let data62 = data61.path;if(typeof data62 === "string"){if(func3(data62) > 240){const err164 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/maxLength",keyword:"maxLength",params:{limit: 240},message:"must NOT have more than 240 characters"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}if(func3(data62) < 1){const err165 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}else {const err166 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}if(data61.line !== undefined){let data63 = data61.line;if(!(((typeof data63 == "number") && (!(data63 % 1) && !isNaN(data63))) && (isFinite(data63)))){const err167 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}if((typeof data63 == "number") && (isFinite(data63))){if(data63 < 1 || isNaN(data63)){const err168 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}}if(data61.end_line !== undefined){let data64 = data61.end_line;if(!(((typeof data64 == "number") && (!(data64 % 1) && !isNaN(data64))) && (isFinite(data64)))){const err169 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}if((typeof data64 == "number") && (isFinite(data64))){if(data64 < 1 || isNaN(data64)){const err170 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}}if(data61.label !== undefined){let data65 = data61.label;if(typeof data65 === "string"){if(func3(data65) > 48){const err171 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}if(func3(data65) < 1){const err172 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}else {const err173 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}}else {const err174 = {instancePath:instancePath+"/states/" + i1+"/sources/" + i2,schemaPath:"common.schema.json#/$defs/sourceReferences/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}}}else {const err175 = {instancePath:instancePath+"/states/" + i1+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}}if(data51.step !== undefined){if(typeof data51.step !== "string"){const err176 = {instancePath:instancePath+"/states/" + i1+"/step",schemaPath:"#/properties/states/items/properties/step/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}}if(data51.lane !== undefined){let data67 = data51.lane;if(typeof data67 === "string"){if(!pattern14.test(data67)){const err177 = {instancePath:instancePath+"/states/" + i1+"/lane",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}}else {const err178 = {instancePath:instancePath+"/states/" + i1+"/lane",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}if(data51.col !== undefined){let data68 = data51.col;if(!(((typeof data68 == "number") && (!(data68 % 1) && !isNaN(data68))) && (isFinite(data68)))){const err179 = {instancePath:instancePath+"/states/" + i1+"/col",schemaPath:"#/properties/states/items/properties/col/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}if((typeof data68 == "number") && (isFinite(data68))){if(data68 > 4 || isNaN(data68)){const err180 = {instancePath:instancePath+"/states/" + i1+"/col",schemaPath:"#/properties/states/items/properties/col/maximum",keyword:"maximum",params:{comparison: "<=", limit: 4},message:"must be <= 4"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}if(data68 < 0 || isNaN(data68)){const err181 = {instancePath:instancePath+"/states/" + i1+"/col",schemaPath:"#/properties/states/items/properties/col/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}}if(data51.width !== undefined){let data69 = data51.width;if((typeof data69 == "number") && (isFinite(data69))){if(data69 < 48 || isNaN(data69)){const err182 = {instancePath:instancePath+"/states/" + i1+"/width",schemaPath:"#/properties/states/items/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 48},message:"must be >= 48"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}else {const err183 = {instancePath:instancePath+"/states/" + i1+"/width",schemaPath:"#/properties/states/items/properties/width/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}if(data51.height !== undefined){let data70 = data51.height;if((typeof data70 == "number") && (isFinite(data70))){if(data70 < 36 || isNaN(data70)){const err184 = {instancePath:instancePath+"/states/" + i1+"/height",schemaPath:"#/properties/states/items/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 36},message:"must be >= 36"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}else {const err185 = {instancePath:instancePath+"/states/" + i1+"/height",schemaPath:"#/properties/states/items/properties/height/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}if(data51.yOffset !== undefined){let data71 = data51.yOffset;if(!((typeof data71 == "number") && (isFinite(data71)))){const err186 = {instancePath:instancePath+"/states/" + i1+"/yOffset",schemaPath:"#/properties/states/items/properties/yOffset/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}}}else {const err187 = {instancePath:instancePath+"/states/" + i1,schemaPath:"#/properties/states/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}}else {const err188 = {instancePath:instancePath+"/states",schemaPath:"#/properties/states/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}if(data.transitions !== undefined){let data72 = data.transitions;if(Array.isArray(data72)){const len5 = data72.length;for(let i3=0; i3<len5; i3++){let data73 = data72[i3];if(data73 && typeof data73 == "object" && !Array.isArray(data73)){if(data73.from === undefined){const err189 = {instancePath:instancePath+"/transitions/" + i3,schemaPath:"#/properties/transitions/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}if(data73.to === undefined){const err190 = {instancePath:instancePath+"/transitions/" + i3,schemaPath:"#/properties/transitions/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}for(const key17 in data73){if(!(func1.call(schema127.properties.transitions.items.properties, key17))){const err191 = {instancePath:instancePath+"/transitions/" + i3,schemaPath:"#/properties/transitions/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key17},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}if(data73.id !== undefined){let data74 = data73.id;if(typeof data74 === "string"){if(!pattern14.test(data74)){const err192 = {instancePath:instancePath+"/transitions/" + i3+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}else {const err193 = {instancePath:instancePath+"/transitions/" + i3+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}if(data73.from !== undefined){let data75 = data73.from;if(typeof data75 === "string"){if(!pattern14.test(data75)){const err194 = {instancePath:instancePath+"/transitions/" + i3+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}else {const err195 = {instancePath:instancePath+"/transitions/" + i3+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}}if(data73.to !== undefined){let data76 = data73.to;if(typeof data76 === "string"){if(!pattern14.test(data76)){const err196 = {instancePath:instancePath+"/transitions/" + i3+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}}else {const err197 = {instancePath:instancePath+"/transitions/" + i3+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}}if(data73.label !== undefined){if(typeof data73.label !== "string"){const err198 = {instancePath:instancePath+"/transitions/" + i3+"/label",schemaPath:"#/properties/transitions/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}}if(data73.note !== undefined){if(typeof data73.note !== "string"){const err199 = {instancePath:instancePath+"/transitions/" + i3+"/note",schemaPath:"#/properties/transitions/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}}if(data73.variant !== undefined){let data79 = data73.variant;if(!((((data79 === "default") || (data79 === "emphasis")) || (data79 === "security")) || (data79 === "dashed"))){const err200 = {instancePath:instancePath+"/transitions/" + i3+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema65.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}}if(data73.route !== undefined){let data80 = data73.route;if(!(((((((data80 === "auto") || (data80 === "straight")) || (data80 === "drop")) || (data80 === "bottom-channel")) || (data80 === "top-channel")) || (data80 === "right-channel")) || (data80 === "left-channel"))){const err201 = {instancePath:instancePath+"/transitions/" + i3+"/route",schemaPath:"#/properties/transitions/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema127.properties.transitions.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}}if(data73.fromSide !== undefined){let data81 = data73.fromSide;if(!((((data81 === "left") || (data81 === "right")) || (data81 === "top")) || (data81 === "bottom"))){const err202 = {instancePath:instancePath+"/transitions/" + i3+"/fromSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema121.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}}if(data73.toSide !== undefined){let data82 = data73.toSide;if(!((((data82 === "left") || (data82 === "right")) || (data82 === "top")) || (data82 === "bottom"))){const err203 = {instancePath:instancePath+"/transitions/" + i3+"/toSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema121.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}}if(data73.channelX !== undefined){let data83 = data73.channelX;if(!((typeof data83 == "number") && (isFinite(data83)))){const err204 = {instancePath:instancePath+"/transitions/" + i3+"/channelX",schemaPath:"#/properties/transitions/items/properties/channelX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}}if(data73.channelY !== undefined){let data84 = data73.channelY;if(!((typeof data84 == "number") && (isFinite(data84)))){const err205 = {instancePath:instancePath+"/transitions/" + i3+"/channelY",schemaPath:"#/properties/transitions/items/properties/channelY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err205];}else {vErrors.push(err205);}errors++;}}if(data73.cornerRadius !== undefined){let data85 = data73.cornerRadius;if((typeof data85 == "number") && (isFinite(data85))){if(data85 < 0 || isNaN(data85)){const err206 = {instancePath:instancePath+"/transitions/" + i3+"/cornerRadius",schemaPath:"#/properties/transitions/items/properties/cornerRadius/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err206];}else {vErrors.push(err206);}errors++;}}else {const err207 = {instancePath:instancePath+"/transitions/" + i3+"/cornerRadius",schemaPath:"#/properties/transitions/items/properties/cornerRadius/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err207];}else {vErrors.push(err207);}errors++;}}if(data73.labelAt !== undefined){let data86 = data73.labelAt;if(Array.isArray(data86)){if(data86.length > 2){const err208 = {instancePath:instancePath+"/transitions/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err208];}else {vErrors.push(err208);}errors++;}if(data86.length < 2){const err209 = {instancePath:instancePath+"/transitions/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err209];}else {vErrors.push(err209);}errors++;}const len6 = data86.length;if(len6 > 0){let data87 = data86[0];if(!((typeof data87 == "number") && (isFinite(data87)))){const err210 = {instancePath:instancePath+"/transitions/" + i3+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err210];}else {vErrors.push(err210);}errors++;}}if(len6 > 1){let data88 = data86[1];if(!((typeof data88 == "number") && (isFinite(data88)))){const err211 = {instancePath:instancePath+"/transitions/" + i3+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err211];}else {vErrors.push(err211);}errors++;}}const len7 = data86.length;if(!(len7 <= 2)){const err212 = {instancePath:instancePath+"/transitions/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err212];}else {vErrors.push(err212);}errors++;}}else {const err213 = {instancePath:instancePath+"/transitions/" + i3+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err213];}else {vErrors.push(err213);}errors++;}}if(data73.labelDx !== undefined){let data89 = data73.labelDx;if(!((typeof data89 == "number") && (isFinite(data89)))){const err214 = {instancePath:instancePath+"/transitions/" + i3+"/labelDx",schemaPath:"#/properties/transitions/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err214];}else {vErrors.push(err214);}errors++;}}if(data73.labelDy !== undefined){let data90 = data73.labelDy;if(!((typeof data90 == "number") && (isFinite(data90)))){const err215 = {instancePath:instancePath+"/transitions/" + i3+"/labelDy",schemaPath:"#/properties/transitions/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err215];}else {vErrors.push(err215);}errors++;}}if(data73.labelSegment !== undefined){let data91 = data73.labelSegment;if(!(((typeof data91 == "number") && (!(data91 % 1) && !isNaN(data91))) && (isFinite(data91)))){const err216 = {instancePath:instancePath+"/transitions/" + i3+"/labelSegment",schemaPath:"#/properties/transitions/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err216];}else {vErrors.push(err216);}errors++;}if((typeof data91 == "number") && (isFinite(data91))){if(data91 < 0 || isNaN(data91)){const err217 = {instancePath:instancePath+"/transitions/" + i3+"/labelSegment",schemaPath:"#/properties/transitions/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err217];}else {vErrors.push(err217);}errors++;}}}if(data73.via !== undefined){let data92 = data73.via;if(Array.isArray(data92)){const len8 = data92.length;for(let i4=0; i4<len8; i4++){let data93 = data92[i4];if(Array.isArray(data93)){if(data93.length > 2){const err218 = {instancePath:instancePath+"/transitions/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err218];}else {vErrors.push(err218);}errors++;}if(data93.length < 2){const err219 = {instancePath:instancePath+"/transitions/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err219];}else {vErrors.push(err219);}errors++;}const len9 = data93.length;if(len9 > 0){let data94 = data93[0];if(!((typeof data94 == "number") && (isFinite(data94)))){const err220 = {instancePath:instancePath+"/transitions/" + i3+"/via/" + i4+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err220];}else {vErrors.push(err220);}errors++;}}if(len9 > 1){let data95 = data93[1];if(!((typeof data95 == "number") && (isFinite(data95)))){const err221 = {instancePath:instancePath+"/transitions/" + i3+"/via/" + i4+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err221];}else {vErrors.push(err221);}errors++;}}const len10 = data93.length;if(!(len10 <= 2)){const err222 = {instancePath:instancePath+"/transitions/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err222];}else {vErrors.push(err222);}errors++;}}else {const err223 = {instancePath:instancePath+"/transitions/" + i3+"/via/" + i4,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err223];}else {vErrors.push(err223);}errors++;}}}else {const err224 = {instancePath:instancePath+"/transitions/" + i3+"/via",schemaPath:"#/properties/transitions/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err224];}else {vErrors.push(err224);}errors++;}}if(data73.width !== undefined){let data96 = data73.width;if((typeof data96 == "number") && (isFinite(data96))){if(data96 < 0.5 || isNaN(data96)){const err225 = {instancePath:instancePath+"/transitions/" + i3+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err225];}else {vErrors.push(err225);}errors++;}}else {const err226 = {instancePath:instancePath+"/transitions/" + i3+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err226];}else {vErrors.push(err226);}errors++;}}}else {const err227 = {instancePath:instancePath+"/transitions/" + i3,schemaPath:"#/properties/transitions/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err227];}else {vErrors.push(err227);}errors++;}}}else {const err228 = {instancePath:instancePath+"/transitions",schemaPath:"#/properties/transitions/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err228];}else {vErrors.push(err228);}errors++;}}if(data.cards !== undefined){let data97 = data.cards;if(Array.isArray(data97)){const len11 = data97.length;for(let i5=0; i5<len11; i5++){let data98 = data97[i5];if(data98 && typeof data98 == "object" && !Array.isArray(data98)){if(data98.dot === undefined){const err229 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err229];}else {vErrors.push(err229);}errors++;}if(data98.title === undefined){const err230 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err230];}else {vErrors.push(err230);}errors++;}if(data98.items === undefined){const err231 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err231];}else {vErrors.push(err231);}errors++;}for(const key18 in data98){if(!(((key18 === "dot") || (key18 === "title")) || (key18 === "items"))){const err232 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key18},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err232];}else {vErrors.push(err232);}errors++;}}if(data98.dot !== undefined){let data99 = data98.dot;if(!(((((((data99 === "cyan") || (data99 === "emerald")) || (data99 === "violet")) || (data99 === "amber")) || (data99 === "rose")) || (data99 === "orange")) || (data99 === "slate"))){const err233 = {instancePath:instancePath+"/cards/" + i5+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema70.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err233];}else {vErrors.push(err233);}errors++;}}if(data98.title !== undefined){let data100 = data98.title;if(typeof data100 === "string"){if(func3(data100) < 1){const err234 = {instancePath:instancePath+"/cards/" + i5+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err234];}else {vErrors.push(err234);}errors++;}}else {const err235 = {instancePath:instancePath+"/cards/" + i5+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err235];}else {vErrors.push(err235);}errors++;}}if(data98.items !== undefined){let data101 = data98.items;if(Array.isArray(data101)){const len12 = data101.length;for(let i6=0; i6<len12; i6++){if(typeof data101[i6] !== "string"){const err236 = {instancePath:instancePath+"/cards/" + i5+"/items/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err236];}else {vErrors.push(err236);}errors++;}}}else {const err237 = {instancePath:instancePath+"/cards/" + i5+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err237];}else {vErrors.push(err237);}errors++;}}}else {const err238 = {instancePath:instancePath+"/cards/" + i5,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err238];}else {vErrors.push(err238);}errors++;}}}else {const err239 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err239];}else {vErrors.push(err239);}errors++;}}}else {const err240 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err240];}else {vErrors.push(err240);}errors++;}validate33.errors = vErrors;return errors === 0;}validate33.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const architectureSchema = validate36;const schema161 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/tt-a1i/archify/schemas/architecture.schema.json","title":"Archify Architecture Diagram","type":"object","additionalProperties":false,"required":["schema_version","diagram_type","meta","components"],"properties":{"schema_version":{"const":1},"diagram_type":{"const":"architecture"},"meta":{"type":"object","additionalProperties":false,"required":["title","output"],"properties":{"title":{"type":"string","minLength":1},"locale":{"$ref":"common.schema.json#/$defs/locale"},"subtitle":{"type":"string"},"output":{"$ref":"common.schema.json#/$defs/portableOutputPath"},"animation":{"$ref":"common.schema.json#/$defs/animation"},"visual_preset":{"$ref":"common.schema.json#/$defs/visualPreset"},"quality_profile":{"$ref":"common.schema.json#/$defs/qualityProfile"},"engineering_profile":{"enum":["deployment-ownership"]},"repository":{"$ref":"common.schema.json#/$defs/repository"},"views":{"$ref":"common.schema.json#/$defs/guidedViews"},"legend":{"type":"object","additionalProperties":false,"properties":{"mode":{"$ref":"common.schema.json#/$defs/legendMode"},"entries":{"type":"object","additionalProperties":false,"properties":{"frontend":{"$ref":"common.schema.json#/$defs/legendEntry"},"backend":{"$ref":"common.schema.json#/$defs/legendEntry"},"database":{"$ref":"common.schema.json#/$defs/legendEntry"},"cloud":{"$ref":"common.schema.json#/$defs/legendEntry"},"security":{"$ref":"common.schema.json#/$defs/legendEntry"},"messagebus":{"$ref":"common.schema.json#/$defs/legendEntry"},"external":{"$ref":"common.schema.json#/$defs/legendEntry"}}}}},"viewBox":{"type":"array","prefixItems":[{"type":"number","minimum":320},{"type":"number","minimum":240}],"items":false,"minItems":2,"maxItems":2}}},"layout":{"type":"object","additionalProperties":false,"required":["mode"],"properties":{"mode":{"enum":["grid"]},"origin":{"$ref":"common.schema.json#/$defs/point"},"cols":{"type":"integer","minimum":1,"maximum":12},"gapX":{"type":"number","minimum":0},"gapY":{"type":"number","minimum":0},"cellW":{"type":"number","minimum":40},"cellH":{"type":"number","minimum":24}}},"components":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","type","label"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"type":{"$ref":"common.schema.json#/$defs/componentType"},"label":{"type":"string","minLength":1},"sublabel":{"type":"string"},"tag":{"type":"string"},"brand":{"$ref":"common.schema.json#/$defs/brandMark"},"sources":{"$ref":"common.schema.json#/$defs/sourceReferences"},"row":{"type":"integer","minimum":0},"col":{"type":"integer","minimum":0},"pos":{"$ref":"common.schema.json#/$defs/point"},"size":{"type":"array","prefixItems":[{"type":"number","exclusiveMinimum":0},{"type":"number","exclusiveMinimum":0}],"items":false,"minItems":2,"maxItems":2}}}},"boundaries":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["kind","label","wraps"],"properties":{"kind":{"enum":["region","security-group"]},"label":{"type":"string","minLength":1},"wraps":{"type":"array","minItems":1,"items":{"$ref":"common.schema.json#/$defs/id"}},"pad":{"type":"number","minimum":0}}}},"connections":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","to"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"from":{"$ref":"common.schema.json#/$defs/id"},"to":{"$ref":"common.schema.json#/$defs/id"},"label":{"type":"string"},"variant":{"$ref":"common.schema.json#/$defs/variant"},"fromSide":{"$ref":"common.schema.json#/$defs/side"},"toSide":{"$ref":"common.schema.json#/$defs/side"},"route":{"enum":["auto","straight","orthogonal-h","orthogonal-v"]},"via":{"type":"array","items":{"$ref":"common.schema.json#/$defs/point"}},"labelAt":{"$ref":"common.schema.json#/$defs/point"},"labelDx":{"type":"number"},"labelDy":{"type":"number"},"labelSegment":{"type":"integer","minimum":0},"width":{"$ref":"common.schema.json#/$defs/relationshipWidth"}}}},"cards":{"$ref":"common.schema.json#/$defs/cards"}}};function validate37(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate37.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 5){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 5},message:"must NOT have more than 5 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.id === undefined){const err1 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data0.label === undefined){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data0.focus === undefined){const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/required",keyword:"required",params:{missingProperty: "focus"},message:"must have required property '"+"focus"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data0){if(!((((key0 === "id") || (key0 === "label")) || (key0 === "focus")) || (key0 === "note"))){const err4 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data0.id !== undefined){let data1 = data0.id;if(typeof data1 === "string"){if(!pattern14.test(data1)){const err5 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/" + i0+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.label !== undefined){let data2 = data0.label;if(typeof data2 === "string"){if(func3(data2) > 48){const err7 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/" + i0+"/label",schemaPath:"#/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data0.focus !== undefined){let data3 = data0.focus;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){let data4 = data3[i1];if(typeof data4 === "string"){if(!pattern14.test(data4)){const err11 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/" + i0+"/focus/" + i1,schemaPath:"#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath:instancePath+"/" + i0+"/focus",schemaPath:"#/items/properties/focus/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data0.note !== undefined){let data5 = data0.note;if(typeof data5 === "string"){if(func3(data5) > 140){const err14 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/maxLength",keyword:"maxLength",params:{limit: 140},message:"must NOT have more than 140 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/" + i0+"/note",schemaPath:"#/items/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate37.errors = vErrors;return errors === 0;}validate37.evaluated = {"items":true,"dynamicProps":false,"dynamicItems":false};function validate36(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/tt-a1i/archify/schemas/architecture.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate36.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schema_version === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schema_version"},message:"must have required property '"+"schema_version"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.diagram_type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "diagram_type"},message:"must have required property '"+"diagram_type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.meta === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "meta"},message:"must have required property '"+"meta"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.components === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "components"},message:"must have required property '"+"components"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data){if(!((((((((key0 === "schema_version") || (key0 === "diagram_type")) || (key0 === "meta")) || (key0 === "layout")) || (key0 === "components")) || (key0 === "boundaries")) || (key0 === "connections")) || (key0 === "cards"))){const err4 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.schema_version !== undefined){if(1 !== data.schema_version){const err5 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/const",keyword:"const",params:{allowedValue: 1},message:"must be equal to constant"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.diagram_type !== undefined){if("architecture" !== data.diagram_type){const err6 = {instancePath:instancePath+"/diagram_type",schemaPath:"#/properties/diagram_type/const",keyword:"const",params:{allowedValue: "architecture"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.meta !== undefined){let data2 = data.meta;if(data2 && typeof data2 == "object" && !Array.isArray(data2)){if(data2.title === undefined){const err7 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data2.output === undefined){const err8 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty: "output"},message:"must have required property '"+"output"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}for(const key1 in data2){if(!(func1.call(schema161.properties.meta.properties, key1))){const err9 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data2.title !== undefined){let data3 = data2.title;if(typeof data3 === "string"){if(func3(data3) < 1){const err10 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data2.locale !== undefined){let data4 = data2.locale;if(!(((data4 === "en") || (data4 === "zh-CN")) || (data4 === "es"))){const err12 = {instancePath:instancePath+"/meta/locale",schemaPath:"common.schema.json#/$defs/locale/enum",keyword:"enum",params:{allowedValues: schema33.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data2.subtitle !== undefined){if(typeof data2.subtitle !== "string"){const err13 = {instancePath:instancePath+"/meta/subtitle",schemaPath:"#/properties/meta/properties/subtitle/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data2.output !== undefined){let data6 = data2.output;if(typeof data6 === "string"){if(!pattern4.test(data6)){const err14 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/0/pattern",keyword:"pattern",params:{pattern: "(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"},message:"must match pattern \""+"(?:^|/)[^/]+[.][Hh][Tt][Mm][Ll]$"+"\""};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}const _errs18 = errors;const _errs19 = errors;if(typeof data6 === "string"){if(!pattern5.test(data6)){const err15 = {};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}var valid5 = _errs19 === errors;if(valid5){const err16 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/1/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}const _errs21 = errors;const _errs22 = errors;if(typeof data6 === "string"){if(!pattern6.test(data6)){const err17 = {};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}var valid6 = _errs22 === errors;if(valid6){const err18 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/2/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}const _errs24 = errors;const _errs25 = errors;if(typeof data6 === "string"){if(!pattern7.test(data6)){const err19 = {};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}var valid7 = _errs25 === errors;if(valid7){const err20 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/3/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}const _errs27 = errors;const _errs28 = errors;if(typeof data6 === "string"){if(!pattern8.test(data6)){const err21 = {};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}var valid8 = _errs28 === errors;if(valid8){const err22 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/4/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}else {errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}}const _errs30 = errors;const _errs31 = errors;if(typeof data6 === "string"){if(!pattern9.test(data6)){const err23 = {};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}var valid9 = _errs31 === errors;if(valid9){const err24 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/5/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}else {errors = _errs30;if(vErrors !== null){if(_errs30){vErrors.length = _errs30;}else {vErrors = null;}}}const _errs33 = errors;const _errs34 = errors;if(typeof data6 === "string"){if(!pattern10.test(data6)){const err25 = {};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}var valid10 = _errs34 === errors;if(valid10){const err26 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/6/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}else {errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}}const _errs36 = errors;const _errs37 = errors;if(typeof data6 === "string"){if(!pattern11.test(data6)){const err27 = {};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}var valid11 = _errs37 === errors;if(valid11){const err28 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/allOf/7/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}else {errors = _errs36;if(vErrors !== null){if(_errs36){vErrors.length = _errs36;}else {vErrors = null;}}}if(typeof data6 === "string"){if(func3(data6) < 1){const err29 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}if(!pattern12.test(data6)){const err30 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/pattern",keyword:"pattern",params:{pattern: "^[^/]+(?:/[^/]+)*$"},message:"must match pattern \""+"^[^/]+(?:/[^/]+)*$"+"\""};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}else {const err31 = {instancePath:instancePath+"/meta/output",schemaPath:"common.schema.json#/$defs/portableOutputPath/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data2.animation !== undefined){let data7 = data2.animation;if(!((data7 === "trace") || (data7 === "none"))){const err32 = {instancePath:instancePath+"/meta/animation",schemaPath:"common.schema.json#/$defs/animation/enum",keyword:"enum",params:{allowedValues: schema74.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}if(data2.visual_preset !== undefined){let data8 = data2.visual_preset;if(!((((data8 === "classic") || (data8 === "signal-flow")) || (data8 === "blueprint")) || (data8 === "editorial"))){const err33 = {instancePath:instancePath+"/meta/visual_preset",schemaPath:"common.schema.json#/$defs/visualPreset/enum",keyword:"enum",params:{allowedValues: schema75.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data2.quality_profile !== undefined){let data9 = data2.quality_profile;if(!((data9 === "standard") || (data9 === "showcase"))){const err34 = {instancePath:instancePath+"/meta/quality_profile",schemaPath:"common.schema.json#/$defs/qualityProfile/enum",keyword:"enum",params:{allowedValues: schema76.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data2.engineering_profile !== undefined){if(!(data2.engineering_profile === "deployment-ownership")){const err35 = {instancePath:instancePath+"/meta/engineering_profile",schemaPath:"#/properties/meta/properties/engineering_profile/enum",keyword:"enum",params:{allowedValues: schema161.properties.meta.properties.engineering_profile.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data2.repository !== undefined){let data11 = data2.repository;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){if(data11.url === undefined){const err36 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}if(data11.revision === undefined){const err37 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/required",keyword:"required",params:{missingProperty: "revision"},message:"must have required property '"+"revision"+"'"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}for(const key2 in data11){if(!((((key2 === "url") || (key2 === "provider")) || (key2 === "link_mode")) || (key2 === "revision"))){const err38 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}if(data11.url !== undefined){let data12 = data11.url;if(typeof data12 === "string"){if(func3(data12) < 1){const err39 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/meta/repository/url",schemaPath:"common.schema.json#/$defs/repository/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data11.provider !== undefined){let data13 = data11.provider;if(!((data13 === "github") || (data13 === "gitee"))){const err41 = {instancePath:instancePath+"/meta/repository/provider",schemaPath:"common.schema.json#/$defs/repository/properties/provider/enum",keyword:"enum",params:{allowedValues: schema35.properties.provider.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data11.link_mode !== undefined){let data14 = data11.link_mode;if(!((data14 === "web") || (data14 === "local-only"))){const err42 = {instancePath:instancePath+"/meta/repository/link_mode",schemaPath:"common.schema.json#/$defs/repository/properties/link_mode/enum",keyword:"enum",params:{allowedValues: schema35.properties.link_mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data11.revision !== undefined){let data15 = data11.revision;if(typeof data15 === "string"){if(!pattern13.test(data15)){const err43 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/pattern",keyword:"pattern",params:{pattern: "^[a-fA-F0-9]{40}$"},message:"must match pattern \""+"^[a-fA-F0-9]{40}$"+"\""};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}else {const err44 = {instancePath:instancePath+"/meta/repository/revision",schemaPath:"common.schema.json#/$defs/repository/properties/revision/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}}else {const err45 = {instancePath:instancePath+"/meta/repository",schemaPath:"common.schema.json#/$defs/repository/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data2.views !== undefined){if(!(validate37(data2.views, {instancePath:instancePath+"/meta/views",parentData:data2,parentDataProperty:"views",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate37.errors : vErrors.concat(validate37.errors);errors = vErrors.length;}}if(data2.legend !== undefined){let data17 = data2.legend;if(data17 && typeof data17 == "object" && !Array.isArray(data17)){for(const key3 in data17){if(!((key3 === "mode") || (key3 === "entries"))){const err46 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}if(data17.mode !== undefined){let data18 = data17.mode;if(!(((data18 === "auto") || (data18 === "all")) || (data18 === "hidden"))){const err47 = {instancePath:instancePath+"/meta/legend/mode",schemaPath:"common.schema.json#/$defs/legendMode/enum",keyword:"enum",params:{allowedValues: schema39.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data17.entries !== undefined){let data19 = data17.entries;if(data19 && typeof data19 == "object" && !Array.isArray(data19)){for(const key4 in data19){if(!(((((((key4 === "frontend") || (key4 === "backend")) || (key4 === "database")) || (key4 === "cloud")) || (key4 === "security")) || (key4 === "messagebus")) || (key4 === "external"))){const err48 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}if(data19.frontend !== undefined){let data20 = data19.frontend;if(data20 && typeof data20 == "object" && !Array.isArray(data20)){if(Object.keys(data20).length < 1){const err49 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}for(const key5 in data20){if(!((key5 === "label") || (key5 === "visible"))){const err50 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}}if(data20.label !== undefined){let data21 = data20.label;if(typeof data21 === "string"){if(func3(data21) > 80){const err51 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}if(func3(data21) < 1){const err52 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}else {const err53 = {instancePath:instancePath+"/meta/legend/entries/frontend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}if(data20.visible !== undefined){if(typeof data20.visible !== "boolean"){const err54 = {instancePath:instancePath+"/meta/legend/entries/frontend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}}else {const err55 = {instancePath:instancePath+"/meta/legend/entries/frontend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}if(data19.backend !== undefined){let data23 = data19.backend;if(data23 && typeof data23 == "object" && !Array.isArray(data23)){if(Object.keys(data23).length < 1){const err56 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}for(const key6 in data23){if(!((key6 === "label") || (key6 === "visible"))){const err57 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}if(data23.label !== undefined){let data24 = data23.label;if(typeof data24 === "string"){if(func3(data24) > 80){const err58 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(func3(data24) < 1){const err59 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}}else {const err60 = {instancePath:instancePath+"/meta/legend/entries/backend/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}if(data23.visible !== undefined){if(typeof data23.visible !== "boolean"){const err61 = {instancePath:instancePath+"/meta/legend/entries/backend/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}}else {const err62 = {instancePath:instancePath+"/meta/legend/entries/backend",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}if(data19.database !== undefined){let data26 = data19.database;if(data26 && typeof data26 == "object" && !Array.isArray(data26)){if(Object.keys(data26).length < 1){const err63 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}for(const key7 in data26){if(!((key7 === "label") || (key7 === "visible"))){const err64 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}}if(data26.label !== undefined){let data27 = data26.label;if(typeof data27 === "string"){if(func3(data27) > 80){const err65 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}if(func3(data27) < 1){const err66 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}else {const err67 = {instancePath:instancePath+"/meta/legend/entries/database/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}if(data26.visible !== undefined){if(typeof data26.visible !== "boolean"){const err68 = {instancePath:instancePath+"/meta/legend/entries/database/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}}else {const err69 = {instancePath:instancePath+"/meta/legend/entries/database",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}if(data19.cloud !== undefined){let data29 = data19.cloud;if(data29 && typeof data29 == "object" && !Array.isArray(data29)){if(Object.keys(data29).length < 1){const err70 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}for(const key8 in data29){if(!((key8 === "label") || (key8 === "visible"))){const err71 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}if(data29.label !== undefined){let data30 = data29.label;if(typeof data30 === "string"){if(func3(data30) > 80){const err72 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}if(func3(data30) < 1){const err73 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}else {const err74 = {instancePath:instancePath+"/meta/legend/entries/cloud/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}if(data29.visible !== undefined){if(typeof data29.visible !== "boolean"){const err75 = {instancePath:instancePath+"/meta/legend/entries/cloud/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}}else {const err76 = {instancePath:instancePath+"/meta/legend/entries/cloud",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}if(data19.security !== undefined){let data32 = data19.security;if(data32 && typeof data32 == "object" && !Array.isArray(data32)){if(Object.keys(data32).length < 1){const err77 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}for(const key9 in data32){if(!((key9 === "label") || (key9 === "visible"))){const err78 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}}if(data32.label !== undefined){let data33 = data32.label;if(typeof data33 === "string"){if(func3(data33) > 80){const err79 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}if(func3(data33) < 1){const err80 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}}else {const err81 = {instancePath:instancePath+"/meta/legend/entries/security/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}if(data32.visible !== undefined){if(typeof data32.visible !== "boolean"){const err82 = {instancePath:instancePath+"/meta/legend/entries/security/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}}else {const err83 = {instancePath:instancePath+"/meta/legend/entries/security",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}if(data19.messagebus !== undefined){let data35 = data19.messagebus;if(data35 && typeof data35 == "object" && !Array.isArray(data35)){if(Object.keys(data35).length < 1){const err84 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}for(const key10 in data35){if(!((key10 === "label") || (key10 === "visible"))){const err85 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key10},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}if(data35.label !== undefined){let data36 = data35.label;if(typeof data36 === "string"){if(func3(data36) > 80){const err86 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}if(func3(data36) < 1){const err87 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}else {const err88 = {instancePath:instancePath+"/meta/legend/entries/messagebus/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}if(data35.visible !== undefined){if(typeof data35.visible !== "boolean"){const err89 = {instancePath:instancePath+"/meta/legend/entries/messagebus/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}}else {const err90 = {instancePath:instancePath+"/meta/legend/entries/messagebus",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}if(data19.external !== undefined){let data38 = data19.external;if(data38 && typeof data38 == "object" && !Array.isArray(data38)){if(Object.keys(data38).length < 1){const err91 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}for(const key11 in data38){if(!((key11 === "label") || (key11 === "visible"))){const err92 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key11},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}if(data38.label !== undefined){let data39 = data38.label;if(typeof data39 === "string"){if(func3(data39) > 80){const err93 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}if(func3(data39) < 1){const err94 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}else {const err95 = {instancePath:instancePath+"/meta/legend/entries/external/label",schemaPath:"common.schema.json#/$defs/legendEntry/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}if(data38.visible !== undefined){if(typeof data38.visible !== "boolean"){const err96 = {instancePath:instancePath+"/meta/legend/entries/external/visible",schemaPath:"common.schema.json#/$defs/legendEntry/properties/visible/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}}else {const err97 = {instancePath:instancePath+"/meta/legend/entries/external",schemaPath:"common.schema.json#/$defs/legendEntry/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}else {const err98 = {instancePath:instancePath+"/meta/legend/entries",schemaPath:"#/properties/meta/properties/legend/properties/entries/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}}else {const err99 = {instancePath:instancePath+"/meta/legend",schemaPath:"#/properties/meta/properties/legend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}if(data2.viewBox !== undefined){let data41 = data2.viewBox;if(Array.isArray(data41)){if(data41.length > 2){const err100 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}if(data41.length < 2){const err101 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}const len0 = data41.length;if(len0 > 0){let data42 = data41[0];if((typeof data42 == "number") && (isFinite(data42))){if(data42 < 320 || isNaN(data42)){const err102 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 320},message:"must be >= 320"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}else {const err103 = {instancePath:instancePath+"/meta/viewBox/0",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}if(len0 > 1){let data43 = data41[1];if((typeof data43 == "number") && (isFinite(data43))){if(data43 < 240 || isNaN(data43)){const err104 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/minimum",keyword:"minimum",params:{comparison: ">=", limit: 240},message:"must be >= 240"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}else {const err105 = {instancePath:instancePath+"/meta/viewBox/1",schemaPath:"#/properties/meta/properties/viewBox/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}const len1 = data41.length;if(!(len1 <= 2)){const err106 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}else {const err107 = {instancePath:instancePath+"/meta/viewBox",schemaPath:"#/properties/meta/properties/viewBox/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}}else {const err108 = {instancePath:instancePath+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}if(data.layout !== undefined){let data44 = data.layout;if(data44 && typeof data44 == "object" && !Array.isArray(data44)){if(data44.mode === undefined){const err109 = {instancePath:instancePath+"/layout",schemaPath:"#/properties/layout/required",keyword:"required",params:{missingProperty: "mode"},message:"must have required property '"+"mode"+"'"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}for(const key12 in data44){if(!(((((((key12 === "mode") || (key12 === "origin")) || (key12 === "cols")) || (key12 === "gapX")) || (key12 === "gapY")) || (key12 === "cellW")) || (key12 === "cellH"))){const err110 = {instancePath:instancePath+"/layout",schemaPath:"#/properties/layout/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key12},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}if(data44.mode !== undefined){if(!(data44.mode === "grid")){const err111 = {instancePath:instancePath+"/layout/mode",schemaPath:"#/properties/layout/properties/mode/enum",keyword:"enum",params:{allowedValues: schema161.properties.layout.properties.mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}if(data44.origin !== undefined){let data46 = data44.origin;if(Array.isArray(data46)){if(data46.length > 2){const err112 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}if(data46.length < 2){const err113 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}const len2 = data46.length;if(len2 > 0){let data47 = data46[0];if(!((typeof data47 == "number") && (isFinite(data47)))){const err114 = {instancePath:instancePath+"/layout/origin/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}if(len2 > 1){let data48 = data46[1];if(!((typeof data48 == "number") && (isFinite(data48)))){const err115 = {instancePath:instancePath+"/layout/origin/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}const len3 = data46.length;if(!(len3 <= 2)){const err116 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}else {const err117 = {instancePath:instancePath+"/layout/origin",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}if(data44.cols !== undefined){let data49 = data44.cols;if(!(((typeof data49 == "number") && (!(data49 % 1) && !isNaN(data49))) && (isFinite(data49)))){const err118 = {instancePath:instancePath+"/layout/cols",schemaPath:"#/properties/layout/properties/cols/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}if((typeof data49 == "number") && (isFinite(data49))){if(data49 > 12 || isNaN(data49)){const err119 = {instancePath:instancePath+"/layout/cols",schemaPath:"#/properties/layout/properties/cols/maximum",keyword:"maximum",params:{comparison: "<=", limit: 12},message:"must be <= 12"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}if(data49 < 1 || isNaN(data49)){const err120 = {instancePath:instancePath+"/layout/cols",schemaPath:"#/properties/layout/properties/cols/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}}if(data44.gapX !== undefined){let data50 = data44.gapX;if((typeof data50 == "number") && (isFinite(data50))){if(data50 < 0 || isNaN(data50)){const err121 = {instancePath:instancePath+"/layout/gapX",schemaPath:"#/properties/layout/properties/gapX/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}else {const err122 = {instancePath:instancePath+"/layout/gapX",schemaPath:"#/properties/layout/properties/gapX/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}if(data44.gapY !== undefined){let data51 = data44.gapY;if((typeof data51 == "number") && (isFinite(data51))){if(data51 < 0 || isNaN(data51)){const err123 = {instancePath:instancePath+"/layout/gapY",schemaPath:"#/properties/layout/properties/gapY/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}else {const err124 = {instancePath:instancePath+"/layout/gapY",schemaPath:"#/properties/layout/properties/gapY/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}if(data44.cellW !== undefined){let data52 = data44.cellW;if((typeof data52 == "number") && (isFinite(data52))){if(data52 < 40 || isNaN(data52)){const err125 = {instancePath:instancePath+"/layout/cellW",schemaPath:"#/properties/layout/properties/cellW/minimum",keyword:"minimum",params:{comparison: ">=", limit: 40},message:"must be >= 40"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}else {const err126 = {instancePath:instancePath+"/layout/cellW",schemaPath:"#/properties/layout/properties/cellW/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}if(data44.cellH !== undefined){let data53 = data44.cellH;if((typeof data53 == "number") && (isFinite(data53))){if(data53 < 24 || isNaN(data53)){const err127 = {instancePath:instancePath+"/layout/cellH",schemaPath:"#/properties/layout/properties/cellH/minimum",keyword:"minimum",params:{comparison: ">=", limit: 24},message:"must be >= 24"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}else {const err128 = {instancePath:instancePath+"/layout/cellH",schemaPath:"#/properties/layout/properties/cellH/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}}}else {const err129 = {instancePath:instancePath+"/layout",schemaPath:"#/properties/layout/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}}if(data.components !== undefined){let data54 = data.components;if(Array.isArray(data54)){if(data54.length < 1){const err130 = {instancePath:instancePath+"/components",schemaPath:"#/properties/components/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}const len4 = data54.length;for(let i0=0; i0<len4; i0++){let data55 = data54[i0];if(data55 && typeof data55 == "object" && !Array.isArray(data55)){if(data55.id === undefined){const err131 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}if(data55.type === undefined){const err132 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}if(data55.label === undefined){const err133 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}for(const key13 in data55){if(!(func1.call(schema161.properties.components.items.properties, key13))){const err134 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key13},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}if(data55.id !== undefined){let data56 = data55.id;if(typeof data56 === "string"){if(!pattern14.test(data56)){const err135 = {instancePath:instancePath+"/components/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}}else {const err136 = {instancePath:instancePath+"/components/" + i0+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}}if(data55.type !== undefined){let data57 = data55.type;if(!(((((((data57 === "frontend") || (data57 === "backend")) || (data57 === "database")) || (data57 === "cloud")) || (data57 === "security")) || (data57 === "messagebus")) || (data57 === "external"))){const err137 = {instancePath:instancePath+"/components/" + i0+"/type",schemaPath:"common.schema.json#/$defs/componentType/enum",keyword:"enum",params:{allowedValues: schema59.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}if(data55.label !== undefined){let data58 = data55.label;if(typeof data58 === "string"){if(func3(data58) < 1){const err138 = {instancePath:instancePath+"/components/" + i0+"/label",schemaPath:"#/properties/components/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}else {const err139 = {instancePath:instancePath+"/components/" + i0+"/label",schemaPath:"#/properties/components/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}if(data55.sublabel !== undefined){if(typeof data55.sublabel !== "string"){const err140 = {instancePath:instancePath+"/components/" + i0+"/sublabel",schemaPath:"#/properties/components/items/properties/sublabel/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}if(data55.tag !== undefined){if(typeof data55.tag !== "string"){const err141 = {instancePath:instancePath+"/components/" + i0+"/tag",schemaPath:"#/properties/components/items/properties/tag/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}}if(data55.brand !== undefined){let data61 = data55.brand;const _errs165 = errors;let valid44 = false;let passing0 = null;const _errs166 = errors;const _errs168 = errors;let valid45 = false;const _errs169 = errors;if(typeof data61 === "string"){if(func3(data61) > 80){const err142 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 80},message:"must NOT have more than 80 characters"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}if(!pattern27.test(data61)){const err143 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[^\\r\\n]+$"},message:"must match pattern \""+"^[^\\r\\n]+$"+"\""};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}var _valid1 = _errs169 === errors;valid45 = valid45 || _valid1;const _errs170 = errors;if(typeof data61 === "string"){if(!pattern28.test(data61)){const err144 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}var _valid1 = _errs170 === errors;valid45 = valid45 || _valid1;if(!valid45){const err145 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}else {errors = _errs168;if(vErrors !== null){if(_errs168){vErrors.length = _errs168;}else {vErrors = null;}}}if(typeof data61 === "string"){if(func3(data61) > 2048){const err146 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}if(func3(data61) < 1){const err147 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}else {const err148 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}var _valid0 = _errs166 === errors;if(_valid0){valid44 = true;passing0 = 0;}const _errs171 = errors;if(data61 && typeof data61 == "object" && !Array.isArray(data61)){if(data61.url === undefined){const err149 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}if(data61.sha256 === undefined){const err150 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}for(const key14 in data61){if(!((key14 === "url") || (key14 === "sha256"))){const err151 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key14},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}if(data61.url !== undefined){let data62 = data61.url;if(typeof data62 === "string"){if(func3(data62) > 2048){const err152 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}if(func3(data62) < 8){const err153 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/minLength",keyword:"minLength",params:{limit: 8},message:"must NOT have fewer than 8 characters"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}if(!pattern28.test(data62)){const err154 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/pattern",keyword:"pattern",params:{pattern: "^https?://"},message:"must match pattern \""+"^https?://"+"\""};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}else {const err155 = {instancePath:instancePath+"/components/" + i0+"/brand/url",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}}if(data61.sha256 !== undefined){let data63 = data61.sha256;if(typeof data63 === "string"){if(!pattern30.test(data63)){const err156 = {instancePath:instancePath+"/components/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^[a-f0-9]{64}$"},message:"must match pattern \""+"^[a-f0-9]{64}$"+"\""};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}}else {const err157 = {instancePath:instancePath+"/components/" + i0+"/brand/sha256",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}}else {const err158 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}var _valid0 = _errs171 === errors;if(_valid0 && valid44){valid44 = false;passing0 = [passing0, 1];}else {if(_valid0){valid44 = true;passing0 = 1;}}if(!valid44){const err159 = {instancePath:instancePath+"/components/" + i0+"/brand",schemaPath:"common.schema.json#/$defs/brandMark/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}else {errors = _errs165;if(vErrors !== null){if(_errs165){vErrors.length = _errs165;}else {vErrors = null;}}}}if(data55.sources !== undefined){let data64 = data55.sources;if(Array.isArray(data64)){if(data64.length > 3){const err160 = {instancePath:instancePath+"/components/" + i0+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}if(data64.length < 1){const err161 = {instancePath:instancePath+"/components/" + i0+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}const len5 = data64.length;for(let i1=0; i1<len5; i1++){let data65 = data64[i1];if(data65 && typeof data65 == "object" && !Array.isArray(data65)){if(data65.path === undefined){const err162 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1,schemaPath:"common.schema.json#/$defs/sourceReferences/items/required",keyword:"required",params:{missingProperty: "path"},message:"must have required property '"+"path"+"'"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}for(const key15 in data65){if(!((((key15 === "path") || (key15 === "line")) || (key15 === "end_line")) || (key15 === "label"))){const err163 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1,schemaPath:"common.schema.json#/$defs/sourceReferences/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key15},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}}if(data65.path !== undefined){let data66 = data65.path;if(typeof data66 === "string"){if(func3(data66) > 240){const err164 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/maxLength",keyword:"maxLength",params:{limit: 240},message:"must NOT have more than 240 characters"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}if(func3(data66) < 1){const err165 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}else {const err166 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/path",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}if(data65.line !== undefined){let data67 = data65.line;if(!(((typeof data67 == "number") && (!(data67 % 1) && !isNaN(data67))) && (isFinite(data67)))){const err167 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}if((typeof data67 == "number") && (isFinite(data67))){if(data67 < 1 || isNaN(data67)){const err168 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}}if(data65.end_line !== undefined){let data68 = data65.end_line;if(!(((typeof data68 == "number") && (!(data68 % 1) && !isNaN(data68))) && (isFinite(data68)))){const err169 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}if((typeof data68 == "number") && (isFinite(data68))){if(data68 < 1 || isNaN(data68)){const err170 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/end_line",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/end_line/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}}if(data65.label !== undefined){let data69 = data65.label;if(typeof data69 === "string"){if(func3(data69) > 48){const err171 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/maxLength",keyword:"maxLength",params:{limit: 48},message:"must NOT have more than 48 characters"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}if(func3(data69) < 1){const err172 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}else {const err173 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1+"/label",schemaPath:"common.schema.json#/$defs/sourceReferences/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}}else {const err174 = {instancePath:instancePath+"/components/" + i0+"/sources/" + i1,schemaPath:"common.schema.json#/$defs/sourceReferences/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}}}else {const err175 = {instancePath:instancePath+"/components/" + i0+"/sources",schemaPath:"common.schema.json#/$defs/sourceReferences/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}}if(data55.row !== undefined){let data70 = data55.row;if(!(((typeof data70 == "number") && (!(data70 % 1) && !isNaN(data70))) && (isFinite(data70)))){const err176 = {instancePath:instancePath+"/components/" + i0+"/row",schemaPath:"#/properties/components/items/properties/row/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}if((typeof data70 == "number") && (isFinite(data70))){if(data70 < 0 || isNaN(data70)){const err177 = {instancePath:instancePath+"/components/" + i0+"/row",schemaPath:"#/properties/components/items/properties/row/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}}}if(data55.col !== undefined){let data71 = data55.col;if(!(((typeof data71 == "number") && (!(data71 % 1) && !isNaN(data71))) && (isFinite(data71)))){const err178 = {instancePath:instancePath+"/components/" + i0+"/col",schemaPath:"#/properties/components/items/properties/col/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}if((typeof data71 == "number") && (isFinite(data71))){if(data71 < 0 || isNaN(data71)){const err179 = {instancePath:instancePath+"/components/" + i0+"/col",schemaPath:"#/properties/components/items/properties/col/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}}if(data55.pos !== undefined){let data72 = data55.pos;if(Array.isArray(data72)){if(data72.length > 2){const err180 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}if(data72.length < 2){const err181 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}const len6 = data72.length;if(len6 > 0){let data73 = data72[0];if(!((typeof data73 == "number") && (isFinite(data73)))){const err182 = {instancePath:instancePath+"/components/" + i0+"/pos/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}if(len6 > 1){let data74 = data72[1];if(!((typeof data74 == "number") && (isFinite(data74)))){const err183 = {instancePath:instancePath+"/components/" + i0+"/pos/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}const len7 = data72.length;if(!(len7 <= 2)){const err184 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}else {const err185 = {instancePath:instancePath+"/components/" + i0+"/pos",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}if(data55.size !== undefined){let data75 = data55.size;if(Array.isArray(data75)){if(data75.length > 2){const err186 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}if(data75.length < 2){const err187 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}const len8 = data75.length;if(len8 > 0){let data76 = data75[0];if((typeof data76 == "number") && (isFinite(data76))){if(data76 <= 0 || isNaN(data76)){const err188 = {instancePath:instancePath+"/components/" + i0+"/size/0",schemaPath:"#/properties/components/items/properties/size/prefixItems/0/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison: ">", limit: 0},message:"must be > 0"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}}else {const err189 = {instancePath:instancePath+"/components/" + i0+"/size/0",schemaPath:"#/properties/components/items/properties/size/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}if(len8 > 1){let data77 = data75[1];if((typeof data77 == "number") && (isFinite(data77))){if(data77 <= 0 || isNaN(data77)){const err190 = {instancePath:instancePath+"/components/" + i0+"/size/1",schemaPath:"#/properties/components/items/properties/size/prefixItems/1/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison: ">", limit: 0},message:"must be > 0"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}else {const err191 = {instancePath:instancePath+"/components/" + i0+"/size/1",schemaPath:"#/properties/components/items/properties/size/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}const len9 = data75.length;if(!(len9 <= 2)){const err192 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}else {const err193 = {instancePath:instancePath+"/components/" + i0+"/size",schemaPath:"#/properties/components/items/properties/size/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}}else {const err194 = {instancePath:instancePath+"/components/" + i0,schemaPath:"#/properties/components/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}}else {const err195 = {instancePath:instancePath+"/components",schemaPath:"#/properties/components/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}}if(data.boundaries !== undefined){let data78 = data.boundaries;if(Array.isArray(data78)){const len10 = data78.length;for(let i2=0; i2<len10; i2++){let data79 = data78[i2];if(data79 && typeof data79 == "object" && !Array.isArray(data79)){if(data79.kind === undefined){const err196 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}if(data79.label === undefined){const err197 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}if(data79.wraps === undefined){const err198 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/required",keyword:"required",params:{missingProperty: "wraps"},message:"must have required property '"+"wraps"+"'"};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}for(const key16 in data79){if(!((((key16 === "kind") || (key16 === "label")) || (key16 === "wraps")) || (key16 === "pad"))){const err199 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key16},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}}if(data79.kind !== undefined){let data80 = data79.kind;if(!((data80 === "region") || (data80 === "security-group"))){const err200 = {instancePath:instancePath+"/boundaries/" + i2+"/kind",schemaPath:"#/properties/boundaries/items/properties/kind/enum",keyword:"enum",params:{allowedValues: schema161.properties.boundaries.items.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}}if(data79.label !== undefined){let data81 = data79.label;if(typeof data81 === "string"){if(func3(data81) < 1){const err201 = {instancePath:instancePath+"/boundaries/" + i2+"/label",schemaPath:"#/properties/boundaries/items/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}}else {const err202 = {instancePath:instancePath+"/boundaries/" + i2+"/label",schemaPath:"#/properties/boundaries/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}}if(data79.wraps !== undefined){let data82 = data79.wraps;if(Array.isArray(data82)){if(data82.length < 1){const err203 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps",schemaPath:"#/properties/boundaries/items/properties/wraps/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}const len11 = data82.length;for(let i3=0; i3<len11; i3++){let data83 = data82[i3];if(typeof data83 === "string"){if(!pattern14.test(data83)){const err204 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps/" + i3,schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}}else {const err205 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps/" + i3,schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err205];}else {vErrors.push(err205);}errors++;}}}else {const err206 = {instancePath:instancePath+"/boundaries/" + i2+"/wraps",schemaPath:"#/properties/boundaries/items/properties/wraps/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err206];}else {vErrors.push(err206);}errors++;}}if(data79.pad !== undefined){let data84 = data79.pad;if((typeof data84 == "number") && (isFinite(data84))){if(data84 < 0 || isNaN(data84)){const err207 = {instancePath:instancePath+"/boundaries/" + i2+"/pad",schemaPath:"#/properties/boundaries/items/properties/pad/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err207];}else {vErrors.push(err207);}errors++;}}else {const err208 = {instancePath:instancePath+"/boundaries/" + i2+"/pad",schemaPath:"#/properties/boundaries/items/properties/pad/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err208];}else {vErrors.push(err208);}errors++;}}}else {const err209 = {instancePath:instancePath+"/boundaries/" + i2,schemaPath:"#/properties/boundaries/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err209];}else {vErrors.push(err209);}errors++;}}}else {const err210 = {instancePath:instancePath+"/boundaries",schemaPath:"#/properties/boundaries/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err210];}else {vErrors.push(err210);}errors++;}}if(data.connections !== undefined){let data85 = data.connections;if(Array.isArray(data85)){const len12 = data85.length;for(let i4=0; i4<len12; i4++){let data86 = data85[i4];if(data86 && typeof data86 == "object" && !Array.isArray(data86)){if(data86.from === undefined){const err211 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err211];}else {vErrors.push(err211);}errors++;}if(data86.to === undefined){const err212 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err212];}else {vErrors.push(err212);}errors++;}for(const key17 in data86){if(!(func1.call(schema161.properties.connections.items.properties, key17))){const err213 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key17},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err213];}else {vErrors.push(err213);}errors++;}}if(data86.id !== undefined){let data87 = data86.id;if(typeof data87 === "string"){if(!pattern14.test(data87)){const err214 = {instancePath:instancePath+"/connections/" + i4+"/id",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err214];}else {vErrors.push(err214);}errors++;}}else {const err215 = {instancePath:instancePath+"/connections/" + i4+"/id",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err215];}else {vErrors.push(err215);}errors++;}}if(data86.from !== undefined){let data88 = data86.from;if(typeof data88 === "string"){if(!pattern14.test(data88)){const err216 = {instancePath:instancePath+"/connections/" + i4+"/from",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err216];}else {vErrors.push(err216);}errors++;}}else {const err217 = {instancePath:instancePath+"/connections/" + i4+"/from",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err217];}else {vErrors.push(err217);}errors++;}}if(data86.to !== undefined){let data89 = data86.to;if(typeof data89 === "string"){if(!pattern14.test(data89)){const err218 = {instancePath:instancePath+"/connections/" + i4+"/to",schemaPath:"common.schema.json#/$defs/id/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z][a-zA-Z0-9_-]*$"},message:"must match pattern \""+"^[a-zA-Z][a-zA-Z0-9_-]*$"+"\""};if(vErrors === null){vErrors = [err218];}else {vErrors.push(err218);}errors++;}}else {const err219 = {instancePath:instancePath+"/connections/" + i4+"/to",schemaPath:"common.schema.json#/$defs/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err219];}else {vErrors.push(err219);}errors++;}}if(data86.label !== undefined){if(typeof data86.label !== "string"){const err220 = {instancePath:instancePath+"/connections/" + i4+"/label",schemaPath:"#/properties/connections/items/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err220];}else {vErrors.push(err220);}errors++;}}if(data86.variant !== undefined){let data91 = data86.variant;if(!((((data91 === "default") || (data91 === "emphasis")) || (data91 === "security")) || (data91 === "dashed"))){const err221 = {instancePath:instancePath+"/connections/" + i4+"/variant",schemaPath:"common.schema.json#/$defs/variant/enum",keyword:"enum",params:{allowedValues: schema65.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err221];}else {vErrors.push(err221);}errors++;}}if(data86.fromSide !== undefined){let data92 = data86.fromSide;if(!((((data92 === "left") || (data92 === "right")) || (data92 === "top")) || (data92 === "bottom"))){const err222 = {instancePath:instancePath+"/connections/" + i4+"/fromSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema121.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err222];}else {vErrors.push(err222);}errors++;}}if(data86.toSide !== undefined){let data93 = data86.toSide;if(!((((data93 === "left") || (data93 === "right")) || (data93 === "top")) || (data93 === "bottom"))){const err223 = {instancePath:instancePath+"/connections/" + i4+"/toSide",schemaPath:"common.schema.json#/$defs/side/enum",keyword:"enum",params:{allowedValues: schema121.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err223];}else {vErrors.push(err223);}errors++;}}if(data86.route !== undefined){let data94 = data86.route;if(!((((data94 === "auto") || (data94 === "straight")) || (data94 === "orthogonal-h")) || (data94 === "orthogonal-v"))){const err224 = {instancePath:instancePath+"/connections/" + i4+"/route",schemaPath:"#/properties/connections/items/properties/route/enum",keyword:"enum",params:{allowedValues: schema161.properties.connections.items.properties.route.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err224];}else {vErrors.push(err224);}errors++;}}if(data86.via !== undefined){let data95 = data86.via;if(Array.isArray(data95)){const len13 = data95.length;for(let i5=0; i5<len13; i5++){let data96 = data95[i5];if(Array.isArray(data96)){if(data96.length > 2){const err225 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err225];}else {vErrors.push(err225);}errors++;}if(data96.length < 2){const err226 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err226];}else {vErrors.push(err226);}errors++;}const len14 = data96.length;if(len14 > 0){let data97 = data96[0];if(!((typeof data97 == "number") && (isFinite(data97)))){const err227 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5+"/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err227];}else {vErrors.push(err227);}errors++;}}if(len14 > 1){let data98 = data96[1];if(!((typeof data98 == "number") && (isFinite(data98)))){const err228 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5+"/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err228];}else {vErrors.push(err228);}errors++;}}const len15 = data96.length;if(!(len15 <= 2)){const err229 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err229];}else {vErrors.push(err229);}errors++;}}else {const err230 = {instancePath:instancePath+"/connections/" + i4+"/via/" + i5,schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err230];}else {vErrors.push(err230);}errors++;}}}else {const err231 = {instancePath:instancePath+"/connections/" + i4+"/via",schemaPath:"#/properties/connections/items/properties/via/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err231];}else {vErrors.push(err231);}errors++;}}if(data86.labelAt !== undefined){let data99 = data86.labelAt;if(Array.isArray(data99)){if(data99.length > 2){const err232 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err232];}else {vErrors.push(err232);}errors++;}if(data99.length < 2){const err233 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err233];}else {vErrors.push(err233);}errors++;}const len16 = data99.length;if(len16 > 0){let data100 = data99[0];if(!((typeof data100 == "number") && (isFinite(data100)))){const err234 = {instancePath:instancePath+"/connections/" + i4+"/labelAt/0",schemaPath:"common.schema.json#/$defs/point/prefixItems/0/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err234];}else {vErrors.push(err234);}errors++;}}if(len16 > 1){let data101 = data99[1];if(!((typeof data101 == "number") && (isFinite(data101)))){const err235 = {instancePath:instancePath+"/connections/" + i4+"/labelAt/1",schemaPath:"common.schema.json#/$defs/point/prefixItems/1/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err235];}else {vErrors.push(err235);}errors++;}}const len17 = data99.length;if(!(len17 <= 2)){const err236 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/items",keyword:"items",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err236];}else {vErrors.push(err236);}errors++;}}else {const err237 = {instancePath:instancePath+"/connections/" + i4+"/labelAt",schemaPath:"common.schema.json#/$defs/point/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err237];}else {vErrors.push(err237);}errors++;}}if(data86.labelDx !== undefined){let data102 = data86.labelDx;if(!((typeof data102 == "number") && (isFinite(data102)))){const err238 = {instancePath:instancePath+"/connections/" + i4+"/labelDx",schemaPath:"#/properties/connections/items/properties/labelDx/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err238];}else {vErrors.push(err238);}errors++;}}if(data86.labelDy !== undefined){let data103 = data86.labelDy;if(!((typeof data103 == "number") && (isFinite(data103)))){const err239 = {instancePath:instancePath+"/connections/" + i4+"/labelDy",schemaPath:"#/properties/connections/items/properties/labelDy/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err239];}else {vErrors.push(err239);}errors++;}}if(data86.labelSegment !== undefined){let data104 = data86.labelSegment;if(!(((typeof data104 == "number") && (!(data104 % 1) && !isNaN(data104))) && (isFinite(data104)))){const err240 = {instancePath:instancePath+"/connections/" + i4+"/labelSegment",schemaPath:"#/properties/connections/items/properties/labelSegment/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err240];}else {vErrors.push(err240);}errors++;}if((typeof data104 == "number") && (isFinite(data104))){if(data104 < 0 || isNaN(data104)){const err241 = {instancePath:instancePath+"/connections/" + i4+"/labelSegment",schemaPath:"#/properties/connections/items/properties/labelSegment/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err241];}else {vErrors.push(err241);}errors++;}}}if(data86.width !== undefined){let data105 = data86.width;if((typeof data105 == "number") && (isFinite(data105))){if(data105 < 0.5 || isNaN(data105)){const err242 = {instancePath:instancePath+"/connections/" + i4+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0.5},message:"must be >= 0.5"};if(vErrors === null){vErrors = [err242];}else {vErrors.push(err242);}errors++;}}else {const err243 = {instancePath:instancePath+"/connections/" + i4+"/width",schemaPath:"common.schema.json#/$defs/relationshipWidth/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err243];}else {vErrors.push(err243);}errors++;}}}else {const err244 = {instancePath:instancePath+"/connections/" + i4,schemaPath:"#/properties/connections/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err244];}else {vErrors.push(err244);}errors++;}}}else {const err245 = {instancePath:instancePath+"/connections",schemaPath:"#/properties/connections/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err245];}else {vErrors.push(err245);}errors++;}}if(data.cards !== undefined){let data106 = data.cards;if(Array.isArray(data106)){const len18 = data106.length;for(let i6=0; i6<len18; i6++){let data107 = data106[i6];if(data107 && typeof data107 == "object" && !Array.isArray(data107)){if(data107.dot === undefined){const err246 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "dot"},message:"must have required property '"+"dot"+"'"};if(vErrors === null){vErrors = [err246];}else {vErrors.push(err246);}errors++;}if(data107.title === undefined){const err247 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err247];}else {vErrors.push(err247);}errors++;}if(data107.items === undefined){const err248 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/required",keyword:"required",params:{missingProperty: "items"},message:"must have required property '"+"items"+"'"};if(vErrors === null){vErrors = [err248];}else {vErrors.push(err248);}errors++;}for(const key18 in data107){if(!(((key18 === "dot") || (key18 === "title")) || (key18 === "items"))){const err249 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key18},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err249];}else {vErrors.push(err249);}errors++;}}if(data107.dot !== undefined){let data108 = data107.dot;if(!(((((((data108 === "cyan") || (data108 === "emerald")) || (data108 === "violet")) || (data108 === "amber")) || (data108 === "rose")) || (data108 === "orange")) || (data108 === "slate"))){const err250 = {instancePath:instancePath+"/cards/" + i6+"/dot",schemaPath:"common.schema.json#/$defs/cards/items/properties/dot/enum",keyword:"enum",params:{allowedValues: schema70.items.properties.dot.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err250];}else {vErrors.push(err250);}errors++;}}if(data107.title !== undefined){let data109 = data107.title;if(typeof data109 === "string"){if(func3(data109) < 1){const err251 = {instancePath:instancePath+"/cards/" + i6+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err251];}else {vErrors.push(err251);}errors++;}}else {const err252 = {instancePath:instancePath+"/cards/" + i6+"/title",schemaPath:"common.schema.json#/$defs/cards/items/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err252];}else {vErrors.push(err252);}errors++;}}if(data107.items !== undefined){let data110 = data107.items;if(Array.isArray(data110)){const len19 = data110.length;for(let i7=0; i7<len19; i7++){if(typeof data110[i7] !== "string"){const err253 = {instancePath:instancePath+"/cards/" + i6+"/items/" + i7,schemaPath:"common.schema.json#/$defs/cards/items/properties/items/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err253];}else {vErrors.push(err253);}errors++;}}}else {const err254 = {instancePath:instancePath+"/cards/" + i6+"/items",schemaPath:"common.schema.json#/$defs/cards/items/properties/items/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err254];}else {vErrors.push(err254);}errors++;}}}else {const err255 = {instancePath:instancePath+"/cards/" + i6,schemaPath:"common.schema.json#/$defs/cards/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err255];}else {vErrors.push(err255);}errors++;}}}else {const err256 = {instancePath:instancePath+"/cards",schemaPath:"common.schema.json#/$defs/cards/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err256];}else {vErrors.push(err256);}errors++;}}}else {const err257 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err257];}else {vErrors.push(err257);}errors++;}validate36.errors = vErrors;return errors === 0;}validate36.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};
export function workflow(data, context = undefined) {
if (!workflowSchema(data, context)) {
workflow.errors = workflowSchema.errors;
diff --git a/archify/renderers/shared/output-path.mjs b/archify/renderers/shared/output-path.mjs
index 634e65fb..372249d6 100644
--- a/archify/renderers/shared/output-path.mjs
+++ b/archify/renderers/shared/output-path.mjs
@@ -1,5 +1,11 @@
import path from 'node:path';
-import { containedBy, resolvePhysicalLocation, sameLocation } from './path-semantics.mjs';
+import {
+ containedBy,
+ isValidWindowsSmbShareName,
+ isWindowsIpcShare,
+ resolvePhysicalLocation,
+ sameLocation,
+} from './path-semantics.mjs';
import { PortablePathError, validatePortablePath } from './portable-path.mjs';
export function canonicalFuturePath(targetPath) {
@@ -115,18 +121,24 @@ function windowsExtendedTailComponents(rawOutput, tail) {
}
function rejectWindowsIpcShare(rawOutput, share) {
- if (/^(?:pipe|mailslot)$/iu.test(share)) {
+ if (isWindowsIpcShare(share)) {
throwNativeOutputDiagnostic(rawOutput, 'windows-ipc-namespace', { share });
}
}
-function validateWindowsNativeComponent(rawOutput, component, componentIndex) {
+function validateWindowsNativeComponent(
+ rawOutput,
+ component,
+ componentIndex,
+ { allowReservedName = false } = {},
+) {
try {
// Prefix the component so a colon is classified as an ADS separator,
// rather than allowing the generic URI detector to claim it first.
validatePortablePath(`native/${component}`, { profile: 'output' });
} catch (error) {
if (!(error instanceof PortablePathError)) throw error;
+ if (allowReservedName && error.reason === 'windows-reserved-name') return;
// Native Windows arguments may intentionally name an existing 8.3 alias.
// Portable authored/archive paths reject that ambiguous spelling, while
// native resolution lets the filesystem prove the existing target.
@@ -153,6 +165,20 @@ function validateWindowsNativeComponent(rawOutput, component, componentIndex) {
}
}
+function validateWindowsUncRootComponents(rawOutput, server, share) {
+ rejectWindowsIpcShare(rawOutput, share);
+ if (!isValidWindowsSmbShareName(share)) {
+ throwNativeOutputDiagnostic(rawOutput, 'windows-unc-share-name', {
+ share,
+ utf16CodeUnits: share.length,
+ limit: 80,
+ });
+ }
+ // UNC servers and shares are root components, not DOS file names. Keep the
+ // server's ordinary native syntax checks while allowing names such as CON.
+ validateWindowsNativeComponent(rawOutput, server, 0, { allowReservedName: true });
+}
+
function windowsExtendedPathComponents(rawOutput) {
// The extended-length namespace deliberately bypasses Win32 normalization.
// Inspect its original spelling so a dot segment cannot retarget a UNC share.
@@ -175,8 +201,8 @@ function windowsExtendedPathComponents(rawOutput) {
if (components.length < 2 || components[0].length === 0 || components[1].length === 0) {
throwNativeOutputDiagnostic(rawOutput, 'windows-extended-root');
}
- rejectWindowsIpcShare(rawOutput, components[1]);
- return windowsExtendedTailComponents(rawOutput, authoredTail);
+ validateWindowsUncRootComponents(rawOutput, components[0], components[1]);
+ return windowsExtendedTailComponents(rawOutput, components.slice(2).join('\\'));
}
throwNativeOutputDiagnostic(rawOutput, 'windows-extended-root');
@@ -186,9 +212,11 @@ function validateWindowsRawUncRoot(rawOutput) {
if (!/^[\\/]{2}/u.test(rawOutput) || /^[\\/]{2}[.?][\\/]/u.test(rawOutput)) return;
// Validate the raw server/share boundary before win32.normalize can collapse
// an empty share or mix the two UNC separator spellings.
- if (!/^([\\/])\1[^\\/]+\1[^\\/]+(?:[\\/]|$)/u.test(rawOutput)) {
+ const unc = rawOutput.match(/^([\\/])\1([^\\/]+)\1([^\\/]+)(?:[\\/]|$)/u);
+ if (!unc) {
throwNativeOutputDiagnostic(rawOutput, 'windows-unc-root');
}
+ validateWindowsUncRootComponents(rawOutput, unc[2], unc[3]);
}
function windowsPathComponents(rawOutput, normalized) {
@@ -202,9 +230,6 @@ function windowsPathComponents(rawOutput, normalized) {
if (normalized.startsWith('\\\\')) {
const unc = normalized.match(/^\\\\([^\\]+)\\([^\\]+)(?:\\|$)/u);
if (!unc) throwNativeOutputDiagnostic(rawOutput, 'windows-unc-root');
- rejectWindowsIpcShare(rawOutput, unc[2]);
- validateWindowsNativeComponent(rawOutput, unc[1], 0);
- validateWindowsNativeComponent(rawOutput, unc[2], 1);
return normalized.slice(unc[0].length).split('\\').filter(Boolean);
}
if (authoredUncPrefix) throwNativeOutputDiagnostic(rawOutput, 'windows-unc-root');
@@ -295,7 +320,7 @@ export function resolveNativeOutputDirectory(
return pathApi.resolve(cwd, rawDirectory);
}
-export function validateAuthoredOutputPath(rawOutput) {
+export function validateAuthoredOutputPath(rawOutput, { cwd = process.cwd() } = {}) {
try {
validatePortablePath(rawOutput, { profile: 'output' });
} catch (error) {
@@ -311,6 +336,23 @@ export function validateAuthoredOutputPath(rawOutput) {
supportedFixes: ['change meta.output to a portable path ending in .html'],
});
}
+ const outputPath = path.resolve(cwd, rawOutput);
+ if (path.extname(canonicalFuturePath(outputPath)).toLowerCase() !== '.html') {
+ throw new OutputPathError('meta.output must resolve to an .html file.', {
+ code: 'output/meta-resolved-extension',
+ message: 'meta.output must resolve to an .html file after symbolic links are followed.',
+ subject: { output: rawOutput },
+ supportedFixes: ['remove the symbolic-link alias or point it to an .html target inside the current working directory'],
+ });
+ }
+ if (!pathIsInside(cwd, outputPath)) {
+ throw new OutputPathError('meta.output must stay inside the current working directory.', {
+ code: 'output/meta-outside-cwd',
+ message: 'meta.output must stay inside the current working directory after symbolic links are resolved.',
+ subject: { output: rawOutput, cwd: path.resolve(cwd) },
+ supportedFixes: ['set meta.output to a relative .html path inside the current working directory'],
+ });
+ }
return rawOutput;
}
@@ -339,7 +381,7 @@ export function resolveOutputPath({
requiredExtension = '.html',
platform = process.platform,
}) {
- if (authoredOutput !== undefined) validateAuthoredOutputPath(authoredOutput);
+ if (authoredOutput !== undefined) validateAuthoredOutputPath(authoredOutput, { cwd });
const source = requestedOutput !== undefined
? 'cli'
: (authoredOutput !== undefined ? 'meta' : 'default');
@@ -348,23 +390,6 @@ export function resolveOutputPath({
: (source === 'meta' ? authoredOutput : defaultOutput);
if (source !== 'meta') validateNativeOutputPath(rawOutput, { platform, kind: 'file' });
const outputPath = path.resolve(cwd, rawOutput);
- if (source === 'meta' && path.extname(canonicalFuturePath(outputPath)).toLowerCase() !== '.html') {
- throw new OutputPathError('meta.output must resolve to an .html file.', {
- code: 'output/meta-resolved-extension',
- message: 'meta.output must resolve to an .html file after symbolic links are followed.',
- subject: { output: rawOutput },
- supportedFixes: ['remove the symbolic-link alias or point it to an .html target inside the current working directory'],
- });
- }
- if (source === 'meta' && !pathIsInside(cwd, outputPath)) {
- throw new OutputPathError('meta.output must stay inside the current working directory.', {
- code: 'output/meta-outside-cwd',
- message: 'meta.output must stay inside the current working directory after symbolic links are resolved.',
- subject: { output: rawOutput, cwd: path.resolve(cwd) },
- supportedFixes: ['set meta.output to a relative .html path inside the current working directory'],
- });
- }
-
for (const inputPath of inputPaths) {
if (!pathsAlias(outputPath, inputPath)) continue;
throw new OutputPathError(`Output must not replace ${inputDescription}.`, {
diff --git a/archify/renderers/shared/path-semantics.mjs b/archify/renderers/shared/path-semantics.mjs
index 6cac0c89..a31d7e3e 100644
--- a/archify/renderers/shared/path-semantics.mjs
+++ b/archify/renderers/shared/path-semantics.mjs
@@ -5,6 +5,19 @@ import path from 'node:path';
const MAX_SYMLINK_DEPTH = 64;
const RECENT_PROBE_NAME_LIMIT = 128;
const recentProbeNames = new Set();
+const WINDOWS_SMB_SHARE_FORBIDDEN = /[\u0000-\u001F"\/\\[\]:|<>+=;,?*]/u;
+
+export function isWindowsIpcShare(share) {
+ return /^(?:IPC\$|pipe|mailslot)$/iu.test(share);
+}
+
+export function isValidWindowsSmbShareName(share) {
+ return typeof share === 'string'
+ && share.length > 0
+ && share.length <= 80
+ && !WINDOWS_SMB_SHARE_FORBIDDEN.test(share)
+ && !/[ .]$/u.test(share);
+}
function result(status, code, details = {}) {
return {
@@ -104,6 +117,12 @@ function splitWindowsAbsolute(absolute, side, { internalRelativeLinkTarget = fal
const extendedUnc = absolute.match(/^(\\\\\?\\UNC\\([^\\]+)\\([^\\]+))(?:\\(.*))?$/iu);
if (extendedUnc) {
+ if (isWindowsIpcShare(extendedUnc[3])) {
+ return rootFailure('windows-namespace-unsupported', side);
+ }
+ if (!isValidWindowsSmbShareName(extendedUnc[3])) {
+ return rootFailure('windows-root-invalid', side);
+ }
if ([extendedUnc[2], extendedUnc[3]].some((component) => component === '.' || component === '..')) {
return rootFailure('windows-root-invalid', side);
}
@@ -139,6 +158,12 @@ function splitWindowsAbsolute(absolute, side, { internalRelativeLinkTarget = fal
const unc = absolute.match(/^[\\/]{2}([^\\/]+)[\\/]([^\\/]+)(?:[\\/](.*))?$/u);
if (unc) {
+ if (isWindowsIpcShare(unc[2])) {
+ return rootFailure('windows-namespace-unsupported', side);
+ }
+ if (!isValidWindowsSmbShareName(unc[2])) {
+ return rootFailure('windows-root-invalid', side);
+ }
if ([unc[1], unc[2]].some((component) => component === '.' || component === '..')) {
return rootFailure('windows-root-invalid', side);
}
diff --git a/archify/renderers/shared/portable-path.mjs b/archify/renderers/shared/portable-path.mjs
index 99c63ebb..e9f8df9d 100644
--- a/archify/renderers/shared/portable-path.mjs
+++ b/archify/renderers/shared/portable-path.mjs
@@ -238,7 +238,9 @@ function semanticEnvelope(value, profile, index) {
const transforms = [
(candidate) => candidate.normalize('NFC'),
(candidate) => candidate.normalize('NFD'),
+ // path-contract-allow: portable-logical-path -- Archive names require conservative case-collision closure.
(candidate) => candidate.toLocaleLowerCase('en-US'),
+ // path-contract-allow: portable-logical-path -- Archive names require conservative case-collision closure.
(candidate) => candidate.toLocaleUpperCase('en-US'),
];
diff --git a/archify/renderers/workflow/README.md b/archify/renderers/workflow/README.md
index ba58a09e..aed5fb82 100644
--- a/archify/renderers/workflow/README.md
+++ b/archify/renderers/workflow/README.md
@@ -10,8 +10,8 @@ node archify/renderers/workflow/render-workflow.mjs input.workflow.json output.h
The renderer validates input against `archify/schemas/workflow.schema.json`
with the bundled standalone validator. No dependency installation is required.
-If `output.html` is omitted, the renderer uses `meta.output` from the JSON file
-or falls back to `workflow.html` in the current working directory.
+If `output.html` is omitted, the renderer uses the required `meta.output` value
+from the JSON file.
After rendering, run the artifact checker:
@@ -32,7 +32,8 @@ Workflow JSON files must set:
"schema_version": 2,
"diagram_type": "workflow",
"meta": {
- "title": "Agent Tool Call Workflow"
+ "title": "Agent Tool Call Workflow",
+ "output": "agent-tool-call.html"
},
"lanes": [],
"phases": [],
@@ -153,7 +154,7 @@ their offsets around zero:
{
"schema_version": 2,
"diagram_type": "workflow",
- "meta": { "title": "stack" },
+ "meta": { "title": "stack", "output": "stack.html" },
"lanes": [{ "id": "cage", "label": "one cage" }],
"groups": [{ "id": "g", "label": "cage", "lane": "cage", "fromCol": 1, "toCol": 3 }],
"nodes": [
diff --git a/archify/schemas/README.md b/archify/schemas/README.md
index 66c8b0b2..12beacce 100644
--- a/archify/schemas/README.md
+++ b/archify/schemas/README.md
@@ -15,7 +15,7 @@ against one of the schemas in this folder before any layout work happens.
| `common.schema.json` | shared `$defs` only (no top-level document) | — |
Every diagram schema requires `schema_version`, `diagram_type`, `meta` (with
-`title`), and its structural arrays — except `segments`, `activations`, and
+`title` and a durable portable `output`), and its structural arrays — except `segments`, `activations`, and
`cards`, which are optional — and sets `additionalProperties: false` at every
level, so unknown fields are rejected rather than silently ignored.
@@ -124,7 +124,11 @@ workflow behavior and including a satisfied contract does not change SVG or
layout-receipt bytes.
A file that validates today must keep validating and rendering within its
-declared version throughout the 2.x release line. Additive viewer,
+declared version throughout the 2.x release line. The explicitly reviewed
+portable-output hardening is the one exception: older v1 documents that omit
+`meta.output` must add a portable POSIX-relative `.html` path (for example,
+`reports/diagram.html`); an explicit CLI output argument does not replace this
+durable authored value. Additive viewer,
accessibility, and presentation improvements may enhance generated HTML, but
they must not reinterpret authored IR or turn a previously valid profile-less
v1 file into a new hard layout failure. Breaking IR changes require a new
diff --git a/archify/schemas/architecture.schema.json b/archify/schemas/architecture.schema.json
index 8cd74f8f..25b31e08 100644
--- a/archify/schemas/architecture.schema.json
+++ b/archify/schemas/architecture.schema.json
@@ -11,7 +11,7 @@
"meta": {
"type": "object",
"additionalProperties": false,
- "required": ["title"],
+ "required": ["title", "output"],
"properties": {
"title": { "type": "string", "minLength": 1 },
"locale": { "$ref": "common.schema.json#/$defs/locale" },
diff --git a/archify/schemas/dataflow.schema.json b/archify/schemas/dataflow.schema.json
index 1e860685..5823a561 100644
--- a/archify/schemas/dataflow.schema.json
+++ b/archify/schemas/dataflow.schema.json
@@ -23,7 +23,8 @@
"type": "object",
"additionalProperties": false,
"required": [
- "title"
+ "title",
+ "output"
],
"properties": {
"title": {
diff --git a/archify/schemas/lifecycle.schema.json b/archify/schemas/lifecycle.schema.json
index 0226d93d..a1711588 100644
--- a/archify/schemas/lifecycle.schema.json
+++ b/archify/schemas/lifecycle.schema.json
@@ -23,7 +23,8 @@
"type": "object",
"additionalProperties": false,
"required": [
- "title"
+ "title",
+ "output"
],
"properties": {
"title": {
diff --git a/archify/schemas/sequence.schema.json b/archify/schemas/sequence.schema.json
index 2c496f4a..f03d2474 100644
--- a/archify/schemas/sequence.schema.json
+++ b/archify/schemas/sequence.schema.json
@@ -22,7 +22,8 @@
"type": "object",
"additionalProperties": false,
"required": [
- "title"
+ "title",
+ "output"
],
"properties": {
"title": {
diff --git a/archify/schemas/workflow.schema.json b/archify/schemas/workflow.schema.json
index 479fea27..1f64b221 100644
--- a/archify/schemas/workflow.schema.json
+++ b/archify/schemas/workflow.schema.json
@@ -26,7 +26,8 @@
"type": "object",
"additionalProperties": false,
"required": [
- "title"
+ "title",
+ "output"
],
"properties": {
"title": {
diff --git a/archify/scripts/generate-validators.mjs b/archify/scripts/generate-validators.mjs
index 2820e702..5d1672ab 100644
--- a/archify/scripts/generate-validators.mjs
+++ b/archify/scripts/generate-validators.mjs
@@ -48,12 +48,10 @@ validatorCode = validatorCode.replaceAll(ajvUcs2Import, inlineUcs2Length);
if (validatorCode.includes('require(')) {
throw new Error('AJV standalone output contains an unexpected runtime dependency');
}
-const schemaValidators = {};
for (const type of diagramTypes) {
const exportPattern = new RegExp(`export const ${type} = (validate\\d+);`);
const match = validatorCode.match(exportPattern);
if (!match) throw new Error(`AJV standalone output no longer exports the ${type} validator as expected`);
- schemaValidators[type] = match[1];
validatorCode = validatorCode.replace(exportPattern, `const ${type}Schema = ${match[1]};`);
}
diff --git a/archify/test/architecture-compare-recovery.test.mjs b/archify/test/architecture-compare-recovery.test.mjs
index 4a15c256..4df3c2a0 100644
--- a/archify/test/architecture-compare-recovery.test.mjs
+++ b/archify/test/architecture-compare-recovery.test.mjs
@@ -166,6 +166,70 @@ test('compare recovery: a claimant swapped at the final backup move is restored
assert.deepEqual(fs.readFileSync(recovery.backup), data.old.receipt);
});
+for (const candidateRole of ['html', 'receipt']) {
+ test(`compare recovery: preserves a claimant that replaces the staged ${candidateRole} at retirement`, { timeout: 70000 }, (t) => {
+ const data = fixture(t);
+ const candidateName = path.basename(data.targets[candidateRole]);
+ const claimant = `${candidateRole} retirement claimant\n`;
+ const claimantIdentityFile = path.join(data.root, `${candidateRole}-retirement-identity.json`);
+ const displacedCandidate = path.join(data.root, `${candidateRole}-retirement-displaced`);
+ const preload = path.join(data.root, `replace-${candidateRole}-candidate-at-retirement.cjs`);
+ fs.writeFileSync(preload, `
+const fs = require('node:fs');
+const path = require('node:path');
+const unlinkSync = fs.unlinkSync;
+const renameSync = fs.renameSync;
+const writeFileSync = fs.writeFileSync;
+let replaced = false;
+const isCandidate = (file) => (
+ path.basename(String(file)) === ${JSON.stringify(candidateName)}
+ && path.basename(path.dirname(String(file))).startsWith('.archify-compare-')
+);
+const replaceCandidate = (file) => {
+ replaced = true;
+ renameSync(file, ${JSON.stringify(displacedCandidate)});
+ writeFileSync(file, ${JSON.stringify(claimant)}, { flag: 'wx' });
+ const stat = fs.lstatSync(file, { bigint: true });
+ writeFileSync(${JSON.stringify(claimantIdentityFile)}, JSON.stringify({
+ dev: String(stat.dev),
+ ino: String(stat.ino),
+ }));
+};
+fs.unlinkSync = (file, ...args) => {
+ if (!replaced && isCandidate(file)) replaceCandidate(file);
+ return unlinkSync(file, ...args);
+};
+fs.renameSync = (source, target, ...args) => {
+ if (!replaced
+ && isCandidate(source)
+ && path.basename(path.dirname(String(target))).startsWith('.archify-remove-')) {
+ replaceCandidate(source);
+ }
+ return renameSync(source, target, ...args);
+};
+`);
+
+ const result = data.run(preload);
+ assert.ifError(result.error);
+ assert.notEqual(result.status, 0, result.stderr || result.stdout);
+ const staging = fs.readdirSync(data.root).filter((name) => (
+ name.startsWith('.archify-compare-')
+ && fs.lstatSync(path.join(data.root, name)).isDirectory()
+ ));
+ assert.equal(staging.length, 1, result.stderr || result.stdout);
+ const candidate = path.join(data.root, staging[0], candidateName);
+ assert.equal(fs.readFileSync(candidate, 'utf8'), claimant);
+ const claimantIdentity = fs.lstatSync(candidate, { bigint: true });
+ assert.deepEqual(
+ { dev: String(claimantIdentity.dev), ino: String(claimantIdentity.ino) },
+ JSON.parse(fs.readFileSync(claimantIdentityFile, 'utf8')),
+ );
+ assert.equal(fs.existsSync(displacedCandidate), true);
+ assert.deepEqual(fs.readFileSync(data.targets.html), data.old.html);
+ assert.deepEqual(fs.readFileSync(data.targets.receipt), data.old.receipt);
+ });
+}
+
for (const scenario of cases) {
test(`compare recovery: ${scenario.name}`, { timeout: 70000 }, (t) => {
const data = fixture(t);
diff --git a/archify/test/architecture-delta.test.mjs b/archify/test/architecture-delta.test.mjs
index 55f93d2b..ab9191fb 100644
--- a/archify/test/architecture-delta.test.mjs
+++ b/archify/test/architecture-delta.test.mjs
@@ -556,6 +556,13 @@ test('compare CLI writes a deterministic three-state artifact and complete sidec
assert.equal(result.status, 0, result.stderr);
const repeat = run(['compare', 'architecture', baseFixture, headFixture, second, '--json']);
assert.equal(repeat.status, 0, repeat.stderr);
+ const replacement = run(['compare', 'architecture', baseFixture, headFixture, first, '--json']);
+ assert.equal(replacement.status, 0, replacement.stderr);
+ assert.equal(
+ fs.readdirSync(tmp).some((entry) => entry.startsWith('.archify-compare-')),
+ false,
+ 'successful replacement must remove only its identity-bound staging entries',
+ );
const firstHtml = fs.readFileSync(first, 'utf8');
const secondHtml = fs.readFileSync(second, 'utf8');
@@ -616,6 +623,37 @@ test('compare CLI writes a deterministic three-state artifact and complete sidec
assert.deepEqual(validateArchitectureDeltaHtml(firstHtml, receipt), { ok: true, checksPassed: 10, checkCount: 10 });
});
+test('compare cleanup preserves an unexpected claimant in private staging', () => {
+ const caseRoot = fs.mkdtempSync(path.join(tmp, 'compare-staging-claimant-'));
+ const output = path.join(caseRoot, 'delta.html');
+ const wrapper = path.join(caseRoot, 'claim-compare-staging.mjs');
+ fs.writeFileSync(wrapper, `
+import fs from 'node:fs';
+import path from 'node:path';
+const rmdirSync = fs.rmdirSync.bind(fs);
+let claimed = false;
+fs.rmdirSync = (directory, ...args) => {
+ if (!claimed && path.basename(String(directory)).startsWith('.archify-compare-')) {
+ claimed = true;
+ fs.writeFileSync(path.join(directory, 'unknown-claimant.txt'), 'preserve compare claimant');
+ }
+ return rmdirSync(directory, ...args);
+};
+process.argv = [process.execPath, ${JSON.stringify(cli)}, 'compare', 'architecture', ${JSON.stringify(baseFixture)}, ${JSON.stringify(headFixture)}, ${JSON.stringify(output)}, '--json'];
+await import(${JSON.stringify(pathToFileURL(cli).href)});
+`);
+
+ const compared = spawnSync(process.execPath, [wrapper], { cwd: skillRoot, encoding: 'utf8' });
+
+ assert.equal(compared.status, 0, compared.stderr || compared.stdout);
+ assert.match(compared.stderr, /Warning: could not remove compare staging directory/);
+ const claimant = fs.readdirSync(caseRoot, { recursive: true })
+ .map((entry) => path.join(caseRoot, entry))
+ .find((entry) => path.basename(entry) === 'unknown-claimant.txt');
+ assert.ok(claimant);
+ assert.equal(fs.readFileSync(claimant, 'utf8'), 'preserve compare claimant');
+});
+
test('compare default receipts preserve distinct HTML extension spellings only when the filesystem does', () => {
const caseRoot = fs.mkdtempSync(path.join(tmp, 'compare-receipt-extension-case-'));
const lower = path.join(caseRoot, 'delta.html');
diff --git a/archify/test/automatic-port-spread.test.mjs b/archify/test/automatic-port-spread.test.mjs
index dc6e1868..a73bbf72 100644
--- a/archify/test/automatic-port-spread.test.mjs
+++ b/archify/test/automatic-port-spread.test.mjs
@@ -13,7 +13,9 @@ function render(mode, doc) {
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-port-spread-'));
const input = path.join(tmp, 'input.json');
const output = path.join(tmp, 'output.html');
- fs.writeFileSync(input, JSON.stringify(doc));
+ const renderDoc = structuredClone(doc);
+ renderDoc.meta = { ...renderDoc.meta, output: `${mode}-automatic-port-spread.html` };
+ fs.writeFileSync(input, JSON.stringify(renderDoc));
try {
execFileSync('node', [
path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`),
diff --git a/archify/test/clean-skill-staging.test.mjs b/archify/test/clean-skill-staging.test.mjs
index af836348..d8d231b6 100644
--- a/archify/test/clean-skill-staging.test.mjs
+++ b/archify/test/clean-skill-staging.test.mjs
@@ -131,7 +131,7 @@ test('clean staging rejects byte-identical but incomplete repository and package
}
});
-test('clean staging preserves index modes and strips repository-only package metadata', (t) => {
+test('clean staging preserves index modes and strips repository-only package metadata', () => {
const root = repositoryFixture();
const destination = path.join(root, 'staged-skill');
try {
@@ -141,15 +141,12 @@ test('clean staging preserves index modes and strips repository-only package met
// Index modes must win over working-tree permissions, including on Windows.
git(root, ['update-index', '--chmod=+x', 'archify/bin/executable.mjs']);
git(root, ['update-index', '--chmod=-x', 'archify/runtime/test/required.dat']);
- const chmod = t.mock.method(fs, 'chmodSync');
-
- stageCleanSkill({ repoRoot: root, destination });
+ const result = stageCleanSkill({ repoRoot: root, destination });
const executable = path.join(destination, 'bin', 'executable.mjs');
const runtimeFixture = path.join(destination, 'runtime', 'test', 'required.dat');
- const appliedModes = new Map(chmod.mock.calls.map(({ arguments: args }) => args));
- assert.equal(appliedModes.get(executable), 0o755);
- assert.equal(appliedModes.get(runtimeFixture), 0o644);
+ assert.equal(result.modes['bin/executable.mjs'], '100755');
+ assert.equal(result.modes['runtime/test/required.dat'], '100644');
// Windows chmod cannot expose Unix executable bits through stat.
if (process.platform !== 'win32') {
assert.equal(fs.statSync(executable).mode & 0o777, 0o755);
@@ -250,6 +247,240 @@ test('clean staging refuses an existing mode manifest path and leaves it untouch
}
});
+test('clean staging never adopts a claimant that wins destination-root creation', () => {
+ const root = repositoryFixture();
+ const destination = path.join(root, 'staged-skill');
+ const claimant = path.join(destination, 'claimant.txt');
+ const originalMkdirSync = fs.mkdirSync;
+ let injected = false;
+ try {
+ git(root, ['add', 'archify']);
+ fs.mkdirSync = function injectDestinationClaimant(target, ...args) {
+ if (!injected && path.resolve(target) === path.resolve(destination)) {
+ injected = true;
+ originalMkdirSync.call(fs, target, { mode: 0o755 });
+ fs.writeFileSync(claimant, 'claimant root\n');
+ }
+ return originalMkdirSync.call(fs, target, ...args);
+ };
+
+ assert.throws(
+ () => stageCleanSkill({ repoRoot: root, destination }),
+ /clean Skill staging destination already exists/,
+ );
+ assert.equal(injected, true, 'the deterministic destination-root race must run');
+ assert.equal(
+ fs.readFileSync(claimant, 'utf8'),
+ 'claimant root\n',
+ 'a destination claimant must not be adopted or removed',
+ );
+ } finally {
+ fs.mkdirSync = originalMkdirSync;
+ fs.rmSync(root, { recursive: true, force: true });
+ }
+});
+
+test('clean staging never overwrites or recursively removes a claimant file', () => {
+ const root = repositoryFixture();
+ const destination = path.join(root, 'staged-skill');
+ const claimant = path.join(destination, 'LICENSE');
+ const originalOpenSync = fs.openSync;
+ let injected = false;
+ try {
+ git(root, ['add', 'archify']);
+ fs.openSync = function injectFileClaimant(target, ...args) {
+ if (!injected && path.resolve(String(target)) === path.resolve(claimant)) {
+ injected = true;
+ fs.writeFileSync(claimant, 'claimant file\n', { flag: 'wx' });
+ }
+ return originalOpenSync.call(fs, target, ...args);
+ };
+
+ assert.throws(
+ () => stageCleanSkill({ repoRoot: root, destination }),
+ /EEXIST|staging entry already exists/,
+ );
+ assert.equal(injected, true, 'the deterministic destination-file race must run');
+ assert.equal(
+ fs.readFileSync(claimant, 'utf8'),
+ 'claimant file\n',
+ 'a file claimant must survive cleanup byte-for-byte',
+ );
+ } finally {
+ fs.openSync = originalOpenSync;
+ fs.rmSync(root, { recursive: true, force: true });
+ }
+});
+
+test('clean staging preserves a file claimant swapped at the retirement syscall boundary', () => {
+ const root = repositoryFixture();
+ const destination = path.join(root, 'staged-skill');
+ const ownedFile = path.join(destination, 'LICENSE');
+ const displacedOwnedFile = path.join(root, 'displaced-owned-license');
+ const laterFile = path.join(destination, 'THIRD_PARTY_NOTICES.md');
+ const originalOpenSync = fs.openSync;
+ const originalRenameSync = fs.renameSync;
+ let injected = false;
+ try {
+ git(root, ['add', 'archify']);
+ fs.openSync = function failAfterFirstStagedFile(target, ...args) {
+ if (path.resolve(String(target)) === path.resolve(laterFile)) {
+ throw Object.assign(new Error('injected staging failure'), { code: 'EIO' });
+ }
+ return originalOpenSync.call(fs, target, ...args);
+ };
+ fs.renameSync = function swapClaimantAtRetirement(source, target, ...args) {
+ if (!injected
+ && path.resolve(String(source)) === path.resolve(ownedFile)
+ && path.basename(path.dirname(String(target))).startsWith('.archify-remove-')) {
+ injected = true;
+ originalRenameSync.call(fs, ownedFile, displacedOwnedFile);
+ fs.writeFileSync(ownedFile, 'claimant file\n', { flag: 'wx' });
+ }
+ return originalRenameSync.call(fs, source, target, ...args);
+ };
+
+ assert.throws(
+ () => stageCleanSkill({ repoRoot: root, destination }),
+ /injected staging failure/,
+ );
+ assert.equal(injected, true, 'cleanup must reach the deterministic retirement race');
+ assert.equal(fs.readFileSync(ownedFile, 'utf8'), 'claimant file\n');
+ assert.equal(fs.readFileSync(displacedOwnedFile, 'utf8'), 'MIT License\n');
+ } finally {
+ fs.openSync = originalOpenSync;
+ fs.renameSync = originalRenameSync;
+ fs.rmSync(root, { recursive: true, force: true });
+ }
+});
+
+test('clean staging preserves a directory claimant swapped at the retirement syscall boundary', () => {
+ const root = repositoryFixture();
+ const destination = path.join(root, 'staged-skill');
+ const modeManifest = path.join(root, 'modes.json');
+ const ownedDirectory = path.join(destination, 'renderers', 'shared');
+ const displacedOwnedDirectory = path.join(root, 'displaced-owned-shared');
+ const originalOpenSync = fs.openSync;
+ const originalRenameSync = fs.renameSync;
+ let injected = false;
+ const matchingFiles = (directory, name) => {
+ const matches = [];
+ for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
+ const absolute = path.join(directory, entry.name);
+ if (entry.isSymbolicLink()) continue;
+ if (entry.isDirectory()) matches.push(...matchingFiles(absolute, name));
+ else if (entry.isFile() && entry.name === name) matches.push(absolute);
+ }
+ return matches;
+ };
+ try {
+ git(root, ['add', 'archify']);
+ fs.openSync = function failModeManifest(target, ...args) {
+ if (path.resolve(String(target)) === path.resolve(modeManifest)) {
+ throw Object.assign(new Error('injected manifest failure'), { code: 'EIO' });
+ }
+ return originalOpenSync.call(fs, target, ...args);
+ };
+ fs.renameSync = function swapDirectoryClaimantAtRetirement(source, target, ...args) {
+ if (!injected
+ && path.resolve(String(source)) === path.resolve(ownedDirectory)
+ && path.basename(path.dirname(String(target))).startsWith('.archify-stage-remove-')) {
+ injected = true;
+ originalRenameSync.call(fs, ownedDirectory, displacedOwnedDirectory);
+ fs.mkdirSync(ownedDirectory);
+ fs.writeFileSync(path.join(ownedDirectory, 'claimant.txt'), 'claimant directory\n');
+ }
+ return originalRenameSync.call(fs, source, target, ...args);
+ };
+
+ assert.throws(
+ () => stageCleanSkill({ repoRoot: root, destination, modeManifest }),
+ /injected manifest failure/,
+ );
+ assert.equal(injected, true, 'cleanup must reach the deterministic directory-retirement race');
+ const claimants = matchingFiles(root, 'claimant.txt');
+ assert.equal(claimants.length, 1, 'the directory claimant must remain available for recovery');
+ assert.equal(fs.readFileSync(claimants[0], 'utf8'), 'claimant directory\n');
+ assert.equal(
+ fs.existsSync(displacedOwnedDirectory),
+ true,
+ 'the displaced owned directory must not be mistaken for the claimant',
+ );
+ } finally {
+ fs.openSync = originalOpenSync;
+ fs.renameSync = originalRenameSync;
+ fs.rmSync(root, { recursive: true, force: true });
+ }
+});
+
+test('clean staging detects a destination-ancestor swap before writing through the opened descriptor', (t) => {
+ const root = repositoryFixture();
+ const destination = path.join(root, 'staged-skill');
+ const detachedDestination = path.join(root, 'detached-owned-stage');
+ const external = path.join(root, 'external-destination');
+ const sentinel = path.join(external, 'sentinel.txt');
+ const redirectedFile = path.join(external, 'LICENSE');
+ const targetFile = path.join(destination, 'LICENSE');
+ const originalOpenSync = fs.openSync;
+ const originalWriteFileSync = fs.writeFileSync;
+ const originalRenameSync = fs.renameSync;
+ let swapped = false;
+ let redirectedIdentity;
+ let wroteRedirectedFile = false;
+ try {
+ git(root, ['add', 'archify']);
+ fs.mkdirSync(external);
+ fs.writeFileSync(sentinel, 'external sentinel\n');
+ const probe = path.join(root, 'destination-symlink-probe');
+ try {
+ fs.symlinkSync(external, probe, process.platform === 'win32' ? 'junction' : 'dir');
+ fs.rmSync(probe, { force: true });
+ } catch (error) {
+ if (['EPERM', 'EACCES', 'ENOTSUP'].includes(error?.code)) {
+ t.skip(`symlinks unavailable: ${error.code}`);
+ return;
+ }
+ throw error;
+ }
+
+ fs.openSync = function redirectAtOpen(target, ...args) {
+ if (!swapped && path.resolve(String(target)) === path.resolve(targetFile)) {
+ swapped = true;
+ originalRenameSync.call(fs, destination, detachedDestination);
+ fs.symlinkSync(external, destination, process.platform === 'win32' ? 'junction' : 'dir');
+ const descriptor = originalOpenSync.call(fs, target, ...args);
+ redirectedIdentity = fs.fstatSync(descriptor, { bigint: true });
+ return descriptor;
+ }
+ return originalOpenSync.call(fs, target, ...args);
+ };
+ fs.writeFileSync = function observeRedirectedWrite(target, ...args) {
+ if (swapped && typeof target === 'number' && redirectedIdentity) {
+ const current = fs.fstatSync(target, { bigint: true });
+ if (current.dev === redirectedIdentity.dev && current.ino === redirectedIdentity.ino) {
+ wroteRedirectedFile = true;
+ }
+ }
+ return originalWriteFileSync.call(fs, target, ...args);
+ };
+
+ assert.throws(
+ () => stageCleanSkill({ repoRoot: root, destination }),
+ /clean Skill staging directory changed/,
+ );
+ assert.equal(swapped, true, 'the deterministic destination-ancestor race must run');
+ assert.equal(wroteRedirectedFile, false, 'no package bytes may be written through a redirected ancestor');
+ assert.equal(fs.existsSync(redirectedFile), false, 'the exclusively created empty file must be retired safely');
+ assert.equal(fs.readFileSync(sentinel, 'utf8'), 'external sentinel\n');
+ assert.equal(fs.lstatSync(destination).isSymbolicLink(), true, 'the ancestor claimant must be preserved');
+ } finally {
+ fs.openSync = originalOpenSync;
+ fs.writeFileSync = originalWriteFileSync;
+ fs.renameSync = originalRenameSync;
+ fs.rmSync(root, { recursive: true, force: true });
+ }
+});
+
test('clean staging rejects a mode manifest that aliases the staged tree through a symlinked ancestor', (t) => {
const root = repositoryFixture();
const physical = path.join(root, 'physical');
diff --git a/archify/test/cli.test.mjs b/archify/test/cli.test.mjs
index 684dfba3..deb6c399 100644
--- a/archify/test/cli.test.mjs
+++ b/archify/test/cli.test.mjs
@@ -1054,8 +1054,12 @@ import path from 'node:path';
const unlinkSync = fs.unlinkSync;
fs.unlinkSync = (target, ...args) => {
const result = unlinkSync(target, ...args);
+ const parent = path.dirname(String(target));
+ const retirementDirectory = path.basename(parent).startsWith('.archify-provenance-')
+ || (path.basename(parent).startsWith('.archify-remove-')
+ && path.basename(path.dirname(parent)).startsWith('.archify-provenance-'));
if (path.basename(String(target)) === ${JSON.stringify(path.basename(pendingPath))}
- && path.basename(path.dirname(String(target))).startsWith('.archify-provenance-')) {
+ && retirementDirectory) {
process.exit(86);
}
return result;
@@ -1616,6 +1620,72 @@ await import(${JSON.stringify(pathToFileURL(cli).href)});
);
});
+test('cli: portable delivery lock: journal candidate retirement preserves a replacement claimant', () => {
+ const input = path.join(skillRoot, 'examples/agent-tool-call.workflow.json');
+ const out = path.join(tmp, 'journal-candidate-retirement-claimant.html');
+ assert.equal(run(['deliver', 'workflow', input, out, '--json']).status, 0);
+ const pendingPath = deliveryPendingPath(out);
+ const candidateName = path.basename(pendingPath);
+ const claimant = '{"claimant":"journal candidate retirement"}\n';
+ const claimantIdentityFile = path.join(tmp, 'journal-candidate-retirement-identity.json');
+ const displacedCandidate = path.join(tmp, 'journal-candidate-retirement-displaced');
+ const priorStaging = fs.readdirSync(path.dirname(out))
+ .filter((name) => name.startsWith('.archify-provenance-'))
+ .sort();
+ const wrapper = path.join(tmp, 'replace-journal-candidate-at-retirement.mjs');
+ fs.writeFileSync(wrapper, `
+import fs from 'node:fs';
+import path from 'node:path';
+const unlinkSync = fs.unlinkSync;
+const renameSync = fs.renameSync;
+const writeFileSync = fs.writeFileSync;
+let replaced = false;
+const isCandidate = (file) => (
+ path.basename(String(file)) === ${JSON.stringify(candidateName)}
+ && path.basename(path.dirname(String(file))).startsWith('.archify-provenance-')
+);
+const replaceCandidate = (file) => {
+ replaced = true;
+ renameSync(file, ${JSON.stringify(displacedCandidate)});
+ writeFileSync(file, ${JSON.stringify(claimant)}, { flag: 'wx' });
+ const stat = fs.lstatSync(file, { bigint: true });
+ writeFileSync(${JSON.stringify(claimantIdentityFile)}, JSON.stringify({
+ dev: String(stat.dev),
+ ino: String(stat.ino),
+ }));
+};
+fs.unlinkSync = (file, ...args) => {
+ if (!replaced && isCandidate(file)) replaceCandidate(file);
+ return unlinkSync(file, ...args);
+};
+fs.renameSync = (source, target, ...args) => {
+ if (!replaced
+ && isCandidate(source)
+ && path.basename(path.dirname(String(target))).startsWith('.archify-remove-')) {
+ replaceCandidate(source);
+ }
+ return renameSync(source, target, ...args);
+};
+process.argv = [process.execPath, ${JSON.stringify(cli)}, 'deliver', 'workflow', ${JSON.stringify(input)}, ${JSON.stringify(out)}, '--json'];
+await import(${JSON.stringify(pathToFileURL(cli).href)});
+`);
+
+ const failed = spawnSync(process.execPath, [wrapper], { cwd: skillRoot, encoding: 'utf8' });
+ assert.equal(failed.status, 1, failed.stderr || failed.stdout);
+ const staging = fs.readdirSync(path.dirname(out))
+ .filter((name) => name.startsWith('.archify-provenance-'))
+ .filter((name) => !priorStaging.includes(name));
+ assert.equal(staging.length, 1, failed.stderr || failed.stdout);
+ const candidate = path.join(path.dirname(out), staging[0], candidateName);
+ assert.equal(fs.readFileSync(candidate, 'utf8'), claimant);
+ const claimantIdentity = fs.lstatSync(candidate, { bigint: true });
+ assert.deepEqual(
+ { dev: String(claimantIdentity.dev), ino: String(claimantIdentity.ino) },
+ JSON.parse(fs.readFileSync(claimantIdentityFile, 'utf8')),
+ );
+ assert.equal(fs.existsSync(displacedCandidate), true);
+});
+
test('cli: portable delivery lock: failed journal restore retains the previous journal and claimant', () => {
const input = path.join(skillRoot, 'examples/agent-tool-call.workflow.json');
const out = path.join(tmp, 'journal-restore-claimant.html');
@@ -2374,17 +2444,63 @@ await import(${JSON.stringify(pathToFileURL(cli).href)});
assert.equal(fs.existsSync(fake.log), false);
});
-test('cli: a first lock handle identity failure leaves no public lock and permits retry', () => {
+test('cli: delivery cleanup preserves an unexpected claimant in private staging', () => {
+ const input = path.join(skillRoot, 'examples/agent-tool-call.workflow.json');
+ const out = path.join(tmp, 'delivery-staging-claimant.html');
+ const stagingBefore = new Set(deliveryStagingEntries(path.dirname(out)));
+ const wrapper = path.join(tmp, 'delivery-staging-claimant.mjs');
+ fs.writeFileSync(wrapper, `
+import fs from 'node:fs';
+import path from 'node:path';
+const rmdirSync = fs.rmdirSync.bind(fs);
+let claimed = false;
+fs.rmdirSync = (directory, ...args) => {
+ if (!claimed && path.basename(String(directory)).startsWith('.archify-delivery-')) {
+ claimed = true;
+ fs.writeFileSync(path.join(directory, 'unknown-claimant.txt'), 'preserve delivery claimant');
+ }
+ return rmdirSync(directory, ...args);
+};
+process.argv = [process.execPath, ${JSON.stringify(cli)}, 'deliver', 'workflow', ${JSON.stringify(input)}, ${JSON.stringify(out)}, '--json'];
+await import(${JSON.stringify(pathToFileURL(cli).href)});
+`);
+
+ const delivered = spawnSync(process.execPath, [wrapper], { cwd: skillRoot, encoding: 'utf8' });
+
+ assert.equal(delivered.status, 0, delivered.stderr || delivered.stdout);
+ assert.equal(JSON.parse(delivered.stdout).ok, true);
+ assert.match(delivered.stderr, /Warning: could not remove delivery staging directory/);
+ const recoveryRoot = fs.readdirSync(path.dirname(out), { withFileTypes: true })
+ .find((entry) => entry.isDirectory() && entry.name.startsWith('.archify-staging-remove-'));
+ assert.ok(recoveryRoot);
+ const staging = deliveryStagingEntries(path.join(path.dirname(out), recoveryRoot.name))
+ .find((entry) => !stagingBefore.has(entry));
+ assert.ok(staging);
+ assert.equal(
+ fs.readFileSync(path.join(
+ path.dirname(out),
+ recoveryRoot.name,
+ staging,
+ 'unknown-claimant.txt',
+ ), 'utf8'),
+ 'preserve delivery claimant',
+ );
+});
+
+test('cli: repeated lock handle identity failures close the descriptor, remove only the owned lock, and permit retry', () => {
const input = path.join(skillRoot, 'examples/agent-tool-call.workflow.json');
const out = path.join(tmp, 'delivery-lock-first-fstat.html');
const lockPath = deliveryLockPath(out);
+ const closeEvidence = path.join(tmp, 'delivery-lock-first-fstat-close.json');
const wrapper = path.join(tmp, 'delivery-lock-first-fstat.mjs');
fs.writeFileSync(wrapper, `
import fs from 'node:fs';
const openSync = fs.openSync;
const fstatSync = fs.fstatSync;
+const closeSync = fs.closeSync;
let lockDescriptor;
-let injected = false;
+let injected = 0;
+let lockClosed = false;
fs.openSync = (file, ...args) => {
const descriptor = openSync(file, ...args);
if (lockDescriptor === undefined && String(file) === ${JSON.stringify(lockPath)}) {
@@ -2393,12 +2509,17 @@ fs.openSync = (file, ...args) => {
return descriptor;
};
fs.fstatSync = (descriptor, ...args) => {
- if (descriptor === lockDescriptor && !injected) {
- injected = true;
- throw Object.assign(new Error('injected first lock fstat failure'), { code: 'EIO' });
+ if (descriptor === lockDescriptor && injected < 2) {
+ injected += 1;
+ throw Object.assign(new Error('injected repeated lock fstat failure'), { code: 'EIO' });
}
return fstatSync(descriptor, ...args);
};
+fs.closeSync = (descriptor, ...args) => {
+ if (descriptor === lockDescriptor) lockClosed = true;
+ return closeSync(descriptor, ...args);
+};
+process.on('exit', () => fs.writeFileSync(${JSON.stringify(closeEvidence)}, JSON.stringify({ lockClosed, injected })));
process.argv = [process.execPath, ${JSON.stringify(cli)}, 'deliver', 'workflow', ${JSON.stringify(input)}, ${JSON.stringify(out)}, '--json'];
await import(${JSON.stringify(pathToFileURL(cli).href)});
`);
@@ -2406,11 +2527,75 @@ await import(${JSON.stringify(pathToFileURL(cli).href)});
const failed = spawnSync(process.execPath, [wrapper], { cwd: skillRoot, encoding: 'utf8' });
assert.equal(failed.status, 1, failed.stderr || failed.stdout);
assert.equal(JSON.parse(failed.stdout).diagnostics[0].code, 'delivery/lock-acquire');
+ assert.deepEqual(JSON.parse(fs.readFileSync(closeEvidence, 'utf8')), {
+ lockClosed: true,
+ injected: 2,
+ });
assert.equal(fs.existsSync(lockPath), false, 'failed identity capture leaked the public lock');
const retry = run(['deliver', 'workflow', input, out, '--json']);
assert.equal(retry.status, 0, retry.stderr || retry.stdout);
});
+test('cli: repeated lock handle identity failures preserve a claimant that replaces the owned entry', () => {
+ const input = path.join(skillRoot, 'examples/agent-tool-call.workflow.json');
+ const out = path.join(tmp, 'delivery-lock-repeated-fstat-claimant.html');
+ const lockPath = deliveryLockPath(out);
+ const detachedOwnedLock = `${lockPath}.detached-double-fstat`;
+ const closeEvidence = path.join(tmp, 'delivery-lock-repeated-fstat-claimant-close.json');
+ const claimant = 'unrelated lock claimant\n';
+ const wrapper = path.join(tmp, 'delivery-lock-repeated-fstat-claimant.mjs');
+ fs.writeFileSync(wrapper, `
+import fs from 'node:fs';
+const openSync = fs.openSync.bind(fs);
+const fstatSync = fs.fstatSync.bind(fs);
+const closeSync = fs.closeSync.bind(fs);
+const writeFileSync = fs.writeFileSync.bind(fs);
+let lockDescriptor;
+let injected = 0;
+let replaced = false;
+let lockClosed = false;
+fs.openSync = (file, ...args) => {
+ const descriptor = openSync(file, ...args);
+ if (lockDescriptor === undefined && String(file) === ${JSON.stringify(lockPath)}) lockDescriptor = descriptor;
+ return descriptor;
+};
+fs.fstatSync = (descriptor, ...args) => {
+ if (descriptor === lockDescriptor && injected < 2) {
+ injected += 1;
+ throw Object.assign(new Error('injected repeated lock fstat failure'), { code: 'EIO' });
+ }
+ return fstatSync(descriptor, ...args);
+};
+fs.writeFileSync = (file, ...args) => {
+ const result = writeFileSync(file, ...args);
+ if (!replaced && file === lockDescriptor) {
+ replaced = true;
+ fs.renameSync(${JSON.stringify(lockPath)}, ${JSON.stringify(detachedOwnedLock)});
+ writeFileSync(${JSON.stringify(lockPath)}, ${JSON.stringify(claimant)}, { flag: 'wx' });
+ }
+ return result;
+};
+fs.closeSync = (descriptor, ...args) => {
+ if (descriptor === lockDescriptor) lockClosed = true;
+ return closeSync(descriptor, ...args);
+};
+process.on('exit', () => writeFileSync(${JSON.stringify(closeEvidence)}, JSON.stringify({ lockClosed, injected, replaced })));
+process.argv = [process.execPath, ${JSON.stringify(cli)}, 'deliver', 'workflow', ${JSON.stringify(input)}, ${JSON.stringify(out)}, '--json'];
+await import(${JSON.stringify(pathToFileURL(cli).href)});
+`);
+
+ const failed = spawnSync(process.execPath, [wrapper], { cwd: skillRoot, encoding: 'utf8' });
+
+ assert.equal(failed.status, 1, failed.stderr || failed.stdout);
+ assert.deepEqual(JSON.parse(fs.readFileSync(closeEvidence, 'utf8')), {
+ lockClosed: true,
+ injected: 2,
+ replaced: true,
+ });
+ assert.equal(fs.readFileSync(lockPath, 'utf8'), claimant);
+ assert.equal(fs.existsSync(detachedOwnedLock), true);
+});
+
for (const failureMode of ['empty-write', 'partial-write', 'close', 'replacement', 'cleanup-failure']) {
test(`cli: portable delivery lock: failed lock initialization is cleaned up and delivery can retry (${failureMode})`, () => {
const input = path.join(skillRoot, 'examples/agent-tool-call.workflow.json');
@@ -2986,6 +3171,187 @@ await import(${JSON.stringify(pathToFileURL(cli).href)});
);
});
+test('cli: failed-provenance candidate retirement preserves a replacement claimant', () => {
+ const validInput = path.join(skillRoot, 'examples/agent-tool-call.workflow.json');
+ const invalidInput = path.join(tmp, 'failed-provenance-retirement.workflow.json');
+ const invalid = JSON.parse(fs.readFileSync(validInput, 'utf8'));
+ invalid.nodes[0].unexpected = true;
+ fs.writeFileSync(invalidInput, JSON.stringify(invalid));
+ const out = path.join(tmp, 'failed-provenance-retirement.html');
+ assert.equal(run(['deliver', 'workflow', validInput, out, '--json']).status, 0);
+ const provenancePath = deliveryProvenancePath(out);
+ const candidateName = path.basename(provenancePath);
+ const claimant = '{"claimant":"failed provenance candidate retirement"}\n';
+ const claimantIdentityFile = path.join(tmp, 'failed-provenance-retirement-identity.json');
+ const displacedCandidate = path.join(tmp, 'failed-provenance-retirement-displaced');
+ const priorStaging = fs.readdirSync(path.dirname(out))
+ .filter((name) => name.startsWith('.archify-provenance-'))
+ .sort();
+ const wrapper = path.join(tmp, 'replace-failed-provenance-candidate-at-retirement.mjs');
+ fs.writeFileSync(wrapper, `
+import fs from 'node:fs';
+import path from 'node:path';
+const unlinkSync = fs.unlinkSync;
+const renameSync = fs.renameSync;
+const writeFileSync = fs.writeFileSync;
+let replaced = false;
+const isCandidate = (file) => (
+ path.basename(String(file)) === ${JSON.stringify(candidateName)}
+ && path.basename(path.dirname(String(file))).startsWith('.archify-provenance-')
+);
+const replaceCandidate = (file) => {
+ replaced = true;
+ renameSync(file, ${JSON.stringify(displacedCandidate)});
+ writeFileSync(file, ${JSON.stringify(claimant)}, { flag: 'wx' });
+ const stat = fs.lstatSync(file, { bigint: true });
+ writeFileSync(${JSON.stringify(claimantIdentityFile)}, JSON.stringify({
+ dev: String(stat.dev),
+ ino: String(stat.ino),
+ }));
+};
+fs.unlinkSync = (file, ...args) => {
+ if (!replaced && isCandidate(file)) replaceCandidate(file);
+ return unlinkSync(file, ...args);
+};
+fs.renameSync = (source, target, ...args) => {
+ if (!replaced
+ && isCandidate(source)
+ && path.basename(path.dirname(String(target))).startsWith('.archify-remove-')) {
+ replaceCandidate(source);
+ }
+ return renameSync(source, target, ...args);
+};
+process.argv = [process.execPath, ${JSON.stringify(cli)}, 'deliver', 'workflow', ${JSON.stringify(invalidInput)}, ${JSON.stringify(out)}, '--json'];
+await import(${JSON.stringify(pathToFileURL(cli).href)});
+`);
+
+ const failed = spawnSync(process.execPath, [wrapper], { cwd: skillRoot, encoding: 'utf8' });
+ assert.equal(failed.status, 1, failed.stderr || failed.stdout);
+ const staging = fs.readdirSync(path.dirname(out))
+ .filter((name) => name.startsWith('.archify-provenance-'))
+ .filter((name) => !priorStaging.includes(name));
+ assert.equal(staging.length, 1, failed.stderr || failed.stdout);
+ const candidate = path.join(path.dirname(out), staging[0], candidateName);
+ assert.equal(fs.readFileSync(candidate, 'utf8'), claimant);
+ const claimantIdentity = fs.lstatSync(candidate, { bigint: true });
+ assert.deepEqual(
+ { dev: String(claimantIdentity.dev), ino: String(claimantIdentity.ino) },
+ JSON.parse(fs.readFileSync(claimantIdentityFile, 'utf8')),
+ );
+ assert.equal(fs.existsSync(displacedCandidate), true);
+});
+
+test('cli: provenance staging cleanup preserves a directory claimant at the removal boundary', () => {
+ const input = path.join(skillRoot, 'examples/agent-tool-call.workflow.json');
+ const out = path.join(tmp, 'provenance-cleanup-claimant.html');
+ const observation = path.join(tmp, 'provenance-cleanup-claimant.json');
+ const wrapper = path.join(tmp, 'claim-provenance-staging-cleanup.mjs');
+ fs.writeFileSync(wrapper, `
+import fs from 'node:fs';
+import path from 'node:path';
+const rmSync = fs.rmSync.bind(fs);
+const rmdirSync = fs.rmdirSync.bind(fs);
+let injected = false;
+let stagingDirectory;
+let claimant;
+function inject(target) {
+ if (injected || !path.basename(String(target)).startsWith('.archify-provenance-')) return;
+ injected = true;
+ stagingDirectory = String(target);
+ fs.renameSync(stagingDirectory, stagingDirectory + '.owned');
+ fs.mkdirSync(stagingDirectory);
+ claimant = path.join(stagingDirectory, 'claimant.txt');
+ fs.writeFileSync(claimant, 'claimant-owned\\n');
+}
+fs.rmSync = (target, ...args) => {
+ inject(target);
+ return rmSync(target, ...args);
+};
+fs.rmdirSync = (target, ...args) => {
+ inject(target);
+ return rmdirSync(target, ...args);
+};
+process.argv = [process.execPath, ${JSON.stringify(cli)}, 'deliver', 'workflow', ${JSON.stringify(input)}, ${JSON.stringify(out)}, '--json'];
+await import(${JSON.stringify(pathToFileURL(cli).href)});
+fs.writeFileSync(${JSON.stringify(observation)}, JSON.stringify({
+ injected,
+ stagingDirectory,
+ claimantSurvived: claimant ? fs.existsSync(claimant) : false,
+ claimantBytes: claimant && fs.existsSync(claimant) ? fs.readFileSync(claimant, 'utf8') : null,
+}));
+`);
+
+ const result = spawnSync(process.execPath, [wrapper], { cwd: skillRoot, encoding: 'utf8' });
+
+ assert.equal(result.status, 0, result.stderr || result.stdout);
+ const state = JSON.parse(fs.readFileSync(observation, 'utf8'));
+ assert.equal(state.injected, true, 'the cleanup-boundary claimant must be installed');
+ assert.equal(state.claimantSurvived, true, 'cleanup must not recursively delete claimant contents');
+ assert.equal(state.claimantBytes, 'claimant-owned\n');
+ assert.equal(fs.existsSync(out), true);
+});
+
+test('cli: delivery staging cleanup preserves an empty directory claimant at the removal boundary', () => {
+ const input = path.join(skillRoot, 'examples/agent-tool-call.workflow.json');
+ const out = path.join(tmp, 'delivery-cleanup-empty-claimant.html');
+ const observation = path.join(tmp, 'delivery-cleanup-empty-claimant.json');
+ const wrapper = path.join(tmp, 'claim-delivery-staging-cleanup.mjs');
+ fs.writeFileSync(wrapper, `
+import fs from 'node:fs';
+import path from 'node:path';
+const renameSync = fs.renameSync.bind(fs);
+const rmdirSync = fs.rmdirSync.bind(fs);
+let injected = false;
+let claimantIdentity;
+function inject(target) {
+ if (injected || !path.basename(String(target)).startsWith('.archify-delivery-')) return;
+ injected = true;
+ const stagingDirectory = String(target);
+ renameSync(stagingDirectory, stagingDirectory + '.owned');
+ fs.mkdirSync(stagingDirectory);
+ const metadata = fs.lstatSync(stagingDirectory, { bigint: true });
+ claimantIdentity = { dev: metadata.dev, ino: metadata.ino };
+}
+fs.rmdirSync = (target, ...args) => {
+ inject(target);
+ return rmdirSync(target, ...args);
+};
+fs.renameSync = (source, target, ...args) => {
+ if (path.basename(path.dirname(String(target))).startsWith('.archify-staging-remove-')) {
+ inject(source);
+ }
+ return renameSync(source, target, ...args);
+};
+function claimantSurvives(directory) {
+ for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
+ if (entry.isSymbolicLink()) continue;
+ const absolute = path.join(directory, entry.name);
+ if (!entry.isDirectory()) continue;
+ const metadata = fs.lstatSync(absolute, { bigint: true });
+ if (claimantIdentity
+ && metadata.dev === claimantIdentity.dev
+ && metadata.ino === claimantIdentity.ino) return true;
+ if (claimantSurvives(absolute)) return true;
+ }
+ return false;
+}
+process.argv = [process.execPath, ${JSON.stringify(cli)}, 'deliver', 'workflow', ${JSON.stringify(input)}, ${JSON.stringify(out)}, '--json'];
+await import(${JSON.stringify(pathToFileURL(cli).href)});
+fs.writeFileSync(${JSON.stringify(observation)}, JSON.stringify({
+ injected,
+ claimantSurvived: claimantSurvives(${JSON.stringify(tmp)}),
+}));
+`);
+
+ const result = spawnSync(process.execPath, [wrapper], { cwd: skillRoot, encoding: 'utf8' });
+
+ assert.equal(result.status, 0, result.stderr || result.stdout);
+ const state = JSON.parse(fs.readFileSync(observation, 'utf8'));
+ assert.equal(state.injected, true, 'the cleanup-boundary claimant must be installed');
+ assert.equal(state.claimantSurvived, true, 'cleanup must preserve the empty claimant inode');
+ assert.equal(fs.existsSync(out), true);
+});
+
test('cli: using the existing receipt as input fails before invalidating the previous delivery', () => {
const input = path.join(skillRoot, 'examples/agent-tool-call.workflow.json');
const out = path.join(tmp, 'receipt-as-input.html');
diff --git a/archify/test/copy-site-assets.test.mjs b/archify/test/copy-site-assets.test.mjs
index a5de166e..d1c689b6 100644
--- a/archify/test/copy-site-assets.test.mjs
+++ b/archify/test/copy-site-assets.test.mjs
@@ -118,6 +118,103 @@ test('copySiteAssets preflights both asset targets before publishing either one'
assert.equal(fs.readFileSync(external, 'utf8'), 'external navigation remains unchanged\n');
});
+test('copySiteAssets rolls back the pair when publishing the second asset fails', (t) => {
+ const root = workspace(t, 'archify-copy-site-assets-pair-rollback-');
+ const outputParent = path.join(root, 'site');
+ const assets = path.join(outputParent, 'assets');
+ const language = path.join(assets, 'site-language.js');
+ const navigation = path.join(assets, 'site-navigation.css');
+ fs.mkdirSync(assets, { recursive: true });
+ fs.writeFileSync(language, 'previous language asset\n');
+ fs.writeFileSync(navigation, 'previous navigation asset\n');
+
+ const linkSync = fs.linkSync.bind(fs);
+ let injected = false;
+ t.mock.method(fs, 'linkSync', (source, destination) => {
+ if (!injected
+ && path.basename(destination) === 'site-navigation.css'
+ && path.basename(source).startsWith('.site-navigation.css.archify-')) {
+ injected = true;
+ throw Object.assign(new Error('injected second publication failure'), { code: 'EIO' });
+ }
+ return linkSync(source, destination);
+ });
+
+ assertThrowsWithCauseCode(
+ () => copySiteAssets(path.join(outputParent, 'index.html')),
+ 'site-asset-publish-failed',
+ );
+ assert.equal(injected, true, 'the second publication must reach the injected failure');
+ assert.equal(fs.readFileSync(language, 'utf8'), 'previous language asset\n');
+ assert.equal(fs.readFileSync(navigation, 'utf8'), 'previous navigation asset\n');
+ assert.deepEqual(
+ fs.readdirSync(assets).sort(),
+ ['site-language.js', 'site-navigation.css'],
+ 'rollback must not leave candidates or backups behind',
+ );
+});
+
+test('copySiteAssets keeps the committed pair when retiring a previous backup needs recovery', (t) => {
+ const root = workspace(t, 'archify-copy-site-assets-backup-recovery-');
+ const outputParent = path.join(root, 'site');
+ const assets = path.join(outputParent, 'assets');
+ const language = path.join(assets, 'site-language.js');
+ const navigation = path.join(assets, 'site-navigation.css');
+ fs.mkdirSync(assets, { recursive: true });
+ fs.writeFileSync(language, 'previous language asset\n');
+ fs.writeFileSync(navigation, 'previous navigation asset\n');
+
+ const unlinkSync = fs.unlinkSync.bind(fs);
+ let injected = false;
+ t.mock.method(fs, 'unlinkSync', (file, ...args) => {
+ if (!injected
+ && path.basename(String(file)).startsWith('.archify-site-backup-')
+ && path.basename(path.dirname(String(file))).startsWith('.archify-remove-')) {
+ injected = true;
+ throw Object.assign(new Error('injected previous-backup cleanup failure'), { code: 'EIO' });
+ }
+ return unlinkSync(file, ...args);
+ });
+
+ assertThrowsWithCauseCode(
+ () => copySiteAssets(path.join(outputParent, 'index.html')),
+ 'previous-site-asset-target-quarantine-cleanup-failed',
+ );
+ assert.equal(injected, true, 'the previous-backup retirement must reach the injected failure');
+ assert.deepEqual(fs.readFileSync(language), fs.readFileSync(path.join(canonicalAssets, 'site-language.js')));
+ assert.deepEqual(fs.readFileSync(navigation), fs.readFileSync(path.join(canonicalAssets, 'site-navigation.css')));
+});
+
+test('copySiteAssets rolls back the first asset and preserves a claimant of the second target', (t) => {
+ const root = workspace(t, 'archify-copy-site-assets-second-claimant-');
+ const outputParent = path.join(root, 'site');
+ const assets = path.join(outputParent, 'assets');
+ const language = path.join(assets, 'site-language.js');
+ const navigation = path.join(assets, 'site-navigation.css');
+ fs.mkdirSync(assets, { recursive: true });
+
+ const linkSync = fs.linkSync.bind(fs);
+ let injected = false;
+ t.mock.method(fs, 'linkSync', (source, destination) => {
+ if (!injected
+ && path.basename(destination) === 'site-navigation.css'
+ && path.basename(source).startsWith('.site-navigation.css.archify-')) {
+ fs.writeFileSync(navigation, 'concurrent navigation claimant\n', { flag: 'wx' });
+ injected = true;
+ }
+ return linkSync(source, destination);
+ });
+
+ assertThrowsWithCauseCode(
+ () => copySiteAssets(path.join(outputParent, 'index.html')),
+ 'site-asset-target-claimed-during-publish',
+ );
+ assert.equal(injected, true, 'the second target must be claimed after the first publish');
+ assert.equal(fs.existsSync(language), false, 'the first publication must roll back to absence');
+ assert.equal(fs.readFileSync(navigation, 'utf8'), 'concurrent navigation claimant\n');
+ assert.deepEqual(fs.readdirSync(assets), ['site-navigation.css']);
+});
+
test('copySiteAssets preserves a target introduced after capture and before publication', (t) => {
const root = workspace(t, 'archify-copy-site-assets-target-swap-');
const outputParent = path.join(root, 'site');
diff --git a/archify/test/delivery-contract.test.mjs b/archify/test/delivery-contract.test.mjs
index 511f5bf5..b53d0bfb 100644
--- a/archify/test/delivery-contract.test.mjs
+++ b/archify/test/delivery-contract.test.mjs
@@ -110,17 +110,24 @@ test('skill uses recoverable verified delivery for the final artifact', () => {
assert.match(delivery, /never claim that the deterministic receipt includes visual review/i);
});
-test('atomic publishers freeze the write slot and reject hardlinked write targets', () => {
- assert.match(delivery, /Every atomic HTML publisher \(`render`, `deliver`, `compare`, and `preview`\)/i);
+test('no-clobber publishers freeze the write slot and reject hardlinked write targets', () => {
+ assert.match(delivery, /Every no-clobber HTML publisher \(`render`, `deliver`, `compare`, and `preview`\)/i);
assert.match(delivery, /requested directory entry, canonical write slot, physical parent/i);
assert.match(delivery, /target type, device\/inode identity, and mode[\s\S]*revalidates/i);
assert.match(delivery, /multiple hard-link names fails closed with `output\/target-hardlinked`/i);
assert.match(delivery, /provenance directory\s+entry itself must be a single-link regular file[\s\S]*`delivery\/provenance-hardlink-unsupported`/i);
- assert.match(delivery, /Hard links remain supported for[\s\S]*read identity[\s\S]*unsupported only as\s+write targets/i);
- assert.match(delivery, /symbolic link to a single-link regular file remains supported/i);
+ assert.match(delivery, /Hard\s+links\s+remain supported for[\s\S]*read identity[\s\S]*unsupported only as\s+write targets/i);
+ assert.match(delivery, /symbolic link to a single-link regular\s+file remains supported/i);
assert.match(delivery, /preserves the symbolic-link entry[\s\S]*resolved target/i);
});
+test('publication contract distinguishes no-clobber recovery from crash-atomic replacement', () => {
+ assert.match(delivery, /publication is no-clobber and recoverable, not crash-atomic/i);
+ assert.match(delivery, /private\s+recovery\s+backup[\s\S]*removes the public name[\s\S]*exclusive hard link/i);
+ assert.match(delivery, /process\s+interruption[\s\S]*public\s+path absent[\s\S]*verified\s+previous bytes/i);
+ assert.match(delivery, /portable\s+Node\.js filesystem API[\s\S]*compare-and-swap/i);
+});
+
test('skill keeps optional opening behind the verified commit and outside automation', () => {
assert.match(delivery, /Add `--open` only when the user wants an immediate local preview/);
assert.match(delivery, /runs after[\s\S]*verified pair commit[\s\S]*journal has been\s+removed/);
diff --git a/archify/test/delivery-sidecar-path.test.mjs b/archify/test/delivery-sidecar-path.test.mjs
index 89cdbd7f..31a8a62b 100644
--- a/archify/test/delivery-sidecar-path.test.mjs
+++ b/archify/test/delivery-sidecar-path.test.mjs
@@ -39,6 +39,30 @@ function windowsShortPath(targetPath) {
return shortPath;
}
+function assignWindowsShortName(targetPath, shortName) {
+ const result = spawnSync(
+ 'fsutil.exe',
+ ['file', 'setshortname', targetPath, shortName],
+ { encoding: 'utf8', windowsHide: true },
+ );
+ if (result.error) {
+ throw new Error(`Could not assign Windows 8.3 name ${shortName}: ${result.error.message}`);
+ }
+ if (result.status !== 0) {
+ const detail = result.stderr.trim() || result.stdout.trim() || 'no command output';
+ throw new Error(`Could not assign Windows 8.3 name ${shortName} (exit ${result.status}): ${detail}`);
+ }
+ const alias = path.join(path.dirname(targetPath), shortName);
+ const aliasStat = fs.statSync(alias, { bigint: true });
+ const targetStat = fs.statSync(targetPath, { bigint: true });
+ assert.deepEqual(
+ [aliasStat.dev, aliasStat.ino],
+ [targetStat.dev, targetStat.ino],
+ 'the explicitly assigned 8.3 name must resolve to the requested entry',
+ );
+ return alias;
+}
+
function controlledWindowsShortRoot(required) {
const root = process.env.ARCHIFY_WINDOWS_8DOT3_ROOT;
const shortRoot = process.env.ARCHIFY_WINDOWS_8DOT3_SHORT_ROOT;
@@ -855,6 +879,72 @@ await import(${JSON.stringify(pathToFileURL(cli).href)});
});
}
+for (const candidateRole of ['artifact', 'provenance']) {
+ test(`delivery preserves a claimant that replaces the staged ${candidateRole} at retirement`, (t) => {
+ const cwd = fs.mkdtempSync(path.join(os.tmpdir(), `archify-${candidateRole}-retirement-claimant-`));
+ t.after(() => fs.rmSync(cwd, { recursive: true, force: true }));
+ const output = path.join(cwd, 'diagram.html');
+ assert.equal(run(['deliver', 'workflow', input, output, '--json'], cwd).status, 0);
+ const candidateName = candidateRole === 'artifact' ? path.basename(output) : 'delivery-provenance.json';
+ const claimant = `${candidateRole} retirement claimant\n`;
+ const claimantIdentityFile = path.join(cwd, `${candidateRole}-retirement-identity.json`);
+ const displacedCandidate = path.join(cwd, `${candidateRole}-retirement-displaced`);
+ const wrapper = path.join(cwd, `replace-staged-${candidateRole}-at-retirement.mjs`);
+ fs.writeFileSync(wrapper, `
+import fs from 'node:fs';
+import path from 'node:path';
+const unlinkSync = fs.unlinkSync;
+const renameSync = fs.renameSync;
+const writeFileSync = fs.writeFileSync;
+let replaced = false;
+const isCandidate = (file) => (
+ path.basename(String(file)) === ${JSON.stringify(candidateName)}
+ && path.basename(path.dirname(String(file))).startsWith('.archify-delivery-')
+);
+const replaceCandidate = (file) => {
+ replaced = true;
+ renameSync(file, ${JSON.stringify(displacedCandidate)});
+ writeFileSync(file, ${JSON.stringify(claimant)}, { flag: 'wx' });
+ const stat = fs.lstatSync(file, { bigint: true });
+ writeFileSync(${JSON.stringify(claimantIdentityFile)}, JSON.stringify({
+ dev: String(stat.dev),
+ ino: String(stat.ino),
+ }));
+};
+fs.unlinkSync = (file, ...args) => {
+ if (!replaced && isCandidate(file)) replaceCandidate(file);
+ return unlinkSync(file, ...args);
+};
+fs.renameSync = (source, target, ...args) => {
+ if (!replaced
+ && isCandidate(source)
+ && path.basename(path.dirname(String(target))).startsWith('.archify-remove-')) {
+ replaceCandidate(source);
+ }
+ return renameSync(source, target, ...args);
+};
+process.argv = [process.execPath, ${JSON.stringify(cli)}, 'deliver', 'workflow', ${JSON.stringify(input)}, ${JSON.stringify(output)}, '--json'];
+await import(${JSON.stringify(pathToFileURL(cli).href)});
+`);
+
+ const failed = spawnSync(process.execPath, [wrapper], { cwd, encoding: 'utf8' });
+ assert.equal(failed.status, 1, failed.stderr || failed.stdout);
+ const staging = fs.readdirSync(cwd).filter((name) => (
+ name.startsWith('.archify-delivery-')
+ && fs.lstatSync(path.join(cwd, name)).isDirectory()
+ ));
+ assert.equal(staging.length, 1, failed.stderr || failed.stdout);
+ const candidate = path.join(cwd, staging[0], candidateName);
+ assert.equal(fs.readFileSync(candidate, 'utf8'), claimant);
+ const claimantIdentity = fs.lstatSync(candidate, { bigint: true });
+ assert.deepEqual(
+ { dev: String(claimantIdentity.dev), ino: String(claimantIdentity.ino) },
+ JSON.parse(fs.readFileSync(claimantIdentityFile, 'utf8')),
+ );
+ assert.equal(fs.existsSync(displacedCandidate), true);
+ });
+}
+
for (const initiallyExisting of [false, true]) {
for (const targetRole of ['artifact', 'provenance']) {
test(`delivery preserves an ${initiallyExisting ? 'existing replacement' : 'absent-slot claimant'} for the ${targetRole}`, (t) => {
@@ -999,8 +1089,11 @@ test('Windows delivery accepts an existing 8.3 artifact alias and keeps strict p
fs.mkdirSync(directory);
const output = path.join(directory, 'diagram artifact with long name.html');
assert.equal(run(['deliver', 'workflow', input, output, '--json'], cwd).status, 0);
- const shortOutput = windowsShortPath(output);
+ const shortOutput = controlledRoot
+ ? assignWindowsShortName(output, 'ARCHDL~1.HTM')
+ : windowsShortPath(output);
if (!shortOutput) {
+ if (requiresWindows8dot3) assert.fail('the controlled Windows fixture did not expose the explicit file 8.3 alias');
t.skip('the Windows volume does not expose a distinct 8.3 artifact alias');
return;
}
diff --git a/archify/test/fixtures/automatic-routing-node-border-clearance.workflow.json b/archify/test/fixtures/automatic-routing-node-border-clearance.workflow.json
index f5e48e87..4d43bb8e 100644
--- a/archify/test/fixtures/automatic-routing-node-border-clearance.workflow.json
+++ b/archify/test/fixtures/automatic-routing-node-border-clearance.workflow.json
@@ -3,6 +3,7 @@
"diagram_type": "workflow",
"meta": {
"title": "自动连线节点边框避让回归",
+ "output": "automatic-routing-node-border-clearance.html",
"quality_profile": "showcase",
"viewBox": [720, 360]
},
diff --git a/archify/test/fixtures/fail-migration-cleanup.mjs b/archify/test/fixtures/fail-migration-cleanup.mjs
index 8ea2af51..21ec1515 100644
--- a/archify/test/fixtures/fail-migration-cleanup.mjs
+++ b/archify/test/fixtures/fail-migration-cleanup.mjs
@@ -1,17 +1,17 @@
import fs from 'node:fs';
import path from 'node:path';
-const originalRmSync = fs.rmSync.bind(fs);
+const originalRmdirSync = fs.rmdirSync.bind(fs);
let injectedFailure = false;
-fs.rmSync = function failMigrationCleanupOnce(target, options) {
+fs.rmdirSync = function failMigrationCleanupOnce(target, options) {
const isMigrationStagingDirectory = path.basename(String(target)).startsWith('.archify-migration-');
if (!injectedFailure && isMigrationStagingDirectory) {
injectedFailure = true;
- originalRmSync(target, options);
+ originalRmdirSync(target, options);
const error = new Error('simulated migration cleanup failure');
error.code = 'EPERM';
throw error;
}
- return originalRmSync(target, options);
+ return originalRmdirSync(target, options);
};
diff --git a/archify/test/fixtures/issue-126/custom-widths.workflow.json b/archify/test/fixtures/issue-126/custom-widths.workflow.json
index 68bd7207..ec393269 100644
--- a/archify/test/fixtures/issue-126/custom-widths.workflow.json
+++ b/archify/test/fixtures/issue-126/custom-widths.workflow.json
@@ -3,6 +3,7 @@
"diagram_type": "workflow",
"meta": {
"title": "Sanitized custom widths",
+ "output": "issue-126-custom-widths.html",
"legend": { "mode": "hidden" }
},
"lanes": [
diff --git a/archify/test/fixtures/issue-126/explicit-route.workflow.json b/archify/test/fixtures/issue-126/explicit-route.workflow.json
index 6d573797..f4c85e5b 100644
--- a/archify/test/fixtures/issue-126/explicit-route.workflow.json
+++ b/archify/test/fixtures/issue-126/explicit-route.workflow.json
@@ -3,6 +3,7 @@
"diagram_type": "workflow",
"meta": {
"title": "Sanitized explicit route",
+ "output": "issue-126-explicit-route.html",
"viewBox": [900, 420],
"legend": { "mode": "hidden" }
},
diff --git a/archify/test/fixtures/issue-126/explicit-viewbox.workflow.json b/archify/test/fixtures/issue-126/explicit-viewbox.workflow.json
index f09740f0..f971da95 100644
--- a/archify/test/fixtures/issue-126/explicit-viewbox.workflow.json
+++ b/archify/test/fixtures/issue-126/explicit-viewbox.workflow.json
@@ -3,6 +3,7 @@
"diagram_type": "workflow",
"meta": {
"title": "Sanitized explicit viewBox",
+ "output": "issue-126-explicit-viewbox.html",
"viewBox": [1600, 520],
"legend": { "mode": "hidden" }
},
diff --git a/archify/test/fixtures/issue-126/labels.workflow.json b/archify/test/fixtures/issue-126/labels.workflow.json
index 0e27edbe..4da3f55b 100644
--- a/archify/test/fixtures/issue-126/labels.workflow.json
+++ b/archify/test/fixtures/issue-126/labels.workflow.json
@@ -3,6 +3,7 @@
"diagram_type": "workflow",
"meta": {
"title": "Sanitized semantic labels",
+ "output": "issue-126-labels.html",
"legend": { "mode": "hidden" }
},
"lanes": [
diff --git a/archify/test/fixtures/v1-workflow-700x400.workflow.json b/archify/test/fixtures/v1-workflow-700x400.workflow.json
index 72212424..90bcfd7f 100644
--- a/archify/test/fixtures/v1-workflow-700x400.workflow.json
+++ b/archify/test/fixtures/v1-workflow-700x400.workflow.json
@@ -3,6 +3,7 @@
"diagram_type": "workflow",
"meta": {
"title": "Legacy narrow workflow",
+ "output": "v1-workflow-700x400.html",
"viewBox": [700, 400]
},
"lanes": [
diff --git a/archify/test/fixtures/workflow-viewport/order-overflow.workflow.json b/archify/test/fixtures/workflow-viewport/order-overflow.workflow.json
index a24e25f4..c05e2a95 100644
--- a/archify/test/fixtures/workflow-viewport/order-overflow.workflow.json
+++ b/archify/test/fixtures/workflow-viewport/order-overflow.workflow.json
@@ -3,6 +3,7 @@
"diagram_type": "workflow",
"meta": {
"title": "订单处理工作流",
+ "output": "order-overflow.html",
"locale": "zh-CN",
"quality_profile": "showcase"
},
diff --git a/archify/test/fixtures/workflow-viewport/order-reflow.workflow.json b/archify/test/fixtures/workflow-viewport/order-reflow.workflow.json
index b59a2ff7..fef683d8 100644
--- a/archify/test/fixtures/workflow-viewport/order-reflow.workflow.json
+++ b/archify/test/fixtures/workflow-viewport/order-reflow.workflow.json
@@ -3,6 +3,7 @@
"diagram_type": "workflow",
"meta": {
"title": "订单处理工作流",
+ "output": "order-reflow.html",
"locale": "zh-CN",
"quality_profile": "showcase"
},
@@ -328,4 +329,4 @@
]
}
]
-}
\ No newline at end of file
+}
diff --git a/archify/test/generate-validators.test.mjs b/archify/test/generate-validators.test.mjs
index 858c1a8f..2d48c4ea 100644
--- a/archify/test/generate-validators.test.mjs
+++ b/archify/test/generate-validators.test.mjs
@@ -20,7 +20,7 @@ function workflowDocument(schemaVersion) {
return {
schema_version: schemaVersion,
diagram_type: 'workflow',
- meta: { title: 'Schema compatibility' },
+ meta: { title: 'Schema compatibility', output: 'schema-compatibility.html' },
lanes: [{ id: 'main', label: 'Main' }],
nodes: [{ id: 'step', lane: 'main', col: 0, type: 'backend', label: 'Step' }],
edges: [],
@@ -92,6 +92,12 @@ test('generated validators share one portable authored output contract', () => {
`${'a'.repeat(251)}.html`,
`${'é'.repeat(128)}.html`,
];
+ const deepOutput = `${Array.from(
+ { length: 10 },
+ (_, index) => `component-${index}-${'a'.repeat(20)}`,
+ ).join('/')}/diagram.html`;
+ assert.ok(deepOutput.length > 255);
+ assert.equal(validatePortableOutputSchema(deepOutput), true);
for (const [type, example] of Object.entries(examples)) {
const document = JSON.parse(fs.readFileSync(path.join(skillRoot, 'examples', example), 'utf8'));
@@ -101,6 +107,12 @@ test('generated validators share one portable authored output contract', () => {
true,
`${type} rejected a portable HTML output: ${JSON.stringify(generatedValidators[type].errors)}`,
);
+ document.meta.output = deepOutput;
+ assert.equal(
+ generatedValidators[type](document),
+ true,
+ `${type} rejected a deep output whose individual components are portable: ${JSON.stringify(generatedValidators[type].errors)}`,
+ );
for (const output of invalidOutputs) {
document.meta.output = output;
diff --git a/archify/test/layout-rules.test.mjs b/archify/test/layout-rules.test.mjs
index 1e20b76d..5dcbac1f 100644
--- a/archify/test/layout-rules.test.mjs
+++ b/archify/test/layout-rules.test.mjs
@@ -39,7 +39,9 @@ function load(mode) {
function render(mode, doc) {
const input = path.join(tmp, `${mode}-${Math.abs(hash(JSON.stringify(doc)))}.json`);
const outPath = path.join(tmp, `${mode}-${Math.abs(hash(JSON.stringify(doc)))}.html`);
- fs.writeFileSync(input, JSON.stringify(doc));
+ const renderDoc = structuredClone(doc);
+ renderDoc.meta = { ...renderDoc.meta, output: `${mode}-layout-rules.html` };
+ fs.writeFileSync(input, JSON.stringify(renderDoc));
try {
execFileSync('node', [
path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`),
diff --git a/archify/test/meta-output-contract.test.mjs b/archify/test/meta-output-contract.test.mjs
index 8e66c44f..2f2b8d6d 100644
--- a/archify/test/meta-output-contract.test.mjs
+++ b/archify/test/meta-output-contract.test.mjs
@@ -39,8 +39,8 @@ function writeDocumentWithoutValidOutput(directory, name, source, output = undef
return target;
}
-function run(args, cwd) {
- return spawnSync(process.execPath, [cli, ...args], { cwd, encoding: 'utf8' });
+function run(args, cwd, { env = process.env } = {}) {
+ return spawnSync(process.execPath, [cli, ...args], { cwd, encoding: 'utf8', env });
}
function jsonOutput(result) {
@@ -102,6 +102,94 @@ test('an explicit CLI output does not hide an invalid durable authored output',
assert.equal(fs.existsSync(override), false);
});
+test('validate rejects an invalid durable output before allocating temporary staging', t => {
+ const directory = workspace(t);
+ const input = writeDocument(
+ directory,
+ 'invalid-before-staging.architecture.json',
+ architectureExample,
+ 'reports\\diagram.html',
+ );
+ const unavailableTemp = path.join(directory, 'missing-temporary-root');
+ const result = run(['validate', 'architecture', input, '--json'], directory, {
+ env: {
+ ...process.env,
+ TMPDIR: unavailableTemp,
+ TMP: unavailableTemp,
+ TEMP: unavailableTemp,
+ },
+ });
+
+ assert.equal(result.status, 1, result.stderr || result.stdout);
+ const failure = jsonOutput(result);
+ assert.equal(failure.diagnostics[0].code, 'output/meta-path-syntax');
+ assert.equal(failure.diagnostics[0].subject.path, '/meta/output');
+ assert.equal(fs.existsSync(unavailableTemp), false);
+});
+
+for (const boundary of [
+ {
+ label: 'escapes through a directory symlink',
+ output: 'reports/diagram.html',
+ expected: /meta\.output must stay inside the current working directory/i,
+ prepare(directory, outside) {
+ fs.symlinkSync(outside, path.join(directory, 'reports'), 'dir');
+ },
+ },
+ {
+ label: 'resolves through a file symlink to a non-HTML target',
+ output: 'diagram.html',
+ expected: /meta\.output must resolve to an? \.html file/i,
+ prepare(directory) {
+ fs.writeFileSync(path.join(directory, 'diagram.json'), 'trusted target\n');
+ fs.symlinkSync(path.join(directory, 'diagram.json'), path.join(directory, 'diagram.html'), 'file');
+ },
+ },
+]) {
+ test(`every command rejects durable meta.output that ${boundary.label}, even with a CLI target`, t => {
+ const directory = workspace(t);
+ const outside = path.join(directory, '..', `${path.basename(directory)}-outside`);
+ fs.mkdirSync(outside);
+ t.after(() => fs.rmSync(outside, { recursive: true, force: true }));
+ boundary.prepare(directory, outside);
+ const architecture = writeDocument(
+ directory,
+ 'invalid.architecture.json',
+ architectureExample,
+ boundary.output,
+ );
+ const peer = writeDocument(
+ directory,
+ 'peer.architecture.json',
+ architectureExample,
+ 'peer.html',
+ );
+ const workflow = writeDocument(
+ directory,
+ 'invalid.workflow.json',
+ workflowFixture,
+ boundary.output,
+ );
+ const explicitDirectory = path.join(directory, 'explicit');
+ const commands = [
+ ['validate', ['validate', 'architecture', architecture, '--json']],
+ ['render', ['render', 'architecture', architecture, path.join(explicitDirectory, 'render.html')]],
+ ['deliver', ['deliver', 'architecture', architecture, path.join(explicitDirectory, 'deliver.html'), '--json']],
+ ['preview', ['preview', 'architecture', architecture, path.join(explicitDirectory, 'preview.html'), '--no-open']],
+ ['compare', ['compare', 'architecture', architecture, peer, path.join(explicitDirectory, 'compare.html'), '--json']],
+ ['migrate', ['migrate', 'workflow', workflow, path.join(explicitDirectory, 'migrated.workflow.json'), '--to-schema', '2', '--json']],
+ ];
+
+ for (const [command, args] of commands) {
+ const result = run(args, directory);
+ assert.equal(result.status, 1, `${command}: ${result.stderr || result.stdout}`);
+ assert.match(`${result.stdout}\n${result.stderr}`, boundary.expected, command);
+ assert.equal(fs.existsSync(explicitDirectory), false, `${command} created its CLI target directory`);
+ }
+ assert.equal(fs.existsSync(path.join(outside, 'diagram.html')), false);
+ });
+}
+
for (const [label, output] of [['missing', undefined], ['non-string', 42]]) {
test(`all artifact commands reject ${label} durable meta.output before creating outputs`, t => {
const directory = workspace(t);
@@ -177,7 +265,10 @@ for (const [label, output] of [['missing', undefined], ['non-string', 42]]) {
'migrate', 'workflow', source, destination, '--to-schema', '2', '--json',
], directory);
assert.equal(result.status, 1, result.stderr || result.stdout);
- assert.equal(jsonOutput(result).diagnostics[0].code, 'output/meta-path-syntax');
+ assert.equal(
+ jsonOutput(result).diagnostics[0].code,
+ label === 'missing' ? 'schema/required' : 'output/meta-path-syntax',
+ );
assert.equal(fs.existsSync(destinationDirectory), false, 'migration created its destination directory');
});
}
diff --git a/archify/test/native-output-path.test.mjs b/archify/test/native-output-path.test.mjs
index 3f3ceea5..91460649 100644
--- a/archify/test/native-output-path.test.mjs
+++ b/archify/test/native-output-path.test.mjs
@@ -1,5 +1,6 @@
import test from 'node:test';
import assert from 'node:assert/strict';
+import fs from 'node:fs';
import path from 'node:path';
import {
@@ -19,9 +20,11 @@ test('Windows CLI outputs retain native absolute, UNC, extended, and relative fo
for (const value of [
String.raw`C:\reports\diagram.html`,
String.raw`\\server\share\reports\diagram.html`,
+ String.raw`\\server\CON\reports\diagram.html`,
'//server/share/reports/diagram.html',
String.raw`\\?\C:\reports\diagram.html`,
String.raw`\\?\UNC\server\share\reports\diagram.html`,
+ String.raw`\\?\UNC\server\CON\reports\diagram.html`,
String.raw`reports\diagram.html`,
String.raw`..\diagram.html`,
String.raw`.\reports\..\diagram.html`,
@@ -54,11 +57,72 @@ test('Windows CLI outputs reject ambiguous or special namespace forms', () => {
String.raw`C:\reports\bad?.html`,
String.raw`\\localhost\pipe\diagram.html`,
String.raw`\\server\mailslot\diagram.html`,
+ String.raw`\\server\IPC$\diagram.html`,
String.raw`\\?\UNC\localhost\pipe\diagram.html`,
String.raw`\\?\UNC\server\MAILSLOT\diagram.html`,
+ String.raw`\\?\UNC\server\ipc$\diagram.html`,
]) nativeFailure(value, { platform: 'win32' });
});
+test('Windows UNC share names use SMB share syntax rather than DOS file-device rules', () => {
+ for (const value of [
+ String.raw`\\server\CON\diagram.html`,
+ String.raw`\\CON\share\diagram.html`,
+ String.raw`\\?\UNC\server\CON\diagram.html`,
+ String.raw`\\?\UNC\CON\share\diagram.html`,
+ ]) {
+ assert.equal(validateNativeOutputPath(value, { platform: 'win32' }), value);
+ }
+
+ for (const value of [
+ String.raw`\\server\bad+share\diagram.html`,
+ String.raw`\\server\trailing.\diagram.html`,
+ `\\\\server\\${'x'.repeat(81)}\\diagram.html`,
+ String.raw`\\?\UNC\server\bad,share\diagram.html`,
+ String.raw`\\?\UNC\server\trailing \diagram.html`,
+ ]) {
+ assert.throws(
+ () => validateNativeOutputPath(value, { platform: 'win32' }),
+ (error) => error?.archifyDiagnostics?.[0]?.evidence?.reason === 'windows-unc-share-name',
+ value,
+ );
+ }
+});
+
+test('Windows IPC shares fail before output resolution touches the filesystem', (t) => {
+ let realpathCalls = 0;
+ let lstatCalls = 0;
+ t.mock.method(fs.realpathSync, 'native', () => {
+ realpathCalls += 1;
+ throw new Error('unexpected realpath');
+ });
+ t.mock.method(fs, 'lstatSync', () => {
+ lstatCalls += 1;
+ throw new Error('unexpected lstat');
+ });
+
+ for (const requestedOutput of [
+ String.raw`\\server\IPC$\diagram.html`,
+ String.raw`\\server\pipe\diagram.html`,
+ String.raw`\\server\mailslot\diagram.html`,
+ String.raw`\\?\UNC\server\IPC$\diagram.html`,
+ String.raw`\\?\UNC\server\pipe\diagram.html`,
+ String.raw`\\?\UNC\server\mailslot\diagram.html`,
+ ]) {
+ assert.throws(
+ () => resolveOutputPath({
+ requestedOutput,
+ defaultOutput: 'diagram.html',
+ platform: 'win32',
+ }),
+ (error) => error?.archifyDiagnostics?.[0]?.evidence?.reason === 'windows-ipc-namespace',
+ requestedOutput,
+ );
+ }
+ assert.equal(realpathCalls, 0);
+ assert.equal(lstatCalls, 0);
+});
+
test('Windows native output directories validate raw spelling before resolution', () => {
const cwd = String.raw`C:\workspace\project`;
const invalid = [
diff --git a/archify/test/output-path.test.mjs b/archify/test/output-path.test.mjs
index 6418fd1c..31478fd1 100644
--- a/archify/test/output-path.test.mjs
+++ b/archify/test/output-path.test.mjs
@@ -616,7 +616,7 @@ for (const slot of ['artifact', 'receipt']) {
}
for (const slot of ['artifact', 'receipt']) {
- test(`compare rejects a same-inode ${slot} candidate byte mutation before publish and restores the old pair`, () => {
+ test(`compare rejects and preserves a same-inode ${slot} candidate byte mutation before publish`, () => {
const cwd = fs.mkdtempSync(path.join(os.tmpdir(), `archify-output-compare-candidate-bytes-${slot}-`));
const output = path.join(cwd, 'delta.html');
const receiptPath = path.join(cwd, 'delta.receipt.json');
@@ -665,7 +665,11 @@ for (const slot of ['artifact', 'receipt']) {
);
assert.equal(fs.readFileSync(output, 'utf8'), outputBytes);
assert.equal(fs.readFileSync(receiptPath, 'utf8'), receiptBytes);
- assert.equal(fs.readdirSync(cwd).some((name) => name.startsWith('.archify-compare-')), false);
+ const recoveryDirectories = fs.readdirSync(cwd)
+ .filter((name) => name.startsWith('.archify-compare-'));
+ assert.equal(recoveryDirectories.length, 1);
+ const preservedCandidate = path.join(cwd, recoveryDirectories[0], candidateName);
+ assert.match(fs.readFileSync(preservedCandidate, 'utf8'), /externally mutated candidate bytes/);
});
}
@@ -735,7 +739,7 @@ test('compare preserves a same-inode edit to the first published member when the
});
for (const slot of ['artifact', 'receipt']) {
- test(`compare rejects a same-inode ${slot} candidate mode mutation before publish`, { skip: process.platform === 'win32' }, () => {
+ test(`compare rejects and preserves a same-inode ${slot} candidate mode mutation before publish`, { skip: process.platform === 'win32' }, () => {
const cwd = fs.mkdtempSync(path.join(os.tmpdir(), `archify-output-compare-candidate-mode-${slot}-`));
const output = path.join(cwd, 'delta.html');
const receiptPath = path.join(cwd, 'delta.receipt.json');
@@ -788,7 +792,11 @@ for (const slot of ['artifact', 'receipt']) {
assert.equal(fs.readFileSync(receiptPath, 'utf8'), receiptBytes);
assert.equal(fs.statSync(output).mode & 0o777, 0o640);
assert.equal(fs.statSync(receiptPath).mode & 0o777, 0o640);
- assert.equal(fs.readdirSync(cwd).some((name) => name.startsWith('.archify-compare-')), false);
+ const recoveryDirectories = fs.readdirSync(cwd)
+ .filter((name) => name.startsWith('.archify-compare-'));
+ assert.equal(recoveryDirectories.length, 1);
+ const preservedCandidate = path.join(cwd, recoveryDirectories[0], candidateName);
+ assert.equal(fs.statSync(preservedCandidate).mode & 0o777, 0o600);
});
}
@@ -812,7 +820,8 @@ for (const slot of ['artifact', 'receipt']) {
fs.unlinkSync = function(file, ...args) {
if (!rejected
&& path.basename(String(file)) === ${JSON.stringify(candidateName)}
- && path.basename(path.dirname(String(file))).startsWith('.archify-compare-')) {
+ && path.basename(path.dirname(String(file))).startsWith('.archify-remove-')
+ && path.basename(path.dirname(path.dirname(String(file)))).startsWith('.archify-compare-')) {
rejected = true;
const error = new Error('injected candidate unlink failure');
error.code = 'EACCES';
@@ -831,11 +840,24 @@ for (const slot of ['artifact', 'receipt']) {
assert.equal(result.status, 1, result.stdout + result.stderr);
const failure = JSON.parse(result.stdout);
assert.equal(failure.stage, 'commit');
- assert.equal(failure.diagnostics[0].code, 'delta/commit-failed');
- assert.match(failure.diagnostics[0].evidence.reason, /injected candidate unlink failure/);
+ assert.equal(failure.diagnostics[0].code, 'output/target-indeterminate');
+ assert.match(
+ failure.diagnostics[0].evidence.reason,
+ /target identity could not be verified safely/,
+ );
assert.equal(fs.readFileSync(output, 'utf8'), outputBytes);
assert.equal(fs.readFileSync(receiptPath, 'utf8'), receiptBytes);
- assert.equal(fs.readdirSync(cwd).some((name) => name.startsWith('.archify-compare-')), false);
+ const [recoveryDirectory] = fs.readdirSync(cwd)
+ .filter((name) => name.startsWith('.archify-compare-'));
+ assert.ok(recoveryDirectory);
+ const recoveryRoot = path.join(cwd, recoveryDirectory);
+ const [quarantineDirectory] = fs.readdirSync(recoveryRoot)
+ .filter((name) => name.startsWith('.archify-remove-'));
+ assert.ok(quarantineDirectory);
+ assert.equal(
+ fs.statSync(path.join(recoveryRoot, quarantineDirectory, candidateName)).isFile(),
+ true,
+ );
});
}
diff --git a/archify/test/path-boundary-contract.test.mjs b/archify/test/path-boundary-contract.test.mjs
index f3be24fb..819aaed6 100644
--- a/archify/test/path-boundary-contract.test.mjs
+++ b/archify/test/path-boundary-contract.test.mjs
@@ -32,7 +32,7 @@ const protectedCallers = productionSourceRoots.flatMap(productionSources).sort()
const exemption = /path-contract-allow:\s*(?:git-path|portable-logical-path|url-path|lexical-capability)\s+--\s+\S/u;
const exemptionMarker = /path-contract-allow:/u;
-const pathIdentifier = String.raw`(?:[$A-Z_a-z][$\w]*(?:Path|Root|Directory|Dir|File|Canonical|Location)|path|root|directory|dir|file|output|input|target|destination|artifact|receipt|relative|resolved|canonical)`;
+const pathIdentifier = String.raw`(?:[$A-Z_a-z][$\w]*(?:Path|Root|Directory|Dir|File|Canonical|Location|Resolved)|path|root|directory|dir|file|output|input|target|destination|artifact|receipt|candidate|relative|resolved|canonical)`;
const pathProperty = String.raw`(?:[$A-Z_a-z][$\w.]*\.(?:path|realPath|canonicalPath|root|directory|dir|file|output|input|target|source|destination|artifact|receipt))`;
const pathOperand = String.raw`(?:${pathIdentifier}|${pathProperty})`;
const rawPathEquality = new RegExp(String.raw`\b${pathOperand}\s*(?:===|!==)\s*${pathOperand}\b`, 'u');
@@ -133,6 +133,26 @@ test('path-boundary detector rejects multiline equality and canonical-path prope
]);
});
+test('path-boundary detector rejects native-path equality through resolved aliases', () => {
+ const violations = inspectPathBoundarySource(
+ 'if (leftResolved === rightResolved) fail();',
+ );
+
+ assert.deepEqual(violations.map(({ rule }) => rule), [
+ 'native-path-raw-equality',
+ ]);
+});
+
+test('path-boundary detector rejects prefix containment through a candidate alias', () => {
+ const violations = inspectPathBoundarySource(
+ 'if (candidate.startsWith(root)) accept();',
+ );
+
+ assert.deepEqual(violations.map(({ rule }) => rule), [
+ 'native-path-string-prefix-containment',
+ ]);
+});
+
test('path-boundary detector permits explicit logical-path and lexical-capability exemptions', () => {
const violations = inspectPathBoundarySource([
'// path-contract-allow: git-path -- Git tree entries use repository-relative POSIX syntax.',
diff --git a/archify/test/path-semantics.test.mjs b/archify/test/path-semantics.test.mjs
index 2154e7a0..3876c04a 100644
--- a/archify/test/path-semantics.test.mjs
+++ b/archify/test/path-semantics.test.mjs
@@ -34,6 +34,7 @@ function mockWindowsFilesystem(t, {
t.after(() => Object.defineProperty(process, 'platform', platform));
const realpathCalls = [];
+ const lstatCalls = [];
const identities = new Map();
let nextIdentity = 1n;
const canonicalPath = (targetPath) => {
@@ -77,6 +78,7 @@ function mockWindowsFilesystem(t, {
});
t.mock.method(fs, 'statSync', statFor);
t.mock.method(fs, 'lstatSync', (targetPath) => {
+ lstatCalls.push(String(targetPath));
if (entriesExist) {
const stat = statFor(targetPath);
const key = canonicalPath(targetPath).toLocaleLowerCase('en-US');
@@ -98,7 +100,7 @@ function mockWindowsFilesystem(t, {
error.code = 'EINVAL';
throw error;
});
- return { realpathCalls };
+ return { lstatCalls, realpathCalls };
}
test('Windows drive and share roots reach native resolution as complete filesystem roots', (t) => {
@@ -109,6 +111,14 @@ test('Windows drive and share roots reach native resolution as complete filesyst
const extendedDrive = String.raw`\\?\C:\reports\diagram.html`;
expectResult(sameLocation(ordinaryUnc, extendedUnc), 'match');
+ expectResult(
+ sameLocation(String.raw`\\server\CON\reports`, String.raw`\\?\UNC\server\CON\reports`),
+ 'match',
+ );
+ expectResult(
+ sameLocation(String.raw`\\CON\share\reports`, String.raw`\\?\UNC\CON\share\reports`),
+ 'match',
+ );
expectResult(
sameLocation(String.raw`\\server\share`, String.raw`\\?\UNC\server\share`),
'match',
@@ -122,13 +132,21 @@ test('Windows drive and share roots reach native resolution as complete filesyst
});
test('Windows device and malformed extended namespaces fail closed before filesystem access', (t) => {
- const { realpathCalls } = mockWindowsFilesystem(t);
+ const { lstatCalls, realpathCalls } = mockWindowsFilesystem(t);
for (const [targetPath, reason] of [
[String.raw`\\.\NUL`, 'windows-namespace-unsupported'],
['//./NUL', 'windows-namespace-unsupported'],
[String.raw`\\?\GLOBALROOT\Device\HarddiskVolume1\diagram.html`, 'windows-namespace-unsupported'],
['//?/GLOBALROOT/Device/HarddiskVolume1/diagram.html', 'windows-namespace-unsupported'],
[String.raw`\\?\Volume{01234567-89AB-CDEF-0123-456789ABCDEF}\diagram.html`, 'windows-namespace-unsupported'],
+ [String.raw`\\server\IPC$\diagram.html`, 'windows-namespace-unsupported'],
+ [String.raw`\\server\pipe\diagram.html`, 'windows-namespace-unsupported'],
+ [String.raw`\\server\mailslot\diagram.html`, 'windows-namespace-unsupported'],
+ [String.raw`\\?\UNC\server\IPC$\diagram.html`, 'windows-namespace-unsupported'],
+ [String.raw`\\?\UNC\server\pipe\diagram.html`, 'windows-namespace-unsupported'],
+ [String.raw`\\?\UNC\server\mailslot\diagram.html`, 'windows-namespace-unsupported'],
+ [String.raw`\\server\bad+share\diagram.html`, 'windows-root-invalid'],
+ [String.raw`\\?\UNC\server\trailing.\diagram.html`, 'windows-root-invalid'],
[String.raw`\\?\UNC\server`, 'windows-root-invalid'],
[String.raw`\\?\other\diagram.html`, 'windows-root-invalid'],
[String.raw`\\server`, 'windows-root-invalid'],
@@ -140,6 +158,7 @@ test('Windows device and malformed extended namespaces fail closed before filesy
assert.equal(comparison.reason.code, reason);
}
assert.deepEqual(realpathCalls, []);
+ assert.deepEqual(lstatCalls, []);
});
test('Windows extended dot segments fail closed before filesystem access', (t) => {
diff --git a/archify/test/preview.test.mjs b/archify/test/preview.test.mjs
index e92d48a8..a5d281ec 100644
--- a/archify/test/preview.test.mjs
+++ b/archify/test/preview.test.mjs
@@ -47,6 +47,30 @@ function windowsShortPath(targetPath) {
return shortPath;
}
+function assignWindowsShortName(targetPath, shortName) {
+ const result = spawnSync(
+ 'fsutil.exe',
+ ['file', 'setshortname', targetPath, shortName],
+ { encoding: 'utf8', windowsHide: true },
+ );
+ if (result.error) {
+ throw new Error(`Could not assign Windows 8.3 name ${shortName}: ${result.error.message}`);
+ }
+ if (result.status !== 0) {
+ const detail = result.stderr.trim() || result.stdout.trim() || 'no command output';
+ throw new Error(`Could not assign Windows 8.3 name ${shortName} (exit ${result.status}): ${detail}`);
+ }
+ const alias = path.join(path.dirname(targetPath), shortName);
+ const aliasStat = fs.statSync(alias, { bigint: true });
+ const targetStat = fs.statSync(targetPath, { bigint: true });
+ assert.deepEqual(
+ [aliasStat.dev, aliasStat.ino],
+ [targetStat.dev, targetStat.ino],
+ 'the explicitly assigned 8.3 name must resolve to the requested entry',
+ );
+ return alias;
+}
+
function controlledWindowsShortRoot(required) {
const root = process.env.ARCHIFY_WINDOWS_8DOT3_ROOT;
const shortRoot = process.env.ARCHIFY_WINDOWS_8DOT3_SHORT_ROOT;
@@ -599,6 +623,77 @@ test('preview: replacing the staged commit candidate preserves the claimant', {
}
});
+test('preview: a candidate swapped at publication cannot replace the last good artifact', { timeout: 10000 }, async (t) => {
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-preview-publication-binding-'));
+ t.after(() => fs.rmSync(tmp, { recursive: true, force: true }));
+ const input = path.join(tmp, 'diagram.json');
+ const output = path.join(tmp, 'diagram.html');
+ const deliveryCli = path.join(tmp, 'delivery.mjs');
+ const marker = path.join(tmp, 'delivery-started');
+ const detachedCandidate = path.join(tmp, 'detached-preview-publication-candidate.html');
+ const previous = '<!doctype html><title>previous preview artifact</title>\n';
+ const claimant = '<!doctype html><title>preview publication claimant</title>\n';
+ fs.writeFileSync(input, '{}');
+ fs.writeFileSync(output, previous);
+ writeDelayedDeliveryCli(deliveryCli, marker, 'Bound preview candidate');
+
+ const openSync = fs.openSync.bind(fs);
+ const closeSync = fs.closeSync.bind(fs);
+ const linkSync = fs.linkSync.bind(fs);
+ const writeFileSync = fs.writeFileSync.bind(fs);
+ let candidatePath;
+ let candidateDescriptor;
+ let injected = false;
+ const inject = () => {
+ injected = true;
+ fs.renameSync(candidatePath, detachedCandidate);
+ writeFileSync(candidatePath, claimant, { flag: 'wx' });
+ };
+ t.mock.method(fs, 'openSync', (file, flags, ...args) => {
+ const descriptor = openSync(file, flags, ...args);
+ const resolved = path.resolve(String(file));
+ if (path.basename(resolved).startsWith('.archify-preview-commit-')
+ && (flags & (fs.constants.O_WRONLY | fs.constants.O_RDWR)) === 0) {
+ candidatePath = resolved;
+ candidateDescriptor = descriptor;
+ }
+ return descriptor;
+ });
+ t.mock.method(fs, 'closeSync', (descriptor) => {
+ const result = closeSync(descriptor);
+ if (!injected && descriptor === candidateDescriptor && fs.existsSync(candidatePath)) inject();
+ return result;
+ });
+ t.mock.method(fs, 'linkSync', (source, target) => {
+ if (!injected
+ && candidatePath
+ && path.resolve(String(source)) === candidatePath
+ && path.basename(String(target)) === path.basename(output)) inject();
+ return linkSync(source, target);
+ });
+
+ const preview = await startPreview({
+ type: 'architecture', input, output, open: false, watch: false,
+ pollMs: 60_000, debounceMs: 10, deliveryCli,
+ });
+ try {
+ const state = await waitForState(
+ preview.url,
+ (candidate) => candidate.status === 'needs-fix',
+ 'publication-boundary replacement did not fail preview',
+ );
+ assert.equal(state.failure.stage, 'commit');
+ assert.equal(state.failure.code, 'output/target-changed');
+ assert.equal(state.failure.evidence.relation.code, 'candidate-identity-changed');
+ assert.equal(injected, true);
+ assert.equal(fs.readFileSync(output, 'utf8'), previous);
+ assert.equal(fs.readFileSync(candidatePath, 'utf8'), claimant);
+ assert.equal(fs.existsSync(detachedCandidate), true);
+ } finally {
+ await preview.stop();
+ }
+});
+
test('preview: replacing the delivered source candidate preserves the claimant', { timeout: 10000 }, async (t) => {
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-preview-source-replacement-'));
t.after(() => fs.rmSync(tmp, { recursive: true, force: true }));
@@ -767,15 +862,16 @@ test('preview: publishing through an existing output symlink preserves the link
}
writeDelayedDeliveryCli(deliveryCli, marker, 'Published through symlink');
const physicalTarget = fs.realpathSync.native(target);
- const renameSync = fs.renameSync;
+ const linkSync = fs.linkSync.bind(fs);
let commits = 0;
- t.mock.method(fs, 'renameSync', (source, destination) => {
- if (path.resolve(destination) === physicalTarget) {
+ t.mock.method(fs, 'linkSync', (source, destination) => {
+ if (path.resolve(destination) === physicalTarget
+ && path.basename(String(source)).startsWith('.archify-preview-commit-')) {
commits += 1;
assert.equal(path.dirname(source), path.dirname(physicalTarget));
assert.match(path.basename(source), /^\.archify-preview-commit-/);
}
- return renameSync(source, destination);
+ return linkSync(source, destination);
});
const preview = await startPreview({
@@ -1348,9 +1444,14 @@ test('preview: Windows 8.3 short path observes edits through the canonical watch
: null;
const realDirectory = path.join(tmp, 'directory name requiring short alias');
fs.mkdirSync(realDirectory);
- const shortDirectory = shortTmp
- ? path.win32.join(shortTmp, path.basename(realDirectory))
- : windowsShortPath(realDirectory);
+ let shortDirectory;
+ if (shortTmp) {
+ const shortName = 'ARCHPR~1';
+ const explicitAlias = assignWindowsShortName(realDirectory, shortName);
+ shortDirectory = path.win32.join(shortTmp, path.basename(explicitAlias));
+ } else {
+ shortDirectory = windowsShortPath(realDirectory);
+ }
if (!shortDirectory) {
t.skip('the Windows volume does not expose a distinct 8.3 short path');
return;
diff --git a/archify/test/release-package-gates.test.mjs b/archify/test/release-package-gates.test.mjs
index 042a604e..4c1d2c3a 100644
--- a/archify/test/release-package-gates.test.mjs
+++ b/archify/test/release-package-gates.test.mjs
@@ -876,6 +876,30 @@ function stagedFixture(files) {
return { fixture, staged };
}
+test('archive writer publishes over a maximum-length output component without an oversized candidate name', () => {
+ const { fixture, staged } = stagedFixture({
+ 'README.md': { content: 'bounded archive candidate\n', mode: 0o644 },
+ });
+ try {
+ const manifest = path.join(fixture, 'modes.json');
+ fs.writeFileSync(manifest, JSON.stringify({ 'README.md': '100644' }));
+ const archive = path.join(fixture, `${'a'.repeat(251)}.zip`);
+ fs.writeFileSync(archive, 'trusted previous archive');
+
+ const build = writeArchive(staged, archive, manifest);
+
+ assert.equal(build.status, 0, `${build.stdout}\n${build.stderr}`);
+ assert.equal(fs.readFileSync(archive).readUInt32LE(0), 0x04034b50);
+ assert.deepEqual(
+ fs.readdirSync(fixture).filter((name) => name.endsWith('.tmp')),
+ [],
+ 'successful publication must not leave a temporary candidate behind',
+ );
+ } finally {
+ fs.rmSync(fixture, { recursive: true, force: true });
+ }
+});
+
test('archive writer records Git index modes from the manifest, not filesystem bits', () => {
const { fixture, staged } = stagedFixture({
'bin/tool.mjs': { content: '#!/usr/bin/env node\n', mode: 0o644 },
@@ -1046,7 +1070,7 @@ test('archive writer rejects a hard-linked output without changing either name',
}
});
-test('archive writer verifies the output binding immediately before rename', () => {
+test('archive writer verifies the output binding immediately before publication', () => {
const { fixture, staged } = stagedFixture({
'safe.txt': { content: 'safe\n', mode: 0o644 },
});
@@ -1071,8 +1095,7 @@ let swapped = false;
fs.openSync = function patchedOpen(file, ...args) {
const descriptor = originalOpen.call(this, file, ...args);
if (typeof file === 'string'
- && path.basename(file).startsWith('.' + path.basename(output) + '.')
- && file.endsWith('.tmp')) {
+ && /^\.archify-zip-[a-f\d]{16}-[a-f\d]{32}\.tmp$/.test(path.basename(file))) {
temporaryDescriptor = descriptor;
}
return descriptor;
@@ -1111,6 +1134,57 @@ require('node:module').syncBuiltinESMExports();
}
});
+test('archive writer preserves a target claimant that arrives after the previous output is backed up', () => {
+ const { fixture, staged } = stagedFixture({
+ 'safe.txt': { content: 'safe\n', mode: 0o644 },
+ });
+ const manifest = path.join(fixture, 'modes.json');
+ const archive = path.join(fixture, 'archive.zip');
+ const preload = path.join(fixture, 'claim-archive-target.cjs');
+ const original = Buffer.from('previous archive\n');
+ const claimant = Buffer.from('concurrent archive claimant\n');
+ fs.writeFileSync(manifest, JSON.stringify({ 'safe.txt': '100644' }));
+ fs.writeFileSync(archive, original);
+ fs.writeFileSync(preload, String.raw`
+const fs = require('node:fs');
+const path = require('node:path');
+const output = process.env.ARCHIFY_TEST_ARCHIVE_OUTPUT;
+const claimant = process.env.ARCHIFY_TEST_ARCHIVE_CLAIMANT;
+const originalLink = fs.linkSync;
+const originalWriteFile = fs.writeFileSync;
+let injected = false;
+fs.linkSync = function patchedLink(source, destination) {
+ if (!injected
+ && path.basename(destination) === path.basename(output)
+ && /^\.archify-zip-[a-f\d]{16}-[a-f\d]{32}\.tmp$/.test(path.basename(source))) {
+ originalWriteFile(output, claimant, { flag: 'wx' });
+ injected = true;
+ }
+ return originalLink.call(this, source, destination);
+};
+require('node:module').syncBuiltinESMExports();
+`);
+ try {
+ const build = writeArchive(staged, archive, manifest, {
+ env: {
+ ...process.env,
+ NODE_OPTIONS: `${process.env.NODE_OPTIONS ? `${process.env.NODE_OPTIONS} ` : ''}--import=${pathToFileURL(preload).href}`,
+ ARCHIFY_TEST_ARCHIVE_OUTPUT: archive,
+ ARCHIFY_TEST_ARCHIVE_CLAIMANT: claimant.toString('utf8'),
+ },
+ });
+ assert.notEqual(build.status, 0, `${build.stdout}\n${build.stderr}`);
+ assert.match(build.stderr, /requires recovery/);
+ assert.ok(fs.readFileSync(archive).equals(claimant), 'the concurrent target claimant must remain public');
+ const backups = fs.readdirSync(fixture)
+ .filter((name) => /^\.archify-zip-backup-[a-f\d]{16}-[a-f\d]{32}\.tmp$/.test(name));
+ assert.equal(backups.length, 1, 'the displaced previous output must remain recoverable');
+ assert.ok(fs.readFileSync(path.join(fixture, backups[0])).equals(original));
+ } finally {
+ fs.rmSync(fixture, { recursive: true, force: true });
+ }
+});
+
test('archive writer rejects a candidate changed while the final output state is checked', () => {
const { fixture, staged } = stagedFixture({
'safe.txt': { content: 'safe\n', mode: 0o644 },
@@ -1134,8 +1208,7 @@ let mutated = false;
fs.openSync = function patchedOpen(file, ...args) {
const descriptor = originalOpen.call(this, file, ...args);
if (typeof file === 'string'
- && path.basename(file).startsWith('.' + path.basename(output) + '.')
- && file.endsWith('.tmp')) {
+ && /^\.archify-zip-[a-f\d]{16}-[a-f\d]{32}\.tmp$/.test(path.basename(file))) {
candidatePath = file;
candidateOpens += 1;
}
@@ -1201,8 +1274,7 @@ let swapped = false;
fs.openSync = function patchedOpen(file, ...args) {
const descriptor = originalOpen.call(this, file, ...args);
if (typeof file === 'string'
- && path.basename(file).startsWith('.' + path.basename(output) + '.')
- && file.endsWith('.tmp')) {
+ && /^\.archify-zip-[a-f\d]{16}-[a-f\d]{32}\.tmp$/.test(path.basename(file))) {
candidatePath = file;
candidateOpens += 1;
}
@@ -1238,6 +1310,70 @@ require('node:module').syncBuiltinESMExports();
}
});
+test('archive writer keeps the candidate identity bound through commit and preserves a release-time successor', () => {
+ const { fixture, staged } = stagedFixture({
+ 'safe.txt': { content: 'safe\n', mode: 0o644 },
+ });
+ const manifest = path.join(fixture, 'modes.json');
+ const archive = path.join(fixture, 'archive.zip');
+ const preload = path.join(fixture, 'replace-candidate-on-release.cjs');
+ const successor = Buffer.from('release-time candidate claimant\n');
+ fs.writeFileSync(manifest, JSON.stringify({ 'safe.txt': '100644' }));
+ fs.writeFileSync(archive, 'previous archive\n');
+ fs.writeFileSync(preload, String.raw`
+const fs = require('node:fs');
+const path = require('node:path');
+const successor = process.env.ARCHIFY_TEST_ARCHIVE_SUCCESSOR;
+const originalOpen = fs.openSync;
+const originalClose = fs.closeSync;
+const originalUnlink = fs.unlinkSync;
+const originalWriteFile = fs.writeFileSync;
+let candidatePath;
+let candidateOpens = 0;
+let bindingDescriptor;
+let swapped = false;
+fs.openSync = function patchedOpen(file, ...args) {
+ const descriptor = originalOpen.call(this, file, ...args);
+ if (typeof file === 'string'
+ && /^\.archify-zip-[a-f\d]{16}-[a-f\d]{32}\.tmp$/.test(path.basename(file))) {
+ candidatePath = file;
+ candidateOpens += 1;
+ if (candidateOpens === 2) bindingDescriptor = descriptor;
+ }
+ return descriptor;
+};
+fs.closeSync = function patchedClose(descriptor) {
+ const result = originalClose.call(this, descriptor);
+ if (!swapped && descriptor === bindingDescriptor) {
+ swapped = true;
+ try { originalUnlink(candidatePath); } catch (error) {
+ if (error.code !== 'ENOENT') throw error;
+ }
+ originalWriteFile(candidatePath, successor, { flag: 'wx' });
+ }
+ return result;
+};
+require('node:module').syncBuiltinESMExports();
+`);
+ try {
+ const build = writeArchive(staged, archive, manifest, {
+ env: {
+ ...process.env,
+ NODE_OPTIONS: `${process.env.NODE_OPTIONS ? `${process.env.NODE_OPTIONS} ` : ''}--import=${pathToFileURL(preload).href}`,
+ ARCHIFY_TEST_ARCHIVE_SUCCESSOR: successor.toString('utf8'),
+ },
+ });
+ assert.equal(build.status, 0, `${build.stdout}\n${build.stderr}`);
+ assert.equal(fs.readFileSync(archive).readUInt32LE(0), 0x04034b50);
+ const candidates = fs.readdirSync(fixture)
+ .filter((name) => /^\.archify-zip-[a-f\d]{16}-[a-f\d]{32}\.tmp$/.test(name));
+ assert.equal(candidates.length, 1, 'the release-time successor must remain named');
+ assert.ok(fs.readFileSync(path.join(fixture, candidates[0])).equals(successor));
+ } finally {
+ fs.rmSync(fixture, { recursive: true, force: true });
+ }
+});
+
test('archive writer preserves an existing regular output mode despite a restrictive umask', {
skip: process.platform === 'win32' ? 'Windows does not expose POSIX creation modes' : false,
}, () => {
@@ -1403,24 +1539,59 @@ test('CI and tagged releases share the maintained Windows path contract on Node
assert.match(runner, /repository root through drive-letter case alias/);
assert.match(runner, /stageCleanSkill\(\{ repoRoot: driveCaseRepoRoot/);
assert.match(runner, /checkForUpdate\(\{/);
- assert.match(runner, /delivery beyond traditional MAX_PATH/);
+ assert.match(runner, /let ordinaryLongDirectory = uncRoot/);
+ assert.match(runner, /ordinary UNC delivery beyond traditional MAX_PATH/);
+ assert.match(runner, /let extendedLongDirectory = extendedUncRoot/);
+ assert.match(runner, /extended UNC delivery beyond traditional MAX_PATH/);
+ assert.match(runner, /case-sensitive upper artifact visual-check to shared UNC/);
+ assert.match(runner, /case-sensitive lower artifact visual-check to shared UNC/);
+ assert.match(runner, /case-variant artifacts must receive distinct evidence names/);
+ assert.match(runner, /normalization-sensitive render \(NFC\)/);
+ assert.match(runner, /normalization-sensitive render \(NFD\)/);
+ assert.match(runner, /normalization-sensitive NFC artifact visual-check to shared UNC/);
+ assert.match(runner, /normalization-sensitive NFD artifact visual-check to shared UNC/);
+ assert.match(runner, /normalization-distinct artifacts must receive distinct evidence names/);
assert.match(runner, /build-zip[.]sh/);
const previewSuite = fs.readFileSync(path.join(repoRoot, 'archify', 'test', 'preview.test.mjs'), 'utf8');
assert.match(previewSuite, /process\.env\.ARCHIFY_REQUIRE_WINDOWS_8DOT3 === '1'/);
assert.match(previewSuite, /process\.env\.ARCHIFY_WINDOWS_8DOT3_ROOT/);
assert.match(previewSuite, /process\.env\.ARCHIFY_WINDOWS_8DOT3_SHORT_ROOT/);
+ assert.match(previewSuite, /assignWindowsShortName\(realDirectory, shortName\)/);
const deliverySuite = fs.readFileSync(
path.join(repoRoot, 'archify', 'test', 'delivery-sidecar-path.test.mjs'),
'utf8',
);
assert.match(deliverySuite, /process\.env\.ARCHIFY_WINDOWS_8DOT3_ROOT/);
assert.match(deliverySuite, /process\.env\.ARCHIFY_WINDOWS_8DOT3_SHORT_ROOT/);
+ assert.match(deliverySuite, /assignWindowsShortName\(output, 'ARCHDL~1[.]HTM'\)/);
+ const visualSidecarSuite = fs.readFileSync(
+ path.join(repoRoot, 'archify', 'test', 'sidecar-path-length.test.mjs'),
+ 'utf8',
+ );
+ assert.match(visualSidecarSuite, /assignWindowsShortName\(artifact, 'ARCHVS~1[.]HTM'\)/);
const workflows = [
['CI', fs.readFileSync(path.join(repoRoot, '.github', 'workflows', 'ci.yml'), 'utf8')],
['release', fs.readFileSync(path.join(repoRoot, '.github', 'workflows', 'release.yml'), 'utf8')],
];
+ const fixtureScript = fs.readFileSync(
+ path.join(repoRoot, 'scripts', 'windows-path-fixtures.ps1'),
+ 'utf8',
+ );
+ assert.match(fixtureScript, /node\$NodeVersion/);
+ assert.match(fixtureScript, /fsutil[.]exe file setCaseSensitiveInfo/);
+ assert.match(fixtureScript, /New-SmbShare[^\n]*-Temporary[^\n]*-ChangeAccess \$identity/);
+ assert.match(fixtureScript, /\\\\localhost\\\$shareName/);
+ assert.match(fixtureScript, /\\\\[?]\\UNC\\localhost\\\$shareName/);
+ assert.match(fixtureScript, /ARCHIFY_WINDOWS_CASE_SENSITIVE_ROOT/);
+ assert.match(fixtureScript, /ARCHIFY_WINDOWS_UNC_ROOT/);
+ assert.match(fixtureScript, /ARCHIFY_WINDOWS_EXTENDED_UNC_ROOT/);
+ assert.match(fixtureScript, /fsutil[.]exe file setshortname/);
+ assert.doesNotMatch(fixtureScript, /fsutil[.]exe 8dot3name set/);
+ assert.match(fixtureScript, /ARCHIFY_WINDOWS_8DOT3_ROOT/);
+ assert.match(fixtureScript, /ARCHIFY_WINDOWS_8DOT3_SHORT_ROOT/);
+ assert.match(fixtureScript, /Remove-SmbShare/);
for (const [label, workflow] of workflows) {
const job = workflowJob(workflow, 'windows-test-portability');
assert.match(job, /runs-on:\s*windows-latest/);
@@ -1429,26 +1600,22 @@ test('CI and tagged releases share the maintained Windows path contract on Node
assert.match(job, /npm ci --ignore-scripts/);
assert.match(job, /node scripts\/run-windows-path-tests\.mjs/);
assert.match(job, /name: Provision controlled Windows path fixtures\n\s+shell: pwsh/);
- assert.match(job, /node\$\{\{ matrix\.node-version \}\}/);
- assert.match(job, /fsutil[.]exe file setCaseSensitiveInfo/);
- assert.match(job, /New-SmbShare[^\n]*-Temporary[^\n]*-ChangeAccess \$identity/);
- assert.match(job, /\\\\localhost\\/);
- assert.match(job, /\\\\[?]\\UNC\\localhost\\/);
- assert.match(job, /ARCHIFY_WINDOWS_CASE_SENSITIVE_ROOT/);
- assert.match(job, /ARCHIFY_WINDOWS_UNC_ROOT/);
- assert.match(job, /ARCHIFY_WINDOWS_EXTENDED_UNC_ROOT/);
- assert.match(job, /fsutil[.]exe file setshortname/);
- assert.match(job, /ARCHIFY_WINDOWS_8DOT3_ROOT/);
- assert.match(job, /ARCHIFY_WINDOWS_8DOT3_SHORT_ROOT/);
+ assert.match(
+ job,
+ /scripts\/windows-path-fixtures[.]ps1 -NodeVersion '\$\{\{ matrix[.]node-version \}\}'/,
+ );
assert.match(
job,
/name: Clean up controlled Windows path fixtures\n\s+if: \$\{\{ always\(\) \}\}/,
);
- assert.match(job, /Remove-SmbShare/);
assert.match(
job,
- /ARCHIFY_REQUIRE_WINDOWS_8DOT3:\s*\$\{\{ matrix\.node-version == 22 && '1' \|\| '0' \}\}/,
- `${label} must require real 8.3 watcher coverage on its controlled Node 22 lane`,
+ /scripts\/windows-path-fixtures[.]ps1 -NodeVersion '\$\{\{ matrix[.]node-version \}\}' -Cleanup/,
+ );
+ assert.match(
+ job,
+ /ARCHIFY_REQUIRE_WINDOWS_8DOT3:\s*'1'/,
+ `${label} must require real 8.3 coverage on every maintained Node lane`,
);
assert.match(
job,
diff --git a/archify/test/renderer-atomic-write.test.mjs b/archify/test/renderer-atomic-write.test.mjs
index 87f32848..2becff8a 100644
--- a/archify/test/renderer-atomic-write.test.mjs
+++ b/archify/test/renderer-atomic-write.test.mjs
@@ -11,6 +11,7 @@ import {
captureRegularFileBinding,
quarantineRemoveRegularFileBinding,
releaseRegularFileBinding,
+ removeOwnedRegularFile,
} from '../renderers/shared/atomic-output.mjs';
import { loadDiagram, writeDiagram } from '../renderers/shared/cli.mjs';
@@ -573,6 +574,64 @@ test('a staged candidate replaced after capture preserves the claimant', (t) =>
assert.equal(fs.existsSync(detachedCandidate), true);
});
+test('a candidate swapped at the publication boundary cannot replace the prior artifact', (t) => {
+ const root = workspace(t, 'archify-render-atomic-publication-binding-');
+ const input = path.join(root, 'diagram.workflow.json');
+ const output = path.join(root, 'diagram.html');
+ const detachedCandidate = path.join(root, 'detached-bound-candidate.html');
+ const previous = '<!doctype html><title>trusted previous artifact</title>\n';
+ const claimant = '<!doctype html><title>publication boundary claimant</title>\n';
+ fs.copyFileSync(workflowFixture, input);
+ fs.writeFileSync(output, previous);
+ const loaded = loadWorkflow(input, output);
+
+ const openSync = fs.openSync.bind(fs);
+ const closeSync = fs.closeSync.bind(fs);
+ const linkSync = fs.linkSync.bind(fs);
+ let candidatePath;
+ let candidateDescriptor;
+ let injected = false;
+ const inject = () => {
+ injected = true;
+ fs.renameSync(candidatePath, detachedCandidate);
+ fs.writeFileSync(candidatePath, claimant, { flag: 'wx' });
+ };
+ t.mock.method(fs, 'openSync', (file, flags, ...args) => {
+ const descriptor = openSync(file, flags, ...args);
+ const resolved = path.resolve(String(file));
+ if (path.basename(resolved).startsWith('.archify-render-')
+ && (flags & (fs.constants.O_WRONLY | fs.constants.O_RDWR)) === 0) {
+ candidatePath = resolved;
+ candidateDescriptor = descriptor;
+ }
+ return descriptor;
+ });
+ t.mock.method(fs, 'closeSync', (descriptor) => {
+ const result = closeSync(descriptor);
+ if (!injected && descriptor === candidateDescriptor && fs.existsSync(candidatePath)) inject();
+ return result;
+ });
+ t.mock.method(fs, 'linkSync', (source, target) => {
+ if (!injected
+ && candidatePath
+ && path.resolve(String(source)) === candidatePath
+ && path.basename(String(target)) === path.basename(output)) inject();
+ return linkSync(source, target);
+ });
+
+ let thrown;
+ try {
+ writeWorkflow(loaded);
+ } catch (error) {
+ thrown = error;
+ }
+ assert.ok(thrown, 'the publication race must fail closed');
+ assert.equal(injected, true, JSON.stringify(thrown.archifyDiagnostics || thrown.message));
+ assert.equal(fs.readFileSync(output, 'utf8'), previous);
+ assert.equal(fs.readFileSync(candidatePath, 'utf8'), claimant);
+ assert.equal(fs.existsSync(detachedCandidate), true);
+});
+
test('a byte-identical replacement before candidate capture is not published', (t) => {
const root = workspace(t, 'archify-render-atomic-candidate-pre-capture-');
const input = path.join(root, 'diagram.workflow.json');
@@ -904,7 +963,7 @@ test('a hardlinked existing output is rejected before staging', (t) => {
assert.deepEqual(renderCandidates(root), []);
});
-test('the previous artifact remains visible until one atomic rename preserves its mode', (t) => {
+test('no-clobber publication retains recovery bytes while the public name is absent', (t) => {
const root = workspace(t, 'archify-render-atomic-rename-');
const input = path.join(root, 'diagram.workflow.json');
const output = path.join(root, 'diagram.html');
@@ -913,27 +972,37 @@ test('the previous artifact remains visible until one atomic rename preserves it
fs.writeFileSync(output, previous);
if (process.platform !== 'win32') fs.chmodSync(output, 0o640);
const previousMode = fs.statSync(output).mode & 0o777;
+ const physicalOutput = fs.realpathSync.native(output);
const loaded = loadWorkflow(input, output);
- const renameSync = fs.renameSync;
- let renames = 0;
- t.mock.method(fs, 'renameSync', (source, target) => {
- renames += 1;
- assert.equal(target, fs.realpathSync.native(output));
- assert.equal(fs.readFileSync(output, 'utf8'), previous);
- assert.match(fs.readFileSync(source, 'utf8'), /<svg role="img"><\/svg>/);
- return renameSync(source, target);
+ const linkSync = fs.linkSync.bind(fs);
+ let publications = 0;
+ t.mock.method(fs, 'linkSync', (source, target) => {
+ if (path.basename(String(source)).startsWith('.archify-render-')) {
+ publications += 1;
+ assert.equal(target, physicalOutput);
+ assert.equal(fs.existsSync(output), false);
+ const recoveryDirectories = fs.readdirSync(root, { withFileTypes: true })
+ .filter((entry) => entry.isDirectory() && entry.name.startsWith('.archify-remove-'));
+ assert.equal(recoveryDirectories.length, 1);
+ assert.equal(
+ fs.readFileSync(path.join(root, recoveryDirectories[0].name, 'previous'), 'utf8'),
+ previous,
+ );
+ assert.match(fs.readFileSync(source, 'utf8'), /<svg role="img"><\/svg>/);
+ }
+ return linkSync(source, target);
});
writeWorkflow(loaded);
- assert.equal(renames, 1);
+ assert.equal(publications, 1);
assert.notEqual(fs.readFileSync(output, 'utf8'), previous);
assert.equal(fs.statSync(output).mode & 0o777, previousMode);
assert.deepEqual(renderCandidates(root), []);
});
-test('atomic replacement preserves permissive existing modes despite a restrictive umask', (t) => {
+test('no-clobber replacement preserves permissive existing modes despite a restrictive umask', (t) => {
if (process.platform === 'win32') {
t.skip('POSIX mode and umask regression');
return;
@@ -1170,7 +1239,7 @@ test('a requested symlink replaced during canonical resolution fails before stag
assert.deepEqual(renderCandidates(root), []);
});
-test('an existing output symlink remains intact while its target is atomically replaced', (t) => {
+test('an existing output symlink remains intact while its resolved target is replaced', (t) => {
const root = workspace(t, 'archify-render-atomic-symlink-');
const input = path.join(root, 'diagram.workflow.json');
const target = path.join(root, 'target.html');
@@ -1216,6 +1285,40 @@ test('quarantine removal deletes only the public entry still owned by its bindin
}
});
+test('owned-file cleanup preserves a successor swapped at the unlink boundary', (t) => {
+ const root = workspace(t, 'archify-owned-cleanup-successor-');
+ const target = path.join(root, 'candidate.html');
+ const detached = path.join(root, 'detached-owned-candidate.html');
+ fs.writeFileSync(target, 'owned candidate\n');
+ const metadata = fs.lstatSync(target, { bigint: true });
+ const identity = { device: metadata.dev, inode: metadata.ino };
+ const unlinkSync = fs.unlinkSync.bind(fs);
+ const renameSync = fs.renameSync.bind(fs);
+ let injected = false;
+ const injectSuccessor = () => {
+ renameSync(target, detached);
+ fs.writeFileSync(target, 'successor claimant\n', { flag: 'wx' });
+ injected = true;
+ };
+ t.mock.method(fs, 'unlinkSync', (file) => {
+ if (!injected && path.resolve(String(file)) === target) {
+ injectSuccessor();
+ }
+ return unlinkSync(file);
+ });
+ t.mock.method(fs, 'renameSync', (source, destination) => {
+ if (!injected && path.resolve(String(source)) === target) injectSuccessor();
+ return renameSync(source, destination);
+ });
+
+ const removed = removeOwnedRegularFile(target, identity);
+
+ assert.equal(injected, true);
+ assert.notEqual(removed.status, 'removed');
+ assert.equal(fs.readFileSync(target, 'utf8'), 'successor claimant\n');
+ assert.equal(fs.readFileSync(detached, 'utf8'), 'owned candidate\n');
+});
+
test('quarantine removal restores a successor swapped at the final move boundary', (t) => {
const root = workspace(t, 'archify-quarantine-remove-successor-');
const target = path.join(root, 'public.lock');
diff --git a/archify/test/sequence-column-fit.test.mjs b/archify/test/sequence-column-fit.test.mjs
index 7778e72b..e2eb3388 100644
--- a/archify/test/sequence-column-fit.test.mjs
+++ b/archify/test/sequence-column-fit.test.mjs
@@ -14,7 +14,9 @@ function renderOutcome(doc) {
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-column-fit-'));
const input = path.join(tmp, 'input.json');
const output = path.join(tmp, 'output.html');
- fs.writeFileSync(input, JSON.stringify(doc));
+ const renderDoc = structuredClone(doc);
+ renderDoc.meta = { ...renderDoc.meta, output: 'sequence-column-fit.html' };
+ fs.writeFileSync(input, JSON.stringify(renderDoc));
try {
execFileSync('node', [
path.join(skillRoot, 'renderers/sequence/render-sequence.mjs'),
diff --git a/archify/test/sidecar-path-length.test.mjs b/archify/test/sidecar-path-length.test.mjs
index a6c71553..4d5d06ba 100644
--- a/archify/test/sidecar-path-length.test.mjs
+++ b/archify/test/sidecar-path-length.test.mjs
@@ -38,6 +38,30 @@ function windowsShortPath(targetPath) {
return shortPath;
}
+function assignWindowsShortName(targetPath, shortName) {
+ const result = spawnSync(
+ 'fsutil.exe',
+ ['file', 'setshortname', targetPath, shortName],
+ { encoding: 'utf8', windowsHide: true },
+ );
+ if (result.error) {
+ throw new Error(`Could not assign Windows 8.3 name ${shortName}: ${result.error.message}`);
+ }
+ if (result.status !== 0) {
+ const detail = result.stderr.trim() || result.stdout.trim() || 'no command output';
+ throw new Error(`Could not assign Windows 8.3 name ${shortName} (exit ${result.status}): ${detail}`);
+ }
+ const alias = path.join(path.dirname(targetPath), shortName);
+ const aliasStat = fs.statSync(alias, { bigint: true });
+ const targetStat = fs.statSync(targetPath, { bigint: true });
+ assert.deepEqual(
+ [aliasStat.dev, aliasStat.ino],
+ [targetStat.dev, targetStat.ino],
+ 'the explicitly assigned 8.3 name must resolve to the requested entry',
+ );
+ return alias;
+}
+
function controlledWindowsShortRoot(required) {
const root = process.env.ARCHIFY_WINDOWS_8DOT3_ROOT;
const shortRoot = process.env.ARCHIFY_WINDOWS_8DOT3_SHORT_ROOT;
@@ -225,7 +249,9 @@ test('Windows existing 8.3 artifact aliases derive one visual-check sidecar name
t.after(() => fs.rmSync(directory, { recursive: true, force: true }));
const artifact = path.join(directory, 'diagram artifact with long name.html');
fs.writeFileSync(artifact, '<!doctype html>');
- const shortArtifact = windowsShortPath(artifact);
+ const shortArtifact = controlledRoot
+ ? assignWindowsShortName(artifact, 'ARCHVS~1.HTM')
+ : windowsShortPath(artifact);
if (!shortArtifact) {
if (requiresWindows8dot3) assert.fail('the controlled Windows volume did not expose a file 8.3 alias');
t.skip('the Windows volume does not expose a distinct file 8.3 alias');
diff --git a/archify/test/v1-compatibility.test.mjs b/archify/test/v1-compatibility.test.mjs
index 259ae21b..3a10d77a 100644
--- a/archify/test/v1-compatibility.test.mjs
+++ b/archify/test/v1-compatibility.test.mjs
@@ -13,7 +13,9 @@ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-v1-compat-'));
function render(mode, doc) {
const input = path.join(tmp, `${mode}.json`);
const output = path.join(tmp, `${mode}.html`);
- fs.writeFileSync(input, JSON.stringify(doc));
+ const renderDoc = structuredClone(doc);
+ renderDoc.meta = { ...renderDoc.meta, output: `${mode}-v1-compatibility.html` };
+ fs.writeFileSync(input, JSON.stringify(renderDoc));
try {
execFileSync('node', [
path.join(skillRoot, `renderers/${mode}/render-${mode}.mjs`),
diff --git a/archify/test/visual-check.test.mjs b/archify/test/visual-check.test.mjs
index e2e77bbd..bf958712 100644
--- a/archify/test/visual-check.test.mjs
+++ b/archify/test/visual-check.test.mjs
@@ -371,6 +371,54 @@ test('visual-check preserves a regular screenshot claimant swapped before regist
assert.equal(fs.existsSync(outputs.receipt), false);
});
+test('visual-check cleanup preserves a successor swapped at its final removal boundary', async (t) => {
+ const input = artifact('staged-cleanup-successor.html');
+ const outputs = sidecarPaths(input);
+ const detached = path.join(tmp, 'detached-owned-artifact-snapshot.html');
+ const successor = Buffer.from('external artifact snapshot cleanup successor\n');
+ const unlinkSync = fs.unlinkSync.bind(fs);
+ const renameSync = fs.renameSync.bind(fs);
+ let stagedPath;
+ let injected = false;
+ const inject = (source) => {
+ injected = true;
+ stagedPath = String(source);
+ renameSync(stagedPath, detached);
+ fs.writeFileSync(stagedPath, successor, { flag: 'wx' });
+ };
+ t.mock.method(fs, 'unlinkSync', (file) => {
+ if (!injected && path.basename(String(file)) === 'artifact-snapshot.html') inject(file);
+ return unlinkSync(file);
+ });
+ t.mock.method(fs, 'renameSync', (source, destination) => {
+ if (!injected
+ && path.basename(String(source)) === 'artifact-snapshot.html'
+ && path.basename(path.dirname(String(destination))).startsWith('.archify-remove-')) {
+ inject(source);
+ }
+ return renameSync(source, destination);
+ });
+ t.after(() => {
+ fs.rmSync(detached, { force: true });
+ for (const directory of stagingDirectories(path.dirname(outputs.receipt))) {
+ fs.rmSync(path.join(path.dirname(outputs.receipt), directory), { recursive: true, force: true });
+ }
+ });
+
+ const result = await runVisualCheck({
+ artifactPath: input,
+ verifyArtifact() {
+ throw new Error('synthetic failure after private snapshot staging');
+ },
+ });
+
+ assert.equal(result.exitCode, 1);
+ assert.equal(injected, true);
+ assert.equal(fs.existsSync(stagedPath), true);
+ assert.deepEqual(fs.readFileSync(stagedPath), successor);
+ assert.equal(fs.existsSync(detached), true);
+});
+
test('sidecarPaths places outputs in outDir instead of beside the artifact', () => {
const input = artifact('outdir-source.html');
const separateDir = path.join(tmp, 'evidence-nested', 'deeper');
@@ -389,6 +437,107 @@ test('sidecarPaths places outputs in outDir instead of beside the artifact', ()
assert.equal(path.dirname(defaultOutputs.receipt), path.dirname(fs.realpathSync.native(input)));
});
+test('sidecarPaths keeps source-distinct case and Unicode names distinct under target semantics', (t) => {
+ const sourceDir = path.join(tmp, 'semantic-source-directory');
+ const outDir = path.join(tmp, 'semantic-target-directory');
+ fs.mkdirSync(sourceDir, { recursive: true });
+ fs.mkdirSync(outDir, { recursive: true });
+ const artifactNames = ['Report.html', 'report.html', 'Caf\u00e9.html', 'Cafe\u0301.html'];
+ const artifacts = artifactNames.map((name) => path.join(sourceDir, name));
+
+ const targetSemanticKey = (name) => name
+ .normalize('NFC')
+ .toLocaleUpperCase('en-US')
+ .toLocaleLowerCase('en-US')
+ .normalize('NFC');
+ const simulatedEntries = new Map();
+ const originalOpen = fs.openSync;
+ const originalStat = fs.statSync;
+ const originalRealpath = fs.realpathSync.native;
+ const sourcePhysical = originalRealpath(sourceDir);
+ const outPhysical = originalRealpath(outDir);
+ const sourceProbes = new Set();
+ fs.openSync = function simulateTargetSemantics(file, ...args) {
+ const descriptor = originalOpen.call(this, file, ...args);
+ if (path.basename(String(file)).startsWith('.archify-path-semantics-')) {
+ if (path.dirname(String(file)) === outPhysical) {
+ simulatedEntries.set(targetSemanticKey(path.basename(String(file))), String(file));
+ } else if (path.dirname(String(file)) === sourcePhysical) {
+ sourceProbes.add(String(file));
+ }
+ }
+ return descriptor;
+ };
+ fs.statSync = function resolveSimulatedAlias(file, ...args) {
+ if (path.dirname(String(file)) === sourcePhysical
+ && path.basename(String(file)).startsWith('.archify-path-semantics-')
+ && !sourceProbes.has(String(file))) {
+ const error = new Error('simulated case- and normalization-sensitive lookup');
+ error.code = 'ENOENT';
+ throw error;
+ }
+ const alias = path.dirname(String(file)) === outPhysical
+ ? simulatedEntries.get(targetSemanticKey(path.basename(String(file))))
+ : undefined;
+ return originalStat.call(this, alias || file, ...args);
+ };
+ fs.realpathSync.native = function resolveSimulatedAlias(file, ...args) {
+ if (path.dirname(String(file)) === sourceDir
+ && !path.basename(String(file)).startsWith('.archify-path-semantics-')) {
+ return path.join(sourcePhysical, path.basename(String(file)));
+ }
+ const alias = path.dirname(String(file)) === outPhysical
+ ? simulatedEntries.get(targetSemanticKey(path.basename(String(file))))
+ : undefined;
+ return originalRealpath.call(this, alias || file, ...args);
+ };
+ t.after(() => {
+ fs.openSync = originalOpen;
+ fs.statSync = originalStat;
+ fs.realpathSync.native = originalRealpath;
+ });
+
+ const calculateOutputs = () => artifacts.map((file) => {
+ fs.writeFileSync(file, '<!doctype html>', { flag: 'wx' });
+ try {
+ return sidecarPaths(file, { outDir });
+ } finally {
+ fs.unlinkSync(file);
+ }
+ });
+ const outputs = calculateOutputs();
+ const outputNames = outputs.map(({ receipt }) => path.basename(receipt));
+ assert.notEqual(
+ targetSemanticKey(outputNames[0]),
+ targetSemanticKey(outputNames[1]),
+ `case-distinct source artifacts must not claim one case-insensitive target name: ${outputNames.join(', ')}`,
+ );
+ assert.notEqual(
+ targetSemanticKey(outputNames[2]),
+ targetSemanticKey(outputNames[3]),
+ 'normalization-distinct source artifacts must not claim one normalization-insensitive target name',
+ );
+ assert.deepEqual(
+ calculateOutputs().map(({ receipt }) => receipt),
+ outputs.map(({ receipt }) => receipt),
+ 'the namespace must be deterministic',
+ );
+ const futureOutDir = path.join(tmp, 'future-semantic-target-directory');
+ fs.writeFileSync(artifacts[0], '<!doctype html>', { flag: 'wx' });
+ try {
+ const beforeCreation = sidecarPaths(artifacts[0], { outDir: futureOutDir });
+ fs.mkdirSync(futureOutDir);
+ const afterCreation = sidecarPaths(artifacts[0], { outDir: futureOutDir });
+ assert.deepEqual(afterCreation, beforeCreation, 'creating --out-dir must not rename its sidecars');
+ } finally {
+ fs.unlinkSync(artifacts[0]);
+ }
+ for (const [{ receipt }, file] of outputs.map((entry, index) => [entry, artifacts[index]])) {
+ assert.match(path.basename(receipt), new RegExp(`^${path.basename(file, '.html')}.*\\.visual-check\\.json$`, 'u'));
+ assert.ok(Buffer.byteLength(path.basename(receipt), 'utf8') <= 255);
+ }
+});
+
test('visual-check writes all sidecars into --out-dir end-to-end, none beside the artifact', async () => {
const input = artifact('outdir-e2e.html');
const outDir = path.join(tmp, 'outdir-e2e-evidence');
@@ -1364,6 +1513,64 @@ for (const candidate of [
});
}
+test('visual-check keeps staged evidence identity-bound across public link creation', async (t) => {
+ const input = artifact('staged-publication-binding.html');
+ const outputs = sidecarPaths(input);
+ const first = await runVisualCheck({
+ artifactPath: input,
+ chromePath: '/fake/chrome',
+ browserFactory: async () => fakeBrowser(),
+ });
+ assert.equal(first.exitCode, 0);
+ const targets = [
+ outputs.receipt,
+ outputs.contactSheet,
+ ...outputs.screenshots.map((entry) => entry.path),
+ ];
+ const before = new Map(targets.map((target) => [target, fs.readFileSync(target)]));
+ const stagingBefore = new Set(stagingDirectories(path.dirname(outputs.receipt)));
+ const detached = path.join(tmp, 'detached-bound-contact-sheet.html');
+ const claimant = Buffer.from('external staged contact-sheet claimant\n');
+ const linkSync = fs.linkSync.bind(fs);
+ let stagedClaimant;
+ let injected = false;
+ t.mock.method(fs, 'linkSync', (source, target) => {
+ const sourcePath = String(source);
+ const targetPath = String(target);
+ if (!injected
+ && path.basename(sourcePath) === 'contact-sheet.html'
+ && path.basename(path.dirname(sourcePath)).startsWith('.archify-visual-check-')
+ && path.resolve(targetPath) === path.resolve(outputs.contactSheet)) {
+ injected = true;
+ stagedClaimant = sourcePath;
+ fs.renameSync(sourcePath, detached);
+ fs.writeFileSync(sourcePath, claimant, { flag: 'wx' });
+ }
+ return linkSync(sourcePath, targetPath);
+ });
+ t.after(() => {
+ fs.rmSync(detached, { force: true });
+ for (const directory of stagingDirectories(path.dirname(outputs.receipt))) {
+ if (!stagingBefore.has(directory)) {
+ fs.rmSync(path.join(path.dirname(outputs.receipt), directory), { recursive: true, force: true });
+ }
+ }
+ });
+
+ const result = await runVisualCheck({
+ artifactPath: input,
+ chromePath: '/fake/chrome',
+ browserFactory: async () => fakeBrowser(),
+ });
+
+ assert.equal(injected, true);
+ assert.equal(result.exitCode, 1);
+ assert.equal(result.receipt.diagnostics.at(-1)?.code, 'viewer/evidence-path-conflict');
+ for (const target of targets) assert.deepEqual(fs.readFileSync(target), before.get(target), target);
+ assert.deepEqual(fs.readFileSync(stagedClaimant), claimant);
+ assert.equal(fs.existsSync(detached), true);
+});
+
for (const scenario of [
{
name: 'contact sheet',
@@ -1713,7 +1920,7 @@ for (const scenario of [
const candidate = String(file);
if (!injected
&& path.basename(candidate) === 'previous-1'
- && path.basename(path.dirname(candidate)).startsWith('.archify-visual-check-')) {
+ && path.basename(path.dirname(candidate)).startsWith('.archify-remove-')) {
injected = true;
retainedPath = candidate;
const error = new Error('synthetic backup unlink failure');
@@ -1753,16 +1960,19 @@ for (const scenario of [
assert.equal(result.receipt.ok, false);
assert.equal(result.receipt.status, 'fail');
assert.equal(result.receipt.publication?.status, 'committed-with-warning');
- assert.equal(result.receipt.publication?.recoveryDirectory, path.dirname(retainedPath));
+ const expectedRecovery = scenario.fault === 'unlink'
+ ? path.dirname(path.dirname(retainedPath))
+ : path.dirname(retainedPath);
+ assert.equal(result.receipt.publication?.recoveryDirectory, expectedRecovery);
assert.ok(result.receipt.publication?.cleanupErrors?.length > 0);
assert.match(result.receipt.error, /cleanup is incomplete/i);
- assert.ok(result.receipt.error.includes(path.dirname(retainedPath)));
+ assert.ok(result.receipt.error.includes(expectedRecovery));
const cleanupDiagnostic = result.receipt.diagnostics.at(-1);
assert.equal(cleanupDiagnostic?.code, 'viewer/evidence-cleanup-incomplete');
assert.equal(cleanupDiagnostic?.severity, 'warning');
assert.equal(
cleanupDiagnostic?.evidence?.recoveryDirectory,
- path.dirname(retainedPath),
+ expectedRecovery,
);
assert.equal(fs.existsSync(retainedPath), true);
assert.deepEqual(
@@ -1802,7 +2012,7 @@ test('public visual-check CLI reports a committed cleanup warning', (t) => {
const candidate = String(file);
if (!injected
&& path.basename(candidate) === 'previous-0'
- && path.basename(path.dirname(candidate)).startsWith('.archify-visual-check-')) {
+ && path.basename(path.dirname(candidate)).startsWith('.archify-remove-')) {
injected = true;
const error = new Error('synthetic public CLI backup unlink failure');
error.code = 'EACCES';
@@ -1837,7 +2047,10 @@ test('public visual-check CLI reports a committed cleanup warning', (t) => {
assert.equal(receipt.diagnostics.at(-1)?.severity, 'warning');
const recoveryDirectory = receipt.publication?.recoveryDirectory;
assert.equal(typeof recoveryDirectory, 'string');
- const retained = path.join(recoveryDirectory, 'previous-0');
+ const quarantine = fs.readdirSync(recoveryDirectory)
+ .find((entry) => entry.startsWith('.archify-remove-'));
+ assert.equal(typeof quarantine, 'string');
+ const retained = path.join(recoveryDirectory, quarantine, 'previous-0');
assert.deepEqual(fs.readFileSync(retained), oldReceipt);
assert.equal(JSON.parse(fs.readFileSync(outputs.receipt, 'utf8')).status, 'skipped');
});
diff --git a/archify/test/workflow-compiler-call-contract.test.mjs b/archify/test/workflow-compiler-call-contract.test.mjs
index d0a6f318..08c153cf 100644
--- a/archify/test/workflow-compiler-call-contract.test.mjs
+++ b/archify/test/workflow-compiler-call-contract.test.mjs
@@ -7,7 +7,13 @@ function workflow(version, locale = 'en') {
return {
schema_version: version,
diagram_type: 'workflow',
- meta: { title: `Workflow ${version}`, locale, quality_profile: 'standard', legend: { mode: 'hidden' } },
+ meta: {
+ title: `Workflow ${version}`,
+ output: `workflow-${version}.html`,
+ locale,
+ quality_profile: 'standard',
+ legend: { mode: 'hidden' },
+ },
lanes: [{ id: 'main', label: 'Main' }],
nodes: [
{ id: 'a', lane: 'main', col: 0, type: 'frontend', label: 'Input' },
diff --git a/archify/test/workflow-compiler-hard-contract.test.mjs b/archify/test/workflow-compiler-hard-contract.test.mjs
index 4dc8e501..f1e697be 100644
--- a/archify/test/workflow-compiler-hard-contract.test.mjs
+++ b/archify/test/workflow-compiler-hard-contract.test.mjs
@@ -13,6 +13,7 @@ function workflow({ lanes, nodes, edges }) {
diagram_type: 'workflow',
meta: {
title: 'Workflow compiler hard-contract fixture',
+ output: 'workflow-hard-contract.html',
legend: { mode: 'hidden' },
},
lanes,
@@ -2064,7 +2065,9 @@ test('fixed-v1 publishes only repairs that survive complete replanning', () => {
const document = {
schema_version: 1,
diagram_type: 'workflow',
- meta: { title: 'Verified fixes', legend: { mode: 'hidden' } },
+ meta: {
+ title: 'Verified fixes', output: 'verified-fixes.html', legend: { mode: 'hidden' },
+ },
lanes: [{ id: 'main', label: 'Main' }],
groups: [{ id: 'target-only', label: 'Target', lane: 'main', fromCol: 2, toCol: 2 }],
nodes: [
@@ -2088,7 +2091,9 @@ test('fixed-v1 verifies the exact serialized values in every rounded-width repai
const document = {
schema_version: 1,
diagram_type: 'workflow',
- meta: { title: 'Rounded verified widths', legend: { mode: 'hidden' } },
+ meta: {
+ title: 'Rounded verified widths', output: 'rounded-verified-widths.html', legend: { mode: 'hidden' },
+ },
lanes: [{ id: 'main', label: 'M' }],
nodes: [
{ id: 'a', lane: 'main', col: 1, type: 'backend', label: 'A', width: 52.006 },
diff --git a/archify/test/workflow-compiler.test.mjs b/archify/test/workflow-compiler.test.mjs
index 8b707fa6..44f94c3a 100644
--- a/archify/test/workflow-compiler.test.mjs
+++ b/archify/test/workflow-compiler.test.mjs
@@ -205,9 +205,9 @@ function adjacentWorkflow({
diagram_type: 'workflow',
meta: {
title: `Adjacent ranks ${fromCol} to ${toCol}`,
+ output: output ?? 'adjacent-workflow.html',
legend: { mode: 'hidden' },
...(viewBox ? { viewBox } : {}),
- ...(output ? { output } : {}),
},
lanes: [{ id: 'main', label: 'Main' }],
nodes: [
@@ -241,6 +241,7 @@ function stackedGroupWorkflow({
diagram_type: 'workflow',
meta: {
title: 'Stacked cage',
+ output: 'stacked-cage.html',
legend: { mode: 'hidden' },
...(schemaVersion === 1 ? { viewBox: [720, 640] } : {}),
},
@@ -353,7 +354,9 @@ test('fixed-v1 keeps valid phase and group spans independent of label measuremen
const workflow = {
schema_version: 1,
diagram_type: 'workflow',
- meta: { title: 'Fixed v1 frame geometry', legend: { mode: 'hidden' } },
+ meta: {
+ title: 'Fixed v1 frame geometry', output: 'fixed-v1-frame.html', legend: { mode: 'hidden' },
+ },
lanes: [{ id: 'main', label: 'Main' }],
phases: [{ id: 'phase', label: 'P'.repeat(17), fromCol: 0, toCol: 0 }],
groups: [{
@@ -533,7 +536,9 @@ test('fixed-v1 reports one causal column-capacity diagnostic for issue #126', ()
const workflow = {
schema_version: 1,
diagram_type: 'workflow',
- meta: { title: 'Issue 126 causal diagnostic', legend: { mode: 'hidden' } },
+ meta: {
+ title: 'Issue 126 causal diagnostic', output: 'issue-126-causal.html', legend: { mode: 'hidden' },
+ },
lanes: [{ id: 'main', label: 'Main' }],
nodes: [
{ id: 'a', lane: 'main', col: 1, type: 'backend', label: 'A' },
@@ -581,6 +586,7 @@ test('fixed-v1 verifies the real coordinate migration before advertising it', ()
diagram_type: 'workflow',
meta: {
title: 'Pinned issue 126 migration',
+ output: 'pinned-issue-126.html',
viewBox: [720, 400],
legend: { mode: 'hidden' },
},
@@ -667,7 +673,9 @@ test('readable-v2 treats the phase header mask as a routing obstacle', () => {
const document = {
schema_version: 2,
diagram_type: 'workflow',
- meta: { title: 'Phase route obstacle', legend: { mode: 'hidden' } },
+ meta: {
+ title: 'Phase route obstacle', output: 'phase-route-obstacle.html', legend: { mode: 'hidden' },
+ },
lanes: [{ id: 'top', label: 'Top' }, { id: 'bottom', label: 'Bottom' }],
nodes: [
{ id: 'a', lane: 'top', col: 0, type: 'backend', label: 'A' },
@@ -706,7 +714,9 @@ test('readable-v2 never routes through a single-rank group label', () => {
const document = {
schema_version: 2,
diagram_type: 'workflow',
- meta: { title: 'Group label route obstacle', legend: { mode: 'hidden' } },
+ meta: {
+ title: 'Group label route obstacle', output: 'group-label-obstacle.html', legend: { mode: 'hidden' },
+ },
lanes: [{ id: 'top', label: 'Top' }, { id: 'bottom', label: 'Bottom' }],
groups: [{ id: 'g', label: groupLabel, lane: 'top', fromCol: 2, toCol: 2 }],
nodes: [
@@ -771,7 +781,9 @@ test('readable-v2 shifts top-side routes beyond lane header text deterministical
const makeDocument = (topLaneLabel) => ({
schema_version: 2,
diagram_type: 'workflow',
- meta: { title: 'Lane header route obstacle', legend: { mode: 'hidden' } },
+ meta: {
+ title: 'Lane header route obstacle', output: 'lane-header-obstacle.html', legend: { mode: 'hidden' },
+ },
lanes: [
{ id: 'top', label: topLaneLabel },
{ id: 'bottom', label: 'Bottom' },
@@ -847,7 +859,7 @@ test('capacity-only viewBox failures preserve the intrinsic routes, labels, and
const document = {
schema_version: 2,
diagram_type: 'workflow',
- meta: { title: 'capacity', legend: { mode: 'hidden' } },
+ meta: { title: 'capacity', output: 'capacity.html', legend: { mode: 'hidden' } },
lanes: [{ id: 'top', label: 'Top' }, { id: 'bottom', label: 'Bottom' }],
nodes: [
{ id: 'n0', lane: 'top', col: 0, type: 'backend', label: 'N0' },
@@ -935,6 +947,7 @@ test('explicit viewBox height capacity names the authored tall node without nami
diagram_type: 'workflow',
meta: {
title: 'Tall node height capacity',
+ output: 'tall-node-capacity.html',
legend: { mode: 'hidden' },
viewBox: [1200, 280],
},
@@ -1053,7 +1066,9 @@ test('readable-v2 contains a long single-rank group label in its frame and intri
const workflow = {
schema_version: 2,
diagram_type: 'workflow',
- meta: { title: 'Single-rank group capacity', legend: { mode: 'hidden' } },
+ meta: {
+ title: 'Single-rank group capacity', output: 'single-rank-group.html', legend: { mode: 'hidden' },
+ },
lanes: [{ id: 'main', label: 'Main' }],
groups: [{
id: 'long-group',
@@ -1087,7 +1102,9 @@ test('readable-v2 group frames contain custom-width member rectangles on every s
const workflow = {
schema_version: 2,
diagram_type: 'workflow',
- meta: { title: 'Wide group member', legend: { mode: 'hidden' } },
+ meta: {
+ title: 'Wide group member', output: 'wide-group-member.html', legend: { mode: 'hidden' },
+ },
lanes: [{ id: 'main', label: 'Main' }],
groups: [{ id: 'group', label: 'G', lane: 'main', fromCol: 2, toCol: 2 }],
nodes: [{
@@ -1114,7 +1131,7 @@ test('readable-v2 group frames contain tagged and tall members away from the lab
const workflow = {
schema_version: 2,
diagram_type: 'workflow',
- meta: { title: description, legend: { mode: 'hidden' } },
+ meta: { title: description, output: 'group-member.html', legend: { mode: 'hidden' } },
lanes: [{ id: 'main', label: 'Main' }],
groups: [{ id: 'group', label: 'G', lane: 'main', fromCol: 0, toCol: 1 }],
nodes: [{
@@ -1143,7 +1160,9 @@ test('readable-v2 keeps a first-rank group label mask clear of its lane header m
const workflow = {
schema_version: 2,
diagram_type: 'workflow',
- meta: { title: 'First-rank group labels', legend: { mode: 'hidden' } },
+ meta: {
+ title: 'First-rank group labels', output: 'first-rank-labels.html', legend: { mode: 'hidden' },
+ },
lanes: [{ id: 'main', label: 'Main' }],
groups: [{ id: 'group', label: 'G', lane: 'main', fromCol: 0, toCol: 0 }],
nodes: [{ id: 'member', lane: 'main', col: 0, type: 'backend', label: 'Member' }],
@@ -1290,7 +1309,9 @@ test('readable-v2 SVG and receipt bytes are deterministic across repeated and re
const workflow = {
schema_version: 2,
diagram_type: 'workflow',
- meta: { title: 'Deterministic workflow', legend: { mode: 'hidden' } },
+ meta: {
+ title: 'Deterministic workflow', output: 'deterministic-workflow.html', legend: { mode: 'hidden' },
+ },
lanes: [{ id: 'main', label: 'Main' }],
nodes: [
{ id: 'a', lane: 'main', col: 0, type: 'frontend', label: 'A' },
diff --git a/archify/test/workflow-migration.test.mjs b/archify/test/workflow-migration.test.mjs
index 93178b50..127fd873 100644
--- a/archify/test/workflow-migration.test.mjs
+++ b/archify/test/workflow-migration.test.mjs
@@ -426,6 +426,7 @@ test('workflow migration reports the measured legacy requirement separately from
diagram_type: 'workflow',
meta: {
title: 'Spacious legacy capacity',
+ output: 'spacious-legacy-capacity.html',
viewBox: [1600, 900],
legend: { mode: 'hidden' },
},
@@ -466,6 +467,35 @@ test('workflow migration cleanup failure warns without reversing a successful co
assert.match(result.stderr, /simulated migration cleanup failure/);
});
+test('workflow migration cleanup preserves an unexpected claimant in its private staging directory', () => {
+ const source = copyFixture('cleanup-claimant-source.workflow.json');
+ const destination = path.join(tmp, 'cleanup-claimant-destination.workflow.json');
+ const importModule = path.join(tmp, 'claim-migration-staging-cleanup.mjs');
+ fs.writeFileSync(importModule, `
+import fs from 'node:fs';
+import path from 'node:path';
+const rmdirSync = fs.rmdirSync.bind(fs);
+let claimed = false;
+fs.rmdirSync = (directory, ...args) => {
+ if (!claimed && path.basename(String(directory)).startsWith('.archify-migration-')) {
+ claimed = true;
+ fs.writeFileSync(path.join(directory, 'unknown-claimant.txt'), 'preserve migration claimant');
+ }
+ return rmdirSync(directory, ...args);
+};
+`);
+
+ const result = runMigration(source, destination, { importModule });
+
+ assert.equal(result.status, 0, result.stderr || result.stdout);
+ assert.match(result.stderr, /Warning: could not remove workflow migration staging directory/);
+ const claimant = fs.readdirSync(tmp, { recursive: true })
+ .map((entry) => path.join(tmp, entry))
+ .find((entry) => path.basename(entry) === 'unknown-claimant.txt');
+ assert.ok(claimant);
+ assert.equal(fs.readFileSync(claimant, 'utf8'), 'preserve migration claimant');
+});
+
test('workflow migration is idempotent when its v2 destination is migrated again', () => {
const source = copyFixture('idempotent-source.workflow.json');
const firstDestination = path.join(tmp, 'idempotent-first.workflow.json');
@@ -649,6 +679,74 @@ fs.readFileSync = (file, ...args) => {
assert.equal(parseJsonOutput(result).diagnostics[0].code, 'migration/destination-changed');
});
+test('workflow migration preserves candidate and destination claimants introduced in the publish window', () => {
+ const source = copyFixture('candidate-publish-race-source.workflow.json');
+ const destination = path.join(tmp, 'candidate-publish-race.workflow.json');
+ const detachedCandidate = path.join(tmp, 'owned-candidate-before-publish.workflow.json');
+ const claimant = '{"claimant":"candidate publish window"}\n';
+ const importModule = path.join(tmp, 'claim-migration-candidate-during-publish.mjs');
+ fs.writeFileSync(importModule, `
+import fs from 'node:fs';
+import path from 'node:path';
+const linkSync = fs.linkSync.bind(fs);
+let claimed = false;
+fs.linkSync = (sourcePath, targetPath, ...args) => {
+ if (!claimed
+ && path.basename(String(sourcePath)) === 'candidate.workflow.json'
+ && path.basename(String(targetPath)) === ${JSON.stringify(path.basename(destination))}) {
+ claimed = true;
+ fs.renameSync(sourcePath, ${JSON.stringify(detachedCandidate)});
+ fs.writeFileSync(sourcePath, ${JSON.stringify(claimant)}, { flag: 'wx' });
+ }
+ return linkSync(sourcePath, targetPath, ...args);
+};
+`);
+
+ const result = runMigration(source, destination, { importModule });
+
+ assert.notEqual(result.status, 0, result.stderr || result.stdout);
+ assert.equal(parseJsonOutput(result).diagnostics[0].code, 'migration/destination-changed');
+ assert.equal(fs.readFileSync(destination, 'utf8'), claimant);
+ const staging = fs.readdirSync(tmp)
+ .find((entry) => entry.startsWith('.archify-migration-')
+ && fs.existsSync(path.join(tmp, entry, 'candidate.workflow.json')));
+ assert.ok(staging, 'the candidate claimant must remain named in private staging');
+ assert.equal(fs.readFileSync(path.join(tmp, staging, 'candidate.workflow.json'), 'utf8'), claimant);
+ assert.equal(JSON.parse(fs.readFileSync(detachedCandidate, 'utf8')).schema_version, 2);
+});
+
+test('workflow migration verifies the final published binding and preserves a last-window target claimant', () => {
+ const source = copyFixture('final-publish-race-source.workflow.json');
+ const destination = path.join(tmp, 'final-publish-race.workflow.json');
+ const detachedPublished = path.join(tmp, 'detached-final-published.workflow.json');
+ const claimant = '{"claimant":"final published window"}\n';
+ const importModule = path.join(tmp, 'claim-final-migration-publication.mjs');
+ fs.writeFileSync(importModule, `
+import fs from 'node:fs';
+import path from 'node:path';
+const unlinkSync = fs.unlinkSync.bind(fs);
+let claimed = false;
+fs.unlinkSync = (file, ...args) => {
+ const result = unlinkSync(file, ...args);
+ if (!claimed
+ && path.basename(String(file)) === 'candidate.workflow.json'
+ && path.basename(path.dirname(String(file))).startsWith('.archify-remove-')) {
+ claimed = true;
+ fs.renameSync(${JSON.stringify(destination)}, ${JSON.stringify(detachedPublished)});
+ fs.writeFileSync(${JSON.stringify(destination)}, ${JSON.stringify(claimant)}, { flag: 'wx' });
+ }
+ return result;
+};
+`);
+
+ const result = runMigration(source, destination, { importModule });
+
+ assert.notEqual(result.status, 0, result.stderr || result.stdout);
+ assert.equal(parseJsonOutput(result).diagnostics[0].code, 'migration/destination-changed');
+ assert.equal(fs.readFileSync(destination, 'utf8'), claimant);
+ assert.equal(JSON.parse(fs.readFileSync(detachedPublished, 'utf8')).schema_version, 2);
+});
+
test('workflow migration preserves an existing destination replaced during candidate mode finalization', () => {
const source = copyFixture('destination-chmod-race-source.workflow.json');
const destination = path.join(tmp, 'destination-chmod-race.workflow.json');
diff --git a/archify/test/workflow-semantic-contract.test.mjs b/archify/test/workflow-semantic-contract.test.mjs
index 0653e1b7..ff6f0481 100644
--- a/archify/test/workflow-semantic-contract.test.mjs
+++ b/archify/test/workflow-semantic-contract.test.mjs
@@ -9,6 +9,7 @@ function document(semanticChecks) {
diagram_type: 'workflow',
meta: {
title: 'Workflow semantic contract fixture',
+ output: 'workflow-semantic-contract.html',
legend: { mode: 'hidden' },
},
lanes: [
diff --git a/docs/issue-52-visual-evidence/dataflow-repro.json b/docs/issue-52-visual-evidence/dataflow-repro.json
index 028e514e..e0209146 100644
--- a/docs/issue-52-visual-evidence/dataflow-repro.json
+++ b/docs/issue-52-visual-evidence/dataflow-repro.json
@@ -1,7 +1,7 @@
{
"schema_version": 1,
"diagram_type": "dataflow",
- "meta": { "title": "Default Flow Only" },
+ "meta": { "title": "Default Flow Only", "output": "docs/issue-52-visual-evidence/dataflow-repro.html" },
"stages": [{ "label": "Input" }, { "label": "Output" }],
"nodes": [
{ "id": "input", "type": "backend", "label": "Input", "stage": 0, "row": 0 },
diff --git a/docs/issue-52-visual-evidence/lifecycle-repro.json b/docs/issue-52-visual-evidence/lifecycle-repro.json
index 482a0a58..392db73c 100644
--- a/docs/issue-52-visual-evidence/lifecycle-repro.json
+++ b/docs/issue-52-visual-evidence/lifecycle-repro.json
@@ -1,7 +1,7 @@
{
"schema_version": 1,
"diagram_type": "lifecycle",
- "meta": { "title": "No Waiting or Failure", "viewBox": [720, 566] },
+ "meta": { "title": "No Waiting or Failure", "output": "docs/issue-52-visual-evidence/lifecycle-repro.html", "viewBox": [720, 566] },
"lanes": [{ "id": "main", "label": "Lifecycle" }],
"states": [
{ "id": "started", "type": "start", "label": "Started", "lane": "main", "col": 0 },
diff --git a/integrations/deepseek-harness/test/adapter-staging.test.mjs b/integrations/deepseek-harness/test/adapter-staging.test.mjs
index e1aea38b..b23cf72f 100644
--- a/integrations/deepseek-harness/test/adapter-staging.test.mjs
+++ b/integrations/deepseek-harness/test/adapter-staging.test.mjs
@@ -38,8 +38,10 @@ function fixture() {
const contractFiles = [
'scripts/stage-clean-skill.mjs',
'archify/renderers/shared/atomic-output.mjs',
+ 'archify/renderers/shared/output-path.mjs',
'archify/renderers/shared/path-semantics.mjs',
'archify/renderers/shared/portable-path.mjs',
+ 'archify/renderers/shared/sidecar-path.mjs',
'integrations/deepseek-harness/scripts/release-source.mjs',
];
for (const relative of contractFiles) {
@@ -126,6 +128,16 @@ test('DSH workflow runs when the shared portable-path contract changes', () => {
2,
'pull requests and branch pushes must both watch the staging identity runtime',
);
+ assert.equal(
+ workflow.match(/archify\/renderers\/shared\/output-path\.mjs/g)?.length,
+ 2,
+ 'pull requests and branch pushes must both watch the native output runtime',
+ );
+ assert.equal(
+ workflow.match(/archify\/renderers\/shared\/sidecar-path\.mjs/g)?.length,
+ 2,
+ 'pull requests and branch pushes must both watch the bounded sidecar runtime',
+ );
});
test('pack stages adapter inputs from the fixture HEAD despite dirty and untracked files', () => {
diff --git a/scripts/copy-site-assets.mjs b/scripts/copy-site-assets.mjs
index 00e6dc77..36cca03b 100644
--- a/scripts/copy-site-assets.mjs
+++ b/scripts/copy-site-assets.mjs
@@ -4,8 +4,10 @@ import path from 'node:path';
import { fileURLToPath } from 'node:url';
import {
+ backupPublicRegularFileBinding,
captureAtomicOutput,
captureRegularFileBinding,
+ quarantineRemoveRegularFileBinding,
releaseRegularFileBinding,
removeOwnedRegularFile,
verifyAtomicOutput,
@@ -78,6 +80,34 @@ function stageSiteAsset(source, commitPath, mode) {
});
}
+function removeBoundSiteCandidate(item, expectedLinks) {
+ const removed = quarantineRemoveRegularFileBinding(
+ item.candidateBinding,
+ item.candidatePath,
+ { subject: 'site-asset-candidate', expectedLinks },
+ );
+ if (removed.status === 'removed' || removed.status === 'preserved') return removed;
+
+ // An in-place mutation still belongs to the inode we created. Rebind its
+ // current bytes by expected identity so quarantine cleanup remains race-safe
+ // without treating a replacement path claimant as ours.
+ const rebound = captureRegularFileBinding(item.candidatePath, {
+ subject: 'mutated-site-asset-candidate',
+ expectedIdentity: item.candidateIdentity,
+ expectedLinks,
+ });
+ if (rebound.status !== 'captured') return removed;
+ try {
+ return quarantineRemoveRegularFileBinding(
+ rebound.binding,
+ item.candidatePath,
+ { subject: 'mutated-site-asset-candidate', expectedLinks },
+ );
+ } finally {
+ releaseRegularFileBinding(rebound.binding);
+ }
+}
+
export function copySiteAssets(outputHtmlPath) {
const requestedOutputParent = path.dirname(path.resolve(outputHtmlPath));
fs.mkdirSync(requestedOutputParent, { recursive: true });
@@ -123,47 +153,224 @@ export function copySiteAssets(outputHtmlPath) {
publications.push({ asset, source, capture });
}
- for (const { asset, source, capture } of publications) {
- let candidatePath;
- let candidateIdentity;
- let candidateBinding;
- try {
- ({ candidatePath, identity: candidateIdentity } = stageSiteAsset(
- source,
- capture.commitPath,
- capture.mode,
- ));
- const candidate = captureRegularFileBinding(candidatePath, {
+ const backedUp = [];
+ const committed = [];
+ let publicationsFinalized = false;
+ let failure;
+ try {
+ // Stage and bind the full pair before moving either public name. A held
+ // descriptor remains the authority for each candidate throughout commit.
+ for (const item of publications) {
+ const staged = stageSiteAsset(item.source, item.capture.commitPath, item.capture.mode);
+ item.candidatePath = staged.candidatePath;
+ item.candidateIdentity = staged.identity;
+ const candidate = captureRegularFileBinding(item.candidatePath, {
subject: 'site-asset-candidate',
- expectedIdentity: candidateIdentity,
- ...(capture.mode === null ? {} : { expectedMode: capture.mode }),
+ expectedIdentity: item.candidateIdentity,
+ ...(item.capture.mode === null ? {} : { expectedMode: item.capture.mode }),
});
- if (candidate.status !== 'captured') throw publicationError(asset, candidate);
- candidateBinding = candidate.binding;
- const targetVerification = verifyAtomicOutput(capture.snapshot);
+ if (candidate.status !== 'captured') throw publicationError(item.asset, candidate);
+ item.candidateBinding = candidate.binding;
+ item.candidatePresent = true;
+
+ if (item.capture.snapshot.target.kind === 'file') {
+ const expected = item.capture.snapshot.target;
+ const previous = captureRegularFileBinding(item.capture.commitPath, {
+ subject: 'previous-site-asset-target',
+ expectedIdentity: { device: expected.device, inode: expected.inode },
+ expectedMode: expected.mode,
+ expectedLinks: 1,
+ });
+ if (previous.status !== 'captured') throw publicationError(item.asset, previous);
+ item.previousBinding = previous.binding;
+ item.backupPath = path.join(
+ targetRoot,
+ `.archify-site-backup-${randomBytes(16).toString('hex')}.tmp`,
+ );
+ }
+ }
+
+ for (const item of publications) {
+ const targetVerification = verifyAtomicOutput(item.capture.snapshot);
if (targetVerification.status !== 'match') {
- throw publicationError(asset, targetVerification);
+ throw publicationError(item.asset, targetVerification);
}
- const candidateVerification = verifyRegularFileBinding(candidateBinding);
+ const candidateVerification = verifyRegularFileBinding(item.candidateBinding, {
+ filePath: item.candidatePath,
+ expectedLinks: 1,
+ });
if (candidateVerification.status !== 'match') {
- throw publicationError(asset, candidateVerification);
- }
- const released = releaseRegularFileBinding(candidateBinding);
- candidateBinding = undefined;
- if (released.status !== 'released') throw publicationError(asset, released);
- fs.renameSync(candidatePath, capture.commitPath);
- candidatePath = undefined;
- candidateIdentity = undefined;
- } finally {
- if (candidateBinding) releaseRegularFileBinding(candidateBinding);
- if (candidatePath && candidateIdentity) {
- const cleanup = removeOwnedRegularFile(candidatePath, candidateIdentity, {
+ throw publicationError(item.asset, candidateVerification);
+ }
+ }
+
+ // Existing targets remain recoverable by identity until both new assets
+ // have been published and verified.
+ for (const item of publications) {
+ if (!item.previousBinding) continue;
+ const backup = backupPublicRegularFileBinding(
+ item.previousBinding,
+ item.capture.commitPath,
+ item.backupPath,
+ { subject: 'previous-site-asset-target' },
+ );
+ item.backupPresent = backup.backupCreated === true;
+ item.backupVerified = backup.backupVerified === true;
+ if (item.backupPresent) backedUp.push(item);
+ if (backup.status !== 'backed-up') throw publicationError(item.asset, backup);
+ }
+
+ for (const item of publications) {
+ const candidateVerification = verifyRegularFileBinding(item.candidateBinding, {
+ filePath: item.candidatePath,
+ expectedLinks: 1,
+ });
+ if (candidateVerification.status !== 'match') {
+ throw publicationError(item.asset, candidateVerification);
+ }
+ try {
+ // A no-clobber hard link makes an after-preflight target claimant win
+ // instead of being overwritten. The binding proves which inode was
+ // linked while it remains open through the complete pair commit.
+ fs.linkSync(item.candidatePath, item.capture.commitPath);
+ } catch (error) {
+ throw publicationError(item.asset, {
+ code: error?.code === 'EEXIST'
+ ? 'site-asset-target-claimed-during-publish'
+ : 'site-asset-publish-failed',
+ systemCode: error?.code,
+ });
+ }
+ item.committed = true;
+ committed.push(item);
+ const linked = verifyRegularFileBinding(item.candidateBinding, {
+ filePath: item.capture.commitPath,
+ expectedLinks: 2,
+ });
+ if (linked.status !== 'match') throw publicationError(item.asset, linked);
+ }
+
+ for (const item of committed) {
+ const removed = removeBoundSiteCandidate(item, 2);
+ if (removed.status !== 'removed') throw publicationError(item.asset, removed);
+ item.candidatePresent = false;
+ const finalized = verifyRegularFileBinding(item.candidateBinding, {
+ filePath: item.capture.commitPath,
+ expectedLinks: 1,
+ });
+ if (finalized.status !== 'match') throw publicationError(item.asset, finalized);
+ }
+
+ // From this point on the new pair is complete and independently bound at
+ // both public names. Retiring old backups is cleanup, not part of a
+ // rollback-capable phase: a cleanup failure may already have moved one old
+ // backup into quarantine, so removing the committed pair would create a
+ // public hole that cannot be restored from the stale backup pathname.
+ publicationsFinalized = true;
+
+ for (const item of backedUp) {
+ const removed = quarantineRemoveRegularFileBinding(
+ item.previousBinding,
+ item.backupPath,
+ { subject: 'previous-site-asset-target', expectedLinks: 1 },
+ );
+ if (removed.status !== 'removed') throw publicationError(item.asset, removed);
+ item.backupPresent = false;
+ }
+ } catch (error) {
+ failure = error;
+ if (publicationsFinalized) throw error;
+ const rollbackErrors = [];
+ for (const item of [...committed].reverse()) {
+ const expectedLinks = item.candidatePresent ? 2 : 1;
+ const removed = quarantineRemoveRegularFileBinding(
+ item.candidateBinding,
+ item.capture.commitPath,
+ { subject: 'published-site-asset', expectedLinks },
+ );
+ if (removed.status !== 'removed') {
+ rollbackErrors.push(`${item.asset}: remove failed (${removed.reason?.code || removed.status})`);
+ } else {
+ item.committed = false;
+ }
+ }
+ for (const item of [...backedUp].reverse()) {
+ if (!item.backupPresent || item.committed) continue;
+ const backup = verifyRegularFileBinding(item.previousBinding, {
+ filePath: item.backupPath,
+ expectedLinks: 1,
+ });
+ if (backup.status !== 'match') {
+ rollbackErrors.push(`${item.asset}: backup changed (${backup.reason?.code || backup.status})`);
+ continue;
+ }
+ try {
+ fs.linkSync(item.backupPath, item.capture.commitPath);
+ } catch (restoreError) {
+ rollbackErrors.push(`${item.asset}: restore failed (${restoreError.code || restoreError.message})`);
+ continue;
+ }
+ const restored = verifyRegularFileBinding(item.previousBinding, {
+ filePath: item.capture.commitPath,
+ expectedLinks: 2,
+ });
+ if (restored.status !== 'match') {
+ rollbackErrors.push(`${item.asset}: restore changed (${restored.reason?.code || restored.status})`);
+ continue;
+ }
+ const removedBackup = quarantineRemoveRegularFileBinding(
+ item.previousBinding,
+ item.backupPath,
+ { subject: 'previous-site-asset-target', expectedLinks: 2 },
+ );
+ if (removedBackup.status !== 'removed') {
+ rollbackErrors.push(`${item.asset}: backup cleanup failed (${removedBackup.reason?.code || removedBackup.status})`);
+ continue;
+ }
+ item.backupPresent = false;
+ const finalized = verifyRegularFileBinding(item.previousBinding, {
+ filePath: item.capture.commitPath,
+ expectedLinks: 1,
+ });
+ if (finalized.status !== 'match') {
+ rollbackErrors.push(`${item.asset}: restore finalization failed (${finalized.reason?.code || finalized.status})`);
+ }
+ }
+ if (rollbackErrors.length) {
+ throw new AggregateError([error], `Site asset transaction requires recovery: ${rollbackErrors.join('; ')}`);
+ }
+ throw error;
+ } finally {
+ for (const item of publications) {
+ if (item.candidateBinding && item.candidatePresent) {
+ const expectedLinks = item.committed ? 2 : 1;
+ const cleanup = removeBoundSiteCandidate(item, expectedLinks);
+ if (!failure && cleanup.status !== 'removed' && cleanup.status !== 'preserved') {
+ failure = publicationError(item.asset, cleanup);
+ }
+ } else if (item.candidatePath && item.candidateIdentity) {
+ const cleanup = removeOwnedRegularFile(item.candidatePath, item.candidateIdentity, {
subject: 'site-asset-candidate',
});
+ if (!failure && !['removed', 'absent', 'preserved'].includes(cleanup.status)) {
+ failure = publicationError(item.asset, cleanup);
+ }
+ }
+ if (item.candidateBinding) releaseRegularFileBinding(item.candidateBinding);
+ if (item.previousBinding) releaseRegularFileBinding(item.previousBinding);
+ }
+ if (!failure) {
+ for (const item of backedUp) {
+ if (!item.backupPresent) continue;
+ const cleanup = removeOwnedRegularFile(item.backupPath, {
+ device: item.capture.snapshot.target.device,
+ inode: item.capture.snapshot.target.inode,
+ }, { subject: 'previous-site-asset-target' });
if (!['removed', 'absent', 'preserved'].includes(cleanup.status)) {
- throw publicationError(asset, cleanup);
+ failure = publicationError(item.asset, cleanup);
}
}
}
}
+ if (failure) throw failure;
}
diff --git a/scripts/run-windows-path-tests.mjs b/scripts/run-windows-path-tests.mjs
index 4849dbdb..ca0c1b72 100644
--- a/scripts/run-windows-path-tests.mjs
+++ b/scripts/run-windows-path-tests.mjs
@@ -6,7 +6,10 @@ import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
-import { sameLocation } from '../archify/renderers/shared/path-semantics.mjs';
+import {
+ sameLocation,
+ sidecarNamespaceComponentKey,
+} from '../archify/renderers/shared/path-semantics.mjs';
import { checkForUpdate } from '../archify/scripts/check-update.mjs';
import { stageCleanSkill } from './stage-clean-skill.mjs';
@@ -157,6 +160,27 @@ async function runControlledWindowsPathE2E() {
assert.equal(sameLocation(upperOutput, lowerOutput).status, 'different');
assert.ok(fs.existsSync(upperOutput) && fs.existsSync(lowerOutput));
+ const nfcOutput = path.join(caseRoot, `${token}-Caf\u00e9.html`);
+ const nfdOutput = path.join(caseRoot, `${token}-Cafe\u0301.html`);
+ assert.equal(
+ path.basename(nfcOutput).normalize('NFC'),
+ path.basename(nfdOutput).normalize('NFC'),
+ 'the controlled artifact pair must differ only by canonical Unicode normalization',
+ );
+ requireSuccess('normalization-sensitive render (NFC)', runCli([
+ 'render', 'architecture', architectureInput, nfcOutput,
+ ]));
+ assert.equal(
+ sameLocation(nfcOutput, nfdOutput).status,
+ 'different',
+ 'a future NFD spelling must remain distinct in the controlled NTFS directory',
+ );
+ requireSuccess('normalization-sensitive render (NFD)', runCli([
+ 'render', 'architecture', architectureInput, nfdOutput,
+ ]));
+ assert.equal(sameLocation(nfcOutput, nfdOutput).status, 'different');
+ assert.ok(fs.existsSync(nfcOutput) && fs.existsSync(nfdOutput));
+
const caseDelivery = path.join(caseRoot, `${token}-drive-case-delivery.html`);
const driveCaseDelivery = path.join(driveCaseRoot, path.basename(caseDelivery));
const deliveredCase = runCli([
@@ -275,20 +299,47 @@ async function runControlledWindowsPathE2E() {
});
assert.equal(update.status, 'update_available');
- let longDirectory = extendedUncRoot;
- for (let index = 0; longDirectory.length <= 320; index += 1) {
- longDirectory = path.win32.join(longDirectory, `${token.slice(0, 24)}-${index}-long-path`);
+ let ordinaryLongDirectory = uncRoot;
+ for (let index = 0; ordinaryLongDirectory.length <= 320; index += 1) {
+ ordinaryLongDirectory = path.win32.join(
+ ordinaryLongDirectory,
+ `${token.slice(0, 24)}-${index}-ordinary-long-path`,
+ );
+ }
+ fs.mkdirSync(ordinaryLongDirectory, { recursive: true });
+ const ordinaryLongOutput = path.win32.join(ordinaryLongDirectory, 'diagram.html');
+ assert.ok(
+ ordinaryLongOutput.length > 320,
+ 'controlled ordinary UNC path must exceed the traditional MAX_PATH limit',
+ );
+ const ordinaryLongDelivery = runCli([
+ 'deliver', 'workflow', workflowInput, ordinaryLongOutput,
+ '--quality', 'showcase', '--json',
+ ]);
+ requireSuccess('ordinary UNC delivery beyond traditional MAX_PATH', ordinaryLongDelivery);
+ assert.equal(JSON.parse(ordinaryLongDelivery.stdout).ok, true);
+ assert.ok(fs.existsSync(ordinaryLongOutput));
+
+ let extendedLongDirectory = extendedUncRoot;
+ for (let index = 0; extendedLongDirectory.length <= 320; index += 1) {
+ extendedLongDirectory = path.win32.join(
+ extendedLongDirectory,
+ `${token.slice(0, 24)}-${index}-extended-long-path`,
+ );
}
- fs.mkdirSync(longDirectory, { recursive: true });
- const longOutput = path.win32.join(longDirectory, 'diagram.html');
- assert.ok(longOutput.length > 320, 'controlled path must exceed the traditional MAX_PATH limit');
- const longDelivery = runCli([
- 'deliver', 'workflow', workflowInput, longOutput,
+ fs.mkdirSync(extendedLongDirectory, { recursive: true });
+ const extendedLongOutput = path.win32.join(extendedLongDirectory, 'diagram.html');
+ assert.ok(
+ extendedLongOutput.length > 320,
+ 'controlled extended UNC path must exceed the traditional MAX_PATH limit',
+ );
+ const extendedLongDelivery = runCli([
+ 'deliver', 'workflow', workflowInput, extendedLongOutput,
'--quality', 'showcase', '--json',
]);
- requireSuccess('delivery beyond traditional MAX_PATH', longDelivery);
- assert.equal(JSON.parse(longDelivery.stdout).ok, true);
- assert.ok(fs.existsSync(longOutput));
+ requireSuccess('extended UNC delivery beyond traditional MAX_PATH', extendedLongDelivery);
+ assert.equal(JSON.parse(extendedLongDelivery.stdout).ok, true);
+ assert.ok(fs.existsSync(extendedLongOutput));
const evidenceDirectory = path.win32.join(uncRoot, `${token}-visual-evidence`);
const visual = runCli([
@@ -298,6 +349,86 @@ async function runControlledWindowsPathE2E() {
requireSuccess('ordinary UNC visual-check', visual);
assert.equal(JSON.parse(visual.stdout).status, 'pass');
+ const sharedCaseEvidenceDirectory = path.win32.join(
+ uncRoot,
+ `${token}-case-variant-visual-evidence`,
+ );
+ const upperVisual = runCli([
+ 'visual-check', upperOutput, '--json', '--out-dir', sharedCaseEvidenceDirectory,
+ ], { timeout: 180_000 });
+ requireSuccess('case-sensitive upper artifact visual-check to shared UNC', upperVisual);
+ const lowerVisual = runCli([
+ 'visual-check', lowerOutput, '--json', '--out-dir', sharedCaseEvidenceDirectory,
+ ], { timeout: 180_000 });
+ requireSuccess('case-sensitive lower artifact visual-check to shared UNC', lowerVisual);
+ const upperReceipt = JSON.parse(upperVisual.stdout);
+ const lowerReceipt = JSON.parse(lowerVisual.stdout);
+ assert.equal(upperReceipt.status, 'pass');
+ assert.equal(lowerReceipt.status, 'pass');
+ const upperReceiptKey = sidecarNamespaceComponentKey(
+ upperReceipt.sidecars.directory,
+ upperReceipt.sidecars.receipt,
+ );
+ const lowerReceiptKey = sidecarNamespaceComponentKey(
+ lowerReceipt.sidecars.directory,
+ lowerReceipt.sidecars.receipt,
+ );
+ assert.equal(upperReceiptKey.status, 'resolved');
+ assert.equal(lowerReceiptKey.status, 'resolved');
+ assert.notEqual(
+ upperReceiptKey.componentKey,
+ lowerReceiptKey.componentKey,
+ 'case-variant artifacts must receive distinct evidence names on a case-insensitive share',
+ );
+ assert.ok(fs.existsSync(path.win32.join(
+ upperReceipt.sidecars.directory,
+ upperReceipt.sidecars.receipt,
+ )));
+ assert.ok(fs.existsSync(path.win32.join(
+ lowerReceipt.sidecars.directory,
+ lowerReceipt.sidecars.receipt,
+ )));
+
+ const sharedNormalizationEvidenceDirectory = path.win32.join(
+ uncRoot,
+ `${token}-normalization-variant-visual-evidence`,
+ );
+ const nfcVisual = runCli([
+ 'visual-check', nfcOutput, '--json', '--out-dir', sharedNormalizationEvidenceDirectory,
+ ], { timeout: 180_000 });
+ requireSuccess('normalization-sensitive NFC artifact visual-check to shared UNC', nfcVisual);
+ const nfdVisual = runCli([
+ 'visual-check', nfdOutput, '--json', '--out-dir', sharedNormalizationEvidenceDirectory,
+ ], { timeout: 180_000 });
+ requireSuccess('normalization-sensitive NFD artifact visual-check to shared UNC', nfdVisual);
+ const nfcReceipt = JSON.parse(nfcVisual.stdout);
+ const nfdReceipt = JSON.parse(nfdVisual.stdout);
+ assert.equal(nfcReceipt.status, 'pass');
+ assert.equal(nfdReceipt.status, 'pass');
+ const nfcReceiptKey = sidecarNamespaceComponentKey(
+ nfcReceipt.sidecars.directory,
+ nfcReceipt.sidecars.receipt,
+ );
+ const nfdReceiptKey = sidecarNamespaceComponentKey(
+ nfdReceipt.sidecars.directory,
+ nfdReceipt.sidecars.receipt,
+ );
+ assert.equal(nfcReceiptKey.status, 'resolved');
+ assert.equal(nfdReceiptKey.status, 'resolved');
+ assert.notEqual(
+ nfcReceiptKey.componentKey,
+ nfdReceiptKey.componentKey,
+ 'normalization-distinct artifacts must receive distinct evidence names on the shared UNC target',
+ );
+ assert.ok(fs.existsSync(path.win32.join(
+ nfcReceipt.sidecars.directory,
+ nfcReceipt.sidecars.receipt,
+ )));
+ assert.ok(fs.existsSync(path.win32.join(
+ nfdReceipt.sidecars.directory,
+ nfdReceipt.sidecars.receipt,
+ )));
+
const previewOutput = path.win32.join(extendedUncRoot, `${token}-preview.html`);
const { startPreview } = await import('../archify/bin/preview.mjs');
preview = await startPreview({
diff --git a/scripts/stage-clean-skill.mjs b/scripts/stage-clean-skill.mjs
index c8f44cff..78cd1abb 100644
--- a/scripts/stage-clean-skill.mjs
+++ b/scripts/stage-clean-skill.mjs
@@ -1,10 +1,16 @@
#!/usr/bin/env node
import { spawnSync } from 'node:child_process';
+import { randomBytes } from 'node:crypto';
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
+import {
+ captureRegularFileBinding,
+ quarantineRemoveRegularFileBinding,
+ releaseRegularFileBinding,
+} from '../archify/renderers/shared/atomic-output.mjs';
import { containedBy, sameEntry } from '../archify/renderers/shared/path-semantics.mjs';
import { validatePortablePathSet } from '../archify/renderers/shared/portable-path.mjs';
import { assertThirdPartyNotices } from './third-party-notices-contract.mjs';
@@ -191,12 +197,246 @@ function snapshotSourceEntry(entry) {
}
}
-function cleanPackageManifest(destination) {
- const packagePath = path.join(destination, 'package.json');
- const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
+function cleanPackageManifestEntry(packageEntries) {
+ const packageEntry = packageEntries.find((entry) => entry.relative === 'archify/package.json');
+ if (!packageEntry) throw new Error('required package input is missing: archify/package.json');
+ const packageJson = JSON.parse(packageEntry.content.toString('utf8'));
delete packageJson.scripts;
delete packageJson.devDependencies;
- fs.writeFileSync(packagePath, `${JSON.stringify(packageJson, null, 2)}\n`);
+ packageEntry.content = Buffer.from(`${JSON.stringify(packageJson, null, 2)}\n`);
+}
+
+function stagingError(message, cause = undefined) {
+ return cause === undefined ? new Error(message) : new Error(message, { cause });
+}
+
+function verifiedDirectoryMetadata(directory) {
+ const metadata = fs.lstatSync(directory, { bigint: true });
+ if (!metadata.isDirectory() || metadata.isSymbolicLink() || metadata.ino === 0n) {
+ throw stagingError(`clean Skill staging directory identity is unavailable: ${directory}`);
+ }
+ return metadata;
+}
+
+function assertOwnedDirectory(owned) {
+ let current;
+ try {
+ current = fs.lstatSync(owned.absolute, { bigint: true });
+ } catch (error) {
+ throw stagingError(`clean Skill staging directory changed: ${owned.absolute}`, error);
+ }
+ if (!current.isDirectory()
+ || current.isSymbolicLink()
+ || current.ino === 0n
+ || !sameFileIdentity(owned.metadata, current)) {
+ throw stagingError(`clean Skill staging directory changed: ${owned.absolute}`);
+ }
+}
+
+function createOwnedDirectory(absolute, parent, ownership, { destinationRoot = false } = {}) {
+ if (parent) assertOwnedDirectory(parent);
+ try {
+ fs.mkdirSync(absolute, { mode: 0o755 });
+ } catch (error) {
+ if (error?.code === 'EEXIST') {
+ const message = destinationRoot
+ ? `clean Skill staging destination already exists: ${absolute}`
+ : `clean Skill staging entry already exists: ${absolute}`;
+ throw stagingError(message, error);
+ }
+ throw error;
+ }
+
+ // Without a handle-backed identity, cleanup cannot prove that the path is
+ // still ours. Leave the entry in place instead of risking a claimant.
+ const metadata = verifiedDirectoryMetadata(absolute);
+ const owned = { absolute, metadata };
+ ownership.directories.push(owned);
+ ownership.directoryByPath.set(absolute, owned);
+ if (parent) assertOwnedDirectory(parent);
+ return owned;
+}
+
+function ensureOwnedParentDirectories(destination, relative, ownership) {
+ const components = relative.split('/');
+ let current = destination;
+ let parent = ownership.directoryByPath.get(destination);
+ const ancestors = [parent];
+ assertOwnedDirectory(parent);
+ for (const component of components.slice(0, -1)) {
+ current = path.join(current, component);
+ let owned = ownership.directoryByPath.get(current);
+ if (!owned) owned = createOwnedDirectory(current, parent, ownership);
+ else assertOwnedDirectory(owned);
+ parent = owned;
+ ancestors.push(owned);
+ }
+ return ancestors;
+}
+
+function captureNewFileIdentity(descriptor, absolute, ownership, ancestors) {
+ let metadata;
+ try {
+ metadata = fs.fstatSync(descriptor, { bigint: true });
+ } catch (error) {
+ // A transient first fstat failure must not turn our just-created file into
+ // an unowned cleanup target. Retry only to bind cleanup, then rethrow the
+ // original failure.
+ try {
+ const retry = fs.fstatSync(descriptor, { bigint: true });
+ if (retry.isFile() && retry.ino !== 0n) {
+ ownership.files.push({ absolute, metadata: retry, ancestors });
+ }
+ } catch {}
+ throw error;
+ }
+ if (!metadata.isFile() || metadata.ino === 0n) {
+ throw stagingError(`clean Skill staging file identity is unavailable: ${absolute}`);
+ }
+ const owned = { absolute, metadata, ancestors };
+ ownership.files.push(owned);
+ return owned;
+}
+
+function writeOwnedFile(absolute, content, mode, ownership, ancestors = []) {
+ for (const ancestor of ancestors) assertOwnedDirectory(ancestor);
+ const noFollow = process.platform === 'win32' ? 0 : (fs.constants.O_NOFOLLOW ?? 0);
+ let descriptor;
+ let owned;
+ try {
+ descriptor = fs.openSync(
+ absolute,
+ fs.constants.O_WRONLY | fs.constants.O_CREAT | fs.constants.O_EXCL | noFollow,
+ mode,
+ );
+ owned = captureNewFileIdentity(descriptor, absolute, ownership, ancestors);
+ // Opening a leaf with O_NOFOLLOW does not prevent a directory ancestor
+ // from being redirected between the preflight and open calls. Recheck the
+ // complete owned chain while the new file is still empty; descriptor-bound
+ // cleanup can then retire that inode without ever writing package bytes
+ // through a claimant-controlled ancestor.
+ for (const ancestor of ancestors) assertOwnedDirectory(ancestor);
+ fs.writeFileSync(descriptor, content);
+ fs.fchmodSync(descriptor, mode);
+ const after = fs.fstatSync(descriptor, { bigint: true });
+ const current = fs.lstatSync(absolute, { bigint: true });
+ if (!after.isFile()
+ || !current.isFile()
+ || after.ino === 0n
+ || current.ino === 0n
+ || !sameFileIdentity(owned.metadata, after)
+ || !sameFileIdentity(after, current)) {
+ throw stagingError(`clean Skill staging file changed while being written: ${absolute}`);
+ }
+ for (const ancestor of ancestors) assertOwnedDirectory(ancestor);
+ } finally {
+ if (descriptor !== undefined) fs.closeSync(descriptor);
+ }
+}
+
+function ownedDirectoryStillNamed(owned) {
+ try {
+ const current = fs.lstatSync(owned.absolute, { bigint: true });
+ return current.isDirectory()
+ && !current.isSymbolicLink()
+ && current.ino !== 0n
+ && sameFileIdentity(owned.metadata, current);
+ } catch {
+ return false;
+ }
+}
+
+function retireOwnedStagingFile(owned) {
+ const captured = captureRegularFileBinding(owned.absolute, {
+ subject: 'clean-staging-file',
+ expectedIdentity: {
+ device: owned.metadata.dev,
+ inode: owned.metadata.ino,
+ },
+ expectedLinks: 1,
+ });
+ if (captured.status !== 'captured') return false;
+ try {
+ const removed = quarantineRemoveRegularFileBinding(
+ captured.binding,
+ owned.absolute,
+ { subject: 'clean-staging-file', expectedLinks: 1 },
+ );
+ return removed.status === 'removed' || removed.status === 'absent';
+ } finally {
+ releaseRegularFileBinding(captured.binding);
+ }
+}
+
+function createDirectoryRetirementQuarantine(parent) {
+ for (let attempt = 0; attempt < 8; attempt += 1) {
+ const directory = path.join(
+ parent,
+ `.archify-stage-remove-${randomBytes(16).toString('hex')}`,
+ );
+ try {
+ fs.mkdirSync(directory, { mode: 0o700 });
+ return directory;
+ } catch (error) {
+ if (error?.code !== 'EEXIST') return null;
+ }
+ }
+ return null;
+}
+
+function retireOwnedStagingDirectory(owned) {
+ if (!ownedDirectoryStillNamed(owned)) return false;
+ try {
+ // Keep a known non-empty directory at its public recovery location. Any
+ // remaining child was not retired as one of this invocation's owned files
+ // and may therefore belong to a claimant.
+ if (fs.readdirSync(owned.absolute).length !== 0) return false;
+ } catch {
+ return false;
+ }
+ const quarantine = createDirectoryRetirementQuarantine(path.dirname(owned.absolute));
+ if (!quarantine) return false;
+ const movedPath = path.join(quarantine, path.basename(owned.absolute));
+ try {
+ fs.renameSync(owned.absolute, movedPath);
+ } catch {
+ try { fs.rmdirSync(quarantine); } catch {}
+ return false;
+ }
+
+ let moved;
+ try {
+ moved = fs.lstatSync(movedPath, { bigint: true });
+ } catch {
+ return false;
+ }
+ if (!moved.isDirectory()
+ || moved.isSymbolicLink()
+ || moved.ino === 0n
+ || !sameFileIdentity(owned.metadata, moved)) {
+ // A successor won the move boundary. It is retained under the private
+ // quarantine name because directories have no portable no-clobber
+ // hard-link primitive with which to restore that exact entry safely.
+ return false;
+ }
+ try {
+ // Never recurse: unexpected children keep the owned directory as recovery
+ // material, and a non-empty successor swapped here cannot be deleted.
+ fs.rmdirSync(movedPath);
+ fs.rmdirSync(quarantine);
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+function cleanupOwnedStaging(ownership) {
+ for (const owned of [...ownership.files].reverse()) {
+ try { retireOwnedStagingFile(owned); } catch {}
+ }
+ for (const owned of [...ownership.directories].reverse()) {
+ try { retireOwnedStagingDirectory(owned); } catch {}
+ }
}
function validateThirdPartyNoticeInputs(repoRoot, packageEntries) {
@@ -249,9 +489,6 @@ export function stageCleanSkill({ repoRoot = scriptRoot, destination, modeManife
const resolvedRoot = fs.realpathSync(path.resolve(repoRoot));
if (!destination) throw new Error('clean Skill staging requires a destination');
const resolvedDestination = path.resolve(destination);
- if (fs.existsSync(resolvedDestination)) {
- throw new Error(`clean Skill staging destination already exists: ${resolvedDestination}`);
- }
// The manifest records each staged file's Git index mode for the archive
// writer. Filesystem permission bits are not portable (Windows cannot store
// an executable bit), so the archive must not re-derive modes from stat.
@@ -308,6 +545,7 @@ export function stageCleanSkill({ repoRoot = scriptRoot, destination, modeManife
// snapshots that predate a runtime remain reproducible by the DSH adapter.
validateRuntimeDependencies(packageEntries);
validateThirdPartyNoticeInputs(resolvedRoot, packageEntries);
+ cleanPackageManifestEntry(packageEntries);
const modes = Object.fromEntries(
packageEntries
@@ -315,27 +553,50 @@ export function stageCleanSkill({ repoRoot = scriptRoot, destination, modeManife
.sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0)),
);
- fs.mkdirSync(resolvedDestination, { recursive: true, mode: 0o755 });
+ const ownership = {
+ directories: [],
+ directoryByPath: new Map(),
+ files: [],
+ };
let fileCount = 0;
- let manifestWritten = false;
try {
+ const destinationParentPath = path.dirname(resolvedDestination);
+ fs.mkdirSync(destinationParentPath, { recursive: true, mode: 0o755 });
+ const destinationParent = {
+ absolute: destinationParentPath,
+ metadata: verifiedDirectoryMetadata(destinationParentPath),
+ };
+ createOwnedDirectory(resolvedDestination, destinationParent, ownership, {
+ destinationRoot: true,
+ });
for (const entry of packageEntries) {
const relativeInsideSkill = entry.relative.slice('archify/'.length);
const target = path.join(resolvedDestination, ...relativeInsideSkill.split('/'));
- fs.mkdirSync(path.dirname(target), { recursive: true });
- fs.writeFileSync(target, entry.content);
- if (entry.mode === '100755') fs.chmodSync(target, 0o755);
- else fs.chmodSync(target, 0o644);
+ const ancestors = ensureOwnedParentDirectories(
+ resolvedDestination,
+ relativeInsideSkill,
+ ownership,
+ );
+ writeOwnedFile(
+ target,
+ entry.content,
+ entry.mode === '100755' ? 0o755 : 0o644,
+ ownership,
+ ancestors,
+ );
fileCount += 1;
}
- cleanPackageManifest(resolvedDestination);
if (resolvedModeManifest !== null) {
- fs.writeFileSync(resolvedModeManifest, `${JSON.stringify(modes, null, 2)}\n`, { flag: 'wx' });
- manifestWritten = true;
+ writeOwnedFile(
+ resolvedModeManifest,
+ `${JSON.stringify(modes, null, 2)}\n`,
+ 0o644,
+ ownership,
+ );
}
+ assertOwnedDirectory(ownership.directoryByPath.get(resolvedDestination));
} catch (error) {
- fs.rmSync(resolvedDestination, { recursive: true, force: true });
- if (manifestWritten) fs.rmSync(resolvedModeManifest, { force: true });
+ cleanupOwnedStaging(ownership);
throw error;
}
diff --git a/scripts/windows-path-fixtures.ps1 b/scripts/windows-path-fixtures.ps1
new file mode 100644
index 00000000..228b4aaf
--- /dev/null
+++ b/scripts/windows-path-fixtures.ps1
@@ -0,0 +1,78 @@
+param(
+ [Parameter(Mandatory = $true)]
+ [string]$NodeVersion,
+ [switch]$Cleanup
+)
+
+$ErrorActionPreference = 'Stop'
+$shareName = "archify-$env:GITHUB_RUN_ID-$env:GITHUB_RUN_ATTEMPT-node$NodeVersion"
+$fixtureRoot = Join-Path $env:RUNNER_TEMP $shareName
+
+function Remove-ArchifyWindowsPathFixtures {
+ Get-SmbShare -Name $shareName -ErrorAction SilentlyContinue |
+ Remove-SmbShare -Force -Confirm:$false -ErrorAction SilentlyContinue
+ if (Test-Path -LiteralPath $fixtureRoot) {
+ Remove-Item -LiteralPath $fixtureRoot -Recurse -Force
+ }
+}
+
+if ($Cleanup) {
+ Remove-ArchifyWindowsPathFixtures
+ exit 0
+}
+
+$shareRoot = Join-Path $fixtureRoot 'share'
+$caseRoot = Join-Path $fixtureRoot 'case-sensitive'
+$eightDotThreeRoot = Join-Path $fixtureRoot 'controlled-eight-dot-three-root'
+$eightDotThreeShortRoot = Join-Path $fixtureRoot 'ARCH8D~1'
+Remove-ArchifyWindowsPathFixtures
+New-Item -ItemType Directory -Path $shareRoot, $caseRoot, $eightDotThreeRoot | Out-Null
+
+& fsutil.exe file setshortname $eightDotThreeRoot 'ARCH8D~1'
+if ($LASTEXITCODE -ne 0) {
+ throw "Could not assign the controlled 8.3 alias at $eightDotThreeRoot"
+}
+$eightDotThreeProbe = Join-Path $eightDotThreeRoot 'short-name-probe.txt'
+$eightDotThreeAliasProbe = Join-Path $eightDotThreeShortRoot 'short-name-probe.txt'
+[IO.File]::WriteAllText($eightDotThreeProbe, 'controlled-8dot3')
+if (-not [IO.Directory]::Exists($eightDotThreeShortRoot) -or
+ [IO.File]::ReadAllText($eightDotThreeAliasProbe) -ne 'controlled-8dot3') {
+ throw 'The explicit 8.3 alias did not resolve to the controlled NTFS directory.'
+}
+[IO.File]::Delete($eightDotThreeProbe)
+
+& fsutil.exe file setCaseSensitiveInfo $caseRoot enable
+if ($LASTEXITCODE -ne 0) {
+ throw "Could not enable per-directory case sensitivity at $caseRoot"
+}
+$upperProbe = Join-Path $caseRoot 'ArchifyCaseProbe.txt'
+$lowerProbe = Join-Path $caseRoot 'archifycaseprobe.txt'
+[IO.File]::WriteAllText($upperProbe, 'upper')
+[IO.File]::WriteAllText($lowerProbe, 'lower')
+if ([IO.File]::ReadAllText($upperProbe) -ne 'upper' -or
+ [IO.File]::ReadAllText($lowerProbe) -ne 'lower') {
+ throw 'The controlled NTFS directory did not preserve case-distinct files.'
+}
+[IO.File]::Delete($upperProbe)
+[IO.File]::Delete($lowerProbe)
+
+$identity = [Security.Principal.WindowsIdentity]::GetCurrent().Name
+New-SmbShare -Name $shareName -Path $shareRoot -Temporary -ChangeAccess $identity | Out-Null
+$uncRoot = "\\localhost\$shareName"
+$extendedUncRoot = "\\?\UNC\localhost\$shareName"
+$uncProbe = [IO.Path]::Combine($uncRoot, 'ordinary-unc-probe.txt')
+$extendedProbe = [IO.Path]::Combine($extendedUncRoot, 'extended-unc-probe.txt')
+[IO.File]::WriteAllText($uncProbe, 'ordinary')
+[IO.File]::WriteAllText($extendedProbe, 'extended')
+if ([IO.File]::ReadAllText($uncProbe) -ne 'ordinary' -or
+ [IO.File]::ReadAllText($extendedProbe) -ne 'extended') {
+ throw 'The controlled SMB share did not support ordinary and extended UNC access.'
+}
+[IO.File]::Delete($uncProbe)
+[IO.File]::Delete($extendedProbe)
+
+Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_CASE_SENSITIVE_ROOT=$caseRoot"
+Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_UNC_ROOT=$uncRoot"
+Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_EXTENDED_UNC_ROOT=$extendedUncRoot"
+Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_8DOT3_ROOT=$eightDotThreeRoot"
+Add-Content -LiteralPath $env:GITHUB_ENV -Value "ARCHIFY_WINDOWS_8DOT3_SHORT_ROOT=$eightDotThreeShortRoot"
diff --git a/scripts/write-deterministic-zip.mjs b/scripts/write-deterministic-zip.mjs
index 57156daf..5a4cba29 100644
--- a/scripts/write-deterministic-zip.mjs
+++ b/scripts/write-deterministic-zip.mjs
@@ -6,8 +6,10 @@ import { createHash, randomBytes } from 'node:crypto';
import { constants as zlibConstants, deflateRawSync } from 'node:zlib';
import {
+ backupPublicRegularFileBinding,
captureAtomicOutput,
captureRegularFileBinding,
+ quarantineRemoveRegularFileBinding,
releaseRegularFileBinding,
removeOwnedRegularFile,
verifyAtomicOutput,
@@ -255,13 +257,62 @@ end.writeUInt16LE(0, 20);
const archive = Buffer.concat([...localParts, ...centralParts, end]);
const archiveSha256 = createHash('sha256').update(archive).digest('hex');
+const outputNamespace = createHash('sha256')
+ .update(path.basename(outputCapture.commitPath))
+ .digest('hex')
+ .slice(0, 16);
const temporary = path.join(
path.dirname(outputCapture.commitPath),
- `.${path.basename(outputCapture.commitPath)}.${randomBytes(16).toString('hex')}.tmp`,
+ `.archify-zip-${outputNamespace}-${randomBytes(16).toString('hex')}.tmp`,
+);
+const previousOutput = path.join(
+ path.dirname(outputCapture.commitPath),
+ `.archify-zip-backup-${outputNamespace}-${randomBytes(16).toString('hex')}.tmp`,
);
let descriptor;
let candidateIdentity;
let candidateBinding;
+let previousBinding;
+let candidatePresent = false;
+let targetCommitted = false;
+let backupPresent = false;
+let publicationFailure;
+
+function archivePublicationError(message, result, filePath = output) {
+ const reason = result?.reason || result || {};
+ return new Error(
+ `${message} (${reason.code || 'verification-failed'}): ${filePath}`,
+ { cause: reason },
+ );
+}
+
+function removeBoundArchiveCandidate(expectedLinks) {
+ const removed = quarantineRemoveRegularFileBinding(
+ candidateBinding,
+ temporary,
+ { subject: 'archive-candidate', expectedLinks },
+ );
+ if (removed.status === 'removed' || removed.status === 'preserved') return removed;
+
+ // If the owned inode was modified in place, bind its current state before
+ // quarantine removal. An entry replaced by another inode is never claimed.
+ const rebound = captureRegularFileBinding(temporary, {
+ subject: 'mutated-archive-candidate',
+ expectedIdentity: candidateIdentity,
+ expectedLinks,
+ });
+ if (rebound.status !== 'captured') return removed;
+ try {
+ return quarantineRemoveRegularFileBinding(
+ rebound.binding,
+ temporary,
+ { subject: 'mutated-archive-candidate', expectedLinks },
+ );
+ } finally {
+ releaseRegularFileBinding(rebound.binding);
+ }
+}
+
try {
const noFollow = process.platform === 'win32' ? 0 : (fs.constants.O_NOFOLLOW || 0);
descriptor = fs.openSync(
@@ -288,6 +339,7 @@ try {
device: candidateMetadata.dev,
inode: candidateMetadata.ino,
};
+ candidatePresent = true;
fs.writeFileSync(descriptor, archive);
if (outputCapture.mode !== null) fs.fchmodSync(descriptor, outputCapture.mode);
fs.fsyncSync(descriptor);
@@ -308,9 +360,7 @@ try {
candidateBinding = candidate.binding;
const verifiedOutput = verifyAtomicOutput(outputCapture.snapshot);
if (verifiedOutput.status !== 'match') {
- throw new Error(
- `archive output changed before publication (${verifiedOutput.reason?.code || 'verification-failed'}): ${output}`,
- );
+ throw archivePublicationError('archive output changed before publication', verifiedOutput);
}
const verifiedCandidate = verifyRegularFileBinding(candidateBinding);
if (verifiedCandidate.status !== 'match') {
@@ -318,27 +368,164 @@ try {
`archive candidate changed before publication (${verifiedCandidate.reason?.code || 'verification-failed'}): ${temporary}`,
);
}
- const releasedCandidate = releaseRegularFileBinding(candidateBinding);
- candidateBinding = undefined;
- if (releasedCandidate.status !== 'released') {
- throw new Error(
- `archive candidate handle could not be released (${releasedCandidate.reason?.code || 'release-failed'}): ${temporary}`,
+ if (outputCapture.snapshot.target.kind === 'file') {
+ const expected = outputCapture.snapshot.target;
+ const previous = captureRegularFileBinding(outputCapture.commitPath, {
+ subject: 'previous-archive-output',
+ expectedIdentity: { device: expected.device, inode: expected.inode },
+ expectedMode: expected.mode,
+ expectedLinks: 1,
+ });
+ if (previous.status !== 'captured') {
+ throw archivePublicationError('previous archive output cannot be bound safely', previous);
+ }
+ previousBinding = previous.binding;
+ const backup = backupPublicRegularFileBinding(
+ previousBinding,
+ outputCapture.commitPath,
+ previousOutput,
+ { subject: 'previous-archive-output' },
+ );
+ backupPresent = backup.backupCreated === true;
+ if (backup.status !== 'backed-up') {
+ throw archivePublicationError('previous archive output cannot be backed up safely', backup);
+ }
+ }
+
+ const ready = verifyRegularFileBinding(candidateBinding, {
+ filePath: temporary,
+ expectedLinks: 1,
+ });
+ if (ready.status !== 'match') {
+ throw archivePublicationError('archive candidate changed before commit', ready, temporary);
+ }
+ try {
+ // linkSync is a no-clobber commit: a writer that claims the public name
+ // after preflight is preserved. The candidate descriptor stays open and
+ // identity-bound until the linked public inode has been verified.
+ fs.linkSync(temporary, outputCapture.commitPath);
+ } catch (error) {
+ throw archivePublicationError('archive output cannot be committed safely', {
+ code: error?.code === 'EEXIST'
+ ? 'archive-output-claimed-during-publish'
+ : 'archive-output-publish-failed',
+ systemCode: error?.code,
+ });
+ }
+ targetCommitted = true;
+ const linked = verifyRegularFileBinding(candidateBinding, {
+ filePath: outputCapture.commitPath,
+ expectedLinks: 2,
+ });
+ if (linked.status !== 'match') {
+ throw archivePublicationError('published archive identity cannot be verified', linked);
+ }
+
+ const removedCandidate = removeBoundArchiveCandidate(2);
+ if (removedCandidate.status !== 'removed') {
+ throw archivePublicationError('archive candidate cannot be finalized safely', removedCandidate, temporary);
+ }
+ candidatePresent = false;
+ const finalized = verifyRegularFileBinding(candidateBinding, {
+ filePath: outputCapture.commitPath,
+ expectedLinks: 1,
+ });
+ if (finalized.status !== 'match') {
+ throw archivePublicationError('published archive changed during finalization', finalized);
+ }
+
+ if (backupPresent) {
+ const removedBackup = quarantineRemoveRegularFileBinding(
+ previousBinding,
+ previousOutput,
+ { subject: 'previous-archive-output', expectedLinks: 1 },
);
+ if (removedBackup.status !== 'removed') {
+ throw archivePublicationError('previous archive backup cannot be finalized safely', removedBackup, previousOutput);
+ }
+ backupPresent = false;
}
- fs.renameSync(temporary, outputCapture.commitPath);
candidateIdentity = undefined;
+} catch (error) {
+ publicationFailure = error;
+ const rollbackErrors = [];
+ if (targetCommitted && candidateBinding) {
+ const removed = quarantineRemoveRegularFileBinding(
+ candidateBinding,
+ outputCapture.commitPath,
+ { subject: 'published-archive-output', expectedLinks: candidatePresent ? 2 : 1 },
+ );
+ if (removed.status === 'removed') {
+ targetCommitted = false;
+ } else {
+ rollbackErrors.push(`published archive removal failed (${removed.reason?.code || removed.status})`);
+ }
+ }
+ if (backupPresent && previousBinding && !targetCommitted) {
+ const backup = verifyRegularFileBinding(previousBinding, {
+ filePath: previousOutput,
+ expectedLinks: 1,
+ });
+ if (backup.status !== 'match') {
+ rollbackErrors.push(`previous archive backup changed (${backup.reason?.code || backup.status})`);
+ } else {
+ try {
+ fs.linkSync(previousOutput, outputCapture.commitPath);
+ const restored = verifyRegularFileBinding(previousBinding, {
+ filePath: outputCapture.commitPath,
+ expectedLinks: 2,
+ });
+ if (restored.status !== 'match') {
+ rollbackErrors.push(`previous archive restore changed (${restored.reason?.code || restored.status})`);
+ } else {
+ const removedBackup = quarantineRemoveRegularFileBinding(
+ previousBinding,
+ previousOutput,
+ { subject: 'previous-archive-output', expectedLinks: 2 },
+ );
+ if (removedBackup.status === 'removed') {
+ backupPresent = false;
+ } else {
+ rollbackErrors.push(`previous archive backup cleanup failed (${removedBackup.reason?.code || removedBackup.status})`);
+ }
+ }
+ } catch (restoreError) {
+ rollbackErrors.push(`previous archive restore failed (${restoreError.code || restoreError.message})`);
+ }
+ }
+ }
+ if (rollbackErrors.length) {
+ throw new AggregateError(
+ [error],
+ `Archive publication requires recovery: ${rollbackErrors.join('; ')}`,
+ );
+ }
+ throw error;
} finally {
if (descriptor !== undefined) fs.closeSync(descriptor);
- if (candidateBinding) releaseRegularFileBinding(candidateBinding);
- if (candidateIdentity) {
+ if (candidateBinding && candidatePresent) {
+ const cleanup = removeBoundArchiveCandidate(targetCommitted ? 2 : 1);
+ if (!publicationFailure && !['removed', 'preserved'].includes(cleanup.status)) {
+ publicationFailure = archivePublicationError(
+ 'archive candidate could not be cleaned safely',
+ cleanup,
+ temporary,
+ );
+ }
+ } else if (candidateIdentity) {
const cleanup = removeOwnedRegularFile(temporary, candidateIdentity, {
subject: 'archive-candidate',
});
- if (!['removed', 'absent', 'preserved'].includes(cleanup.status)) {
- throw new Error(
- `archive candidate could not be cleaned safely (${cleanup.reason?.code || 'cleanup-failed'}): ${temporary}`,
+ if (!publicationFailure && !['removed', 'absent', 'preserved'].includes(cleanup.status)) {
+ publicationFailure = archivePublicationError(
+ 'archive candidate could not be cleaned safely',
+ cleanup,
+ temporary,
);
}
}
+ if (candidateBinding) releaseRegularFileBinding(candidateBinding);
+ if (previousBinding) releaseRegularFileBinding(previousBinding);
}
+if (publicationFailure) throw publicationFailure;
console.log(`built ${output} (${entryCount} files)`);