From 8ab0d0eb98ba2d2b232001c215267012146526c5 Mon Sep 17 00:00:00 2001 From: Asterios Raptis Date: Thu, 22 Oct 2026 13:34:06 +0200 Subject: [PATCH 1/3] fix(schema): x-schema-version 1.20 for 0.42.1's content, and a ledger gate in both directions (#279) 0.42.1 changed the ExerciseVariable description under 1.19, against the rule that a description-only edit bumps x-schema-version too. Both schema files move to 1.20 (lockstep), quality-rules.json and grading-presets.json follow, the baselines and generated modules are regenerated. The new ledger (src/__fixtures__/schema-baseline/schema-version-ledger.json) maps each version to the digest of the schema set's content without $id and x-schema-version. src/schema-version-ledger.test.ts fails on a change without a bump, a bump without a change, files out of lockstep and two rows with one digest; seeded probes run on a ledger consistent by construction. RED before the bump, on this repository: "the schema content changed but x-schema-version is still 1.19". Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/schema-diagrams.md | 2 +- schema/content-manifest.schema.json | 2 +- schema/grading-presets.json | 2 +- schema/lesson.schema.json | 2 +- schema/quality-rules.json | 2 +- scripts/schema-version-ledger.d.mts | 10 ++ scripts/schema-version-ledger.mjs | 88 +++++++++++++++ .../content-manifest.schema.json | 2 +- .../schema-baseline/lesson.schema.json | 2 +- .../schema-version-ledger.json | 4 + src/schema-baseline.test.ts | 2 +- src/schema-validators.generated.ts | 2 +- src/schema-version-ledger.test.ts | 101 ++++++++++++++++++ src/schemas.generated.ts | 4 +- 14 files changed, 214 insertions(+), 11 deletions(-) create mode 100644 scripts/schema-version-ledger.d.mts create mode 100644 scripts/schema-version-ledger.mjs create mode 100644 src/__fixtures__/schema-baseline/schema-version-ledger.json create mode 100644 src/schema-version-ledger.test.ts diff --git a/docs/schema-diagrams.md b/docs/schema-diagrams.md index 803fa79..c2a6eef 100644 --- a/docs/schema-diagrams.md +++ b/docs/schema-diagrams.md @@ -26,7 +26,7 @@ false ordering sentence survived in this repo for weeks. - + ### 1. Content structure (generated) diff --git a/schema/content-manifest.schema.json b/schema/content-manifest.schema.json index 683c06b..892da1a 100644 --- a/schema/content-manifest.schema.json +++ b/schema/content-manifest.schema.json @@ -481,5 +481,5 @@ ], "title": "ContentManifest", "type": "object", - "x-schema-version": "1.19" + "x-schema-version": "1.20" } diff --git a/schema/grading-presets.json b/schema/grading-presets.json index e935dd8..c926244 100644 --- a/schema/grading-presets.json +++ b/schema/grading-presets.json @@ -1,5 +1,5 @@ { - "$schema-version": "1.19", + "$schema-version": "1.20", "description": "Grading presets for a content set's evaluation block (schema: content-manifest.schema.json, ContentSetEvaluation). A preset's evaluation is COPIED into a set's manifest when the author picks it; a later correction of a preset in this file does not change sets that already carry a copy, and the manifest does not record which preset it came from. Class A presets follow a primary source, class B presets are widely used conventions and say so in their note, templates carry a scale's grades and pass mark but no thresholds (the author sets them), and unavailable entries name scales that cannot be expressed as percentages, with the reason. label is the grade as written (a number, a letter or a range); label_native is the official word for it, where one exists. min_percent is an integer in the schema. Where an official lower bound is not a whole percent (52 of 60 points is 86.67 %), the row carries the whole percent below it. On the national scale that is exact, not an approximation: only whole points are reachable, and between 51 points (85 %) and 52 points (86.67 %) no reachable value lies, so 86 separates them as the regulation does; 87 would give 52 points the lower grade. The rule maps the national scale, not a consumer's run: a run counts answered units on its own grid (40 units: 2.5 % steps), so it can land between two reachable points of the scale, for example at 86.25 %, and then earns the upper grade. Every such row is listed in the preset's rounded_rows with its official value; a preset with an empty list has exact thresholds. The lowest row always sits at 0, also where a scale starts above 0 (1 of 60 points), so every run earns a grade.", "presets": [ { diff --git a/schema/lesson.schema.json b/schema/lesson.schema.json index dced7cd..3f07390 100644 --- a/schema/lesson.schema.json +++ b/schema/lesson.schema.json @@ -1340,5 +1340,5 @@ ], "title": "Lesson", "type": "object", - "x-schema-version": "1.19" + "x-schema-version": "1.20" } diff --git a/schema/quality-rules.json b/schema/quality-rules.json index ea4184d..3c8263f 100644 --- a/schema/quality-rules.json +++ b/schema/quality-rules.json @@ -1,5 +1,5 @@ { - "$schema-version": "1.19", + "$schema-version": "1.20", "_comment": "Shared quality minimums, canonical in learn-content-engine and applied by its validateLessonQuality (engine#185). A lesson's purpose lifts some of them: bridge the exercise and exercise-type minimums, quiz the exercise-type minimum. Consumers read these numbers from the pinned engine release instead of keeping a copy.", "rules": { "minExerciseTypes": 2, diff --git a/scripts/schema-version-ledger.d.mts b/scripts/schema-version-ledger.d.mts new file mode 100644 index 0000000..bf60e7f --- /dev/null +++ b/scripts/schema-version-ledger.d.mts @@ -0,0 +1,10 @@ +export interface SchemaSetTexts { + lesson: string; + manifest: string; +} + +export function schemaSetDigest(texts: SchemaSetTexts): string; + +export function schemaSetVersions(texts: SchemaSetTexts): { lesson: string; manifest: string }; + +export function ledgerFindings(ledger: Record, texts: SchemaSetTexts): string[]; diff --git a/scripts/schema-version-ledger.mjs b/scripts/schema-version-ledger.mjs new file mode 100644 index 0000000..9724f2a --- /dev/null +++ b/scripts/schema-version-ledger.mjs @@ -0,0 +1,88 @@ +/** + * The schema set's version must move with its content, and only then (engine#279). + * + * `x-schema-version` is the revision counter of the schema DEFINITION + * (docs/lesson-format.md, "schema_version vs x-schema-version"): it bumps on + * every change, description-only edits included. The two schema files move + * in lockstep, so the counter versions the SET (lesson + manifest), not each + * file. Nothing enforced that, and a check over every release tag found + * content that changed under an unchanged number seven times, twice after the + * rule was written down (0.24.1 under 1.14, 0.42.1 under 1.19). + * + * The ledger (`src/__fixtures__/schema-baseline/schema-version-ledger.json`) + * maps each `x-schema-version` to the digest of the schema set's content: + * both files parsed, `$id` and `x-schema-version` removed, keys sorted. A + * change without a bump leaves the current digest different from its own + * version's row; a bump without a change reproduces an earlier row's digest. + * Both are findings, as are files out of lockstep and two rows with one + * digest. + */ + +import { createHash } from "node:crypto"; + +const sortKeys = (value) => { + if (Array.isArray(value)) return value.map(sortKeys); + if (value && typeof value === "object") { + return Object.fromEntries( + Object.keys(value) + .sort() + .map((key) => [key, sortKeys(value[key])]), + ); + } + return value; +}; + +const withoutCounters = (text) => { + const content = JSON.parse(text); + delete content.$id; + delete content["x-schema-version"]; + return sortKeys(content); +}; + +/** Digest of the schema set's content, without `$id` and `x-schema-version`. */ +export function schemaSetDigest({ lesson, manifest }) { + const content = JSON.stringify([withoutCounters(lesson), withoutCounters(manifest)]); + return createHash("sha256").update(content).digest("hex"); +} + +/** The `x-schema-version` of each file of the set. */ +export function schemaSetVersions({ lesson, manifest }) { + return { + lesson: JSON.parse(lesson)["x-schema-version"], + manifest: JSON.parse(manifest)["x-schema-version"], + }; +} + +/** + * Every way the set and the ledger disagree, as messages; empty when the + * current version's row holds exactly the current content. + */ +export function ledgerFindings(ledger, texts) { + const findings = []; + const versions = schemaSetVersions(texts); + if (versions.lesson !== versions.manifest) { + findings.push( + `the schema files are out of lockstep: lesson.schema.json is ${versions.lesson}, content-manifest.schema.json is ${versions.manifest}`, + ); + } + const seen = new Map(); + for (const [version, digest] of Object.entries(ledger)) { + if (seen.has(digest)) findings.push(`ledger rows ${seen.get(digest)} and ${version} hold the same content`); + else seen.set(digest, version); + } + const version = versions.lesson; + const digest = schemaSetDigest(texts); + const earlier = Object.entries(ledger).find(([other, recorded]) => other !== version && recorded === digest); + if (earlier) { + findings.push( + `x-schema-version rose to ${version}, but the content equals ${earlier[0]}: a version moves only with a change`, + ); + } else if (!(version in ledger)) { + findings.push(`x-schema-version ${version} has no ledger row; add "${version}": "${digest}"`); + } else if (ledger[version] !== digest) { + findings.push( + `the schema content changed but x-schema-version is still ${version}: bump it in both files and add a ledger row`, + ); + } + return findings; +} diff --git a/src/__fixtures__/schema-baseline/content-manifest.schema.json b/src/__fixtures__/schema-baseline/content-manifest.schema.json index 683c06b..892da1a 100644 --- a/src/__fixtures__/schema-baseline/content-manifest.schema.json +++ b/src/__fixtures__/schema-baseline/content-manifest.schema.json @@ -481,5 +481,5 @@ ], "title": "ContentManifest", "type": "object", - "x-schema-version": "1.19" + "x-schema-version": "1.20" } diff --git a/src/__fixtures__/schema-baseline/lesson.schema.json b/src/__fixtures__/schema-baseline/lesson.schema.json index dced7cd..3f07390 100644 --- a/src/__fixtures__/schema-baseline/lesson.schema.json +++ b/src/__fixtures__/schema-baseline/lesson.schema.json @@ -1340,5 +1340,5 @@ ], "title": "Lesson", "type": "object", - "x-schema-version": "1.19" + "x-schema-version": "1.20" } diff --git a/src/__fixtures__/schema-baseline/schema-version-ledger.json b/src/__fixtures__/schema-baseline/schema-version-ledger.json new file mode 100644 index 0000000..d2e89cd --- /dev/null +++ b/src/__fixtures__/schema-baseline/schema-version-ledger.json @@ -0,0 +1,4 @@ +{ + "1.19": "6844d0b774dcb8590c15371411781901331d1193ee9c6e5acec5a81d48897532", + "1.20": "eda257b91a8d67d9c0b81e950269a235d94f7cb990ae6a81fa3e04ef66877024" +} diff --git a/src/schema-baseline.test.ts b/src/schema-baseline.test.ts index 5163aba..ec3a1cf 100644 --- a/src/schema-baseline.test.ts +++ b/src/schema-baseline.test.ts @@ -17,7 +17,7 @@ const NEW_ID_BASE = "https://astrapi69.github.io/learn-content-engine/schema"; /** The current, deliberately-set schema version. Bumping it is a conscious * release decision (new exercise type = minor); update it together with the * frozen baseline in the same commit. */ -const EXPECTED_SCHEMA_VERSION = "1.19"; +const EXPECTED_SCHEMA_VERSION = "1.20"; const readText = (relativePath: string): string => readFileSync(fileURLToPath(new URL(relativePath, import.meta.url)), "utf8"); diff --git a/src/schema-validators.generated.ts b/src/schema-validators.generated.ts index 062a2e2..dacec41 100644 --- a/src/schema-validators.generated.ts +++ b/src/schema-validators.generated.ts @@ -20,4 +20,4 @@ import type { ValidateFunction } from "ajv"; // function itself. const ucs2length = ucs2lengthModule.default ?? ucs2lengthModule; -export const validateLessonStructure: ValidateFunction = validate20 as unknown as ValidateFunction;const schema31 = {"$defs":{"Card":{"additionalProperties":false,"properties":{"audio":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"back":{"maxLength":500,"minLength":1,"type":"string"},"code_language":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}],"default":null},"code_snippet":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}],"default":null},"difficulty":{"anyOf":[{"maximum":5,"minimum":1,"type":"integer"},{"type":"null"}],"default":null},"expected_output":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"front":{"maxLength":500,"minLength":1,"type":"string"},"hint":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null},"id":{"$ref":"#/$defs/SlugId"},"stable_id":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,63}$"},{"type":"null"}],"default":null},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"media_type":{"anyOf":[{"enum":["text","code","formula","diagram"],"type":"string"},{"type":"null"}],"default":null},"notes":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"tags":{"default":[],"items":{"$ref":"#/$defs/SlugId"},"maxItems":20,"type":"array"},"token_roles":{"anyOf":[{"items":{"$ref":"#/$defs/CardTokenRole"},"maxItems":10,"type":"array"},{"type":"null"}],"default":null}},"required":["id","front","back"],"type":"object"},"CardTokenRole":{"additionalProperties":false,"properties":{"role":{"$ref":"#/$defs/TokenRole"},"token":{"maxLength":120,"minLength":1,"type":"string"}},"required":["token","role"],"type":"object"},"ClozeBlank":{"additionalProperties":false,"properties":{"accept":{"items":{"type":"string"},"minItems":1,"type":"array"},"hint":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null},"placeholder":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null},"stable_id":{"anyOf":[{"$ref":"#/$defs/SlugId"},{"type":"null"}],"default":null}},"required":["accept"],"type":"object"},"Exercise":{"additionalProperties":false,"properties":{"accept":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null},"accept_orderings":{"anyOf":[{"items":{"items":{"type":"integer"},"type":"array"},"type":"array"},{"type":"null"}],"default":null},"blanks":{"anyOf":[{"items":{"$ref":"#/$defs/ClozeBlank"},"type":"array"},{"type":"null"}],"default":null},"card_ids":{"default":[],"items":{"type":"string"},"maxItems":50,"type":"array"},"case_sensitive":{"default":false,"type":"boolean"},"cloze_mode":{"anyOf":[{"enum":["type","select","multiselect"],"type":"string"},{"type":"null"}],"default":null},"direction":{"default":"target_to_source","enum":["source_to_target","target_to_source","both","random"],"type":"string"},"distractors":{"default":[],"items":{"type":"string"},"maxItems":20,"type":"array"},"examples":{"anyOf":[{"items":{"$ref":"#/$defs/InlineExample"},"maxItems":20,"type":"array"},{"type":"null"}],"default":null},"explanation":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"ext_payload":{"additionalProperties":true,"type":"object"},"from_cards":{"default":false,"type":"boolean"},"hint":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null},"id":{"$ref":"#/$defs/SlugId"},"stable_id":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,63}$"},{"type":"null"}],"default":null},"images":{"anyOf":[{"items":{"$ref":"#/$defs/PictureImage"},"type":"array"},{"type":"null"}],"default":null},"multiple":{"default":false,"type":"boolean"},"options":{"anyOf":[{"items":{"$ref":"#/$defs/MultipleChoiceOption"},"maxItems":20,"type":"array"},{"type":"null"}],"default":null},"pairs":{"anyOf":[{"items":{"$ref":"#/$defs/Pair"},"type":"array"},{"type":"null"}],"default":null},"prompt":{"maxLength":1000,"minLength":1,"type":"string"},"sentence":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null},"tiles":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null},"type":{"anyOf":[{"$ref":"#/$defs/ExerciseType"},{"$ref":"#/$defs/ExtExerciseType"}]},"variables":{"anyOf":[{"items":{"$ref":"#/$defs/ExerciseVariable"},"maxItems":20,"minItems":1,"type":"array"},{"type":"null"}],"default":null}},"required":["id","type","prompt"],"type":"object"},"ExerciseType":{"enum":["matching","picture_choice","free_text","word_tiles","cloze","multiple_choice"],"type":"string"},"ExerciseVariable":{"additionalProperties":false,"properties":{"name":{"maxLength":32,"pattern":"^[a-z][a-z0-9_]*$","type":"string"},"min":{"type":"number"},"max":{"type":"number"},"step":{"exclusiveMinimum":0,"type":"number"},"expression":{"maxLength":200,"minLength":1,"type":"string"},"tolerance":{"minimum":0,"type":"number"}},"required":["name"],"type":"object"},"ExtExerciseType":{"pattern":"^ext:[a-z0-9]+-[a-z0-9-]+$","type":"string"},"InlineExample":{"additionalProperties":false,"properties":{"content":{"maxLength":5000,"minLength":1,"type":"string"},"language":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}],"default":null},"title":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null}},"required":["content"],"type":"object"},"LessonResource":{"additionalProperties":false,"properties":{"author":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"default":null},"description":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"duration":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null},"free":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null},"language":{"anyOf":[{"maxLength":35,"type":"string"},{"type":"null"}],"default":null},"level":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null},"partnership":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null},"tags":{"anyOf":[{"items":{"type":"string"},"maxItems":20,"type":"array"},{"type":"null"}],"default":null},"title":{"maxLength":300,"minLength":1,"type":"string"},"type":{"maxLength":40,"minLength":1,"type":"string"},"url":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["type","title","url"],"type":"object"},"LessonStep":{"additionalProperties":false,"properties":{"body":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"example_label":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null},"example_url":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"examples":{"anyOf":[{"items":{"$ref":"#/$defs/InlineExample"},"maxItems":20,"type":"array"},{"type":"null"}],"default":null},"exercise":{"anyOf":[{"$ref":"#/$defs/Exercise"},{"type":"null"}],"default":null},"id":{"$ref":"#/$defs/SlugId"},"review_lesson_id":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null},"theory_ref":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null},"title":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null},"type":{"$ref":"#/$defs/StepType"}},"required":["id","type"],"type":"object"},"MultipleChoiceOption":{"additionalProperties":false,"properties":{"correct":{"default":false,"type":"boolean"},"stable_id":{"anyOf":[{"$ref":"#/$defs/SlugId"},{"type":"null"}],"default":null},"text":{"maxLength":500,"minLength":1,"type":"string"}},"required":["text"],"type":"object"},"Pair":{"additionalProperties":false,"properties":{"left":{"maxLength":500,"minLength":1,"type":"string"},"right":{"maxLength":500,"minLength":1,"type":"string"},"stable_id":{"anyOf":[{"$ref":"#/$defs/SlugId"},{"type":"null"}],"default":null}},"required":["left","right"],"type":"object"},"PictureImage":{"additionalProperties":false,"properties":{"is_correct":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null},"label":{"maxLength":500,"minLength":1,"type":"string"},"src":{"anyOf":[{"maxLength":500,"minLength":1,"type":"string"},{"maxLength":250000,"pattern":"^data:image/[a-z0-9.+-]+;base64,","type":"string"}]}},"required":["src","label"],"type":"object"},"SlugId":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},"StepType":{"enum":["theory","exercise"],"type":"string"},"TokenRole":{"enum":["article","verb","noun","adjective","preposition","gender_marker","tense_marker"],"type":"string"}},"$id":"https://astrapi69.github.io/learn-content-engine/schema/lesson.schema.json","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"cards":{"default":[],"items":{"$ref":"#/$defs/Card"},"type":"array"},"contributed_at":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null},"contributed_by":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"estimated_minutes":{"default":10,"maximum":240,"minimum":1,"type":"integer"},"id":{"$ref":"#/$defs/SlugId"},"purpose":{"default":"practice","enum":["practice","bridge","quiz"],"type":"string"},"requires_extensions":{"items":{"pattern":"^ext:[a-z0-9]+-[a-z0-9-]+@\\d+$","type":"string"},"type":"array"},"resources":{"anyOf":[{"items":{"$ref":"#/$defs/LessonResource"},"type":"array"},{"type":"null"}],"default":null},"source_language":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"steps":{"items":{"$ref":"#/$defs/LessonStep"},"minItems":1,"type":"array"},"target_language":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"title":{"maxLength":200,"minLength":1,"type":"string"},"variation_note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null},"variation_of":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}],"default":null}},"required":["id","title","steps"],"type":"object","x-schema-version":"1.19"};const schema33 = {"type":"string","minLength":1,"maxLength":120,"pattern":"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"};const schema38 = {"additionalProperties":false,"properties":{"author":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"default":null},"description":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"duration":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null},"free":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null},"language":{"anyOf":[{"maxLength":35,"type":"string"},{"type":"null"}],"default":null},"level":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null},"partnership":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null},"tags":{"anyOf":[{"items":{"type":"string"},"maxItems":20,"type":"array"},{"type":"null"}],"default":null},"title":{"maxLength":300,"minLength":1,"type":"string"},"type":{"maxLength":40,"minLength":1,"type":"string"},"url":{"maxLength":2000,"minLength":1,"type":"string"}},"required":["type","title","url"],"type":"object"};const func1 = Object.prototype.hasOwnProperty;const func3 = ucs2length;const schema32 = {"additionalProperties":false,"properties":{"audio":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"back":{"maxLength":500,"minLength":1,"type":"string"},"code_language":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}],"default":null},"code_snippet":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}],"default":null},"difficulty":{"anyOf":[{"maximum":5,"minimum":1,"type":"integer"},{"type":"null"}],"default":null},"expected_output":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"front":{"maxLength":500,"minLength":1,"type":"string"},"hint":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null},"id":{"$ref":"#/$defs/SlugId"},"stable_id":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{7,63}$"},{"type":"null"}],"default":null},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"media_type":{"anyOf":[{"enum":["text","code","formula","diagram"],"type":"string"},{"type":"null"}],"default":null},"notes":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"tags":{"default":[],"items":{"$ref":"#/$defs/SlugId"},"maxItems":20,"type":"array"},"token_roles":{"anyOf":[{"items":{"$ref":"#/$defs/CardTokenRole"},"maxItems":10,"type":"array"},{"type":"null"}],"default":null}},"required":["id","front","back"],"type":"object"};const pattern4 = new RegExp("^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$", "u");const pattern5 = new RegExp("^[a-z0-9][a-z0-9_-]{7,63}$", "u");const schema35 = {"additionalProperties":false,"properties":{"role":{"$ref":"#/$defs/TokenRole"},"token":{"maxLength":120,"minLength":1,"type":"string"}},"required":["token","role"],"type":"object"};const schema36 = {"enum":["article","verb","noun","adjective","preposition","gender_marker","tense_marker"],"type":"string"};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(data && typeof data == "object" && !Array.isArray(data)){if(data.token === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "token"},message:"must have required property '"+"token"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.role === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "role"},message:"must have required property '"+"role"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "role") || (key0 === "token"))){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.role !== undefined){let data0 = data.role;if(typeof data0 !== "string"){const err3 = {instancePath:instancePath+"/role",schemaPath:"#/$defs/TokenRole/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(!(((((((data0 === "article") || (data0 === "verb")) || (data0 === "noun")) || (data0 === "adjective")) || (data0 === "preposition")) || (data0 === "gender_marker")) || (data0 === "tense_marker"))){const err4 = {instancePath:instancePath+"/role",schemaPath:"#/$defs/TokenRole/enum",keyword:"enum",params:{allowedValues: schema36.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.token !== undefined){let data1 = data.token;if(typeof data1 === "string"){if(func3(data1) > 120){const err5 = {instancePath:instancePath+"/token",schemaPath:"#/properties/token/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(func3(data1) < 1){const err6 = {instancePath:instancePath+"/token",schemaPath:"#/properties/token/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/token",schemaPath:"#/properties/token/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}validate22.errors = vErrors;return errors === 0;}validate22.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate21(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate21.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.front === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "front"},message:"must have required property '"+"front"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.back === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "back"},message:"must have required property '"+"back"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(func1.call(schema32.properties, key0))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.audio !== undefined){let data0 = data.audio;const _errs3 = errors;let valid1 = false;const _errs4 = errors;if(typeof data0 !== "string"){const err4 = {instancePath:instancePath+"/audio",schemaPath:"#/properties/audio/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid0 = _errs4 === errors;valid1 = valid1 || _valid0;const _errs6 = errors;if(data0 !== null){const err5 = {instancePath:instancePath+"/audio",schemaPath:"#/properties/audio/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}var _valid0 = _errs6 === errors;valid1 = valid1 || _valid0;if(!valid1){const err6 = {instancePath:instancePath+"/audio",schemaPath:"#/properties/audio/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}}if(data.back !== undefined){let data1 = data.back;if(typeof data1 === "string"){if(func3(data1) > 500){const err7 = {instancePath:instancePath+"/back",schemaPath:"#/properties/back/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data1) < 1){const err8 = {instancePath:instancePath+"/back",schemaPath:"#/properties/back/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+"/back",schemaPath:"#/properties/back/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.code_language !== undefined){let data2 = data.code_language;const _errs11 = errors;let valid2 = false;const _errs12 = errors;if(typeof data2 === "string"){if(func3(data2) > 30){const err10 = {instancePath:instancePath+"/code_language",schemaPath:"#/properties/code_language/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 30},message:"must NOT have more than 30 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/code_language",schemaPath:"#/properties/code_language/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid1 = _errs12 === errors;valid2 = valid2 || _valid1;const _errs14 = errors;if(data2 !== null){const err12 = {instancePath:instancePath+"/code_language",schemaPath:"#/properties/code_language/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid1 = _errs14 === errors;valid2 = valid2 || _valid1;if(!valid2){const err13 = {instancePath:instancePath+"/code_language",schemaPath:"#/properties/code_language/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}else {errors = _errs11;if(vErrors !== null){if(_errs11){vErrors.length = _errs11;}else {vErrors = null;}}}}if(data.code_snippet !== undefined){let data3 = data.code_snippet;const _errs17 = errors;let valid3 = false;const _errs18 = errors;if(typeof data3 === "string"){if(func3(data3) > 5000){const err14 = {instancePath:instancePath+"/code_snippet",schemaPath:"#/properties/code_snippet/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 5000},message:"must NOT have more than 5000 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/code_snippet",schemaPath:"#/properties/code_snippet/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}var _valid2 = _errs18 === errors;valid3 = valid3 || _valid2;const _errs20 = errors;if(data3 !== null){const err16 = {instancePath:instancePath+"/code_snippet",schemaPath:"#/properties/code_snippet/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}var _valid2 = _errs20 === errors;valid3 = valid3 || _valid2;if(!valid3){const err17 = {instancePath:instancePath+"/code_snippet",schemaPath:"#/properties/code_snippet/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}else {errors = _errs17;if(vErrors !== null){if(_errs17){vErrors.length = _errs17;}else {vErrors = null;}}}}if(data.difficulty !== undefined){let data4 = data.difficulty;const _errs23 = errors;let valid4 = false;const _errs24 = errors;if(!((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4)))){const err18 = {instancePath:instancePath+"/difficulty",schemaPath:"#/properties/difficulty/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(typeof data4 == "number"){if(data4 > 5 || isNaN(data4)){const err19 = {instancePath:instancePath+"/difficulty",schemaPath:"#/properties/difficulty/anyOf/0/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(data4 < 1 || isNaN(data4)){const err20 = {instancePath:instancePath+"/difficulty",schemaPath:"#/properties/difficulty/anyOf/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}var _valid3 = _errs24 === errors;valid4 = valid4 || _valid3;const _errs26 = errors;if(data4 !== null){const err21 = {instancePath:instancePath+"/difficulty",schemaPath:"#/properties/difficulty/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}var _valid3 = _errs26 === errors;valid4 = valid4 || _valid3;if(!valid4){const err22 = {instancePath:instancePath+"/difficulty",schemaPath:"#/properties/difficulty/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}else {errors = _errs23;if(vErrors !== null){if(_errs23){vErrors.length = _errs23;}else {vErrors = null;}}}}if(data.expected_output !== undefined){let data5 = data.expected_output;const _errs29 = errors;let valid5 = false;const _errs30 = errors;if(typeof data5 === "string"){if(func3(data5) > 2000){const err23 = {instancePath:instancePath+"/expected_output",schemaPath:"#/properties/expected_output/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}else {const err24 = {instancePath:instancePath+"/expected_output",schemaPath:"#/properties/expected_output/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}var _valid4 = _errs30 === errors;valid5 = valid5 || _valid4;const _errs32 = errors;if(data5 !== null){const err25 = {instancePath:instancePath+"/expected_output",schemaPath:"#/properties/expected_output/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}var _valid4 = _errs32 === errors;valid5 = valid5 || _valid4;if(!valid5){const err26 = {instancePath:instancePath+"/expected_output",schemaPath:"#/properties/expected_output/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}else {errors = _errs29;if(vErrors !== null){if(_errs29){vErrors.length = _errs29;}else {vErrors = null;}}}}if(data.front !== undefined){let data6 = data.front;if(typeof data6 === "string"){if(func3(data6) > 500){const err27 = {instancePath:instancePath+"/front",schemaPath:"#/properties/front/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(func3(data6) < 1){const err28 = {instancePath:instancePath+"/front",schemaPath:"#/properties/front/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}else {const err29 = {instancePath:instancePath+"/front",schemaPath:"#/properties/front/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}if(data.hint !== undefined){let data7 = data.hint;const _errs37 = errors;let valid6 = false;const _errs38 = errors;if(typeof data7 === "string"){if(func3(data7) > 1000){const err30 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}else {const err31 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}var _valid5 = _errs38 === errors;valid6 = valid6 || _valid5;const _errs40 = errors;if(data7 !== null){const err32 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}var _valid5 = _errs40 === errors;valid6 = valid6 || _valid5;if(!valid6){const err33 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}else {errors = _errs37;if(vErrors !== null){if(_errs37){vErrors.length = _errs37;}else {vErrors = null;}}}}if(data.id !== undefined){let data8 = data.id;if(typeof data8 === "string"){if(func3(data8) > 120){const err34 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}if(func3(data8) < 1){const err35 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if(!pattern4.test(data8)){const err36 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}else {const err37 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data.stable_id !== undefined){let data9 = data.stable_id;const _errs46 = errors;let valid8 = false;const _errs47 = errors;if(typeof data9 === "string"){if(!pattern5.test(data9)){const err38 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9][a-z0-9_-]{7,63}$"},message:"must match pattern \""+"^[a-z0-9][a-z0-9_-]{7,63}$"+"\""};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}else {const err39 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}var _valid6 = _errs47 === errors;valid8 = valid8 || _valid6;const _errs49 = errors;if(data9 !== null){const err40 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}var _valid6 = _errs49 === errors;valid8 = valid8 || _valid6;if(!valid8){const err41 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}else {errors = _errs46;if(vErrors !== null){if(_errs46){vErrors.length = _errs46;}else {vErrors = null;}}}}if(data.image !== undefined){let data10 = data.image;const _errs52 = errors;let valid9 = false;const _errs53 = errors;if(typeof data10 !== "string"){const err42 = {instancePath:instancePath+"/image",schemaPath:"#/properties/image/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}var _valid7 = _errs53 === errors;valid9 = valid9 || _valid7;const _errs55 = errors;if(data10 !== null){const err43 = {instancePath:instancePath+"/image",schemaPath:"#/properties/image/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}var _valid7 = _errs55 === errors;valid9 = valid9 || _valid7;if(!valid9){const err44 = {instancePath:instancePath+"/image",schemaPath:"#/properties/image/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}else {errors = _errs52;if(vErrors !== null){if(_errs52){vErrors.length = _errs52;}else {vErrors = null;}}}}if(data.media_type !== undefined){let data11 = data.media_type;const _errs58 = errors;let valid10 = false;const _errs59 = errors;if(typeof data11 !== "string"){const err45 = {instancePath:instancePath+"/media_type",schemaPath:"#/properties/media_type/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(!((((data11 === "text") || (data11 === "code")) || (data11 === "formula")) || (data11 === "diagram"))){const err46 = {instancePath:instancePath+"/media_type",schemaPath:"#/properties/media_type/anyOf/0/enum",keyword:"enum",params:{allowedValues: schema32.properties.media_type.anyOf[0].enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}var _valid8 = _errs59 === errors;valid10 = valid10 || _valid8;const _errs61 = errors;if(data11 !== null){const err47 = {instancePath:instancePath+"/media_type",schemaPath:"#/properties/media_type/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}var _valid8 = _errs61 === errors;valid10 = valid10 || _valid8;if(!valid10){const err48 = {instancePath:instancePath+"/media_type",schemaPath:"#/properties/media_type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}else {errors = _errs58;if(vErrors !== null){if(_errs58){vErrors.length = _errs58;}else {vErrors = null;}}}}if(data.notes !== undefined){let data12 = data.notes;const _errs64 = errors;let valid11 = false;const _errs65 = errors;if(typeof data12 === "string"){if(func3(data12) > 2000){const err49 = {instancePath:instancePath+"/notes",schemaPath:"#/properties/notes/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}else {const err50 = {instancePath:instancePath+"/notes",schemaPath:"#/properties/notes/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}var _valid9 = _errs65 === errors;valid11 = valid11 || _valid9;const _errs67 = errors;if(data12 !== null){const err51 = {instancePath:instancePath+"/notes",schemaPath:"#/properties/notes/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}var _valid9 = _errs67 === errors;valid11 = valid11 || _valid9;if(!valid11){const err52 = {instancePath:instancePath+"/notes",schemaPath:"#/properties/notes/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}else {errors = _errs64;if(vErrors !== null){if(_errs64){vErrors.length = _errs64;}else {vErrors = null;}}}}if(data.tags !== undefined){let data13 = data.tags;if(Array.isArray(data13)){if(data13.length > 20){const err53 = {instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}const len0 = data13.length;for(let i0=0; i0 120){const err54 = {instancePath:instancePath+"/tags/" + i0,schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}if(func3(data14) < 1){const err55 = {instancePath:instancePath+"/tags/" + i0,schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}if(!pattern4.test(data14)){const err56 = {instancePath:instancePath+"/tags/" + i0,schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}else {const err57 = {instancePath:instancePath+"/tags/" + i0,schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}}else {const err58 = {instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data.token_roles !== undefined){let data15 = data.token_roles;const _errs75 = errors;let valid15 = false;const _errs76 = errors;if(Array.isArray(data15)){if(data15.length > 10){const err59 = {instancePath:instancePath+"/token_roles",schemaPath:"#/properties/token_roles/anyOf/0/maxItems",keyword:"maxItems",params:{limit: 10},message:"must NOT have more than 10 items"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}const len1 = data15.length;for(let i1=0; i1 200){const err5 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid0 = _errs8 === errors;valid3 = valid3 || _valid0;const _errs10 = errors;if(data2 !== null){const err7 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid0 = _errs10 === errors;valid3 = valid3 || _valid0;if(!valid3){const err8 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs7;if(vErrors !== null){if(_errs7){vErrors.length = _errs7;}else {vErrors = null;}}}}if(data.placeholder !== undefined){let data3 = data.placeholder;const _errs13 = errors;let valid4 = false;const _errs14 = errors;if(typeof data3 === "string"){if(func3(data3) > 40){const err9 = {instancePath:instancePath+"/placeholder",schemaPath:"#/properties/placeholder/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 40},message:"must NOT have more than 40 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/placeholder",schemaPath:"#/properties/placeholder/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}var _valid1 = _errs14 === errors;valid4 = valid4 || _valid1;const _errs16 = errors;if(data3 !== null){const err11 = {instancePath:instancePath+"/placeholder",schemaPath:"#/properties/placeholder/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid1 = _errs16 === errors;valid4 = valid4 || _valid1;if(!valid4){const err12 = {instancePath:instancePath+"/placeholder",schemaPath:"#/properties/placeholder/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}else {errors = _errs13;if(vErrors !== null){if(_errs13){vErrors.length = _errs13;}else {vErrors = null;}}}}if(data.stable_id !== undefined){let data4 = data.stable_id;const _errs19 = errors;let valid5 = false;const _errs20 = errors;if(typeof data4 === "string"){if(func3(data4) > 120){const err13 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(func3(data4) < 1){const err14 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(!pattern4.test(data4)){const err15 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}else {const err16 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}var _valid2 = _errs20 === errors;valid5 = valid5 || _valid2;const _errs23 = errors;if(data4 !== null){const err17 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}var _valid2 = _errs23 === errors;valid5 = valid5 || _valid2;if(!valid5){const err18 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}else {errors = _errs19;if(vErrors !== null){if(_errs19){vErrors.length = _errs19;}else {vErrors = null;}}}}}else {const err19 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}validate27.errors = vErrors;return errors === 0;}validate27.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema47 = {"additionalProperties":false,"properties":{"correct":{"default":false,"type":"boolean"},"stable_id":{"anyOf":[{"$ref":"#/$defs/SlugId"},{"type":"null"}],"default":null},"text":{"maxLength":500,"minLength":1,"type":"string"}},"required":["text"],"type":"object"};function validate29(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate29.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.text === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "text"},message:"must have required property '"+"text"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((key0 === "correct") || (key0 === "stable_id")) || (key0 === "text"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.correct !== undefined){if(typeof data.correct !== "boolean"){const err2 = {instancePath:instancePath+"/correct",schemaPath:"#/properties/correct/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.stable_id !== undefined){let data1 = data.stable_id;const _errs5 = errors;let valid1 = false;const _errs6 = errors;if(typeof data1 === "string"){if(func3(data1) > 120){const err3 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func3(data1) < 1){const err4 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid0 = _errs6 === errors;valid1 = valid1 || _valid0;const _errs9 = errors;if(data1 !== null){const err7 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid0 = _errs9 === errors;valid1 = valid1 || _valid0;if(!valid1){const err8 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs5;if(vErrors !== null){if(_errs5){vErrors.length = _errs5;}else {vErrors = null;}}}}if(data.text !== undefined){let data2 = data.text;if(typeof data2 === "string"){if(func3(data2) > 500){const err9 = {instancePath:instancePath+"/text",schemaPath:"#/properties/text/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(func3(data2) < 1){const err10 = {instancePath:instancePath+"/text",schemaPath:"#/properties/text/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+"/text",schemaPath:"#/properties/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}else {const err12 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}validate29.errors = vErrors;return errors === 0;}validate29.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema49 = {"additionalProperties":false,"properties":{"left":{"maxLength":500,"minLength":1,"type":"string"},"right":{"maxLength":500,"minLength":1,"type":"string"},"stable_id":{"anyOf":[{"$ref":"#/$defs/SlugId"},{"type":"null"}],"default":null}},"required":["left","right"],"type":"object"};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(data && typeof data == "object" && !Array.isArray(data)){if(data.left === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "left"},message:"must have required property '"+"left"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.right === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "right"},message:"must have required property '"+"right"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((key0 === "left") || (key0 === "right")) || (key0 === "stable_id"))){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.left !== undefined){let data0 = data.left;if(typeof data0 === "string"){if(func3(data0) > 500){const err3 = {instancePath:instancePath+"/left",schemaPath:"#/properties/left/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func3(data0) < 1){const err4 = {instancePath:instancePath+"/left",schemaPath:"#/properties/left/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/left",schemaPath:"#/properties/left/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.right !== undefined){let data1 = data.right;if(typeof data1 === "string"){if(func3(data1) > 500){const err6 = {instancePath:instancePath+"/right",schemaPath:"#/properties/right/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(func3(data1) < 1){const err7 = {instancePath:instancePath+"/right",schemaPath:"#/properties/right/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+"/right",schemaPath:"#/properties/right/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.stable_id !== undefined){let data2 = data.stable_id;const _errs7 = errors;let valid1 = false;const _errs8 = errors;if(typeof data2 === "string"){if(func3(data2) > 120){const err9 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(func3(data2) < 1){const err10 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(!pattern4.test(data2)){const err11 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid0 = _errs8 === errors;valid1 = valid1 || _valid0;const _errs11 = errors;if(data2 !== null){const err13 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}var _valid0 = _errs11 === errors;valid1 = valid1 || _valid0;if(!valid1){const err14 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}else {errors = _errs7;if(vErrors !== null){if(_errs7){vErrors.length = _errs7;}else {vErrors = null;}}}}}else {const err15 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}validate31.errors = vErrors;return errors === 0;}validate31.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const pattern12 = new RegExp("^data:image/[a-z0-9.+-]+;base64,", "u");const pattern15 = new RegExp("^ext:[a-z0-9]+-[a-z0-9-]+$", "u");const pattern16 = new RegExp("^[a-z][a-z0-9_]*$", "u");function validate26(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate26.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.prompt === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "prompt"},message:"must have required property '"+"prompt"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(func1.call(schema41.properties, key0))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.accept !== undefined){let data0 = data.accept;const _errs3 = errors;let valid1 = false;const _errs4 = errors;if(Array.isArray(data0)){const len0 = data0.length;for(let i0=0; i0 50){const err16 = {instancePath:instancePath+"/card_ids",schemaPath:"#/properties/card_ids/maxItems",keyword:"maxItems",params:{limit: 50},message:"must NOT have more than 50 items"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}const len4 = data7.length;for(let i4=0; i4 20){const err26 = {instancePath:instancePath+"/distractors",schemaPath:"#/properties/distractors/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}const len5 = data12.length;for(let i5=0; i5 20){const err29 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf/0/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}const len6 = data14.length;for(let i6=0; i6 5000){const err32 = {instancePath:instancePath+"/examples/" + i6+"/content",schemaPath:"#/$defs/InlineExample/properties/content/maxLength",keyword:"maxLength",params:{limit: 5000},message:"must NOT have more than 5000 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}if(func3(data16) < 1){const err33 = {instancePath:instancePath+"/examples/" + i6+"/content",schemaPath:"#/$defs/InlineExample/properties/content/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}else {const err34 = {instancePath:instancePath+"/examples/" + i6+"/content",schemaPath:"#/$defs/InlineExample/properties/content/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data15.language !== undefined){let data17 = data15.language;const _errs56 = errors;let valid22 = false;const _errs57 = errors;if(typeof data17 === "string"){if(func3(data17) > 30){const err35 = {instancePath:instancePath+"/examples/" + i6+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 30},message:"must NOT have more than 30 characters"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}else {const err36 = {instancePath:instancePath+"/examples/" + i6+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}var _valid5 = _errs57 === errors;valid22 = valid22 || _valid5;const _errs59 = errors;if(data17 !== null){const err37 = {instancePath:instancePath+"/examples/" + i6+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}var _valid5 = _errs59 === errors;valid22 = valid22 || _valid5;if(!valid22){const err38 = {instancePath:instancePath+"/examples/" + i6+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}else {errors = _errs56;if(vErrors !== null){if(_errs56){vErrors.length = _errs56;}else {vErrors = null;}}}}if(data15.title !== undefined){let data18 = data15.title;const _errs62 = errors;let valid23 = false;const _errs63 = errors;if(typeof data18 === "string"){if(func3(data18) > 200){const err39 = {instancePath:instancePath+"/examples/" + i6+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/examples/" + i6+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}var _valid6 = _errs63 === errors;valid23 = valid23 || _valid6;const _errs65 = errors;if(data18 !== null){const err41 = {instancePath:instancePath+"/examples/" + i6+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}var _valid6 = _errs65 === errors;valid23 = valid23 || _valid6;if(!valid23){const err42 = {instancePath:instancePath+"/examples/" + i6+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}else {errors = _errs62;if(vErrors !== null){if(_errs62){vErrors.length = _errs62;}else {vErrors = null;}}}}}else {const err43 = {instancePath:instancePath+"/examples/" + i6,schemaPath:"#/$defs/InlineExample/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}}else {const err44 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf/0/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}var _valid4 = _errs47 === errors;valid17 = valid17 || _valid4;const _errs67 = errors;if(data14 !== null){const err45 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}var _valid4 = _errs67 === errors;valid17 = valid17 || _valid4;if(!valid17){const err46 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}else {errors = _errs46;if(vErrors !== null){if(_errs46){vErrors.length = _errs46;}else {vErrors = null;}}}}if(data.explanation !== undefined){let data19 = data.explanation;const _errs70 = errors;let valid24 = false;const _errs71 = errors;if(typeof data19 === "string"){if(func3(data19) > 2000){const err47 = {instancePath:instancePath+"/explanation",schemaPath:"#/properties/explanation/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}else {const err48 = {instancePath:instancePath+"/explanation",schemaPath:"#/properties/explanation/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}var _valid7 = _errs71 === errors;valid24 = valid24 || _valid7;const _errs73 = errors;if(data19 !== null){const err49 = {instancePath:instancePath+"/explanation",schemaPath:"#/properties/explanation/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}var _valid7 = _errs73 === errors;valid24 = valid24 || _valid7;if(!valid24){const err50 = {instancePath:instancePath+"/explanation",schemaPath:"#/properties/explanation/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}else {errors = _errs70;if(vErrors !== null){if(_errs70){vErrors.length = _errs70;}else {vErrors = null;}}}}if(data.ext_payload !== undefined){let data20 = data.ext_payload;if(data20 && typeof data20 == "object" && !Array.isArray(data20)){}else {const err51 = {instancePath:instancePath+"/ext_payload",schemaPath:"#/properties/ext_payload/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data.from_cards !== undefined){if(typeof data.from_cards !== "boolean"){const err52 = {instancePath:instancePath+"/from_cards",schemaPath:"#/properties/from_cards/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}if(data.hint !== undefined){let data22 = data.hint;const _errs81 = errors;let valid25 = false;const _errs82 = errors;if(typeof data22 === "string"){if(func3(data22) > 1000){const err53 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}var _valid8 = _errs82 === errors;valid25 = valid25 || _valid8;const _errs84 = errors;if(data22 !== null){const err55 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}var _valid8 = _errs84 === errors;valid25 = valid25 || _valid8;if(!valid25){const err56 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}else {errors = _errs81;if(vErrors !== null){if(_errs81){vErrors.length = _errs81;}else {vErrors = null;}}}}if(data.id !== undefined){let data23 = data.id;if(typeof data23 === "string"){if(func3(data23) > 120){const err57 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}if(func3(data23) < 1){const err58 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(!pattern4.test(data23)){const err59 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}}else {const err60 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}if(data.stable_id !== undefined){let data24 = data.stable_id;const _errs90 = errors;let valid27 = false;const _errs91 = errors;if(typeof data24 === "string"){if(!pattern5.test(data24)){const err61 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9][a-z0-9_-]{7,63}$"},message:"must match pattern \""+"^[a-z0-9][a-z0-9_-]{7,63}$"+"\""};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}else {const err62 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}var _valid9 = _errs91 === errors;valid27 = valid27 || _valid9;const _errs93 = errors;if(data24 !== null){const err63 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}var _valid9 = _errs93 === errors;valid27 = valid27 || _valid9;if(!valid27){const err64 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}else {errors = _errs90;if(vErrors !== null){if(_errs90){vErrors.length = _errs90;}else {vErrors = null;}}}}if(data.images !== undefined){let data25 = data.images;const _errs96 = errors;let valid28 = false;const _errs97 = errors;if(Array.isArray(data25)){const len7 = data25.length;for(let i7=0; i7 10){const err68 = {instancePath:instancePath+"/images/" + i7+"/is_correct",schemaPath:"#/$defs/PictureImage/properties/is_correct/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 10},message:"must NOT have more than 10 characters"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}else {const err69 = {instancePath:instancePath+"/images/" + i7+"/is_correct",schemaPath:"#/$defs/PictureImage/properties/is_correct/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}var _valid11 = _errs105 === errors;valid33 = valid33 || _valid11;const _errs107 = errors;if(data27 !== null){const err70 = {instancePath:instancePath+"/images/" + i7+"/is_correct",schemaPath:"#/$defs/PictureImage/properties/is_correct/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}var _valid11 = _errs107 === errors;valid33 = valid33 || _valid11;if(!valid33){const err71 = {instancePath:instancePath+"/images/" + i7+"/is_correct",schemaPath:"#/$defs/PictureImage/properties/is_correct/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}else {errors = _errs104;if(vErrors !== null){if(_errs104){vErrors.length = _errs104;}else {vErrors = null;}}}}if(data26.label !== undefined){let data28 = data26.label;if(typeof data28 === "string"){if(func3(data28) > 500){const err72 = {instancePath:instancePath+"/images/" + i7+"/label",schemaPath:"#/$defs/PictureImage/properties/label/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}if(func3(data28) < 1){const err73 = {instancePath:instancePath+"/images/" + i7+"/label",schemaPath:"#/$defs/PictureImage/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+"/images/" + i7+"/label",schemaPath:"#/$defs/PictureImage/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}if(data26.src !== undefined){let data29 = data26.src;const _errs112 = errors;let valid34 = false;const _errs113 = errors;if(typeof data29 === "string"){if(func3(data29) > 500){const err75 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}if(func3(data29) < 1){const err76 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}else {const err77 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}var _valid12 = _errs113 === errors;valid34 = valid34 || _valid12;const _errs115 = errors;if(typeof data29 === "string"){if(func3(data29) > 250000){const err78 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf/1/maxLength",keyword:"maxLength",params:{limit: 250000},message:"must NOT have more than 250000 characters"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}if(!pattern12.test(data29)){const err79 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^data:image/[a-z0-9.+-]+;base64,"},message:"must match pattern \""+"^data:image/[a-z0-9.+-]+;base64,"+"\""};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}else {const err80 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}var _valid12 = _errs115 === errors;valid34 = valid34 || _valid12;if(!valid34){const err81 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}else {errors = _errs112;if(vErrors !== null){if(_errs112){vErrors.length = _errs112;}else {vErrors = null;}}}}}else {const err82 = {instancePath:instancePath+"/images/" + i7,schemaPath:"#/$defs/PictureImage/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}}else {const err83 = {instancePath:instancePath+"/images",schemaPath:"#/properties/images/anyOf/0/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}var _valid10 = _errs97 === errors;valid28 = valid28 || _valid10;const _errs117 = errors;if(data25 !== null){const err84 = {instancePath:instancePath+"/images",schemaPath:"#/properties/images/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}var _valid10 = _errs117 === errors;valid28 = valid28 || _valid10;if(!valid28){const err85 = {instancePath:instancePath+"/images",schemaPath:"#/properties/images/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}else {errors = _errs96;if(vErrors !== null){if(_errs96){vErrors.length = _errs96;}else {vErrors = null;}}}}if(data.multiple !== undefined){if(typeof data.multiple !== "boolean"){const err86 = {instancePath:instancePath+"/multiple",schemaPath:"#/properties/multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}if(data.options !== undefined){let data31 = data.options;const _errs122 = errors;let valid35 = false;const _errs123 = errors;if(Array.isArray(data31)){if(data31.length > 20){const err87 = {instancePath:instancePath+"/options",schemaPath:"#/properties/options/anyOf/0/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}const len8 = data31.length;for(let i8=0; i8 1000){const err94 = {instancePath:instancePath+"/prompt",schemaPath:"#/properties/prompt/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}if(func3(data35) < 1){const err95 = {instancePath:instancePath+"/prompt",schemaPath:"#/properties/prompt/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+"/prompt",schemaPath:"#/properties/prompt/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}if(data.sentence !== undefined){let data36 = data.sentence;const _errs138 = errors;let valid41 = false;const _errs139 = errors;if(typeof data36 === "string"){if(func3(data36) > 1000){const err97 = {instancePath:instancePath+"/sentence",schemaPath:"#/properties/sentence/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}else {const err98 = {instancePath:instancePath+"/sentence",schemaPath:"#/properties/sentence/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}var _valid15 = _errs139 === errors;valid41 = valid41 || _valid15;const _errs141 = errors;if(data36 !== null){const err99 = {instancePath:instancePath+"/sentence",schemaPath:"#/properties/sentence/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}var _valid15 = _errs141 === errors;valid41 = valid41 || _valid15;if(!valid41){const err100 = {instancePath:instancePath+"/sentence",schemaPath:"#/properties/sentence/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}else {errors = _errs138;if(vErrors !== null){if(_errs138){vErrors.length = _errs138;}else {vErrors = null;}}}}if(data.tiles !== undefined){let data37 = data.tiles;const _errs144 = errors;let valid42 = false;const _errs145 = errors;if(Array.isArray(data37)){const len10 = data37.length;for(let i10=0; i10 20){const err110 = {instancePath:instancePath+"/variables",schemaPath:"#/properties/variables/anyOf/0/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}if(data40.length < 1){const err111 = {instancePath:instancePath+"/variables",schemaPath:"#/properties/variables/anyOf/0/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}const len11 = data40.length;for(let i11=0; i11 32){const err114 = {instancePath:instancePath+"/variables/" + i11+"/name",schemaPath:"#/$defs/ExerciseVariable/properties/name/maxLength",keyword:"maxLength",params:{limit: 32},message:"must NOT have more than 32 characters"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}if(!pattern16.test(data42)){const err115 = {instancePath:instancePath+"/variables/" + i11+"/name",schemaPath:"#/$defs/ExerciseVariable/properties/name/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9_]*$"},message:"must match pattern \""+"^[a-z][a-z0-9_]*$"+"\""};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}else {const err116 = {instancePath:instancePath+"/variables/" + i11+"/name",schemaPath:"#/$defs/ExerciseVariable/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data41.min !== undefined){if(!(typeof data41.min == "number")){const err117 = {instancePath:instancePath+"/variables/" + i11+"/min",schemaPath:"#/$defs/ExerciseVariable/properties/min/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}if(data41.max !== undefined){if(!(typeof data41.max == "number")){const err118 = {instancePath:instancePath+"/variables/" + i11+"/max",schemaPath:"#/$defs/ExerciseVariable/properties/max/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}if(data41.step !== undefined){let data45 = data41.step;if(typeof data45 == "number"){if(data45 <= 0 || isNaN(data45)){const err119 = {instancePath:instancePath+"/variables/" + i11+"/step",schemaPath:"#/$defs/ExerciseVariable/properties/step/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison: ">", limit: 0},message:"must be > 0"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}else {const err120 = {instancePath:instancePath+"/variables/" + i11+"/step",schemaPath:"#/$defs/ExerciseVariable/properties/step/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data41.expression !== undefined){let data46 = data41.expression;if(typeof data46 === "string"){if(func3(data46) > 200){const err121 = {instancePath:instancePath+"/variables/" + i11+"/expression",schemaPath:"#/$defs/ExerciseVariable/properties/expression/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}if(func3(data46) < 1){const err122 = {instancePath:instancePath+"/variables/" + i11+"/expression",schemaPath:"#/$defs/ExerciseVariable/properties/expression/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+"/variables/" + i11+"/expression",schemaPath:"#/$defs/ExerciseVariable/properties/expression/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}if(data41.tolerance !== undefined){let data47 = data41.tolerance;if(typeof data47 == "number"){if(data47 < 0 || isNaN(data47)){const err124 = {instancePath:instancePath+"/variables/" + i11+"/tolerance",schemaPath:"#/$defs/ExerciseVariable/properties/tolerance/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}else {const err125 = {instancePath:instancePath+"/variables/" + i11+"/tolerance",schemaPath:"#/$defs/ExerciseVariable/properties/tolerance/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}}else {const err126 = {instancePath:instancePath+"/variables/" + i11,schemaPath:"#/$defs/ExerciseVariable/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+"/variables",schemaPath:"#/properties/variables/anyOf/0/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}var _valid18 = _errs161 === errors;valid48 = valid48 || _valid18;const _errs179 = errors;if(data40 !== null){const err128 = {instancePath:instancePath+"/variables",schemaPath:"#/properties/variables/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}var _valid18 = _errs179 === errors;valid48 = valid48 || _valid18;if(!valid48){const err129 = {instancePath:instancePath+"/variables",schemaPath:"#/properties/variables/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}else {errors = _errs160;if(vErrors !== null){if(_errs160){vErrors.length = _errs160;}else {vErrors = null;}}}}}else {const err130 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}validate26.errors = vErrors;return errors === 0;}validate26.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate25(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate25.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(func1.call(schema39.properties, key0))){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.body !== undefined){let data0 = data.body;const _errs3 = errors;let valid1 = false;const _errs4 = errors;if(typeof data0 !== "string"){const err3 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}var _valid0 = _errs4 === errors;valid1 = valid1 || _valid0;const _errs6 = errors;if(data0 !== null){const err4 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid0 = _errs6 === errors;valid1 = valid1 || _valid0;if(!valid1){const err5 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}}if(data.example_label !== undefined){let data1 = data.example_label;const _errs9 = errors;let valid2 = false;const _errs10 = errors;if(typeof data1 === "string"){if(func3(data1) > 200){const err6 = {instancePath:instancePath+"/example_label",schemaPath:"#/properties/example_label/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/example_label",schemaPath:"#/properties/example_label/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid1 = _errs10 === errors;valid2 = valid2 || _valid1;const _errs12 = errors;if(data1 !== null){const err8 = {instancePath:instancePath+"/example_label",schemaPath:"#/properties/example_label/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}var _valid1 = _errs12 === errors;valid2 = valid2 || _valid1;if(!valid2){const err9 = {instancePath:instancePath+"/example_label",schemaPath:"#/properties/example_label/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}else {errors = _errs9;if(vErrors !== null){if(_errs9){vErrors.length = _errs9;}else {vErrors = null;}}}}if(data.example_url !== undefined){let data2 = data.example_url;const _errs15 = errors;let valid3 = false;const _errs16 = errors;if(typeof data2 === "string"){if(func3(data2) > 2000){const err10 = {instancePath:instancePath+"/example_url",schemaPath:"#/properties/example_url/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/example_url",schemaPath:"#/properties/example_url/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid2 = _errs16 === errors;valid3 = valid3 || _valid2;const _errs18 = errors;if(data2 !== null){const err12 = {instancePath:instancePath+"/example_url",schemaPath:"#/properties/example_url/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid2 = _errs18 === errors;valid3 = valid3 || _valid2;if(!valid3){const err13 = {instancePath:instancePath+"/example_url",schemaPath:"#/properties/example_url/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}else {errors = _errs15;if(vErrors !== null){if(_errs15){vErrors.length = _errs15;}else {vErrors = null;}}}}if(data.examples !== undefined){let data3 = data.examples;const _errs21 = errors;let valid4 = false;const _errs22 = errors;if(Array.isArray(data3)){if(data3.length > 20){const err14 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf/0/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}const len0 = data3.length;for(let i0=0; i0 5000){const err17 = {instancePath:instancePath+"/examples/" + i0+"/content",schemaPath:"#/$defs/InlineExample/properties/content/maxLength",keyword:"maxLength",params:{limit: 5000},message:"must NOT have more than 5000 characters"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}if(func3(data5) < 1){const err18 = {instancePath:instancePath+"/examples/" + i0+"/content",schemaPath:"#/$defs/InlineExample/properties/content/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}else {const err19 = {instancePath:instancePath+"/examples/" + i0+"/content",schemaPath:"#/$defs/InlineExample/properties/content/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data4.language !== undefined){let data6 = data4.language;const _errs31 = errors;let valid9 = false;const _errs32 = errors;if(typeof data6 === "string"){if(func3(data6) > 30){const err20 = {instancePath:instancePath+"/examples/" + i0+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 30},message:"must NOT have more than 30 characters"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}else {const err21 = {instancePath:instancePath+"/examples/" + i0+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}var _valid4 = _errs32 === errors;valid9 = valid9 || _valid4;const _errs34 = errors;if(data6 !== null){const err22 = {instancePath:instancePath+"/examples/" + i0+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}var _valid4 = _errs34 === errors;valid9 = valid9 || _valid4;if(!valid9){const err23 = {instancePath:instancePath+"/examples/" + i0+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}else {errors = _errs31;if(vErrors !== null){if(_errs31){vErrors.length = _errs31;}else {vErrors = null;}}}}if(data4.title !== undefined){let data7 = data4.title;const _errs37 = errors;let valid10 = false;const _errs38 = errors;if(typeof data7 === "string"){if(func3(data7) > 200){const err24 = {instancePath:instancePath+"/examples/" + i0+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}else {const err25 = {instancePath:instancePath+"/examples/" + i0+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}var _valid5 = _errs38 === errors;valid10 = valid10 || _valid5;const _errs40 = errors;if(data7 !== null){const err26 = {instancePath:instancePath+"/examples/" + i0+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}var _valid5 = _errs40 === errors;valid10 = valid10 || _valid5;if(!valid10){const err27 = {instancePath:instancePath+"/examples/" + i0+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}else {errors = _errs37;if(vErrors !== null){if(_errs37){vErrors.length = _errs37;}else {vErrors = null;}}}}}else {const err28 = {instancePath:instancePath+"/examples/" + i0,schemaPath:"#/$defs/InlineExample/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}}else {const err29 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf/0/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}var _valid3 = _errs22 === errors;valid4 = valid4 || _valid3;const _errs42 = errors;if(data3 !== null){const err30 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}var _valid3 = _errs42 === errors;valid4 = valid4 || _valid3;if(!valid4){const err31 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}}if(data.exercise !== undefined){let data8 = data.exercise;const _errs45 = errors;let valid11 = false;const _errs46 = errors;if(!(validate26(data8, {instancePath:instancePath+"/exercise",parentData:data,parentDataProperty:"exercise",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors);errors = vErrors.length;}var _valid6 = _errs46 === errors;valid11 = valid11 || _valid6;const _errs47 = errors;if(data8 !== null){const err32 = {instancePath:instancePath+"/exercise",schemaPath:"#/properties/exercise/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}var _valid6 = _errs47 === errors;valid11 = valid11 || _valid6;if(!valid11){const err33 = {instancePath:instancePath+"/exercise",schemaPath:"#/properties/exercise/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}else {errors = _errs45;if(vErrors !== null){if(_errs45){vErrors.length = _errs45;}else {vErrors = null;}}}}if(data.id !== undefined){let data9 = data.id;if(typeof data9 === "string"){if(func3(data9) > 120){const err34 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}if(func3(data9) < 1){const err35 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if(!pattern4.test(data9)){const err36 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}else {const err37 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data.review_lesson_id !== undefined){let data10 = data.review_lesson_id;const _errs53 = errors;let valid13 = false;const _errs54 = errors;if(typeof data10 === "string"){if(func3(data10) > 200){const err38 = {instancePath:instancePath+"/review_lesson_id",schemaPath:"#/properties/review_lesson_id/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}else {const err39 = {instancePath:instancePath+"/review_lesson_id",schemaPath:"#/properties/review_lesson_id/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}var _valid7 = _errs54 === errors;valid13 = valid13 || _valid7;const _errs56 = errors;if(data10 !== null){const err40 = {instancePath:instancePath+"/review_lesson_id",schemaPath:"#/properties/review_lesson_id/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}var _valid7 = _errs56 === errors;valid13 = valid13 || _valid7;if(!valid13){const err41 = {instancePath:instancePath+"/review_lesson_id",schemaPath:"#/properties/review_lesson_id/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}else {errors = _errs53;if(vErrors !== null){if(_errs53){vErrors.length = _errs53;}else {vErrors = null;}}}}if(data.theory_ref !== undefined){let data11 = data.theory_ref;const _errs59 = errors;let valid14 = false;const _errs60 = errors;if(typeof data11 === "string"){if(func3(data11) > 200){const err42 = {instancePath:instancePath+"/theory_ref",schemaPath:"#/properties/theory_ref/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}else {const err43 = {instancePath:instancePath+"/theory_ref",schemaPath:"#/properties/theory_ref/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}var _valid8 = _errs60 === errors;valid14 = valid14 || _valid8;const _errs62 = errors;if(data11 !== null){const err44 = {instancePath:instancePath+"/theory_ref",schemaPath:"#/properties/theory_ref/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}var _valid8 = _errs62 === errors;valid14 = valid14 || _valid8;if(!valid14){const err45 = {instancePath:instancePath+"/theory_ref",schemaPath:"#/properties/theory_ref/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}else {errors = _errs59;if(vErrors !== null){if(_errs59){vErrors.length = _errs59;}else {vErrors = null;}}}}if(data.title !== undefined){let data12 = data.title;const _errs65 = errors;let valid15 = false;const _errs66 = errors;if(typeof data12 === "string"){if(func3(data12) > 200){const err46 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}var _valid9 = _errs66 === errors;valid15 = valid15 || _valid9;const _errs68 = errors;if(data12 !== null){const err48 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}var _valid9 = _errs68 === errors;valid15 = valid15 || _valid9;if(!valid15){const err49 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}else {errors = _errs65;if(vErrors !== null){if(_errs65){vErrors.length = _errs65;}else {vErrors = null;}}}}if(data.type !== undefined){let data13 = data.type;if(typeof data13 !== "string"){const err50 = {instancePath:instancePath+"/type",schemaPath:"#/$defs/StepType/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}if(!((data13 === "theory") || (data13 === "exercise"))){const err51 = {instancePath:instancePath+"/type",schemaPath:"#/$defs/StepType/enum",keyword:"enum",params:{allowedValues: schema55.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}}else {const err52 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}validate25.errors = vErrors;return errors === 0;}validate25.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const pattern8 = new RegExp("^ext:[a-z0-9]+-[a-z0-9-]+@\\d+$", "u");function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://astrapi69.github.io/learn-content-engine/schema/lesson.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.id === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.title === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.steps === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "steps"},message:"must have required property '"+"steps"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(func1.call(schema31.properties, key0))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.cards !== undefined){let data0 = data.cards;if(Array.isArray(data0)){const len0 = data0.length;for(let i0=0; i0 40){const err5 = {instancePath:instancePath+"/contributed_at",schemaPath:"#/properties/contributed_at/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 40},message:"must NOT have more than 40 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/contributed_at",schemaPath:"#/properties/contributed_at/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid0 = _errs7 === errors;valid3 = valid3 || _valid0;const _errs9 = errors;if(data2 !== null){const err7 = {instancePath:instancePath+"/contributed_at",schemaPath:"#/properties/contributed_at/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid0 = _errs9 === errors;valid3 = valid3 || _valid0;if(!valid3){const err8 = {instancePath:instancePath+"/contributed_at",schemaPath:"#/properties/contributed_at/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs6;if(vErrors !== null){if(_errs6){vErrors.length = _errs6;}else {vErrors = null;}}}}if(data.contributed_by !== undefined){let data3 = data.contributed_by;const _errs12 = errors;let valid4 = false;const _errs13 = errors;if(typeof data3 === "string"){if(func3(data3) > 200){const err9 = {instancePath:instancePath+"/contributed_by",schemaPath:"#/properties/contributed_by/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/contributed_by",schemaPath:"#/properties/contributed_by/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}var _valid1 = _errs13 === errors;valid4 = valid4 || _valid1;const _errs15 = errors;if(data3 !== null){const err11 = {instancePath:instancePath+"/contributed_by",schemaPath:"#/properties/contributed_by/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid1 = _errs15 === errors;valid4 = valid4 || _valid1;if(!valid4){const err12 = {instancePath:instancePath+"/contributed_by",schemaPath:"#/properties/contributed_by/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}else {errors = _errs12;if(vErrors !== null){if(_errs12){vErrors.length = _errs12;}else {vErrors = null;}}}}if(data.description !== undefined){let data4 = data.description;const _errs18 = errors;let valid5 = false;const _errs19 = errors;if(typeof data4 === "string"){if(func3(data4) > 500){const err13 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}var _valid2 = _errs19 === errors;valid5 = valid5 || _valid2;const _errs21 = errors;if(data4 !== null){const err15 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}var _valid2 = _errs21 === errors;valid5 = valid5 || _valid2;if(!valid5){const err16 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}}if(data.domain !== undefined){let data5 = data.domain;const _errs24 = errors;let valid6 = false;const _errs25 = errors;if(typeof data5 !== "string"){const err17 = {instancePath:instancePath+"/domain",schemaPath:"#/properties/domain/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}var _valid3 = _errs25 === errors;valid6 = valid6 || _valid3;const _errs27 = errors;if(data5 !== null){const err18 = {instancePath:instancePath+"/domain",schemaPath:"#/properties/domain/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}var _valid3 = _errs27 === errors;valid6 = valid6 || _valid3;if(!valid6){const err19 = {instancePath:instancePath+"/domain",schemaPath:"#/properties/domain/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}}if(data.estimated_minutes !== undefined){let data6 = data.estimated_minutes;if(!((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6)))){const err20 = {instancePath:instancePath+"/estimated_minutes",schemaPath:"#/properties/estimated_minutes/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(typeof data6 == "number"){if(data6 > 240 || isNaN(data6)){const err21 = {instancePath:instancePath+"/estimated_minutes",schemaPath:"#/properties/estimated_minutes/maximum",keyword:"maximum",params:{comparison: "<=", limit: 240},message:"must be <= 240"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(data6 < 1 || isNaN(data6)){const err22 = {instancePath:instancePath+"/estimated_minutes",schemaPath:"#/properties/estimated_minutes/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}}if(data.id !== undefined){let data7 = data.id;if(typeof data7 === "string"){if(func3(data7) > 120){const err23 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}if(func3(data7) < 1){const err24 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if(!pattern4.test(data7)){const err25 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}else {const err26 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data.purpose !== undefined){let data8 = data.purpose;if(typeof data8 !== "string"){const err27 = {instancePath:instancePath+"/purpose",schemaPath:"#/properties/purpose/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(!(((data8 === "practice") || (data8 === "bridge")) || (data8 === "quiz"))){const err28 = {instancePath:instancePath+"/purpose",schemaPath:"#/properties/purpose/enum",keyword:"enum",params:{allowedValues: schema31.properties.purpose.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data.requires_extensions !== undefined){let data9 = data.requires_extensions;if(Array.isArray(data9)){const len1 = data9.length;for(let i1=0; i1 300){const err36 = {instancePath:instancePath+"/resources/" + i2+"/author",schemaPath:"#/$defs/LessonResource/properties/author/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}else {const err37 = {instancePath:instancePath+"/resources/" + i2+"/author",schemaPath:"#/$defs/LessonResource/properties/author/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}var _valid5 = _errs50 === errors;valid15 = valid15 || _valid5;const _errs52 = errors;if(data13 !== null){const err38 = {instancePath:instancePath+"/resources/" + i2+"/author",schemaPath:"#/$defs/LessonResource/properties/author/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}var _valid5 = _errs52 === errors;valid15 = valid15 || _valid5;if(!valid15){const err39 = {instancePath:instancePath+"/resources/" + i2+"/author",schemaPath:"#/$defs/LessonResource/properties/author/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}else {errors = _errs49;if(vErrors !== null){if(_errs49){vErrors.length = _errs49;}else {vErrors = null;}}}}if(data12.description !== undefined){let data14 = data12.description;const _errs55 = errors;let valid16 = false;const _errs56 = errors;if(typeof data14 === "string"){if(func3(data14) > 2000){const err40 = {instancePath:instancePath+"/resources/" + i2+"/description",schemaPath:"#/$defs/LessonResource/properties/description/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}else {const err41 = {instancePath:instancePath+"/resources/" + i2+"/description",schemaPath:"#/$defs/LessonResource/properties/description/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}var _valid6 = _errs56 === errors;valid16 = valid16 || _valid6;const _errs58 = errors;if(data14 !== null){const err42 = {instancePath:instancePath+"/resources/" + i2+"/description",schemaPath:"#/$defs/LessonResource/properties/description/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}var _valid6 = _errs58 === errors;valid16 = valid16 || _valid6;if(!valid16){const err43 = {instancePath:instancePath+"/resources/" + i2+"/description",schemaPath:"#/$defs/LessonResource/properties/description/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}else {errors = _errs55;if(vErrors !== null){if(_errs55){vErrors.length = _errs55;}else {vErrors = null;}}}}if(data12.duration !== undefined){let data15 = data12.duration;const _errs61 = errors;let valid17 = false;const _errs62 = errors;if(typeof data15 === "string"){if(func3(data15) > 40){const err44 = {instancePath:instancePath+"/resources/" + i2+"/duration",schemaPath:"#/$defs/LessonResource/properties/duration/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 40},message:"must NOT have more than 40 characters"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}else {const err45 = {instancePath:instancePath+"/resources/" + i2+"/duration",schemaPath:"#/$defs/LessonResource/properties/duration/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}var _valid7 = _errs62 === errors;valid17 = valid17 || _valid7;const _errs64 = errors;if(data15 !== null){const err46 = {instancePath:instancePath+"/resources/" + i2+"/duration",schemaPath:"#/$defs/LessonResource/properties/duration/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}var _valid7 = _errs64 === errors;valid17 = valid17 || _valid7;if(!valid17){const err47 = {instancePath:instancePath+"/resources/" + i2+"/duration",schemaPath:"#/$defs/LessonResource/properties/duration/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}else {errors = _errs61;if(vErrors !== null){if(_errs61){vErrors.length = _errs61;}else {vErrors = null;}}}}if(data12.free !== undefined){let data16 = data12.free;const _errs67 = errors;let valid18 = false;const _errs68 = errors;if(typeof data16 !== "boolean"){const err48 = {instancePath:instancePath+"/resources/" + i2+"/free",schemaPath:"#/$defs/LessonResource/properties/free/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}var _valid8 = _errs68 === errors;valid18 = valid18 || _valid8;const _errs70 = errors;if(data16 !== null){const err49 = {instancePath:instancePath+"/resources/" + i2+"/free",schemaPath:"#/$defs/LessonResource/properties/free/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}var _valid8 = _errs70 === errors;valid18 = valid18 || _valid8;if(!valid18){const err50 = {instancePath:instancePath+"/resources/" + i2+"/free",schemaPath:"#/$defs/LessonResource/properties/free/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}else {errors = _errs67;if(vErrors !== null){if(_errs67){vErrors.length = _errs67;}else {vErrors = null;}}}}if(data12.language !== undefined){let data17 = data12.language;const _errs73 = errors;let valid19 = false;const _errs74 = errors;if(typeof data17 === "string"){if(func3(data17) > 35){const err51 = {instancePath:instancePath+"/resources/" + i2+"/language",schemaPath:"#/$defs/LessonResource/properties/language/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 35},message:"must NOT have more than 35 characters"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}else {const err52 = {instancePath:instancePath+"/resources/" + i2+"/language",schemaPath:"#/$defs/LessonResource/properties/language/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}var _valid9 = _errs74 === errors;valid19 = valid19 || _valid9;const _errs76 = errors;if(data17 !== null){const err53 = {instancePath:instancePath+"/resources/" + i2+"/language",schemaPath:"#/$defs/LessonResource/properties/language/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}var _valid9 = _errs76 === errors;valid19 = valid19 || _valid9;if(!valid19){const err54 = {instancePath:instancePath+"/resources/" + i2+"/language",schemaPath:"#/$defs/LessonResource/properties/language/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}else {errors = _errs73;if(vErrors !== null){if(_errs73){vErrors.length = _errs73;}else {vErrors = null;}}}}if(data12.level !== undefined){let data18 = data12.level;const _errs79 = errors;let valid20 = false;const _errs80 = errors;if(typeof data18 === "string"){if(func3(data18) > 10){const err55 = {instancePath:instancePath+"/resources/" + i2+"/level",schemaPath:"#/$defs/LessonResource/properties/level/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 10},message:"must NOT have more than 10 characters"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}else {const err56 = {instancePath:instancePath+"/resources/" + i2+"/level",schemaPath:"#/$defs/LessonResource/properties/level/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}var _valid10 = _errs80 === errors;valid20 = valid20 || _valid10;const _errs82 = errors;if(data18 !== null){const err57 = {instancePath:instancePath+"/resources/" + i2+"/level",schemaPath:"#/$defs/LessonResource/properties/level/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}var _valid10 = _errs82 === errors;valid20 = valid20 || _valid10;if(!valid20){const err58 = {instancePath:instancePath+"/resources/" + i2+"/level",schemaPath:"#/$defs/LessonResource/properties/level/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}else {errors = _errs79;if(vErrors !== null){if(_errs79){vErrors.length = _errs79;}else {vErrors = null;}}}}if(data12.partnership !== undefined){let data19 = data12.partnership;const _errs85 = errors;let valid21 = false;const _errs86 = errors;if(typeof data19 !== "boolean"){const err59 = {instancePath:instancePath+"/resources/" + i2+"/partnership",schemaPath:"#/$defs/LessonResource/properties/partnership/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}var _valid11 = _errs86 === errors;valid21 = valid21 || _valid11;const _errs88 = errors;if(data19 !== null){const err60 = {instancePath:instancePath+"/resources/" + i2+"/partnership",schemaPath:"#/$defs/LessonResource/properties/partnership/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}var _valid11 = _errs88 === errors;valid21 = valid21 || _valid11;if(!valid21){const err61 = {instancePath:instancePath+"/resources/" + i2+"/partnership",schemaPath:"#/$defs/LessonResource/properties/partnership/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}else {errors = _errs85;if(vErrors !== null){if(_errs85){vErrors.length = _errs85;}else {vErrors = null;}}}}if(data12.tags !== undefined){let data20 = data12.tags;const _errs91 = errors;let valid22 = false;const _errs92 = errors;if(Array.isArray(data20)){if(data20.length > 20){const err62 = {instancePath:instancePath+"/resources/" + i2+"/tags",schemaPath:"#/$defs/LessonResource/properties/tags/anyOf/0/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}const len3 = data20.length;for(let i3=0; i3 300){const err67 = {instancePath:instancePath+"/resources/" + i2+"/title",schemaPath:"#/$defs/LessonResource/properties/title/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}if(func3(data22) < 1){const err68 = {instancePath:instancePath+"/resources/" + i2+"/title",schemaPath:"#/$defs/LessonResource/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}else {const err69 = {instancePath:instancePath+"/resources/" + i2+"/title",schemaPath:"#/$defs/LessonResource/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}if(data12.type !== undefined){let data23 = data12.type;if(typeof data23 === "string"){if(func3(data23) > 40){const err70 = {instancePath:instancePath+"/resources/" + i2+"/type",schemaPath:"#/$defs/LessonResource/properties/type/maxLength",keyword:"maxLength",params:{limit: 40},message:"must NOT have more than 40 characters"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}if(func3(data23) < 1){const err71 = {instancePath:instancePath+"/resources/" + i2+"/type",schemaPath:"#/$defs/LessonResource/properties/type/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}else {const err72 = {instancePath:instancePath+"/resources/" + i2+"/type",schemaPath:"#/$defs/LessonResource/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data12.url !== undefined){let data24 = data12.url;if(typeof data24 === "string"){if(func3(data24) > 2000){const err73 = {instancePath:instancePath+"/resources/" + i2+"/url",schemaPath:"#/$defs/LessonResource/properties/url/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}if(func3(data24) < 1){const err74 = {instancePath:instancePath+"/resources/" + i2+"/url",schemaPath:"#/$defs/LessonResource/properties/url/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+"/resources/" + i2+"/url",schemaPath:"#/$defs/LessonResource/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}}else {const err76 = {instancePath:instancePath+"/resources/" + i2,schemaPath:"#/$defs/LessonResource/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}}else {const err77 = {instancePath:instancePath+"/resources",schemaPath:"#/properties/resources/anyOf/0/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}var _valid4 = _errs42 === errors;valid10 = valid10 || _valid4;const _errs104 = errors;if(data11 !== null){const err78 = {instancePath:instancePath+"/resources",schemaPath:"#/properties/resources/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}var _valid4 = _errs104 === errors;valid10 = valid10 || _valid4;if(!valid10){const err79 = {instancePath:instancePath+"/resources",schemaPath:"#/properties/resources/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}else {errors = _errs41;if(vErrors !== null){if(_errs41){vErrors.length = _errs41;}else {vErrors = null;}}}}if(data.source_language !== undefined){let data25 = data.source_language;const _errs107 = errors;let valid25 = false;const _errs108 = errors;if(typeof data25 !== "string"){const err80 = {instancePath:instancePath+"/source_language",schemaPath:"#/properties/source_language/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}var _valid13 = _errs108 === errors;valid25 = valid25 || _valid13;const _errs110 = errors;if(data25 !== null){const err81 = {instancePath:instancePath+"/source_language",schemaPath:"#/properties/source_language/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}var _valid13 = _errs110 === errors;valid25 = valid25 || _valid13;if(!valid25){const err82 = {instancePath:instancePath+"/source_language",schemaPath:"#/properties/source_language/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}else {errors = _errs107;if(vErrors !== null){if(_errs107){vErrors.length = _errs107;}else {vErrors = null;}}}}if(data.steps !== undefined){let data26 = data.steps;if(Array.isArray(data26)){if(data26.length < 1){const err83 = {instancePath:instancePath+"/steps",schemaPath:"#/properties/steps/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}const len4 = data26.length;for(let i4=0; i4 200){const err88 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}if(func3(data29) < 1){const err89 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}else {const err90 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}if(data.variation_note !== undefined){let data30 = data.variation_note;const _errs124 = errors;let valid29 = false;const _errs125 = errors;if(typeof data30 === "string"){if(func3(data30) > 500){const err91 = {instancePath:instancePath+"/variation_note",schemaPath:"#/properties/variation_note/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}else {const err92 = {instancePath:instancePath+"/variation_note",schemaPath:"#/properties/variation_note/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}var _valid15 = _errs125 === errors;valid29 = valid29 || _valid15;const _errs127 = errors;if(data30 !== null){const err93 = {instancePath:instancePath+"/variation_note",schemaPath:"#/properties/variation_note/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}var _valid15 = _errs127 === errors;valid29 = valid29 || _valid15;if(!valid29){const err94 = {instancePath:instancePath+"/variation_note",schemaPath:"#/properties/variation_note/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}else {errors = _errs124;if(vErrors !== null){if(_errs124){vErrors.length = _errs124;}else {vErrors = null;}}}}if(data.variation_of !== undefined){let data31 = data.variation_of;const _errs130 = errors;let valid30 = false;const _errs131 = errors;if(typeof data31 === "string"){if(func3(data31) > 120){const err95 = {instancePath:instancePath+"/variation_of",schemaPath:"#/properties/variation_of/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}else {const err96 = {instancePath:instancePath+"/variation_of",schemaPath:"#/properties/variation_of/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}var _valid16 = _errs131 === errors;valid30 = valid30 || _valid16;const _errs133 = errors;if(data31 !== null){const err97 = {instancePath:instancePath+"/variation_of",schemaPath:"#/properties/variation_of/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}var _valid16 = _errs133 === errors;valid30 = valid30 || _valid16;if(!valid30){const err98 = {instancePath:instancePath+"/variation_of",schemaPath:"#/properties/variation_of/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}else {errors = _errs130;if(vErrors !== null){if(_errs130){vErrors.length = _errs130;}else {vErrors = null;}}}}}else {const err99 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};export const validateManifestStructure: ValidateFunction = validate35 as unknown as ValidateFunction;const schema56 = {"$defs":{"ContentSet":{"additionalProperties":false,"properties":{"assets":{"default":[],"items":{"$ref":"#/$defs/ContentSetAsset"},"maxItems":500,"type":"array"},"book":{"anyOf":[{"$ref":"#/$defs/ContentSetBook"},{"type":"null"}],"default":null},"cover_image":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"description":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"domain":{"default":"language","maxLength":60,"minLength":1,"type":"string"},"domain_label":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}],"default":null},"id":{"maxLength":120,"minLength":1,"type":"string"},"lesson_count":{"maximum":10000,"minimum":0,"type":"integer"},"level":{"maxLength":20,"minLength":1,"type":"string"},"path":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"default":null},"source_language":{"default":"en","type":"string"},"tags":{"default":[],"items":{"type":"string"},"maxItems":20,"type":"array"},"target_language":{"type":"string"},"title":{"maxLength":200,"minLength":1,"type":"string"},"title_native":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null},"version":{"type":"string"},"visibility":{"default":"visible","enum":["visible","hidden"],"type":"string"},"attribution":{"anyOf":[{"type":"object","additionalProperties":false,"required":["author"],"properties":{"author":{"type":"string","minLength":1,"maxLength":120},"derived_from":{"type":"array","maxItems":8,"items":{"type":"object","additionalProperties":false,"required":["author"],"properties":{"author":{"type":"string","minLength":1,"maxLength":120}}}}}},{"type":"null"}],"default":null},"review_status":{"anyOf":[{"type":"string","enum":["authored","generated","reviewed"]},{"type":"null"}],"default":null},"evaluation":{"anyOf":[{"$ref":"#/$defs/ContentSetEvaluation"},{"type":"null"}],"default":null}},"required":["id","title","target_language","level","version","lesson_count"],"type":"object"},"ContentSetAsset":{"additionalProperties":false,"properties":{"path":{"maxLength":300,"minLength":1,"type":"string"},"size_kb":{"maximum":500,"minimum":1,"type":"integer"}},"required":["path","size_kb"],"type":"object"},"ContentSetBook":{"properties":{"asin":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null},"author":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"default":null},"title":{"maxLength":300,"minLength":1,"type":"string"},"url":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null}},"required":["title"],"type":"object"},"ContentSetEvaluation":{"additionalProperties":false,"properties":{"scheme":{"default":"percent","enum":["percent","pass_fail","grades"]},"pass_percent":{"maximum":100,"minimum":0,"type":"integer"},"basis":{"default":"elements","enum":["elements"]},"grades":{"items":{"$ref":"#/$defs/ContentSetGrade"},"minItems":2,"type":"array"},"report":{"default":"compact","enum":["compact","detailed"]},"title":{"minLength":1,"type":"string"}},"type":"object"},"ContentSetGrade":{"additionalProperties":false,"properties":{"min_percent":{"maximum":100,"minimum":0,"type":"integer"},"label":{"minLength":1,"type":"string"},"label_native":{"minLength":1,"type":"string"}},"required":["min_percent","label"],"type":"object"}},"$id":"https://astrapi69.github.io/learn-content-engine/schema/content-manifest.schema.json","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"description":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"metadata":{"additionalProperties":true,"default":{},"type":"object"},"name":{"maxLength":200,"minLength":1,"type":"string"},"schema_version":{"default":"1.7","type":"string"},"sets":{"default":[],"items":{"$ref":"#/$defs/ContentSet"},"type":"array"}},"required":["name"],"type":"object","x-schema-version":"1.19"};const schema57 = {"additionalProperties":false,"properties":{"assets":{"default":[],"items":{"$ref":"#/$defs/ContentSetAsset"},"maxItems":500,"type":"array"},"book":{"anyOf":[{"$ref":"#/$defs/ContentSetBook"},{"type":"null"}],"default":null},"cover_image":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"description":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"domain":{"default":"language","maxLength":60,"minLength":1,"type":"string"},"domain_label":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}],"default":null},"id":{"maxLength":120,"minLength":1,"type":"string"},"lesson_count":{"maximum":10000,"minimum":0,"type":"integer"},"level":{"maxLength":20,"minLength":1,"type":"string"},"path":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"default":null},"source_language":{"default":"en","type":"string"},"tags":{"default":[],"items":{"type":"string"},"maxItems":20,"type":"array"},"target_language":{"type":"string"},"title":{"maxLength":200,"minLength":1,"type":"string"},"title_native":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null},"version":{"type":"string"},"visibility":{"default":"visible","enum":["visible","hidden"],"type":"string"},"attribution":{"anyOf":[{"type":"object","additionalProperties":false,"required":["author"],"properties":{"author":{"type":"string","minLength":1,"maxLength":120},"derived_from":{"type":"array","maxItems":8,"items":{"type":"object","additionalProperties":false,"required":["author"],"properties":{"author":{"type":"string","minLength":1,"maxLength":120}}}}}},{"type":"null"}],"default":null},"review_status":{"anyOf":[{"type":"string","enum":["authored","generated","reviewed"]},{"type":"null"}],"default":null},"evaluation":{"anyOf":[{"$ref":"#/$defs/ContentSetEvaluation"},{"type":"null"}],"default":null}},"required":["id","title","target_language","level","version","lesson_count"],"type":"object"};const schema58 = {"additionalProperties":false,"properties":{"path":{"maxLength":300,"minLength":1,"type":"string"},"size_kb":{"maximum":500,"minimum":1,"type":"integer"}},"required":["path","size_kb"],"type":"object"};const schema59 = {"properties":{"asin":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null},"author":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"default":null},"title":{"maxLength":300,"minLength":1,"type":"string"},"url":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null}},"required":["title"],"type":"object"};const schema60 = {"additionalProperties":false,"properties":{"scheme":{"default":"percent","enum":["percent","pass_fail","grades"]},"pass_percent":{"maximum":100,"minimum":0,"type":"integer"},"basis":{"default":"elements","enum":["elements"]},"grades":{"items":{"$ref":"#/$defs/ContentSetGrade"},"minItems":2,"type":"array"},"report":{"default":"compact","enum":["compact","detailed"]},"title":{"minLength":1,"type":"string"}},"type":"object"};const schema61 = {"additionalProperties":false,"properties":{"min_percent":{"maximum":100,"minimum":0,"type":"integer"},"label":{"minLength":1,"type":"string"},"label_native":{"minLength":1,"type":"string"}},"required":["min_percent","label"],"type":"object"};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(data && typeof data == "object" && !Array.isArray(data)){for(const key0 in data){if(!((((((key0 === "scheme") || (key0 === "pass_percent")) || (key0 === "basis")) || (key0 === "grades")) || (key0 === "report")) || (key0 === "title"))){const err0 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}if(data.scheme !== undefined){let data0 = data.scheme;if(!(((data0 === "percent") || (data0 === "pass_fail")) || (data0 === "grades"))){const err1 = {instancePath:instancePath+"/scheme",schemaPath:"#/properties/scheme/enum",keyword:"enum",params:{allowedValues: schema60.properties.scheme.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.pass_percent !== undefined){let data1 = data.pass_percent;if(!((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1)))){const err2 = {instancePath:instancePath+"/pass_percent",schemaPath:"#/properties/pass_percent/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(typeof data1 == "number"){if(data1 > 100 || isNaN(data1)){const err3 = {instancePath:instancePath+"/pass_percent",schemaPath:"#/properties/pass_percent/maximum",keyword:"maximum",params:{comparison: "<=", limit: 100},message:"must be <= 100"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data1 < 0 || isNaN(data1)){const err4 = {instancePath:instancePath+"/pass_percent",schemaPath:"#/properties/pass_percent/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}if(data.basis !== undefined){if(!(data.basis === "elements")){const err5 = {instancePath:instancePath+"/basis",schemaPath:"#/properties/basis/enum",keyword:"enum",params:{allowedValues: schema60.properties.basis.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.grades !== undefined){let data3 = data.grades;if(Array.isArray(data3)){if(data3.length < 2){const err6 = {instancePath:instancePath+"/grades",schemaPath:"#/properties/grades/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}const len0 = data3.length;for(let i0=0; i0 100 || isNaN(data5)){const err11 = {instancePath:instancePath+"/grades/" + i0+"/min_percent",schemaPath:"#/$defs/ContentSetGrade/properties/min_percent/maximum",keyword:"maximum",params:{comparison: "<=", limit: 100},message:"must be <= 100"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data5 < 0 || isNaN(data5)){const err12 = {instancePath:instancePath+"/grades/" + i0+"/min_percent",schemaPath:"#/$defs/ContentSetGrade/properties/min_percent/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}if(data4.label !== undefined){let data6 = data4.label;if(typeof data6 === "string"){if(func3(data6) < 1){const err13 = {instancePath:instancePath+"/grades/" + i0+"/label",schemaPath:"#/$defs/ContentSetGrade/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/grades/" + i0+"/label",schemaPath:"#/$defs/ContentSetGrade/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data4.label_native !== undefined){let data7 = data4.label_native;if(typeof data7 === "string"){if(func3(data7) < 1){const err15 = {instancePath:instancePath+"/grades/" + i0+"/label_native",schemaPath:"#/$defs/ContentSetGrade/properties/label_native/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}else {const err16 = {instancePath:instancePath+"/grades/" + i0+"/label_native",schemaPath:"#/$defs/ContentSetGrade/properties/label_native/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath:instancePath+"/grades/" + i0,schemaPath:"#/$defs/ContentSetGrade/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}else {const err18 = {instancePath:instancePath+"/grades",schemaPath:"#/properties/grades/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.report !== undefined){let data8 = data.report;if(!((data8 === "compact") || (data8 === "detailed"))){const err19 = {instancePath:instancePath+"/report",schemaPath:"#/properties/report/enum",keyword:"enum",params:{allowedValues: schema60.properties.report.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data.title !== undefined){let data9 = data.title;if(typeof data9 === "string"){if(func3(data9) < 1){const err20 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}else {const err21 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}}else {const err22 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}validate37.errors = vErrors;return errors === 0;}validate37.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate36(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){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.id === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.title === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.target_language === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "target_language"},message:"must have required property '"+"target_language"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.level === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "level"},message:"must have required property '"+"level"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.version === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.lesson_count === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lesson_count"},message:"must have required property '"+"lesson_count"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(func1.call(schema57.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.assets !== undefined){let data0 = data.assets;if(Array.isArray(data0)){if(data0.length > 500){const err7 = {instancePath:instancePath+"/assets",schemaPath:"#/properties/assets/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}const len0 = data0.length;for(let i0=0; i0 300){const err11 = {instancePath:instancePath+"/assets/" + i0+"/path",schemaPath:"#/$defs/ContentSetAsset/properties/path/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(func3(data2) < 1){const err12 = {instancePath:instancePath+"/assets/" + i0+"/path",schemaPath:"#/$defs/ContentSetAsset/properties/path/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+"/assets/" + i0+"/path",schemaPath:"#/$defs/ContentSetAsset/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data1.size_kb !== undefined){let data3 = data1.size_kb;if(!((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3)))){const err14 = {instancePath:instancePath+"/assets/" + i0+"/size_kb",schemaPath:"#/$defs/ContentSetAsset/properties/size_kb/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(typeof data3 == "number"){if(data3 > 500 || isNaN(data3)){const err15 = {instancePath:instancePath+"/assets/" + i0+"/size_kb",schemaPath:"#/$defs/ContentSetAsset/properties/size_kb/maximum",keyword:"maximum",params:{comparison: "<=", limit: 500},message:"must be <= 500"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(data3 < 1 || isNaN(data3)){const err16 = {instancePath:instancePath+"/assets/" + i0+"/size_kb",schemaPath:"#/$defs/ContentSetAsset/properties/size_kb/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}}else {const err17 = {instancePath:instancePath+"/assets/" + i0,schemaPath:"#/$defs/ContentSetAsset/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}else {const err18 = {instancePath:instancePath+"/assets",schemaPath:"#/properties/assets/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.book !== undefined){let data4 = data.book;const _errs13 = errors;let valid5 = false;const _errs14 = errors;if(data4 && typeof data4 == "object" && !Array.isArray(data4)){if(data4.title === undefined){const err19 = {instancePath:instancePath+"/book",schemaPath:"#/$defs/ContentSetBook/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(data4.asin !== undefined){let data5 = data4.asin;const _errs18 = errors;let valid8 = false;const _errs19 = errors;if(typeof data5 === "string"){if(func3(data5) > 20){const err20 = {instancePath:instancePath+"/book/asin",schemaPath:"#/$defs/ContentSetBook/properties/asin/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 20},message:"must NOT have more than 20 characters"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}else {const err21 = {instancePath:instancePath+"/book/asin",schemaPath:"#/$defs/ContentSetBook/properties/asin/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}var _valid1 = _errs19 === errors;valid8 = valid8 || _valid1;const _errs21 = errors;if(data5 !== null){const err22 = {instancePath:instancePath+"/book/asin",schemaPath:"#/$defs/ContentSetBook/properties/asin/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}var _valid1 = _errs21 === errors;valid8 = valid8 || _valid1;if(!valid8){const err23 = {instancePath:instancePath+"/book/asin",schemaPath:"#/$defs/ContentSetBook/properties/asin/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}}if(data4.author !== undefined){let data6 = data4.author;const _errs24 = errors;let valid9 = false;const _errs25 = errors;if(typeof data6 === "string"){if(func3(data6) > 300){const err24 = {instancePath:instancePath+"/book/author",schemaPath:"#/$defs/ContentSetBook/properties/author/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}else {const err25 = {instancePath:instancePath+"/book/author",schemaPath:"#/$defs/ContentSetBook/properties/author/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}var _valid2 = _errs25 === errors;valid9 = valid9 || _valid2;const _errs27 = errors;if(data6 !== null){const err26 = {instancePath:instancePath+"/book/author",schemaPath:"#/$defs/ContentSetBook/properties/author/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}var _valid2 = _errs27 === errors;valid9 = valid9 || _valid2;if(!valid9){const err27 = {instancePath:instancePath+"/book/author",schemaPath:"#/$defs/ContentSetBook/properties/author/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}}if(data4.title !== undefined){let data7 = data4.title;if(typeof data7 === "string"){if(func3(data7) > 300){const err28 = {instancePath:instancePath+"/book/title",schemaPath:"#/$defs/ContentSetBook/properties/title/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}if(func3(data7) < 1){const err29 = {instancePath:instancePath+"/book/title",schemaPath:"#/$defs/ContentSetBook/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}else {const err30 = {instancePath:instancePath+"/book/title",schemaPath:"#/$defs/ContentSetBook/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data4.url !== undefined){let data8 = data4.url;const _errs32 = errors;let valid10 = false;const _errs33 = errors;if(typeof data8 === "string"){if(func3(data8) > 2000){const err31 = {instancePath:instancePath+"/book/url",schemaPath:"#/$defs/ContentSetBook/properties/url/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}else {const err32 = {instancePath:instancePath+"/book/url",schemaPath:"#/$defs/ContentSetBook/properties/url/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}var _valid3 = _errs33 === errors;valid10 = valid10 || _valid3;const _errs35 = errors;if(data8 !== null){const err33 = {instancePath:instancePath+"/book/url",schemaPath:"#/$defs/ContentSetBook/properties/url/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}var _valid3 = _errs35 === errors;valid10 = valid10 || _valid3;if(!valid10){const err34 = {instancePath:instancePath+"/book/url",schemaPath:"#/$defs/ContentSetBook/properties/url/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}else {errors = _errs32;if(vErrors !== null){if(_errs32){vErrors.length = _errs32;}else {vErrors = null;}}}}}else {const err35 = {instancePath:instancePath+"/book",schemaPath:"#/$defs/ContentSetBook/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}var _valid0 = _errs14 === errors;valid5 = valid5 || _valid0;if(_valid0){var props0 = {};props0.asin = true;props0.author = true;props0.title = true;props0.url = true;}const _errs37 = errors;if(data4 !== null){const err36 = {instancePath:instancePath+"/book",schemaPath:"#/properties/book/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}var _valid0 = _errs37 === errors;valid5 = valid5 || _valid0;if(!valid5){const err37 = {instancePath:instancePath+"/book",schemaPath:"#/properties/book/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}else {errors = _errs13;if(vErrors !== null){if(_errs13){vErrors.length = _errs13;}else {vErrors = null;}}}}if(data.cover_image !== undefined){let data9 = data.cover_image;const _errs40 = errors;let valid11 = false;const _errs41 = errors;if(typeof data9 !== "string"){const err38 = {instancePath:instancePath+"/cover_image",schemaPath:"#/properties/cover_image/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}var _valid4 = _errs41 === errors;valid11 = valid11 || _valid4;const _errs43 = errors;if(data9 !== null){const err39 = {instancePath:instancePath+"/cover_image",schemaPath:"#/properties/cover_image/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}var _valid4 = _errs43 === errors;valid11 = valid11 || _valid4;if(!valid11){const err40 = {instancePath:instancePath+"/cover_image",schemaPath:"#/properties/cover_image/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}else {errors = _errs40;if(vErrors !== null){if(_errs40){vErrors.length = _errs40;}else {vErrors = null;}}}}if(data.description !== undefined){let data10 = data.description;const _errs46 = errors;let valid12 = false;const _errs47 = errors;if(typeof data10 === "string"){if(func3(data10) > 2000){const err41 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}else {const err42 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}var _valid5 = _errs47 === errors;valid12 = valid12 || _valid5;const _errs49 = errors;if(data10 !== null){const err43 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}var _valid5 = _errs49 === errors;valid12 = valid12 || _valid5;if(!valid12){const err44 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}else {errors = _errs46;if(vErrors !== null){if(_errs46){vErrors.length = _errs46;}else {vErrors = null;}}}}if(data.domain !== undefined){let data11 = data.domain;if(typeof data11 === "string"){if(func3(data11) > 60){const err45 = {instancePath:instancePath+"/domain",schemaPath:"#/properties/domain/maxLength",keyword:"maxLength",params:{limit: 60},message:"must NOT have more than 60 characters"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(func3(data11) < 1){const err46 = {instancePath:instancePath+"/domain",schemaPath:"#/properties/domain/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/domain",schemaPath:"#/properties/domain/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data.domain_label !== undefined){let data12 = data.domain_label;const _errs54 = errors;let valid13 = false;const _errs55 = errors;if(typeof data12 === "string"){if(func3(data12) > 120){const err48 = {instancePath:instancePath+"/domain_label",schemaPath:"#/properties/domain_label/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}else {const err49 = {instancePath:instancePath+"/domain_label",schemaPath:"#/properties/domain_label/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}var _valid6 = _errs55 === errors;valid13 = valid13 || _valid6;const _errs57 = errors;if(data12 !== null){const err50 = {instancePath:instancePath+"/domain_label",schemaPath:"#/properties/domain_label/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}var _valid6 = _errs57 === errors;valid13 = valid13 || _valid6;if(!valid13){const err51 = {instancePath:instancePath+"/domain_label",schemaPath:"#/properties/domain_label/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}else {errors = _errs54;if(vErrors !== null){if(_errs54){vErrors.length = _errs54;}else {vErrors = null;}}}}if(data.id !== undefined){let data13 = data.id;if(typeof data13 === "string"){if(func3(data13) > 120){const err52 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data13) < 1){const err53 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/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+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data.lesson_count !== undefined){let data14 = data.lesson_count;if(!((typeof data14 == "number") && (!(data14 % 1) && !isNaN(data14)))){const err55 = {instancePath:instancePath+"/lesson_count",schemaPath:"#/properties/lesson_count/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}if(typeof data14 == "number"){if(data14 > 10000 || isNaN(data14)){const err56 = {instancePath:instancePath+"/lesson_count",schemaPath:"#/properties/lesson_count/maximum",keyword:"maximum",params:{comparison: "<=", limit: 10000},message:"must be <= 10000"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}if(data14 < 0 || isNaN(data14)){const err57 = {instancePath:instancePath+"/lesson_count",schemaPath:"#/properties/lesson_count/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}}if(data.level !== undefined){let data15 = data.level;if(typeof data15 === "string"){if(func3(data15) > 20){const err58 = {instancePath:instancePath+"/level",schemaPath:"#/properties/level/maxLength",keyword:"maxLength",params:{limit: 20},message:"must NOT have more than 20 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(func3(data15) < 1){const err59 = {instancePath:instancePath+"/level",schemaPath:"#/properties/level/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+"/level",schemaPath:"#/properties/level/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}if(data.path !== undefined){let data16 = data.path;const _errs66 = errors;let valid14 = false;const _errs67 = errors;if(typeof data16 === "string"){if(func3(data16) > 300){const err61 = {instancePath:instancePath+"/path",schemaPath:"#/properties/path/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}else {const err62 = {instancePath:instancePath+"/path",schemaPath:"#/properties/path/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}var _valid7 = _errs67 === errors;valid14 = valid14 || _valid7;const _errs69 = errors;if(data16 !== null){const err63 = {instancePath:instancePath+"/path",schemaPath:"#/properties/path/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}var _valid7 = _errs69 === errors;valid14 = valid14 || _valid7;if(!valid14){const err64 = {instancePath:instancePath+"/path",schemaPath:"#/properties/path/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}else {errors = _errs66;if(vErrors !== null){if(_errs66){vErrors.length = _errs66;}else {vErrors = null;}}}}if(data.source_language !== undefined){if(typeof data.source_language !== "string"){const err65 = {instancePath:instancePath+"/source_language",schemaPath:"#/properties/source_language/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data.tags !== undefined){let data18 = data.tags;if(Array.isArray(data18)){if(data18.length > 20){const err66 = {instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}const len1 = data18.length;for(let i1=0; i1 200){const err70 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}if(func3(data21) < 1){const err71 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}else {const err72 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data.title_native !== undefined){let data22 = data.title_native;const _errs82 = errors;let valid17 = false;const _errs83 = errors;if(typeof data22 === "string"){if(func3(data22) > 200){const err73 = {instancePath:instancePath+"/title_native",schemaPath:"#/properties/title_native/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}else {const err74 = {instancePath:instancePath+"/title_native",schemaPath:"#/properties/title_native/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}var _valid8 = _errs83 === errors;valid17 = valid17 || _valid8;const _errs85 = errors;if(data22 !== null){const err75 = {instancePath:instancePath+"/title_native",schemaPath:"#/properties/title_native/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}var _valid8 = _errs85 === errors;valid17 = valid17 || _valid8;if(!valid17){const err76 = {instancePath:instancePath+"/title_native",schemaPath:"#/properties/title_native/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}else {errors = _errs82;if(vErrors !== null){if(_errs82){vErrors.length = _errs82;}else {vErrors = null;}}}}if(data.version !== undefined){if(typeof data.version !== "string"){const err77 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}if(data.visibility !== undefined){let data24 = data.visibility;if(typeof data24 !== "string"){const err78 = {instancePath:instancePath+"/visibility",schemaPath:"#/properties/visibility/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}if(!((data24 === "visible") || (data24 === "hidden"))){const err79 = {instancePath:instancePath+"/visibility",schemaPath:"#/properties/visibility/enum",keyword:"enum",params:{allowedValues: schema57.properties.visibility.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}if(data.attribution !== undefined){let data25 = data.attribution;const _errs92 = errors;let valid18 = false;const _errs93 = errors;if(data25 && typeof data25 == "object" && !Array.isArray(data25)){if(data25.author === undefined){const err80 = {instancePath:instancePath+"/attribution",schemaPath:"#/properties/attribution/anyOf/0/required",keyword:"required",params:{missingProperty: "author"},message:"must have required property '"+"author"+"'"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}for(const key2 in data25){if(!((key2 === "author") || (key2 === "derived_from"))){const err81 = {instancePath:instancePath+"/attribution",schemaPath:"#/properties/attribution/anyOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}if(data25.author !== undefined){let data26 = data25.author;if(typeof data26 === "string"){if(func3(data26) > 120){const err82 = {instancePath:instancePath+"/attribution/author",schemaPath:"#/properties/attribution/anyOf/0/properties/author/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}if(func3(data26) < 1){const err83 = {instancePath:instancePath+"/attribution/author",schemaPath:"#/properties/attribution/anyOf/0/properties/author/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}else {const err84 = {instancePath:instancePath+"/attribution/author",schemaPath:"#/properties/attribution/anyOf/0/properties/author/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}if(data25.derived_from !== undefined){let data27 = data25.derived_from;if(Array.isArray(data27)){if(data27.length > 8){const err85 = {instancePath:instancePath+"/attribution/derived_from",schemaPath:"#/properties/attribution/anyOf/0/properties/derived_from/maxItems",keyword:"maxItems",params:{limit: 8},message:"must NOT have more than 8 items"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}const len2 = data27.length;for(let i2=0; i2 120){const err88 = {instancePath:instancePath+"/attribution/derived_from/" + i2+"/author",schemaPath:"#/properties/attribution/anyOf/0/properties/derived_from/items/properties/author/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}if(func3(data29) < 1){const err89 = {instancePath:instancePath+"/attribution/derived_from/" + i2+"/author",schemaPath:"#/properties/attribution/anyOf/0/properties/derived_from/items/properties/author/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}else {const err90 = {instancePath:instancePath+"/attribution/derived_from/" + i2+"/author",schemaPath:"#/properties/attribution/anyOf/0/properties/derived_from/items/properties/author/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}}else {const err91 = {instancePath:instancePath+"/attribution/derived_from/" + i2,schemaPath:"#/properties/attribution/anyOf/0/properties/derived_from/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}}else {const err92 = {instancePath:instancePath+"/attribution/derived_from",schemaPath:"#/properties/attribution/anyOf/0/properties/derived_from/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}}else {const err93 = {instancePath:instancePath+"/attribution",schemaPath:"#/properties/attribution/anyOf/0/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}var _valid9 = _errs93 === errors;valid18 = valid18 || _valid9;const _errs105 = errors;if(data25 !== null){const err94 = {instancePath:instancePath+"/attribution",schemaPath:"#/properties/attribution/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}var _valid9 = _errs105 === errors;valid18 = valid18 || _valid9;if(!valid18){const err95 = {instancePath:instancePath+"/attribution",schemaPath:"#/properties/attribution/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}else {errors = _errs92;if(vErrors !== null){if(_errs92){vErrors.length = _errs92;}else {vErrors = null;}}}}if(data.review_status !== undefined){let data30 = data.review_status;const _errs108 = errors;let valid23 = false;const _errs109 = errors;if(typeof data30 !== "string"){const err96 = {instancePath:instancePath+"/review_status",schemaPath:"#/properties/review_status/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}if(!(((data30 === "authored") || (data30 === "generated")) || (data30 === "reviewed"))){const err97 = {instancePath:instancePath+"/review_status",schemaPath:"#/properties/review_status/anyOf/0/enum",keyword:"enum",params:{allowedValues: schema57.properties.review_status.anyOf[0].enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}var _valid10 = _errs109 === errors;valid23 = valid23 || _valid10;const _errs111 = errors;if(data30 !== null){const err98 = {instancePath:instancePath+"/review_status",schemaPath:"#/properties/review_status/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}var _valid10 = _errs111 === errors;valid23 = valid23 || _valid10;if(!valid23){const err99 = {instancePath:instancePath+"/review_status",schemaPath:"#/properties/review_status/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}else {errors = _errs108;if(vErrors !== null){if(_errs108){vErrors.length = _errs108;}else {vErrors = null;}}}}if(data.evaluation !== undefined){let data31 = data.evaluation;const _errs114 = errors;let valid24 = false;const _errs115 = errors;if(!(validate37(data31, {instancePath:instancePath+"/evaluation",parentData:data,parentDataProperty:"evaluation",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate37.errors : vErrors.concat(validate37.errors);errors = vErrors.length;}var _valid11 = _errs115 === errors;valid24 = valid24 || _valid11;const _errs116 = errors;if(data31 !== null){const err100 = {instancePath:instancePath+"/evaluation",schemaPath:"#/properties/evaluation/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}var _valid11 = _errs116 === errors;valid24 = valid24 || _valid11;if(!valid24){const err101 = {instancePath:instancePath+"/evaluation",schemaPath:"#/properties/evaluation/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}else {errors = _errs114;if(vErrors !== null){if(_errs114){vErrors.length = _errs114;}else {vErrors = null;}}}}}else {const err102 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}validate36.errors = vErrors;return errors === 0;}validate36.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate35(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://astrapi69.github.io/learn-content-engine/schema/content-manifest.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate35.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.name === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "description") || (key0 === "metadata")) || (key0 === "name")) || (key0 === "schema_version")) || (key0 === "sets"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.description !== undefined){let data0 = data.description;const _errs3 = errors;let valid1 = false;const _errs4 = errors;if(typeof data0 === "string"){if(func3(data0) > 2000){const err2 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}var _valid0 = _errs4 === errors;valid1 = valid1 || _valid0;const _errs6 = errors;if(data0 !== null){const err4 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid0 = _errs6 === errors;valid1 = valid1 || _valid0;if(!valid1){const err5 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}}if(data.metadata !== undefined){let data1 = data.metadata;if(data1 && typeof data1 == "object" && !Array.isArray(data1)){}else {const err6 = {instancePath:instancePath+"/metadata",schemaPath:"#/properties/metadata/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.name !== undefined){let data2 = data.name;if(typeof data2 === "string"){if(func3(data2) > 200){const err7 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/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+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.schema_version !== undefined){if(typeof data.schema_version !== "string"){const err10 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.sets !== undefined){let data4 = data.sets;if(Array.isArray(data4)){const len0 = data4.length;for(let i0=0; i0 120){const err5 = {instancePath:instancePath+"/token",schemaPath:"#/properties/token/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(func3(data1) < 1){const err6 = {instancePath:instancePath+"/token",schemaPath:"#/properties/token/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/token",schemaPath:"#/properties/token/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}validate22.errors = vErrors;return errors === 0;}validate22.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate21(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate21.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.front === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "front"},message:"must have required property '"+"front"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.back === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "back"},message:"must have required property '"+"back"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(func1.call(schema32.properties, key0))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.audio !== undefined){let data0 = data.audio;const _errs3 = errors;let valid1 = false;const _errs4 = errors;if(typeof data0 !== "string"){const err4 = {instancePath:instancePath+"/audio",schemaPath:"#/properties/audio/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid0 = _errs4 === errors;valid1 = valid1 || _valid0;const _errs6 = errors;if(data0 !== null){const err5 = {instancePath:instancePath+"/audio",schemaPath:"#/properties/audio/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}var _valid0 = _errs6 === errors;valid1 = valid1 || _valid0;if(!valid1){const err6 = {instancePath:instancePath+"/audio",schemaPath:"#/properties/audio/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}}if(data.back !== undefined){let data1 = data.back;if(typeof data1 === "string"){if(func3(data1) > 500){const err7 = {instancePath:instancePath+"/back",schemaPath:"#/properties/back/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data1) < 1){const err8 = {instancePath:instancePath+"/back",schemaPath:"#/properties/back/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+"/back",schemaPath:"#/properties/back/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.code_language !== undefined){let data2 = data.code_language;const _errs11 = errors;let valid2 = false;const _errs12 = errors;if(typeof data2 === "string"){if(func3(data2) > 30){const err10 = {instancePath:instancePath+"/code_language",schemaPath:"#/properties/code_language/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 30},message:"must NOT have more than 30 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/code_language",schemaPath:"#/properties/code_language/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid1 = _errs12 === errors;valid2 = valid2 || _valid1;const _errs14 = errors;if(data2 !== null){const err12 = {instancePath:instancePath+"/code_language",schemaPath:"#/properties/code_language/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid1 = _errs14 === errors;valid2 = valid2 || _valid1;if(!valid2){const err13 = {instancePath:instancePath+"/code_language",schemaPath:"#/properties/code_language/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}else {errors = _errs11;if(vErrors !== null){if(_errs11){vErrors.length = _errs11;}else {vErrors = null;}}}}if(data.code_snippet !== undefined){let data3 = data.code_snippet;const _errs17 = errors;let valid3 = false;const _errs18 = errors;if(typeof data3 === "string"){if(func3(data3) > 5000){const err14 = {instancePath:instancePath+"/code_snippet",schemaPath:"#/properties/code_snippet/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 5000},message:"must NOT have more than 5000 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/code_snippet",schemaPath:"#/properties/code_snippet/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}var _valid2 = _errs18 === errors;valid3 = valid3 || _valid2;const _errs20 = errors;if(data3 !== null){const err16 = {instancePath:instancePath+"/code_snippet",schemaPath:"#/properties/code_snippet/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}var _valid2 = _errs20 === errors;valid3 = valid3 || _valid2;if(!valid3){const err17 = {instancePath:instancePath+"/code_snippet",schemaPath:"#/properties/code_snippet/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}else {errors = _errs17;if(vErrors !== null){if(_errs17){vErrors.length = _errs17;}else {vErrors = null;}}}}if(data.difficulty !== undefined){let data4 = data.difficulty;const _errs23 = errors;let valid4 = false;const _errs24 = errors;if(!((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4)))){const err18 = {instancePath:instancePath+"/difficulty",schemaPath:"#/properties/difficulty/anyOf/0/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(typeof data4 == "number"){if(data4 > 5 || isNaN(data4)){const err19 = {instancePath:instancePath+"/difficulty",schemaPath:"#/properties/difficulty/anyOf/0/maximum",keyword:"maximum",params:{comparison: "<=", limit: 5},message:"must be <= 5"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(data4 < 1 || isNaN(data4)){const err20 = {instancePath:instancePath+"/difficulty",schemaPath:"#/properties/difficulty/anyOf/0/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}var _valid3 = _errs24 === errors;valid4 = valid4 || _valid3;const _errs26 = errors;if(data4 !== null){const err21 = {instancePath:instancePath+"/difficulty",schemaPath:"#/properties/difficulty/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}var _valid3 = _errs26 === errors;valid4 = valid4 || _valid3;if(!valid4){const err22 = {instancePath:instancePath+"/difficulty",schemaPath:"#/properties/difficulty/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}else {errors = _errs23;if(vErrors !== null){if(_errs23){vErrors.length = _errs23;}else {vErrors = null;}}}}if(data.expected_output !== undefined){let data5 = data.expected_output;const _errs29 = errors;let valid5 = false;const _errs30 = errors;if(typeof data5 === "string"){if(func3(data5) > 2000){const err23 = {instancePath:instancePath+"/expected_output",schemaPath:"#/properties/expected_output/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}else {const err24 = {instancePath:instancePath+"/expected_output",schemaPath:"#/properties/expected_output/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}var _valid4 = _errs30 === errors;valid5 = valid5 || _valid4;const _errs32 = errors;if(data5 !== null){const err25 = {instancePath:instancePath+"/expected_output",schemaPath:"#/properties/expected_output/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}var _valid4 = _errs32 === errors;valid5 = valid5 || _valid4;if(!valid5){const err26 = {instancePath:instancePath+"/expected_output",schemaPath:"#/properties/expected_output/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}else {errors = _errs29;if(vErrors !== null){if(_errs29){vErrors.length = _errs29;}else {vErrors = null;}}}}if(data.front !== undefined){let data6 = data.front;if(typeof data6 === "string"){if(func3(data6) > 500){const err27 = {instancePath:instancePath+"/front",schemaPath:"#/properties/front/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(func3(data6) < 1){const err28 = {instancePath:instancePath+"/front",schemaPath:"#/properties/front/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}else {const err29 = {instancePath:instancePath+"/front",schemaPath:"#/properties/front/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}if(data.hint !== undefined){let data7 = data.hint;const _errs37 = errors;let valid6 = false;const _errs38 = errors;if(typeof data7 === "string"){if(func3(data7) > 1000){const err30 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}else {const err31 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}var _valid5 = _errs38 === errors;valid6 = valid6 || _valid5;const _errs40 = errors;if(data7 !== null){const err32 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}var _valid5 = _errs40 === errors;valid6 = valid6 || _valid5;if(!valid6){const err33 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}else {errors = _errs37;if(vErrors !== null){if(_errs37){vErrors.length = _errs37;}else {vErrors = null;}}}}if(data.id !== undefined){let data8 = data.id;if(typeof data8 === "string"){if(func3(data8) > 120){const err34 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}if(func3(data8) < 1){const err35 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if(!pattern4.test(data8)){const err36 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}else {const err37 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data.stable_id !== undefined){let data9 = data.stable_id;const _errs46 = errors;let valid8 = false;const _errs47 = errors;if(typeof data9 === "string"){if(!pattern5.test(data9)){const err38 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9][a-z0-9_-]{7,63}$"},message:"must match pattern \""+"^[a-z0-9][a-z0-9_-]{7,63}$"+"\""};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}else {const err39 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}var _valid6 = _errs47 === errors;valid8 = valid8 || _valid6;const _errs49 = errors;if(data9 !== null){const err40 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}var _valid6 = _errs49 === errors;valid8 = valid8 || _valid6;if(!valid8){const err41 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}else {errors = _errs46;if(vErrors !== null){if(_errs46){vErrors.length = _errs46;}else {vErrors = null;}}}}if(data.image !== undefined){let data10 = data.image;const _errs52 = errors;let valid9 = false;const _errs53 = errors;if(typeof data10 !== "string"){const err42 = {instancePath:instancePath+"/image",schemaPath:"#/properties/image/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}var _valid7 = _errs53 === errors;valid9 = valid9 || _valid7;const _errs55 = errors;if(data10 !== null){const err43 = {instancePath:instancePath+"/image",schemaPath:"#/properties/image/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}var _valid7 = _errs55 === errors;valid9 = valid9 || _valid7;if(!valid9){const err44 = {instancePath:instancePath+"/image",schemaPath:"#/properties/image/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}else {errors = _errs52;if(vErrors !== null){if(_errs52){vErrors.length = _errs52;}else {vErrors = null;}}}}if(data.media_type !== undefined){let data11 = data.media_type;const _errs58 = errors;let valid10 = false;const _errs59 = errors;if(typeof data11 !== "string"){const err45 = {instancePath:instancePath+"/media_type",schemaPath:"#/properties/media_type/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(!((((data11 === "text") || (data11 === "code")) || (data11 === "formula")) || (data11 === "diagram"))){const err46 = {instancePath:instancePath+"/media_type",schemaPath:"#/properties/media_type/anyOf/0/enum",keyword:"enum",params:{allowedValues: schema32.properties.media_type.anyOf[0].enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}var _valid8 = _errs59 === errors;valid10 = valid10 || _valid8;const _errs61 = errors;if(data11 !== null){const err47 = {instancePath:instancePath+"/media_type",schemaPath:"#/properties/media_type/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}var _valid8 = _errs61 === errors;valid10 = valid10 || _valid8;if(!valid10){const err48 = {instancePath:instancePath+"/media_type",schemaPath:"#/properties/media_type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}else {errors = _errs58;if(vErrors !== null){if(_errs58){vErrors.length = _errs58;}else {vErrors = null;}}}}if(data.notes !== undefined){let data12 = data.notes;const _errs64 = errors;let valid11 = false;const _errs65 = errors;if(typeof data12 === "string"){if(func3(data12) > 2000){const err49 = {instancePath:instancePath+"/notes",schemaPath:"#/properties/notes/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}else {const err50 = {instancePath:instancePath+"/notes",schemaPath:"#/properties/notes/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}var _valid9 = _errs65 === errors;valid11 = valid11 || _valid9;const _errs67 = errors;if(data12 !== null){const err51 = {instancePath:instancePath+"/notes",schemaPath:"#/properties/notes/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}var _valid9 = _errs67 === errors;valid11 = valid11 || _valid9;if(!valid11){const err52 = {instancePath:instancePath+"/notes",schemaPath:"#/properties/notes/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}else {errors = _errs64;if(vErrors !== null){if(_errs64){vErrors.length = _errs64;}else {vErrors = null;}}}}if(data.tags !== undefined){let data13 = data.tags;if(Array.isArray(data13)){if(data13.length > 20){const err53 = {instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}const len0 = data13.length;for(let i0=0; i0 120){const err54 = {instancePath:instancePath+"/tags/" + i0,schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}if(func3(data14) < 1){const err55 = {instancePath:instancePath+"/tags/" + i0,schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}if(!pattern4.test(data14)){const err56 = {instancePath:instancePath+"/tags/" + i0,schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}else {const err57 = {instancePath:instancePath+"/tags/" + i0,schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}}else {const err58 = {instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}if(data.token_roles !== undefined){let data15 = data.token_roles;const _errs75 = errors;let valid15 = false;const _errs76 = errors;if(Array.isArray(data15)){if(data15.length > 10){const err59 = {instancePath:instancePath+"/token_roles",schemaPath:"#/properties/token_roles/anyOf/0/maxItems",keyword:"maxItems",params:{limit: 10},message:"must NOT have more than 10 items"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}const len1 = data15.length;for(let i1=0; i1 200){const err5 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid0 = _errs8 === errors;valid3 = valid3 || _valid0;const _errs10 = errors;if(data2 !== null){const err7 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid0 = _errs10 === errors;valid3 = valid3 || _valid0;if(!valid3){const err8 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs7;if(vErrors !== null){if(_errs7){vErrors.length = _errs7;}else {vErrors = null;}}}}if(data.placeholder !== undefined){let data3 = data.placeholder;const _errs13 = errors;let valid4 = false;const _errs14 = errors;if(typeof data3 === "string"){if(func3(data3) > 40){const err9 = {instancePath:instancePath+"/placeholder",schemaPath:"#/properties/placeholder/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 40},message:"must NOT have more than 40 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/placeholder",schemaPath:"#/properties/placeholder/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}var _valid1 = _errs14 === errors;valid4 = valid4 || _valid1;const _errs16 = errors;if(data3 !== null){const err11 = {instancePath:instancePath+"/placeholder",schemaPath:"#/properties/placeholder/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid1 = _errs16 === errors;valid4 = valid4 || _valid1;if(!valid4){const err12 = {instancePath:instancePath+"/placeholder",schemaPath:"#/properties/placeholder/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}else {errors = _errs13;if(vErrors !== null){if(_errs13){vErrors.length = _errs13;}else {vErrors = null;}}}}if(data.stable_id !== undefined){let data4 = data.stable_id;const _errs19 = errors;let valid5 = false;const _errs20 = errors;if(typeof data4 === "string"){if(func3(data4) > 120){const err13 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(func3(data4) < 1){const err14 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(!pattern4.test(data4)){const err15 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}else {const err16 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}var _valid2 = _errs20 === errors;valid5 = valid5 || _valid2;const _errs23 = errors;if(data4 !== null){const err17 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}var _valid2 = _errs23 === errors;valid5 = valid5 || _valid2;if(!valid5){const err18 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}else {errors = _errs19;if(vErrors !== null){if(_errs19){vErrors.length = _errs19;}else {vErrors = null;}}}}}else {const err19 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}validate27.errors = vErrors;return errors === 0;}validate27.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema47 = {"additionalProperties":false,"properties":{"correct":{"default":false,"type":"boolean"},"stable_id":{"anyOf":[{"$ref":"#/$defs/SlugId"},{"type":"null"}],"default":null},"text":{"maxLength":500,"minLength":1,"type":"string"}},"required":["text"],"type":"object"};function validate29(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate29.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.text === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "text"},message:"must have required property '"+"text"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((key0 === "correct") || (key0 === "stable_id")) || (key0 === "text"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.correct !== undefined){if(typeof data.correct !== "boolean"){const err2 = {instancePath:instancePath+"/correct",schemaPath:"#/properties/correct/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.stable_id !== undefined){let data1 = data.stable_id;const _errs5 = errors;let valid1 = false;const _errs6 = errors;if(typeof data1 === "string"){if(func3(data1) > 120){const err3 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func3(data1) < 1){const err4 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid0 = _errs6 === errors;valid1 = valid1 || _valid0;const _errs9 = errors;if(data1 !== null){const err7 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid0 = _errs9 === errors;valid1 = valid1 || _valid0;if(!valid1){const err8 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs5;if(vErrors !== null){if(_errs5){vErrors.length = _errs5;}else {vErrors = null;}}}}if(data.text !== undefined){let data2 = data.text;if(typeof data2 === "string"){if(func3(data2) > 500){const err9 = {instancePath:instancePath+"/text",schemaPath:"#/properties/text/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(func3(data2) < 1){const err10 = {instancePath:instancePath+"/text",schemaPath:"#/properties/text/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+"/text",schemaPath:"#/properties/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}else {const err12 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}validate29.errors = vErrors;return errors === 0;}validate29.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema49 = {"additionalProperties":false,"properties":{"left":{"maxLength":500,"minLength":1,"type":"string"},"right":{"maxLength":500,"minLength":1,"type":"string"},"stable_id":{"anyOf":[{"$ref":"#/$defs/SlugId"},{"type":"null"}],"default":null}},"required":["left","right"],"type":"object"};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(data && typeof data == "object" && !Array.isArray(data)){if(data.left === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "left"},message:"must have required property '"+"left"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.right === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "right"},message:"must have required property '"+"right"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((key0 === "left") || (key0 === "right")) || (key0 === "stable_id"))){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.left !== undefined){let data0 = data.left;if(typeof data0 === "string"){if(func3(data0) > 500){const err3 = {instancePath:instancePath+"/left",schemaPath:"#/properties/left/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func3(data0) < 1){const err4 = {instancePath:instancePath+"/left",schemaPath:"#/properties/left/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/left",schemaPath:"#/properties/left/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.right !== undefined){let data1 = data.right;if(typeof data1 === "string"){if(func3(data1) > 500){const err6 = {instancePath:instancePath+"/right",schemaPath:"#/properties/right/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(func3(data1) < 1){const err7 = {instancePath:instancePath+"/right",schemaPath:"#/properties/right/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+"/right",schemaPath:"#/properties/right/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.stable_id !== undefined){let data2 = data.stable_id;const _errs7 = errors;let valid1 = false;const _errs8 = errors;if(typeof data2 === "string"){if(func3(data2) > 120){const err9 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(func3(data2) < 1){const err10 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(!pattern4.test(data2)){const err11 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/stable_id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid0 = _errs8 === errors;valid1 = valid1 || _valid0;const _errs11 = errors;if(data2 !== null){const err13 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}var _valid0 = _errs11 === errors;valid1 = valid1 || _valid0;if(!valid1){const err14 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}else {errors = _errs7;if(vErrors !== null){if(_errs7){vErrors.length = _errs7;}else {vErrors = null;}}}}}else {const err15 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}validate31.errors = vErrors;return errors === 0;}validate31.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const pattern12 = new RegExp("^data:image/[a-z0-9.+-]+;base64,", "u");const pattern15 = new RegExp("^ext:[a-z0-9]+-[a-z0-9-]+$", "u");const pattern16 = new RegExp("^[a-z][a-z0-9_]*$", "u");function validate26(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate26.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.prompt === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "prompt"},message:"must have required property '"+"prompt"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(func1.call(schema41.properties, key0))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.accept !== undefined){let data0 = data.accept;const _errs3 = errors;let valid1 = false;const _errs4 = errors;if(Array.isArray(data0)){const len0 = data0.length;for(let i0=0; i0 50){const err16 = {instancePath:instancePath+"/card_ids",schemaPath:"#/properties/card_ids/maxItems",keyword:"maxItems",params:{limit: 50},message:"must NOT have more than 50 items"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}const len4 = data7.length;for(let i4=0; i4 20){const err26 = {instancePath:instancePath+"/distractors",schemaPath:"#/properties/distractors/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}const len5 = data12.length;for(let i5=0; i5 20){const err29 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf/0/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}const len6 = data14.length;for(let i6=0; i6 5000){const err32 = {instancePath:instancePath+"/examples/" + i6+"/content",schemaPath:"#/$defs/InlineExample/properties/content/maxLength",keyword:"maxLength",params:{limit: 5000},message:"must NOT have more than 5000 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}if(func3(data16) < 1){const err33 = {instancePath:instancePath+"/examples/" + i6+"/content",schemaPath:"#/$defs/InlineExample/properties/content/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}else {const err34 = {instancePath:instancePath+"/examples/" + i6+"/content",schemaPath:"#/$defs/InlineExample/properties/content/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data15.language !== undefined){let data17 = data15.language;const _errs56 = errors;let valid22 = false;const _errs57 = errors;if(typeof data17 === "string"){if(func3(data17) > 30){const err35 = {instancePath:instancePath+"/examples/" + i6+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 30},message:"must NOT have more than 30 characters"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}else {const err36 = {instancePath:instancePath+"/examples/" + i6+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}var _valid5 = _errs57 === errors;valid22 = valid22 || _valid5;const _errs59 = errors;if(data17 !== null){const err37 = {instancePath:instancePath+"/examples/" + i6+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}var _valid5 = _errs59 === errors;valid22 = valid22 || _valid5;if(!valid22){const err38 = {instancePath:instancePath+"/examples/" + i6+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}else {errors = _errs56;if(vErrors !== null){if(_errs56){vErrors.length = _errs56;}else {vErrors = null;}}}}if(data15.title !== undefined){let data18 = data15.title;const _errs62 = errors;let valid23 = false;const _errs63 = errors;if(typeof data18 === "string"){if(func3(data18) > 200){const err39 = {instancePath:instancePath+"/examples/" + i6+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else {const err40 = {instancePath:instancePath+"/examples/" + i6+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}var _valid6 = _errs63 === errors;valid23 = valid23 || _valid6;const _errs65 = errors;if(data18 !== null){const err41 = {instancePath:instancePath+"/examples/" + i6+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}var _valid6 = _errs65 === errors;valid23 = valid23 || _valid6;if(!valid23){const err42 = {instancePath:instancePath+"/examples/" + i6+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}else {errors = _errs62;if(vErrors !== null){if(_errs62){vErrors.length = _errs62;}else {vErrors = null;}}}}}else {const err43 = {instancePath:instancePath+"/examples/" + i6,schemaPath:"#/$defs/InlineExample/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}}else {const err44 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf/0/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}var _valid4 = _errs47 === errors;valid17 = valid17 || _valid4;const _errs67 = errors;if(data14 !== null){const err45 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}var _valid4 = _errs67 === errors;valid17 = valid17 || _valid4;if(!valid17){const err46 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}else {errors = _errs46;if(vErrors !== null){if(_errs46){vErrors.length = _errs46;}else {vErrors = null;}}}}if(data.explanation !== undefined){let data19 = data.explanation;const _errs70 = errors;let valid24 = false;const _errs71 = errors;if(typeof data19 === "string"){if(func3(data19) > 2000){const err47 = {instancePath:instancePath+"/explanation",schemaPath:"#/properties/explanation/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}else {const err48 = {instancePath:instancePath+"/explanation",schemaPath:"#/properties/explanation/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}var _valid7 = _errs71 === errors;valid24 = valid24 || _valid7;const _errs73 = errors;if(data19 !== null){const err49 = {instancePath:instancePath+"/explanation",schemaPath:"#/properties/explanation/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}var _valid7 = _errs73 === errors;valid24 = valid24 || _valid7;if(!valid24){const err50 = {instancePath:instancePath+"/explanation",schemaPath:"#/properties/explanation/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}else {errors = _errs70;if(vErrors !== null){if(_errs70){vErrors.length = _errs70;}else {vErrors = null;}}}}if(data.ext_payload !== undefined){let data20 = data.ext_payload;if(data20 && typeof data20 == "object" && !Array.isArray(data20)){}else {const err51 = {instancePath:instancePath+"/ext_payload",schemaPath:"#/properties/ext_payload/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data.from_cards !== undefined){if(typeof data.from_cards !== "boolean"){const err52 = {instancePath:instancePath+"/from_cards",schemaPath:"#/properties/from_cards/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}if(data.hint !== undefined){let data22 = data.hint;const _errs81 = errors;let valid25 = false;const _errs82 = errors;if(typeof data22 === "string"){if(func3(data22) > 1000){const err53 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}var _valid8 = _errs82 === errors;valid25 = valid25 || _valid8;const _errs84 = errors;if(data22 !== null){const err55 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}var _valid8 = _errs84 === errors;valid25 = valid25 || _valid8;if(!valid25){const err56 = {instancePath:instancePath+"/hint",schemaPath:"#/properties/hint/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}else {errors = _errs81;if(vErrors !== null){if(_errs81){vErrors.length = _errs81;}else {vErrors = null;}}}}if(data.id !== undefined){let data23 = data.id;if(typeof data23 === "string"){if(func3(data23) > 120){const err57 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}if(func3(data23) < 1){const err58 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(!pattern4.test(data23)){const err59 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}}else {const err60 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}if(data.stable_id !== undefined){let data24 = data.stable_id;const _errs90 = errors;let valid27 = false;const _errs91 = errors;if(typeof data24 === "string"){if(!pattern5.test(data24)){const err61 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/0/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9][a-z0-9_-]{7,63}$"},message:"must match pattern \""+"^[a-z0-9][a-z0-9_-]{7,63}$"+"\""};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}else {const err62 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}var _valid9 = _errs91 === errors;valid27 = valid27 || _valid9;const _errs93 = errors;if(data24 !== null){const err63 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}var _valid9 = _errs93 === errors;valid27 = valid27 || _valid9;if(!valid27){const err64 = {instancePath:instancePath+"/stable_id",schemaPath:"#/properties/stable_id/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}else {errors = _errs90;if(vErrors !== null){if(_errs90){vErrors.length = _errs90;}else {vErrors = null;}}}}if(data.images !== undefined){let data25 = data.images;const _errs96 = errors;let valid28 = false;const _errs97 = errors;if(Array.isArray(data25)){const len7 = data25.length;for(let i7=0; i7 10){const err68 = {instancePath:instancePath+"/images/" + i7+"/is_correct",schemaPath:"#/$defs/PictureImage/properties/is_correct/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 10},message:"must NOT have more than 10 characters"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}else {const err69 = {instancePath:instancePath+"/images/" + i7+"/is_correct",schemaPath:"#/$defs/PictureImage/properties/is_correct/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}var _valid11 = _errs105 === errors;valid33 = valid33 || _valid11;const _errs107 = errors;if(data27 !== null){const err70 = {instancePath:instancePath+"/images/" + i7+"/is_correct",schemaPath:"#/$defs/PictureImage/properties/is_correct/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}var _valid11 = _errs107 === errors;valid33 = valid33 || _valid11;if(!valid33){const err71 = {instancePath:instancePath+"/images/" + i7+"/is_correct",schemaPath:"#/$defs/PictureImage/properties/is_correct/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}else {errors = _errs104;if(vErrors !== null){if(_errs104){vErrors.length = _errs104;}else {vErrors = null;}}}}if(data26.label !== undefined){let data28 = data26.label;if(typeof data28 === "string"){if(func3(data28) > 500){const err72 = {instancePath:instancePath+"/images/" + i7+"/label",schemaPath:"#/$defs/PictureImage/properties/label/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}if(func3(data28) < 1){const err73 = {instancePath:instancePath+"/images/" + i7+"/label",schemaPath:"#/$defs/PictureImage/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+"/images/" + i7+"/label",schemaPath:"#/$defs/PictureImage/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}if(data26.src !== undefined){let data29 = data26.src;const _errs112 = errors;let valid34 = false;const _errs113 = errors;if(typeof data29 === "string"){if(func3(data29) > 500){const err75 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}if(func3(data29) < 1){const err76 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}else {const err77 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}var _valid12 = _errs113 === errors;valid34 = valid34 || _valid12;const _errs115 = errors;if(typeof data29 === "string"){if(func3(data29) > 250000){const err78 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf/1/maxLength",keyword:"maxLength",params:{limit: 250000},message:"must NOT have more than 250000 characters"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}if(!pattern12.test(data29)){const err79 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^data:image/[a-z0-9.+-]+;base64,"},message:"must match pattern \""+"^data:image/[a-z0-9.+-]+;base64,"+"\""};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}else {const err80 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}var _valid12 = _errs115 === errors;valid34 = valid34 || _valid12;if(!valid34){const err81 = {instancePath:instancePath+"/images/" + i7+"/src",schemaPath:"#/$defs/PictureImage/properties/src/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}else {errors = _errs112;if(vErrors !== null){if(_errs112){vErrors.length = _errs112;}else {vErrors = null;}}}}}else {const err82 = {instancePath:instancePath+"/images/" + i7,schemaPath:"#/$defs/PictureImage/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}}else {const err83 = {instancePath:instancePath+"/images",schemaPath:"#/properties/images/anyOf/0/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}var _valid10 = _errs97 === errors;valid28 = valid28 || _valid10;const _errs117 = errors;if(data25 !== null){const err84 = {instancePath:instancePath+"/images",schemaPath:"#/properties/images/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}var _valid10 = _errs117 === errors;valid28 = valid28 || _valid10;if(!valid28){const err85 = {instancePath:instancePath+"/images",schemaPath:"#/properties/images/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}else {errors = _errs96;if(vErrors !== null){if(_errs96){vErrors.length = _errs96;}else {vErrors = null;}}}}if(data.multiple !== undefined){if(typeof data.multiple !== "boolean"){const err86 = {instancePath:instancePath+"/multiple",schemaPath:"#/properties/multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}}if(data.options !== undefined){let data31 = data.options;const _errs122 = errors;let valid35 = false;const _errs123 = errors;if(Array.isArray(data31)){if(data31.length > 20){const err87 = {instancePath:instancePath+"/options",schemaPath:"#/properties/options/anyOf/0/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}const len8 = data31.length;for(let i8=0; i8 1000){const err94 = {instancePath:instancePath+"/prompt",schemaPath:"#/properties/prompt/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}if(func3(data35) < 1){const err95 = {instancePath:instancePath+"/prompt",schemaPath:"#/properties/prompt/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+"/prompt",schemaPath:"#/properties/prompt/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}if(data.sentence !== undefined){let data36 = data.sentence;const _errs138 = errors;let valid41 = false;const _errs139 = errors;if(typeof data36 === "string"){if(func3(data36) > 1000){const err97 = {instancePath:instancePath+"/sentence",schemaPath:"#/properties/sentence/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}else {const err98 = {instancePath:instancePath+"/sentence",schemaPath:"#/properties/sentence/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}var _valid15 = _errs139 === errors;valid41 = valid41 || _valid15;const _errs141 = errors;if(data36 !== null){const err99 = {instancePath:instancePath+"/sentence",schemaPath:"#/properties/sentence/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}var _valid15 = _errs141 === errors;valid41 = valid41 || _valid15;if(!valid41){const err100 = {instancePath:instancePath+"/sentence",schemaPath:"#/properties/sentence/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}else {errors = _errs138;if(vErrors !== null){if(_errs138){vErrors.length = _errs138;}else {vErrors = null;}}}}if(data.tiles !== undefined){let data37 = data.tiles;const _errs144 = errors;let valid42 = false;const _errs145 = errors;if(Array.isArray(data37)){const len10 = data37.length;for(let i10=0; i10 20){const err110 = {instancePath:instancePath+"/variables",schemaPath:"#/properties/variables/anyOf/0/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}if(data40.length < 1){const err111 = {instancePath:instancePath+"/variables",schemaPath:"#/properties/variables/anyOf/0/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}const len11 = data40.length;for(let i11=0; i11 32){const err114 = {instancePath:instancePath+"/variables/" + i11+"/name",schemaPath:"#/$defs/ExerciseVariable/properties/name/maxLength",keyword:"maxLength",params:{limit: 32},message:"must NOT have more than 32 characters"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}if(!pattern16.test(data42)){const err115 = {instancePath:instancePath+"/variables/" + i11+"/name",schemaPath:"#/$defs/ExerciseVariable/properties/name/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9_]*$"},message:"must match pattern \""+"^[a-z][a-z0-9_]*$"+"\""};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}else {const err116 = {instancePath:instancePath+"/variables/" + i11+"/name",schemaPath:"#/$defs/ExerciseVariable/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data41.min !== undefined){if(!(typeof data41.min == "number")){const err117 = {instancePath:instancePath+"/variables/" + i11+"/min",schemaPath:"#/$defs/ExerciseVariable/properties/min/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}if(data41.max !== undefined){if(!(typeof data41.max == "number")){const err118 = {instancePath:instancePath+"/variables/" + i11+"/max",schemaPath:"#/$defs/ExerciseVariable/properties/max/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}if(data41.step !== undefined){let data45 = data41.step;if(typeof data45 == "number"){if(data45 <= 0 || isNaN(data45)){const err119 = {instancePath:instancePath+"/variables/" + i11+"/step",schemaPath:"#/$defs/ExerciseVariable/properties/step/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison: ">", limit: 0},message:"must be > 0"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}else {const err120 = {instancePath:instancePath+"/variables/" + i11+"/step",schemaPath:"#/$defs/ExerciseVariable/properties/step/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data41.expression !== undefined){let data46 = data41.expression;if(typeof data46 === "string"){if(func3(data46) > 200){const err121 = {instancePath:instancePath+"/variables/" + i11+"/expression",schemaPath:"#/$defs/ExerciseVariable/properties/expression/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}if(func3(data46) < 1){const err122 = {instancePath:instancePath+"/variables/" + i11+"/expression",schemaPath:"#/$defs/ExerciseVariable/properties/expression/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+"/variables/" + i11+"/expression",schemaPath:"#/$defs/ExerciseVariable/properties/expression/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}if(data41.tolerance !== undefined){let data47 = data41.tolerance;if(typeof data47 == "number"){if(data47 < 0 || isNaN(data47)){const err124 = {instancePath:instancePath+"/variables/" + i11+"/tolerance",schemaPath:"#/$defs/ExerciseVariable/properties/tolerance/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}else {const err125 = {instancePath:instancePath+"/variables/" + i11+"/tolerance",schemaPath:"#/$defs/ExerciseVariable/properties/tolerance/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}}else {const err126 = {instancePath:instancePath+"/variables/" + i11,schemaPath:"#/$defs/ExerciseVariable/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+"/variables",schemaPath:"#/properties/variables/anyOf/0/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}var _valid18 = _errs161 === errors;valid48 = valid48 || _valid18;const _errs179 = errors;if(data40 !== null){const err128 = {instancePath:instancePath+"/variables",schemaPath:"#/properties/variables/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}var _valid18 = _errs179 === errors;valid48 = valid48 || _valid18;if(!valid48){const err129 = {instancePath:instancePath+"/variables",schemaPath:"#/properties/variables/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}else {errors = _errs160;if(vErrors !== null){if(_errs160){vErrors.length = _errs160;}else {vErrors = null;}}}}}else {const err130 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}validate26.errors = vErrors;return errors === 0;}validate26.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate25(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate25.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.type === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(func1.call(schema39.properties, key0))){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.body !== undefined){let data0 = data.body;const _errs3 = errors;let valid1 = false;const _errs4 = errors;if(typeof data0 !== "string"){const err3 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}var _valid0 = _errs4 === errors;valid1 = valid1 || _valid0;const _errs6 = errors;if(data0 !== null){const err4 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid0 = _errs6 === errors;valid1 = valid1 || _valid0;if(!valid1){const err5 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}}if(data.example_label !== undefined){let data1 = data.example_label;const _errs9 = errors;let valid2 = false;const _errs10 = errors;if(typeof data1 === "string"){if(func3(data1) > 200){const err6 = {instancePath:instancePath+"/example_label",schemaPath:"#/properties/example_label/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/example_label",schemaPath:"#/properties/example_label/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid1 = _errs10 === errors;valid2 = valid2 || _valid1;const _errs12 = errors;if(data1 !== null){const err8 = {instancePath:instancePath+"/example_label",schemaPath:"#/properties/example_label/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}var _valid1 = _errs12 === errors;valid2 = valid2 || _valid1;if(!valid2){const err9 = {instancePath:instancePath+"/example_label",schemaPath:"#/properties/example_label/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}else {errors = _errs9;if(vErrors !== null){if(_errs9){vErrors.length = _errs9;}else {vErrors = null;}}}}if(data.example_url !== undefined){let data2 = data.example_url;const _errs15 = errors;let valid3 = false;const _errs16 = errors;if(typeof data2 === "string"){if(func3(data2) > 2000){const err10 = {instancePath:instancePath+"/example_url",schemaPath:"#/properties/example_url/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/example_url",schemaPath:"#/properties/example_url/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid2 = _errs16 === errors;valid3 = valid3 || _valid2;const _errs18 = errors;if(data2 !== null){const err12 = {instancePath:instancePath+"/example_url",schemaPath:"#/properties/example_url/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid2 = _errs18 === errors;valid3 = valid3 || _valid2;if(!valid3){const err13 = {instancePath:instancePath+"/example_url",schemaPath:"#/properties/example_url/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}else {errors = _errs15;if(vErrors !== null){if(_errs15){vErrors.length = _errs15;}else {vErrors = null;}}}}if(data.examples !== undefined){let data3 = data.examples;const _errs21 = errors;let valid4 = false;const _errs22 = errors;if(Array.isArray(data3)){if(data3.length > 20){const err14 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf/0/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}const len0 = data3.length;for(let i0=0; i0 5000){const err17 = {instancePath:instancePath+"/examples/" + i0+"/content",schemaPath:"#/$defs/InlineExample/properties/content/maxLength",keyword:"maxLength",params:{limit: 5000},message:"must NOT have more than 5000 characters"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}if(func3(data5) < 1){const err18 = {instancePath:instancePath+"/examples/" + i0+"/content",schemaPath:"#/$defs/InlineExample/properties/content/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}else {const err19 = {instancePath:instancePath+"/examples/" + i0+"/content",schemaPath:"#/$defs/InlineExample/properties/content/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data4.language !== undefined){let data6 = data4.language;const _errs31 = errors;let valid9 = false;const _errs32 = errors;if(typeof data6 === "string"){if(func3(data6) > 30){const err20 = {instancePath:instancePath+"/examples/" + i0+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 30},message:"must NOT have more than 30 characters"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}else {const err21 = {instancePath:instancePath+"/examples/" + i0+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}var _valid4 = _errs32 === errors;valid9 = valid9 || _valid4;const _errs34 = errors;if(data6 !== null){const err22 = {instancePath:instancePath+"/examples/" + i0+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}var _valid4 = _errs34 === errors;valid9 = valid9 || _valid4;if(!valid9){const err23 = {instancePath:instancePath+"/examples/" + i0+"/language",schemaPath:"#/$defs/InlineExample/properties/language/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}else {errors = _errs31;if(vErrors !== null){if(_errs31){vErrors.length = _errs31;}else {vErrors = null;}}}}if(data4.title !== undefined){let data7 = data4.title;const _errs37 = errors;let valid10 = false;const _errs38 = errors;if(typeof data7 === "string"){if(func3(data7) > 200){const err24 = {instancePath:instancePath+"/examples/" + i0+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}else {const err25 = {instancePath:instancePath+"/examples/" + i0+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}var _valid5 = _errs38 === errors;valid10 = valid10 || _valid5;const _errs40 = errors;if(data7 !== null){const err26 = {instancePath:instancePath+"/examples/" + i0+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}var _valid5 = _errs40 === errors;valid10 = valid10 || _valid5;if(!valid10){const err27 = {instancePath:instancePath+"/examples/" + i0+"/title",schemaPath:"#/$defs/InlineExample/properties/title/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}else {errors = _errs37;if(vErrors !== null){if(_errs37){vErrors.length = _errs37;}else {vErrors = null;}}}}}else {const err28 = {instancePath:instancePath+"/examples/" + i0,schemaPath:"#/$defs/InlineExample/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}}else {const err29 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf/0/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}var _valid3 = _errs22 === errors;valid4 = valid4 || _valid3;const _errs42 = errors;if(data3 !== null){const err30 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}var _valid3 = _errs42 === errors;valid4 = valid4 || _valid3;if(!valid4){const err31 = {instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}else {errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}}}if(data.exercise !== undefined){let data8 = data.exercise;const _errs45 = errors;let valid11 = false;const _errs46 = errors;if(!(validate26(data8, {instancePath:instancePath+"/exercise",parentData:data,parentDataProperty:"exercise",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors);errors = vErrors.length;}var _valid6 = _errs46 === errors;valid11 = valid11 || _valid6;const _errs47 = errors;if(data8 !== null){const err32 = {instancePath:instancePath+"/exercise",schemaPath:"#/properties/exercise/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}var _valid6 = _errs47 === errors;valid11 = valid11 || _valid6;if(!valid11){const err33 = {instancePath:instancePath+"/exercise",schemaPath:"#/properties/exercise/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}else {errors = _errs45;if(vErrors !== null){if(_errs45){vErrors.length = _errs45;}else {vErrors = null;}}}}if(data.id !== undefined){let data9 = data.id;if(typeof data9 === "string"){if(func3(data9) > 120){const err34 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}if(func3(data9) < 1){const err35 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if(!pattern4.test(data9)){const err36 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}else {const err37 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data.review_lesson_id !== undefined){let data10 = data.review_lesson_id;const _errs53 = errors;let valid13 = false;const _errs54 = errors;if(typeof data10 === "string"){if(func3(data10) > 200){const err38 = {instancePath:instancePath+"/review_lesson_id",schemaPath:"#/properties/review_lesson_id/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}else {const err39 = {instancePath:instancePath+"/review_lesson_id",schemaPath:"#/properties/review_lesson_id/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}var _valid7 = _errs54 === errors;valid13 = valid13 || _valid7;const _errs56 = errors;if(data10 !== null){const err40 = {instancePath:instancePath+"/review_lesson_id",schemaPath:"#/properties/review_lesson_id/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}var _valid7 = _errs56 === errors;valid13 = valid13 || _valid7;if(!valid13){const err41 = {instancePath:instancePath+"/review_lesson_id",schemaPath:"#/properties/review_lesson_id/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}else {errors = _errs53;if(vErrors !== null){if(_errs53){vErrors.length = _errs53;}else {vErrors = null;}}}}if(data.theory_ref !== undefined){let data11 = data.theory_ref;const _errs59 = errors;let valid14 = false;const _errs60 = errors;if(typeof data11 === "string"){if(func3(data11) > 200){const err42 = {instancePath:instancePath+"/theory_ref",schemaPath:"#/properties/theory_ref/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}else {const err43 = {instancePath:instancePath+"/theory_ref",schemaPath:"#/properties/theory_ref/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}var _valid8 = _errs60 === errors;valid14 = valid14 || _valid8;const _errs62 = errors;if(data11 !== null){const err44 = {instancePath:instancePath+"/theory_ref",schemaPath:"#/properties/theory_ref/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}var _valid8 = _errs62 === errors;valid14 = valid14 || _valid8;if(!valid14){const err45 = {instancePath:instancePath+"/theory_ref",schemaPath:"#/properties/theory_ref/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}else {errors = _errs59;if(vErrors !== null){if(_errs59){vErrors.length = _errs59;}else {vErrors = null;}}}}if(data.title !== undefined){let data12 = data.title;const _errs65 = errors;let valid15 = false;const _errs66 = errors;if(typeof data12 === "string"){if(func3(data12) > 200){const err46 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}var _valid9 = _errs66 === errors;valid15 = valid15 || _valid9;const _errs68 = errors;if(data12 !== null){const err48 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}var _valid9 = _errs68 === errors;valid15 = valid15 || _valid9;if(!valid15){const err49 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}else {errors = _errs65;if(vErrors !== null){if(_errs65){vErrors.length = _errs65;}else {vErrors = null;}}}}if(data.type !== undefined){let data13 = data.type;if(typeof data13 !== "string"){const err50 = {instancePath:instancePath+"/type",schemaPath:"#/$defs/StepType/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}if(!((data13 === "theory") || (data13 === "exercise"))){const err51 = {instancePath:instancePath+"/type",schemaPath:"#/$defs/StepType/enum",keyword:"enum",params:{allowedValues: schema55.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}}else {const err52 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}validate25.errors = vErrors;return errors === 0;}validate25.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const pattern8 = new RegExp("^ext:[a-z0-9]+-[a-z0-9-]+@\\d+$", "u");function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://astrapi69.github.io/learn-content-engine/schema/lesson.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.id === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.title === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.steps === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "steps"},message:"must have required property '"+"steps"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(func1.call(schema31.properties, key0))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.cards !== undefined){let data0 = data.cards;if(Array.isArray(data0)){const len0 = data0.length;for(let i0=0; i0 40){const err5 = {instancePath:instancePath+"/contributed_at",schemaPath:"#/properties/contributed_at/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 40},message:"must NOT have more than 40 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/contributed_at",schemaPath:"#/properties/contributed_at/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid0 = _errs7 === errors;valid3 = valid3 || _valid0;const _errs9 = errors;if(data2 !== null){const err7 = {instancePath:instancePath+"/contributed_at",schemaPath:"#/properties/contributed_at/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid0 = _errs9 === errors;valid3 = valid3 || _valid0;if(!valid3){const err8 = {instancePath:instancePath+"/contributed_at",schemaPath:"#/properties/contributed_at/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs6;if(vErrors !== null){if(_errs6){vErrors.length = _errs6;}else {vErrors = null;}}}}if(data.contributed_by !== undefined){let data3 = data.contributed_by;const _errs12 = errors;let valid4 = false;const _errs13 = errors;if(typeof data3 === "string"){if(func3(data3) > 200){const err9 = {instancePath:instancePath+"/contributed_by",schemaPath:"#/properties/contributed_by/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/contributed_by",schemaPath:"#/properties/contributed_by/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}var _valid1 = _errs13 === errors;valid4 = valid4 || _valid1;const _errs15 = errors;if(data3 !== null){const err11 = {instancePath:instancePath+"/contributed_by",schemaPath:"#/properties/contributed_by/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid1 = _errs15 === errors;valid4 = valid4 || _valid1;if(!valid4){const err12 = {instancePath:instancePath+"/contributed_by",schemaPath:"#/properties/contributed_by/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}else {errors = _errs12;if(vErrors !== null){if(_errs12){vErrors.length = _errs12;}else {vErrors = null;}}}}if(data.description !== undefined){let data4 = data.description;const _errs18 = errors;let valid5 = false;const _errs19 = errors;if(typeof data4 === "string"){if(func3(data4) > 500){const err13 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}var _valid2 = _errs19 === errors;valid5 = valid5 || _valid2;const _errs21 = errors;if(data4 !== null){const err15 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}var _valid2 = _errs21 === errors;valid5 = valid5 || _valid2;if(!valid5){const err16 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}}if(data.domain !== undefined){let data5 = data.domain;const _errs24 = errors;let valid6 = false;const _errs25 = errors;if(typeof data5 !== "string"){const err17 = {instancePath:instancePath+"/domain",schemaPath:"#/properties/domain/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}var _valid3 = _errs25 === errors;valid6 = valid6 || _valid3;const _errs27 = errors;if(data5 !== null){const err18 = {instancePath:instancePath+"/domain",schemaPath:"#/properties/domain/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}var _valid3 = _errs27 === errors;valid6 = valid6 || _valid3;if(!valid6){const err19 = {instancePath:instancePath+"/domain",schemaPath:"#/properties/domain/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}}if(data.estimated_minutes !== undefined){let data6 = data.estimated_minutes;if(!((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6)))){const err20 = {instancePath:instancePath+"/estimated_minutes",schemaPath:"#/properties/estimated_minutes/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(typeof data6 == "number"){if(data6 > 240 || isNaN(data6)){const err21 = {instancePath:instancePath+"/estimated_minutes",schemaPath:"#/properties/estimated_minutes/maximum",keyword:"maximum",params:{comparison: "<=", limit: 240},message:"must be <= 240"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(data6 < 1 || isNaN(data6)){const err22 = {instancePath:instancePath+"/estimated_minutes",schemaPath:"#/properties/estimated_minutes/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}}if(data.id !== undefined){let data7 = data.id;if(typeof data7 === "string"){if(func3(data7) > 120){const err23 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}if(func3(data7) < 1){const err24 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if(!pattern4.test(data7)){const err25 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/pattern",keyword:"pattern",params:{pattern: "^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"},message:"must match pattern \""+"^[\\p{Ll}\\p{Nd}]+(-[\\p{Ll}\\p{Nd}]+)*$"+"\""};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}else {const err26 = {instancePath:instancePath+"/id",schemaPath:"#/$defs/SlugId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data.purpose !== undefined){let data8 = data.purpose;if(typeof data8 !== "string"){const err27 = {instancePath:instancePath+"/purpose",schemaPath:"#/properties/purpose/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(!(((data8 === "practice") || (data8 === "bridge")) || (data8 === "quiz"))){const err28 = {instancePath:instancePath+"/purpose",schemaPath:"#/properties/purpose/enum",keyword:"enum",params:{allowedValues: schema31.properties.purpose.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data.requires_extensions !== undefined){let data9 = data.requires_extensions;if(Array.isArray(data9)){const len1 = data9.length;for(let i1=0; i1 300){const err36 = {instancePath:instancePath+"/resources/" + i2+"/author",schemaPath:"#/$defs/LessonResource/properties/author/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}else {const err37 = {instancePath:instancePath+"/resources/" + i2+"/author",schemaPath:"#/$defs/LessonResource/properties/author/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}var _valid5 = _errs50 === errors;valid15 = valid15 || _valid5;const _errs52 = errors;if(data13 !== null){const err38 = {instancePath:instancePath+"/resources/" + i2+"/author",schemaPath:"#/$defs/LessonResource/properties/author/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}var _valid5 = _errs52 === errors;valid15 = valid15 || _valid5;if(!valid15){const err39 = {instancePath:instancePath+"/resources/" + i2+"/author",schemaPath:"#/$defs/LessonResource/properties/author/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}else {errors = _errs49;if(vErrors !== null){if(_errs49){vErrors.length = _errs49;}else {vErrors = null;}}}}if(data12.description !== undefined){let data14 = data12.description;const _errs55 = errors;let valid16 = false;const _errs56 = errors;if(typeof data14 === "string"){if(func3(data14) > 2000){const err40 = {instancePath:instancePath+"/resources/" + i2+"/description",schemaPath:"#/$defs/LessonResource/properties/description/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}else {const err41 = {instancePath:instancePath+"/resources/" + i2+"/description",schemaPath:"#/$defs/LessonResource/properties/description/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}var _valid6 = _errs56 === errors;valid16 = valid16 || _valid6;const _errs58 = errors;if(data14 !== null){const err42 = {instancePath:instancePath+"/resources/" + i2+"/description",schemaPath:"#/$defs/LessonResource/properties/description/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}var _valid6 = _errs58 === errors;valid16 = valid16 || _valid6;if(!valid16){const err43 = {instancePath:instancePath+"/resources/" + i2+"/description",schemaPath:"#/$defs/LessonResource/properties/description/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}else {errors = _errs55;if(vErrors !== null){if(_errs55){vErrors.length = _errs55;}else {vErrors = null;}}}}if(data12.duration !== undefined){let data15 = data12.duration;const _errs61 = errors;let valid17 = false;const _errs62 = errors;if(typeof data15 === "string"){if(func3(data15) > 40){const err44 = {instancePath:instancePath+"/resources/" + i2+"/duration",schemaPath:"#/$defs/LessonResource/properties/duration/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 40},message:"must NOT have more than 40 characters"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}else {const err45 = {instancePath:instancePath+"/resources/" + i2+"/duration",schemaPath:"#/$defs/LessonResource/properties/duration/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}var _valid7 = _errs62 === errors;valid17 = valid17 || _valid7;const _errs64 = errors;if(data15 !== null){const err46 = {instancePath:instancePath+"/resources/" + i2+"/duration",schemaPath:"#/$defs/LessonResource/properties/duration/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}var _valid7 = _errs64 === errors;valid17 = valid17 || _valid7;if(!valid17){const err47 = {instancePath:instancePath+"/resources/" + i2+"/duration",schemaPath:"#/$defs/LessonResource/properties/duration/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}else {errors = _errs61;if(vErrors !== null){if(_errs61){vErrors.length = _errs61;}else {vErrors = null;}}}}if(data12.free !== undefined){let data16 = data12.free;const _errs67 = errors;let valid18 = false;const _errs68 = errors;if(typeof data16 !== "boolean"){const err48 = {instancePath:instancePath+"/resources/" + i2+"/free",schemaPath:"#/$defs/LessonResource/properties/free/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}var _valid8 = _errs68 === errors;valid18 = valid18 || _valid8;const _errs70 = errors;if(data16 !== null){const err49 = {instancePath:instancePath+"/resources/" + i2+"/free",schemaPath:"#/$defs/LessonResource/properties/free/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}var _valid8 = _errs70 === errors;valid18 = valid18 || _valid8;if(!valid18){const err50 = {instancePath:instancePath+"/resources/" + i2+"/free",schemaPath:"#/$defs/LessonResource/properties/free/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}else {errors = _errs67;if(vErrors !== null){if(_errs67){vErrors.length = _errs67;}else {vErrors = null;}}}}if(data12.language !== undefined){let data17 = data12.language;const _errs73 = errors;let valid19 = false;const _errs74 = errors;if(typeof data17 === "string"){if(func3(data17) > 35){const err51 = {instancePath:instancePath+"/resources/" + i2+"/language",schemaPath:"#/$defs/LessonResource/properties/language/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 35},message:"must NOT have more than 35 characters"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}else {const err52 = {instancePath:instancePath+"/resources/" + i2+"/language",schemaPath:"#/$defs/LessonResource/properties/language/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}var _valid9 = _errs74 === errors;valid19 = valid19 || _valid9;const _errs76 = errors;if(data17 !== null){const err53 = {instancePath:instancePath+"/resources/" + i2+"/language",schemaPath:"#/$defs/LessonResource/properties/language/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}var _valid9 = _errs76 === errors;valid19 = valid19 || _valid9;if(!valid19){const err54 = {instancePath:instancePath+"/resources/" + i2+"/language",schemaPath:"#/$defs/LessonResource/properties/language/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}else {errors = _errs73;if(vErrors !== null){if(_errs73){vErrors.length = _errs73;}else {vErrors = null;}}}}if(data12.level !== undefined){let data18 = data12.level;const _errs79 = errors;let valid20 = false;const _errs80 = errors;if(typeof data18 === "string"){if(func3(data18) > 10){const err55 = {instancePath:instancePath+"/resources/" + i2+"/level",schemaPath:"#/$defs/LessonResource/properties/level/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 10},message:"must NOT have more than 10 characters"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}else {const err56 = {instancePath:instancePath+"/resources/" + i2+"/level",schemaPath:"#/$defs/LessonResource/properties/level/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}var _valid10 = _errs80 === errors;valid20 = valid20 || _valid10;const _errs82 = errors;if(data18 !== null){const err57 = {instancePath:instancePath+"/resources/" + i2+"/level",schemaPath:"#/$defs/LessonResource/properties/level/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}var _valid10 = _errs82 === errors;valid20 = valid20 || _valid10;if(!valid20){const err58 = {instancePath:instancePath+"/resources/" + i2+"/level",schemaPath:"#/$defs/LessonResource/properties/level/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}else {errors = _errs79;if(vErrors !== null){if(_errs79){vErrors.length = _errs79;}else {vErrors = null;}}}}if(data12.partnership !== undefined){let data19 = data12.partnership;const _errs85 = errors;let valid21 = false;const _errs86 = errors;if(typeof data19 !== "boolean"){const err59 = {instancePath:instancePath+"/resources/" + i2+"/partnership",schemaPath:"#/$defs/LessonResource/properties/partnership/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}var _valid11 = _errs86 === errors;valid21 = valid21 || _valid11;const _errs88 = errors;if(data19 !== null){const err60 = {instancePath:instancePath+"/resources/" + i2+"/partnership",schemaPath:"#/$defs/LessonResource/properties/partnership/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}var _valid11 = _errs88 === errors;valid21 = valid21 || _valid11;if(!valid21){const err61 = {instancePath:instancePath+"/resources/" + i2+"/partnership",schemaPath:"#/$defs/LessonResource/properties/partnership/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}else {errors = _errs85;if(vErrors !== null){if(_errs85){vErrors.length = _errs85;}else {vErrors = null;}}}}if(data12.tags !== undefined){let data20 = data12.tags;const _errs91 = errors;let valid22 = false;const _errs92 = errors;if(Array.isArray(data20)){if(data20.length > 20){const err62 = {instancePath:instancePath+"/resources/" + i2+"/tags",schemaPath:"#/$defs/LessonResource/properties/tags/anyOf/0/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}const len3 = data20.length;for(let i3=0; i3 300){const err67 = {instancePath:instancePath+"/resources/" + i2+"/title",schemaPath:"#/$defs/LessonResource/properties/title/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}if(func3(data22) < 1){const err68 = {instancePath:instancePath+"/resources/" + i2+"/title",schemaPath:"#/$defs/LessonResource/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}else {const err69 = {instancePath:instancePath+"/resources/" + i2+"/title",schemaPath:"#/$defs/LessonResource/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}if(data12.type !== undefined){let data23 = data12.type;if(typeof data23 === "string"){if(func3(data23) > 40){const err70 = {instancePath:instancePath+"/resources/" + i2+"/type",schemaPath:"#/$defs/LessonResource/properties/type/maxLength",keyword:"maxLength",params:{limit: 40},message:"must NOT have more than 40 characters"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}if(func3(data23) < 1){const err71 = {instancePath:instancePath+"/resources/" + i2+"/type",schemaPath:"#/$defs/LessonResource/properties/type/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}else {const err72 = {instancePath:instancePath+"/resources/" + i2+"/type",schemaPath:"#/$defs/LessonResource/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data12.url !== undefined){let data24 = data12.url;if(typeof data24 === "string"){if(func3(data24) > 2000){const err73 = {instancePath:instancePath+"/resources/" + i2+"/url",schemaPath:"#/$defs/LessonResource/properties/url/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}if(func3(data24) < 1){const err74 = {instancePath:instancePath+"/resources/" + i2+"/url",schemaPath:"#/$defs/LessonResource/properties/url/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+"/resources/" + i2+"/url",schemaPath:"#/$defs/LessonResource/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}}else {const err76 = {instancePath:instancePath+"/resources/" + i2,schemaPath:"#/$defs/LessonResource/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}}}else {const err77 = {instancePath:instancePath+"/resources",schemaPath:"#/properties/resources/anyOf/0/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}var _valid4 = _errs42 === errors;valid10 = valid10 || _valid4;const _errs104 = errors;if(data11 !== null){const err78 = {instancePath:instancePath+"/resources",schemaPath:"#/properties/resources/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}var _valid4 = _errs104 === errors;valid10 = valid10 || _valid4;if(!valid10){const err79 = {instancePath:instancePath+"/resources",schemaPath:"#/properties/resources/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}else {errors = _errs41;if(vErrors !== null){if(_errs41){vErrors.length = _errs41;}else {vErrors = null;}}}}if(data.source_language !== undefined){let data25 = data.source_language;const _errs107 = errors;let valid25 = false;const _errs108 = errors;if(typeof data25 !== "string"){const err80 = {instancePath:instancePath+"/source_language",schemaPath:"#/properties/source_language/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}var _valid13 = _errs108 === errors;valid25 = valid25 || _valid13;const _errs110 = errors;if(data25 !== null){const err81 = {instancePath:instancePath+"/source_language",schemaPath:"#/properties/source_language/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}var _valid13 = _errs110 === errors;valid25 = valid25 || _valid13;if(!valid25){const err82 = {instancePath:instancePath+"/source_language",schemaPath:"#/properties/source_language/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}else {errors = _errs107;if(vErrors !== null){if(_errs107){vErrors.length = _errs107;}else {vErrors = null;}}}}if(data.steps !== undefined){let data26 = data.steps;if(Array.isArray(data26)){if(data26.length < 1){const err83 = {instancePath:instancePath+"/steps",schemaPath:"#/properties/steps/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}const len4 = data26.length;for(let i4=0; i4 200){const err88 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}if(func3(data29) < 1){const err89 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}else {const err90 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}if(data.variation_note !== undefined){let data30 = data.variation_note;const _errs124 = errors;let valid29 = false;const _errs125 = errors;if(typeof data30 === "string"){if(func3(data30) > 500){const err91 = {instancePath:instancePath+"/variation_note",schemaPath:"#/properties/variation_note/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}else {const err92 = {instancePath:instancePath+"/variation_note",schemaPath:"#/properties/variation_note/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}var _valid15 = _errs125 === errors;valid29 = valid29 || _valid15;const _errs127 = errors;if(data30 !== null){const err93 = {instancePath:instancePath+"/variation_note",schemaPath:"#/properties/variation_note/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}var _valid15 = _errs127 === errors;valid29 = valid29 || _valid15;if(!valid29){const err94 = {instancePath:instancePath+"/variation_note",schemaPath:"#/properties/variation_note/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}else {errors = _errs124;if(vErrors !== null){if(_errs124){vErrors.length = _errs124;}else {vErrors = null;}}}}if(data.variation_of !== undefined){let data31 = data.variation_of;const _errs130 = errors;let valid30 = false;const _errs131 = errors;if(typeof data31 === "string"){if(func3(data31) > 120){const err95 = {instancePath:instancePath+"/variation_of",schemaPath:"#/properties/variation_of/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}else {const err96 = {instancePath:instancePath+"/variation_of",schemaPath:"#/properties/variation_of/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}var _valid16 = _errs131 === errors;valid30 = valid30 || _valid16;const _errs133 = errors;if(data31 !== null){const err97 = {instancePath:instancePath+"/variation_of",schemaPath:"#/properties/variation_of/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}var _valid16 = _errs133 === errors;valid30 = valid30 || _valid16;if(!valid30){const err98 = {instancePath:instancePath+"/variation_of",schemaPath:"#/properties/variation_of/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}else {errors = _errs130;if(vErrors !== null){if(_errs130){vErrors.length = _errs130;}else {vErrors = null;}}}}}else {const err99 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};export const validateManifestStructure: ValidateFunction = validate35 as unknown as ValidateFunction;const schema56 = {"$defs":{"ContentSet":{"additionalProperties":false,"properties":{"assets":{"default":[],"items":{"$ref":"#/$defs/ContentSetAsset"},"maxItems":500,"type":"array"},"book":{"anyOf":[{"$ref":"#/$defs/ContentSetBook"},{"type":"null"}],"default":null},"cover_image":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"description":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"domain":{"default":"language","maxLength":60,"minLength":1,"type":"string"},"domain_label":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}],"default":null},"id":{"maxLength":120,"minLength":1,"type":"string"},"lesson_count":{"maximum":10000,"minimum":0,"type":"integer"},"level":{"maxLength":20,"minLength":1,"type":"string"},"path":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"default":null},"source_language":{"default":"en","type":"string"},"tags":{"default":[],"items":{"type":"string"},"maxItems":20,"type":"array"},"target_language":{"type":"string"},"title":{"maxLength":200,"minLength":1,"type":"string"},"title_native":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null},"version":{"type":"string"},"visibility":{"default":"visible","enum":["visible","hidden"],"type":"string"},"attribution":{"anyOf":[{"type":"object","additionalProperties":false,"required":["author"],"properties":{"author":{"type":"string","minLength":1,"maxLength":120},"derived_from":{"type":"array","maxItems":8,"items":{"type":"object","additionalProperties":false,"required":["author"],"properties":{"author":{"type":"string","minLength":1,"maxLength":120}}}}}},{"type":"null"}],"default":null},"review_status":{"anyOf":[{"type":"string","enum":["authored","generated","reviewed"]},{"type":"null"}],"default":null},"evaluation":{"anyOf":[{"$ref":"#/$defs/ContentSetEvaluation"},{"type":"null"}],"default":null}},"required":["id","title","target_language","level","version","lesson_count"],"type":"object"},"ContentSetAsset":{"additionalProperties":false,"properties":{"path":{"maxLength":300,"minLength":1,"type":"string"},"size_kb":{"maximum":500,"minimum":1,"type":"integer"}},"required":["path","size_kb"],"type":"object"},"ContentSetBook":{"properties":{"asin":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null},"author":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"default":null},"title":{"maxLength":300,"minLength":1,"type":"string"},"url":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null}},"required":["title"],"type":"object"},"ContentSetEvaluation":{"additionalProperties":false,"properties":{"scheme":{"default":"percent","enum":["percent","pass_fail","grades"]},"pass_percent":{"maximum":100,"minimum":0,"type":"integer"},"basis":{"default":"elements","enum":["elements"]},"grades":{"items":{"$ref":"#/$defs/ContentSetGrade"},"minItems":2,"type":"array"},"report":{"default":"compact","enum":["compact","detailed"]},"title":{"minLength":1,"type":"string"}},"type":"object"},"ContentSetGrade":{"additionalProperties":false,"properties":{"min_percent":{"maximum":100,"minimum":0,"type":"integer"},"label":{"minLength":1,"type":"string"},"label_native":{"minLength":1,"type":"string"}},"required":["min_percent","label"],"type":"object"}},"$id":"https://astrapi69.github.io/learn-content-engine/schema/content-manifest.schema.json","$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"description":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"metadata":{"additionalProperties":true,"default":{},"type":"object"},"name":{"maxLength":200,"minLength":1,"type":"string"},"schema_version":{"default":"1.7","type":"string"},"sets":{"default":[],"items":{"$ref":"#/$defs/ContentSet"},"type":"array"}},"required":["name"],"type":"object","x-schema-version":"1.20"};const schema57 = {"additionalProperties":false,"properties":{"assets":{"default":[],"items":{"$ref":"#/$defs/ContentSetAsset"},"maxItems":500,"type":"array"},"book":{"anyOf":[{"$ref":"#/$defs/ContentSetBook"},{"type":"null"}],"default":null},"cover_image":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"description":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null},"domain":{"default":"language","maxLength":60,"minLength":1,"type":"string"},"domain_label":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}],"default":null},"id":{"maxLength":120,"minLength":1,"type":"string"},"lesson_count":{"maximum":10000,"minimum":0,"type":"integer"},"level":{"maxLength":20,"minLength":1,"type":"string"},"path":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"default":null},"source_language":{"default":"en","type":"string"},"tags":{"default":[],"items":{"type":"string"},"maxItems":20,"type":"array"},"target_language":{"type":"string"},"title":{"maxLength":200,"minLength":1,"type":"string"},"title_native":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null},"version":{"type":"string"},"visibility":{"default":"visible","enum":["visible","hidden"],"type":"string"},"attribution":{"anyOf":[{"type":"object","additionalProperties":false,"required":["author"],"properties":{"author":{"type":"string","minLength":1,"maxLength":120},"derived_from":{"type":"array","maxItems":8,"items":{"type":"object","additionalProperties":false,"required":["author"],"properties":{"author":{"type":"string","minLength":1,"maxLength":120}}}}}},{"type":"null"}],"default":null},"review_status":{"anyOf":[{"type":"string","enum":["authored","generated","reviewed"]},{"type":"null"}],"default":null},"evaluation":{"anyOf":[{"$ref":"#/$defs/ContentSetEvaluation"},{"type":"null"}],"default":null}},"required":["id","title","target_language","level","version","lesson_count"],"type":"object"};const schema58 = {"additionalProperties":false,"properties":{"path":{"maxLength":300,"minLength":1,"type":"string"},"size_kb":{"maximum":500,"minimum":1,"type":"integer"}},"required":["path","size_kb"],"type":"object"};const schema59 = {"properties":{"asin":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null},"author":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"default":null},"title":{"maxLength":300,"minLength":1,"type":"string"},"url":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null}},"required":["title"],"type":"object"};const schema60 = {"additionalProperties":false,"properties":{"scheme":{"default":"percent","enum":["percent","pass_fail","grades"]},"pass_percent":{"maximum":100,"minimum":0,"type":"integer"},"basis":{"default":"elements","enum":["elements"]},"grades":{"items":{"$ref":"#/$defs/ContentSetGrade"},"minItems":2,"type":"array"},"report":{"default":"compact","enum":["compact","detailed"]},"title":{"minLength":1,"type":"string"}},"type":"object"};const schema61 = {"additionalProperties":false,"properties":{"min_percent":{"maximum":100,"minimum":0,"type":"integer"},"label":{"minLength":1,"type":"string"},"label_native":{"minLength":1,"type":"string"}},"required":["min_percent","label"],"type":"object"};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(data && typeof data == "object" && !Array.isArray(data)){for(const key0 in data){if(!((((((key0 === "scheme") || (key0 === "pass_percent")) || (key0 === "basis")) || (key0 === "grades")) || (key0 === "report")) || (key0 === "title"))){const err0 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}if(data.scheme !== undefined){let data0 = data.scheme;if(!(((data0 === "percent") || (data0 === "pass_fail")) || (data0 === "grades"))){const err1 = {instancePath:instancePath+"/scheme",schemaPath:"#/properties/scheme/enum",keyword:"enum",params:{allowedValues: schema60.properties.scheme.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.pass_percent !== undefined){let data1 = data.pass_percent;if(!((typeof data1 == "number") && (!(data1 % 1) && !isNaN(data1)))){const err2 = {instancePath:instancePath+"/pass_percent",schemaPath:"#/properties/pass_percent/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(typeof data1 == "number"){if(data1 > 100 || isNaN(data1)){const err3 = {instancePath:instancePath+"/pass_percent",schemaPath:"#/properties/pass_percent/maximum",keyword:"maximum",params:{comparison: "<=", limit: 100},message:"must be <= 100"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data1 < 0 || isNaN(data1)){const err4 = {instancePath:instancePath+"/pass_percent",schemaPath:"#/properties/pass_percent/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}if(data.basis !== undefined){if(!(data.basis === "elements")){const err5 = {instancePath:instancePath+"/basis",schemaPath:"#/properties/basis/enum",keyword:"enum",params:{allowedValues: schema60.properties.basis.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.grades !== undefined){let data3 = data.grades;if(Array.isArray(data3)){if(data3.length < 2){const err6 = {instancePath:instancePath+"/grades",schemaPath:"#/properties/grades/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}const len0 = data3.length;for(let i0=0; i0 100 || isNaN(data5)){const err11 = {instancePath:instancePath+"/grades/" + i0+"/min_percent",schemaPath:"#/$defs/ContentSetGrade/properties/min_percent/maximum",keyword:"maximum",params:{comparison: "<=", limit: 100},message:"must be <= 100"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data5 < 0 || isNaN(data5)){const err12 = {instancePath:instancePath+"/grades/" + i0+"/min_percent",schemaPath:"#/$defs/ContentSetGrade/properties/min_percent/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}if(data4.label !== undefined){let data6 = data4.label;if(typeof data6 === "string"){if(func3(data6) < 1){const err13 = {instancePath:instancePath+"/grades/" + i0+"/label",schemaPath:"#/$defs/ContentSetGrade/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/grades/" + i0+"/label",schemaPath:"#/$defs/ContentSetGrade/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data4.label_native !== undefined){let data7 = data4.label_native;if(typeof data7 === "string"){if(func3(data7) < 1){const err15 = {instancePath:instancePath+"/grades/" + i0+"/label_native",schemaPath:"#/$defs/ContentSetGrade/properties/label_native/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}else {const err16 = {instancePath:instancePath+"/grades/" + i0+"/label_native",schemaPath:"#/$defs/ContentSetGrade/properties/label_native/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {instancePath:instancePath+"/grades/" + i0,schemaPath:"#/$defs/ContentSetGrade/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}else {const err18 = {instancePath:instancePath+"/grades",schemaPath:"#/properties/grades/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.report !== undefined){let data8 = data.report;if(!((data8 === "compact") || (data8 === "detailed"))){const err19 = {instancePath:instancePath+"/report",schemaPath:"#/properties/report/enum",keyword:"enum",params:{allowedValues: schema60.properties.report.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data.title !== undefined){let data9 = data.title;if(typeof data9 === "string"){if(func3(data9) < 1){const err20 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}else {const err21 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}}else {const err22 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}validate37.errors = vErrors;return errors === 0;}validate37.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate36(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){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.id === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.title === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.target_language === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "target_language"},message:"must have required property '"+"target_language"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.level === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "level"},message:"must have required property '"+"level"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.version === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.lesson_count === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lesson_count"},message:"must have required property '"+"lesson_count"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!(func1.call(schema57.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.assets !== undefined){let data0 = data.assets;if(Array.isArray(data0)){if(data0.length > 500){const err7 = {instancePath:instancePath+"/assets",schemaPath:"#/properties/assets/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}const len0 = data0.length;for(let i0=0; i0 300){const err11 = {instancePath:instancePath+"/assets/" + i0+"/path",schemaPath:"#/$defs/ContentSetAsset/properties/path/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(func3(data2) < 1){const err12 = {instancePath:instancePath+"/assets/" + i0+"/path",schemaPath:"#/$defs/ContentSetAsset/properties/path/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+"/assets/" + i0+"/path",schemaPath:"#/$defs/ContentSetAsset/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data1.size_kb !== undefined){let data3 = data1.size_kb;if(!((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3)))){const err14 = {instancePath:instancePath+"/assets/" + i0+"/size_kb",schemaPath:"#/$defs/ContentSetAsset/properties/size_kb/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(typeof data3 == "number"){if(data3 > 500 || isNaN(data3)){const err15 = {instancePath:instancePath+"/assets/" + i0+"/size_kb",schemaPath:"#/$defs/ContentSetAsset/properties/size_kb/maximum",keyword:"maximum",params:{comparison: "<=", limit: 500},message:"must be <= 500"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(data3 < 1 || isNaN(data3)){const err16 = {instancePath:instancePath+"/assets/" + i0+"/size_kb",schemaPath:"#/$defs/ContentSetAsset/properties/size_kb/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}}else {const err17 = {instancePath:instancePath+"/assets/" + i0,schemaPath:"#/$defs/ContentSetAsset/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}else {const err18 = {instancePath:instancePath+"/assets",schemaPath:"#/properties/assets/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.book !== undefined){let data4 = data.book;const _errs13 = errors;let valid5 = false;const _errs14 = errors;if(data4 && typeof data4 == "object" && !Array.isArray(data4)){if(data4.title === undefined){const err19 = {instancePath:instancePath+"/book",schemaPath:"#/$defs/ContentSetBook/required",keyword:"required",params:{missingProperty: "title"},message:"must have required property '"+"title"+"'"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(data4.asin !== undefined){let data5 = data4.asin;const _errs18 = errors;let valid8 = false;const _errs19 = errors;if(typeof data5 === "string"){if(func3(data5) > 20){const err20 = {instancePath:instancePath+"/book/asin",schemaPath:"#/$defs/ContentSetBook/properties/asin/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 20},message:"must NOT have more than 20 characters"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}else {const err21 = {instancePath:instancePath+"/book/asin",schemaPath:"#/$defs/ContentSetBook/properties/asin/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}var _valid1 = _errs19 === errors;valid8 = valid8 || _valid1;const _errs21 = errors;if(data5 !== null){const err22 = {instancePath:instancePath+"/book/asin",schemaPath:"#/$defs/ContentSetBook/properties/asin/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}var _valid1 = _errs21 === errors;valid8 = valid8 || _valid1;if(!valid8){const err23 = {instancePath:instancePath+"/book/asin",schemaPath:"#/$defs/ContentSetBook/properties/asin/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}}if(data4.author !== undefined){let data6 = data4.author;const _errs24 = errors;let valid9 = false;const _errs25 = errors;if(typeof data6 === "string"){if(func3(data6) > 300){const err24 = {instancePath:instancePath+"/book/author",schemaPath:"#/$defs/ContentSetBook/properties/author/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}else {const err25 = {instancePath:instancePath+"/book/author",schemaPath:"#/$defs/ContentSetBook/properties/author/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}var _valid2 = _errs25 === errors;valid9 = valid9 || _valid2;const _errs27 = errors;if(data6 !== null){const err26 = {instancePath:instancePath+"/book/author",schemaPath:"#/$defs/ContentSetBook/properties/author/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}var _valid2 = _errs27 === errors;valid9 = valid9 || _valid2;if(!valid9){const err27 = {instancePath:instancePath+"/book/author",schemaPath:"#/$defs/ContentSetBook/properties/author/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}else {errors = _errs24;if(vErrors !== null){if(_errs24){vErrors.length = _errs24;}else {vErrors = null;}}}}if(data4.title !== undefined){let data7 = data4.title;if(typeof data7 === "string"){if(func3(data7) > 300){const err28 = {instancePath:instancePath+"/book/title",schemaPath:"#/$defs/ContentSetBook/properties/title/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}if(func3(data7) < 1){const err29 = {instancePath:instancePath+"/book/title",schemaPath:"#/$defs/ContentSetBook/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}else {const err30 = {instancePath:instancePath+"/book/title",schemaPath:"#/$defs/ContentSetBook/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data4.url !== undefined){let data8 = data4.url;const _errs32 = errors;let valid10 = false;const _errs33 = errors;if(typeof data8 === "string"){if(func3(data8) > 2000){const err31 = {instancePath:instancePath+"/book/url",schemaPath:"#/$defs/ContentSetBook/properties/url/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}else {const err32 = {instancePath:instancePath+"/book/url",schemaPath:"#/$defs/ContentSetBook/properties/url/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}var _valid3 = _errs33 === errors;valid10 = valid10 || _valid3;const _errs35 = errors;if(data8 !== null){const err33 = {instancePath:instancePath+"/book/url",schemaPath:"#/$defs/ContentSetBook/properties/url/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}var _valid3 = _errs35 === errors;valid10 = valid10 || _valid3;if(!valid10){const err34 = {instancePath:instancePath+"/book/url",schemaPath:"#/$defs/ContentSetBook/properties/url/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}else {errors = _errs32;if(vErrors !== null){if(_errs32){vErrors.length = _errs32;}else {vErrors = null;}}}}}else {const err35 = {instancePath:instancePath+"/book",schemaPath:"#/$defs/ContentSetBook/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}var _valid0 = _errs14 === errors;valid5 = valid5 || _valid0;if(_valid0){var props0 = {};props0.asin = true;props0.author = true;props0.title = true;props0.url = true;}const _errs37 = errors;if(data4 !== null){const err36 = {instancePath:instancePath+"/book",schemaPath:"#/properties/book/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}var _valid0 = _errs37 === errors;valid5 = valid5 || _valid0;if(!valid5){const err37 = {instancePath:instancePath+"/book",schemaPath:"#/properties/book/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}else {errors = _errs13;if(vErrors !== null){if(_errs13){vErrors.length = _errs13;}else {vErrors = null;}}}}if(data.cover_image !== undefined){let data9 = data.cover_image;const _errs40 = errors;let valid11 = false;const _errs41 = errors;if(typeof data9 !== "string"){const err38 = {instancePath:instancePath+"/cover_image",schemaPath:"#/properties/cover_image/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}var _valid4 = _errs41 === errors;valid11 = valid11 || _valid4;const _errs43 = errors;if(data9 !== null){const err39 = {instancePath:instancePath+"/cover_image",schemaPath:"#/properties/cover_image/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}var _valid4 = _errs43 === errors;valid11 = valid11 || _valid4;if(!valid11){const err40 = {instancePath:instancePath+"/cover_image",schemaPath:"#/properties/cover_image/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}else {errors = _errs40;if(vErrors !== null){if(_errs40){vErrors.length = _errs40;}else {vErrors = null;}}}}if(data.description !== undefined){let data10 = data.description;const _errs46 = errors;let valid12 = false;const _errs47 = errors;if(typeof data10 === "string"){if(func3(data10) > 2000){const err41 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}else {const err42 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}var _valid5 = _errs47 === errors;valid12 = valid12 || _valid5;const _errs49 = errors;if(data10 !== null){const err43 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}var _valid5 = _errs49 === errors;valid12 = valid12 || _valid5;if(!valid12){const err44 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}else {errors = _errs46;if(vErrors !== null){if(_errs46){vErrors.length = _errs46;}else {vErrors = null;}}}}if(data.domain !== undefined){let data11 = data.domain;if(typeof data11 === "string"){if(func3(data11) > 60){const err45 = {instancePath:instancePath+"/domain",schemaPath:"#/properties/domain/maxLength",keyword:"maxLength",params:{limit: 60},message:"must NOT have more than 60 characters"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(func3(data11) < 1){const err46 = {instancePath:instancePath+"/domain",schemaPath:"#/properties/domain/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}else {const err47 = {instancePath:instancePath+"/domain",schemaPath:"#/properties/domain/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data.domain_label !== undefined){let data12 = data.domain_label;const _errs54 = errors;let valid13 = false;const _errs55 = errors;if(typeof data12 === "string"){if(func3(data12) > 120){const err48 = {instancePath:instancePath+"/domain_label",schemaPath:"#/properties/domain_label/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}else {const err49 = {instancePath:instancePath+"/domain_label",schemaPath:"#/properties/domain_label/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}var _valid6 = _errs55 === errors;valid13 = valid13 || _valid6;const _errs57 = errors;if(data12 !== null){const err50 = {instancePath:instancePath+"/domain_label",schemaPath:"#/properties/domain_label/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}var _valid6 = _errs57 === errors;valid13 = valid13 || _valid6;if(!valid13){const err51 = {instancePath:instancePath+"/domain_label",schemaPath:"#/properties/domain_label/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}else {errors = _errs54;if(vErrors !== null){if(_errs54){vErrors.length = _errs54;}else {vErrors = null;}}}}if(data.id !== undefined){let data13 = data.id;if(typeof data13 === "string"){if(func3(data13) > 120){const err52 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(func3(data13) < 1){const err53 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/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+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data.lesson_count !== undefined){let data14 = data.lesson_count;if(!((typeof data14 == "number") && (!(data14 % 1) && !isNaN(data14)))){const err55 = {instancePath:instancePath+"/lesson_count",schemaPath:"#/properties/lesson_count/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}if(typeof data14 == "number"){if(data14 > 10000 || isNaN(data14)){const err56 = {instancePath:instancePath+"/lesson_count",schemaPath:"#/properties/lesson_count/maximum",keyword:"maximum",params:{comparison: "<=", limit: 10000},message:"must be <= 10000"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}if(data14 < 0 || isNaN(data14)){const err57 = {instancePath:instancePath+"/lesson_count",schemaPath:"#/properties/lesson_count/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}}if(data.level !== undefined){let data15 = data.level;if(typeof data15 === "string"){if(func3(data15) > 20){const err58 = {instancePath:instancePath+"/level",schemaPath:"#/properties/level/maxLength",keyword:"maxLength",params:{limit: 20},message:"must NOT have more than 20 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(func3(data15) < 1){const err59 = {instancePath:instancePath+"/level",schemaPath:"#/properties/level/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+"/level",schemaPath:"#/properties/level/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}if(data.path !== undefined){let data16 = data.path;const _errs66 = errors;let valid14 = false;const _errs67 = errors;if(typeof data16 === "string"){if(func3(data16) > 300){const err61 = {instancePath:instancePath+"/path",schemaPath:"#/properties/path/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}else {const err62 = {instancePath:instancePath+"/path",schemaPath:"#/properties/path/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}var _valid7 = _errs67 === errors;valid14 = valid14 || _valid7;const _errs69 = errors;if(data16 !== null){const err63 = {instancePath:instancePath+"/path",schemaPath:"#/properties/path/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}var _valid7 = _errs69 === errors;valid14 = valid14 || _valid7;if(!valid14){const err64 = {instancePath:instancePath+"/path",schemaPath:"#/properties/path/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}else {errors = _errs66;if(vErrors !== null){if(_errs66){vErrors.length = _errs66;}else {vErrors = null;}}}}if(data.source_language !== undefined){if(typeof data.source_language !== "string"){const err65 = {instancePath:instancePath+"/source_language",schemaPath:"#/properties/source_language/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data.tags !== undefined){let data18 = data.tags;if(Array.isArray(data18)){if(data18.length > 20){const err66 = {instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}const len1 = data18.length;for(let i1=0; i1 200){const err70 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}if(func3(data21) < 1){const err71 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}else {const err72 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data.title_native !== undefined){let data22 = data.title_native;const _errs82 = errors;let valid17 = false;const _errs83 = errors;if(typeof data22 === "string"){if(func3(data22) > 200){const err73 = {instancePath:instancePath+"/title_native",schemaPath:"#/properties/title_native/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}else {const err74 = {instancePath:instancePath+"/title_native",schemaPath:"#/properties/title_native/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}var _valid8 = _errs83 === errors;valid17 = valid17 || _valid8;const _errs85 = errors;if(data22 !== null){const err75 = {instancePath:instancePath+"/title_native",schemaPath:"#/properties/title_native/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}var _valid8 = _errs85 === errors;valid17 = valid17 || _valid8;if(!valid17){const err76 = {instancePath:instancePath+"/title_native",schemaPath:"#/properties/title_native/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}else {errors = _errs82;if(vErrors !== null){if(_errs82){vErrors.length = _errs82;}else {vErrors = null;}}}}if(data.version !== undefined){if(typeof data.version !== "string"){const err77 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}}if(data.visibility !== undefined){let data24 = data.visibility;if(typeof data24 !== "string"){const err78 = {instancePath:instancePath+"/visibility",schemaPath:"#/properties/visibility/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}if(!((data24 === "visible") || (data24 === "hidden"))){const err79 = {instancePath:instancePath+"/visibility",schemaPath:"#/properties/visibility/enum",keyword:"enum",params:{allowedValues: schema57.properties.visibility.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}}if(data.attribution !== undefined){let data25 = data.attribution;const _errs92 = errors;let valid18 = false;const _errs93 = errors;if(data25 && typeof data25 == "object" && !Array.isArray(data25)){if(data25.author === undefined){const err80 = {instancePath:instancePath+"/attribution",schemaPath:"#/properties/attribution/anyOf/0/required",keyword:"required",params:{missingProperty: "author"},message:"must have required property '"+"author"+"'"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}for(const key2 in data25){if(!((key2 === "author") || (key2 === "derived_from"))){const err81 = {instancePath:instancePath+"/attribution",schemaPath:"#/properties/attribution/anyOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}if(data25.author !== undefined){let data26 = data25.author;if(typeof data26 === "string"){if(func3(data26) > 120){const err82 = {instancePath:instancePath+"/attribution/author",schemaPath:"#/properties/attribution/anyOf/0/properties/author/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}if(func3(data26) < 1){const err83 = {instancePath:instancePath+"/attribution/author",schemaPath:"#/properties/attribution/anyOf/0/properties/author/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}else {const err84 = {instancePath:instancePath+"/attribution/author",schemaPath:"#/properties/attribution/anyOf/0/properties/author/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}}if(data25.derived_from !== undefined){let data27 = data25.derived_from;if(Array.isArray(data27)){if(data27.length > 8){const err85 = {instancePath:instancePath+"/attribution/derived_from",schemaPath:"#/properties/attribution/anyOf/0/properties/derived_from/maxItems",keyword:"maxItems",params:{limit: 8},message:"must NOT have more than 8 items"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}const len2 = data27.length;for(let i2=0; i2 120){const err88 = {instancePath:instancePath+"/attribution/derived_from/" + i2+"/author",schemaPath:"#/properties/attribution/anyOf/0/properties/derived_from/items/properties/author/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}if(func3(data29) < 1){const err89 = {instancePath:instancePath+"/attribution/derived_from/" + i2+"/author",schemaPath:"#/properties/attribution/anyOf/0/properties/derived_from/items/properties/author/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}else {const err90 = {instancePath:instancePath+"/attribution/derived_from/" + i2+"/author",schemaPath:"#/properties/attribution/anyOf/0/properties/derived_from/items/properties/author/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}}}else {const err91 = {instancePath:instancePath+"/attribution/derived_from/" + i2,schemaPath:"#/properties/attribution/anyOf/0/properties/derived_from/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}}}else {const err92 = {instancePath:instancePath+"/attribution/derived_from",schemaPath:"#/properties/attribution/anyOf/0/properties/derived_from/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}}else {const err93 = {instancePath:instancePath+"/attribution",schemaPath:"#/properties/attribution/anyOf/0/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}var _valid9 = _errs93 === errors;valid18 = valid18 || _valid9;const _errs105 = errors;if(data25 !== null){const err94 = {instancePath:instancePath+"/attribution",schemaPath:"#/properties/attribution/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}var _valid9 = _errs105 === errors;valid18 = valid18 || _valid9;if(!valid18){const err95 = {instancePath:instancePath+"/attribution",schemaPath:"#/properties/attribution/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}else {errors = _errs92;if(vErrors !== null){if(_errs92){vErrors.length = _errs92;}else {vErrors = null;}}}}if(data.review_status !== undefined){let data30 = data.review_status;const _errs108 = errors;let valid23 = false;const _errs109 = errors;if(typeof data30 !== "string"){const err96 = {instancePath:instancePath+"/review_status",schemaPath:"#/properties/review_status/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}if(!(((data30 === "authored") || (data30 === "generated")) || (data30 === "reviewed"))){const err97 = {instancePath:instancePath+"/review_status",schemaPath:"#/properties/review_status/anyOf/0/enum",keyword:"enum",params:{allowedValues: schema57.properties.review_status.anyOf[0].enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}var _valid10 = _errs109 === errors;valid23 = valid23 || _valid10;const _errs111 = errors;if(data30 !== null){const err98 = {instancePath:instancePath+"/review_status",schemaPath:"#/properties/review_status/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}var _valid10 = _errs111 === errors;valid23 = valid23 || _valid10;if(!valid23){const err99 = {instancePath:instancePath+"/review_status",schemaPath:"#/properties/review_status/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}else {errors = _errs108;if(vErrors !== null){if(_errs108){vErrors.length = _errs108;}else {vErrors = null;}}}}if(data.evaluation !== undefined){let data31 = data.evaluation;const _errs114 = errors;let valid24 = false;const _errs115 = errors;if(!(validate37(data31, {instancePath:instancePath+"/evaluation",parentData:data,parentDataProperty:"evaluation",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate37.errors : vErrors.concat(validate37.errors);errors = vErrors.length;}var _valid11 = _errs115 === errors;valid24 = valid24 || _valid11;const _errs116 = errors;if(data31 !== null){const err100 = {instancePath:instancePath+"/evaluation",schemaPath:"#/properties/evaluation/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}var _valid11 = _errs116 === errors;valid24 = valid24 || _valid11;if(!valid24){const err101 = {instancePath:instancePath+"/evaluation",schemaPath:"#/properties/evaluation/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}else {errors = _errs114;if(vErrors !== null){if(_errs114){vErrors.length = _errs114;}else {vErrors = null;}}}}}else {const err102 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}validate36.errors = vErrors;return errors === 0;}validate36.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate35(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://astrapi69.github.io/learn-content-engine/schema/content-manifest.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate35.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.name === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "description") || (key0 === "metadata")) || (key0 === "name")) || (key0 === "schema_version")) || (key0 === "sets"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.description !== undefined){let data0 = data.description;const _errs3 = errors;let valid1 = false;const _errs4 = errors;if(typeof data0 === "string"){if(func3(data0) > 2000){const err2 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}var _valid0 = _errs4 === errors;valid1 = valid1 || _valid0;const _errs6 = errors;if(data0 !== null){const err4 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid0 = _errs6 === errors;valid1 = valid1 || _valid0;if(!valid1){const err5 = {instancePath:instancePath+"/description",schemaPath:"#/properties/description/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}}if(data.metadata !== undefined){let data1 = data.metadata;if(data1 && typeof data1 == "object" && !Array.isArray(data1)){}else {const err6 = {instancePath:instancePath+"/metadata",schemaPath:"#/properties/metadata/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.name !== undefined){let data2 = data.name;if(typeof data2 === "string"){if(func3(data2) > 200){const err7 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func3(data2) < 1){const err8 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/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+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.schema_version !== undefined){if(typeof data.schema_version !== "string"){const err10 = {instancePath:instancePath+"/schema_version",schemaPath:"#/properties/schema_version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.sets !== undefined){let data4 = data.sets;if(Array.isArray(data4)){const len0 = data4.length;for(let i0=0; i0 => JSON.parse(readFileSync(LEDGER_PATH, "utf-8")) as Record; + +const current = { + lesson: readFileSync("schema/lesson.schema.json", "utf-8"), + manifest: readFileSync("schema/content-manifest.schema.json", "utf-8"), +}; + +const withVersion = (text: string, version: string): string => + text.replace(/"x-schema-version": "[^"]*"/, `"x-schema-version": "${version}"`); + +const nextVersion = (version: string): string => { + const [major = 0, minor = 0] = version.split(".").map(Number); + return `${major}.${minor + 1}`; +}; + +const currentVersion = (JSON.parse(current.lesson) as { "x-schema-version": string })["x-schema-version"]; + +/** The negative probes run against a ledger that is consistent by + * construction, so they prove the gate can fail whatever the repository's + * own state is. Only the first test reads the committed ledger. */ +const consistentLedger = (): Record => ({ [currentVersion]: schemaSetDigest(current) }); + +describe("schema version ledger (engine#279)", () => { + it("the current version's ledger row holds exactly the current content", () => { + expect(ledgerFindings(readLedger(), current)).toEqual([]); + }); + + it("a content change under the same version fails", () => { + const edited = { ...current, lesson: current.lesson.replace("The smallest learnable unit", "The smallest unit") }; + expect(edited.lesson).not.toBe(current.lesson); + expect(ledgerFindings(consistentLedger(), edited)).toEqual([ + `the schema content changed but x-schema-version is still ${currentVersion}: bump it in both files and add a ledger row`, + ]); + }); + + it("a version that rises without a content change fails, even with a ledger row for it", () => { + const bumped = nextVersion(currentVersion); + const raised = { lesson: withVersion(current.lesson, bumped), manifest: withVersion(current.manifest, bumped) }; + const ledger = { ...consistentLedger(), [bumped]: schemaSetDigest(raised) }; + expect(ledgerFindings(ledger, raised)).toContain( + `x-schema-version rose to ${bumped}, but the content equals ${currentVersion}: a version moves only with a change`, + ); + }); + + it("a version that rises without a content change fails when its row is missing too", () => { + const bumped = nextVersion(currentVersion); + const raised = { lesson: withVersion(current.lesson, bumped), manifest: withVersion(current.manifest, bumped) }; + expect(ledgerFindings(consistentLedger(), raised)).toEqual([ + `x-schema-version rose to ${bumped}, but the content equals ${currentVersion}: a version moves only with a change`, + ]); + }); + + it("a real change with a bump but no ledger row fails and names the row to add", () => { + const bumped = nextVersion(currentVersion); + const changed = { + lesson: withVersion(current.lesson.replace("The smallest learnable unit", "The smallest unit"), bumped), + manifest: withVersion(current.manifest, bumped), + }; + expect(ledgerFindings(consistentLedger(), changed)).toEqual([ + `x-schema-version ${bumped} has no ledger row; add "${bumped}": "${schemaSetDigest(changed)}"`, + ]); + }); + + it("files out of lockstep fail", () => { + const split = { ...current, manifest: withVersion(current.manifest, nextVersion(currentVersion)) }; + expect(ledgerFindings(consistentLedger(), split)).toContain( + `the schema files are out of lockstep: lesson.schema.json is ${currentVersion}, content-manifest.schema.json is ${nextVersion(currentVersion)}`, + ); + }); + + it("two ledger rows with one digest fail", () => { + const ledger = consistentLedger(); + const duplicate = { ...ledger, "0.0": schemaSetDigest(current) }; + expect(ledgerFindings(duplicate, current)).toContain(`ledger rows ${currentVersion} and 0.0 hold the same content`); + }); + + it("the digest ignores $id and x-schema-version and nothing else", () => { + const moved = { + lesson: current.lesson.replace(/"\$id": "[^"]*"/, '"$id": "https://example.invalid/lesson.schema.json"'), + manifest: withVersion(current.manifest, "9.9"), + }; + expect(schemaSetDigest(moved)).toBe(schemaSetDigest(current)); + expect(schemaSetDigest({ ...current, lesson: current.lesson.replace("Card", "Kard") })).not.toBe( + schemaSetDigest(current), + ); + }); +}); diff --git a/src/schemas.generated.ts b/src/schemas.generated.ts index 39faaa4..ededaee 100644 --- a/src/schemas.generated.ts +++ b/src/schemas.generated.ts @@ -1131,7 +1131,7 @@ export const LESSON_SCHEMA: object = { "steps" ], "type": "object", - "x-schema-version": "1.19" + "x-schema-version": "1.20" }; /** schema/content-manifest.schema.json, without its annotations */ @@ -1526,5 +1526,5 @@ export const CONTENT_MANIFEST_SCHEMA: object = { "name" ], "type": "object", - "x-schema-version": "1.19" + "x-schema-version": "1.20" }; From acc30f0937f74df04e2661e54777c65608814598 Mon Sep 17 00:00:00 2001 From: Asterios Raptis Date: Thu, 22 Oct 2026 13:34:06 +0200 Subject: [PATCH 2/3] docs: name no schema or package version where none is needed; record v1.20 and the ledger (#279) README, concepts, architecture, comparative-analysis and the three blog posts in both languages no longer state the current schema or package version; the schema file does. A Mermaid node in comparative-analysis still said "schema 1.15" four versions on, out of the version-claims gate's reach. The manifest schema_version default in lesson-format.md stays: authors need it and it keeps that gate from scanning blind. lesson-format.md records v1.20 and 0.42.1's slip in the counter history; CONTRIBUTING names the ledger row in the schema-change steps. Co-Authored-By: Claude Opus 5.5 (1M context) --- CONTRIBUTING.md | 5 +++++ README.md | 2 +- docs/architecture.md | 2 +- docs/blog/de/did-we-reinvent-the-wheel.md | 2 +- docs/blog/de/one-source-many-outputs.md | 2 +- docs/blog/de/schema-first-content-engineering.md | 4 ++-- docs/blog/did-we-reinvent-the-wheel.md | 2 +- docs/blog/one-source-many-outputs.md | 2 +- docs/blog/schema-first-content-engineering.md | 4 ++-- docs/comparative-analysis.md | 12 ++++++------ docs/concepts.md | 2 +- docs/lesson-format.md | 7 ++++++- 12 files changed, 28 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6226c5a..f1ff999 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -140,6 +140,11 @@ a **new `ExerciseType` now starts here**: run `make sync-types` to regenerate `src/types/lesson-schema.generated.ts`. The [byte baseline](src/schema-baseline.test.ts) intentionally goes red on a schema change - update it in the same commit so the change is deliberate. + Every schema change, description-only included, bumps `x-schema-version` + in both schema files (they move in lockstep) and adds a row to the + [version ledger](src/__fixtures__/schema-baseline/schema-version-ledger.json); + the [ledger test](src/schema-version-ledger.test.ts) names the digest to add + and fails on a change without a bump and on a bump without a change (engine#279). 2. Mirror the new type's cross-field rule in `src/rules.ts` (RED first: add a rejecting negative test, then implement) with `E-*`/`W-*` rule ids + catalog rows. A message that names a value (a term, an id, a count) also passes it as diff --git a/README.md b/README.md index e508c5b..dd77980 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Beyond validity it checks a lesson against the shared quality minimums instance (`resolveExerciseVariables`) and maps a lesson run's percent to the verdict of its set's `evaluation` block (`gradeFor`), so every consumer gets the same answer. -Tracks the lesson schema, currently **v1.19**. +Ships the lesson schema it validates against (`schema/lesson.schema.json`; its version is `x-schema-version` there). ## Install diff --git a/docs/architecture.md b/docs/architecture.md index 2f72778..221f86e 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -142,7 +142,7 @@ Three classes, and they are not equally urgent: (see [schema-version policy](concepts.md#schema-version-policy-additive)), so content authored against an older version stays valid under a newer one: a manifest that declares `schema_version: "1.2"` keeps validating although the - manifest schema_version field currently defaults to 1.7. A repo that does not + field's default has moved on since. A repo that does not want the new field does not need the release. - **New error rules.** These move the pin, because content that was valid before can be invalid after. Rare under the additive policy, but not diff --git a/docs/blog/de/did-we-reinvent-the-wheel.md b/docs/blog/de/did-we-reinvent-the-wheel.md index 4c8b459..4eb8c51 100644 --- a/docs/blog/de/did-we-reinvent-the-wheel.md +++ b/docs/blog/de/did-we-reinvent-the-wheel.md @@ -9,7 +9,7 @@ tags: [benchmark, architecture, interoperability, documentation] *Eine fremde KI hat unsere Content-Engine gegen QTI, H5P, Moodle, Canvas und Duolingo gebenchmarkt und Lücken gefunden, die längst geschlossen waren. Die Korrektur war kein Code. Dann kam die ehrliche Frage, die ehrliche Antwort, und ein Fehler, den nur die Content-Repositories fangen konnten.* -`learn-content-engine` · Schema aktuell v1.19 · framework-agnostisches TypeScript +`learn-content-engine` · framework-agnostisches TypeScript ## Ein Benchmark von außen diff --git a/docs/blog/de/one-source-many-outputs.md b/docs/blog/de/one-source-many-outputs.md index 8d5b6ad..d11180f 100644 --- a/docs/blog/de/one-source-many-outputs.md +++ b/docs/blog/de/one-source-many-outputs.md @@ -43,7 +43,7 @@ Drei Dinge bleiben in dem, was Sie schreiben, bewusst getrennt: der **Inhalt** ( Sie müssen dieses JSON nicht von Hand schreiben. Die Referenz-App liefert einen **Lektions-Editor** mit, der dem Wort "einfach" entwachsen ist: der klassische vierstufige Assistent (Metadaten, Karten, Übungen, Speichern & Teilen), ein Buch-Pfad, der eingefügte oder hochgeladene Lehrbuchkapitel in Wissens-Lektionen verwandelt, ein Erweiterungs-Zweig, der selbst benotete Quizze und Diktate ohne JSON autorierbar macht, und ein Bearbeitungsmodus. All das erzeugt Lektionen in demselben kanonischen Schema und kann sogar direkt aus der App einen Pull Request gegen ein Content-Repository öffnen; [Teil 3 der Serie](create-a-lesson-in-the-app.md) geht jeden Pfad durch. Was darüber hinaus **geplant** ist, ist ein reicherer, auf Lehrende zugeschnittener Editor für die schwereren Fälle (größere Sets). Beides ändert das Modell nicht: Die Quelle bleibt der Vertrag, und jeder Editor (einfach oder reich) ist nur ein weiteres Werkzeug, das ihn liest und schreibt. -> **Additiv als Prinzip.** Das Schema ist versioniert (aktuell 1.19) und wächst nur additiv: Neue Felder sind optional, eine letztes Jahr geschriebene Lektion validiert also heute noch. Sie werden nie gezwungen, Inhalte zu migrieren, nur weil sich das Schema bewegt hat. +> **Additiv als Prinzip.** Das Schema ist versioniert (`x-schema-version`) und wächst nur additiv: Neue Felder sind optional, eine letztes Jahr geschriebene Lektion validiert also heute noch. Sie werden nie gezwungen, Inhalte zu migrieren, nur weil sich das Schema bewegt hat. ## Validierung ist Rechtschreibprüfung für Test-Logik diff --git a/docs/blog/de/schema-first-content-engineering.md b/docs/blog/de/schema-first-content-engineering.md index d6f86ab..0183d02 100644 --- a/docs/blog/de/schema-first-content-engineering.md +++ b/docs/blog/de/schema-first-content-engineering.md @@ -9,11 +9,11 @@ tags: [architecture, schema-design, typescript, content-engineering] *Wie `learn-content-engine` ein stabiles Kern-Schema behält und trotzdem Raum für pädagogische Erfindung lässt: durch eine harte Linie zwischen dem Vertrag, den es besitzt, und den Regeln, die seine Consumer besitzen.* -`learn-content-engine` · Schema aktuell v1.19 · framework-agnostisches TypeScript +`learn-content-engine` · framework-agnostisches TypeScript ## Das Content-Schema-Dilemma -`learn-content-engine` ist eine framework-agnostische TypeScript-Bibliothek, die Lerninhalte parst und validiert: Sprachkurse zuallererst, wobei ein `domain`-Feld (seit Engine 0.20.0 ein kontrolliertes Vokabular aus bekannten Werten plus other) dieselbe Form auch andere Wissensgebiete tragen lässt (Technik-Kurse, Führerschein-Vorbereitung, Psychologie). Sie verwandelt Rohquellen (Lektions-JSON plus eine `manifest.yaml`) in eine kanonische interne Form, und sie ist die einzige Quelle der Wahrheit für das Lektions-Schema, aktuell Version 1.19. +`learn-content-engine` ist eine framework-agnostische TypeScript-Bibliothek, die Lerninhalte parst und validiert: Sprachkurse zuallererst, wobei ein `domain`-Feld (seit Engine 0.20.0 ein kontrolliertes Vokabular aus bekannten Werten plus other) dieselbe Form auch andere Wissensgebiete tragen lässt (Technik-Kurse, Führerschein-Vorbereitung, Psychologie). Sie verwandelt Rohquellen (Lektions-JSON plus eine `manifest.yaml`) in eine kanonische interne Form, und sie ist die einzige Quelle der Wahrheit für das Lektions-Schema. Der Kern ist bewusst klein. Kein Rendering, keine Persistenz, kein Netzwerk; die Laufzeit-Abhängigkeiten sind ein YAML-Parser und ein JSON-Schema-Validator, und der XML-Parser des QTI-Adapters sitzt hinter einem eigenen Subpath, sodass er den Kern-Import nie berührt. Seit 0.29.0 haben auch die Semantikregeln einen eigenen Subpath, ohne den JSON-Schema-Validator, sodass eine Browser-App sie ausführen kann, ohne ihn mitzutragen. Was er bietet, ist reine Validierung und Transformation. Dieser Minimalismus ist der Punkt, und er erzwingt eine harte Frage: *Wie entwickelt man ein Content-Schema weiter, ohne jeden Consumer zu brechen, der davon abhängt?* diff --git a/docs/blog/did-we-reinvent-the-wheel.md b/docs/blog/did-we-reinvent-the-wheel.md index bdf878d..d56d604 100644 --- a/docs/blog/did-we-reinvent-the-wheel.md +++ b/docs/blog/did-we-reinvent-the-wheel.md @@ -9,7 +9,7 @@ tags: [benchmark, architecture, interoperability, documentation] *An outside AI benchmarked our content engine against QTI, H5P, Moodle, Canvas and Duolingo and found gaps we had already closed. The fix was not code. Then came the honest question, the honest answer, and one bug that only the content repositories could catch.* -`learn-content-engine` · schema currently v1.19 · framework-agnostic TypeScript +`learn-content-engine` · framework-agnostic TypeScript ## A benchmark from outside diff --git a/docs/blog/one-source-many-outputs.md b/docs/blog/one-source-many-outputs.md index fad6438..a842578 100644 --- a/docs/blog/one-source-many-outputs.md +++ b/docs/blog/one-source-many-outputs.md @@ -43,7 +43,7 @@ Three things stay deliberately separate in what you write: the **content** (the You don't have to write that JSON by hand. The reference app ships a **lesson creator** that has outgrown the word "simple": the classic four-step wizard (metadata, cards, exercises, save & share), a book path that turns pasted or uploaded textbook chapters into knowledge lessons, an extension branch that makes even graded quizzes and dictation authorable without JSON, and an edit mode. All of it produces lessons in this same canonical schema and can even open a pull request against a content repository directly from the app; part 3 of the series walks through every path. What is **planned** beyond it is a richer, teacher-facing editor for the heavier cases (larger sets). Neither changes the model: the source stays the contract, and every editor (simple or rich) is just one more tool that reads and writes it. -> **Additive by policy.** The schema is versioned (currently 1.19) and only grows additively: new fields are optional, so a lesson written last year still validates today. You are never forced to migrate content just because the schema moved. +> **Additive by policy.** The schema is versioned (`x-schema-version`) and only grows additively: new fields are optional, so a lesson written last year still validates today. You are never forced to migrate content just because the schema moved. ## Validation is spell-check for test logic diff --git a/docs/blog/schema-first-content-engineering.md b/docs/blog/schema-first-content-engineering.md index 3ffa836..6f78fce 100644 --- a/docs/blog/schema-first-content-engineering.md +++ b/docs/blog/schema-first-content-engineering.md @@ -9,11 +9,11 @@ tags: [architecture, schema-design, typescript, content-engineering] *How `learn-content-engine` keeps a stable core schema and still leaves room for pedagogical invention: by drawing a hard line between the contract it owns and the rules its consumers own.* -`learn-content-engine` · schema currently v1.19 · framework-agnostic TypeScript +`learn-content-engine` · framework-agnostic TypeScript ## The content-schema dilemma -`learn-content-engine` is a framework-agnostic TypeScript library that parses and validates learning content: language courses foremost, though a `domain` field (a known-values-plus-other vocabulary since engine 0.20.0) lets the same shape carry other knowledge domains (tech courses, driving-test prep, psychology). It turns raw sources (lesson JSON plus a `manifest.yaml`) into a canonical internal shape, and it is the single source of truth for the lesson schema, currently version 1.19. +`learn-content-engine` is a framework-agnostic TypeScript library that parses and validates learning content: language courses foremost, though a `domain` field (a known-values-plus-other vocabulary since engine 0.20.0) lets the same shape carry other knowledge domains (tech courses, driving-test prep, psychology). It turns raw sources (lesson JSON plus a `manifest.yaml`) into a canonical internal shape, and it is the single source of truth for the lesson schema. The core is deliberately small. No rendering, no persistence, no networking; its runtime dependencies are a YAML parser and a JSON-Schema validator, and the QTI adapter's XML parser sits behind its own subpath so it never enters the core import. Since 0.29.0 the semantic rules have a subpath of their own too, without the JSON-Schema validator, so a browser app can run them without carrying it. What it offers is pure validation and transformation. That minimalism is the point, and it forces one hard question: *how do you evolve a content schema without breaking every consumer that depends on it?* diff --git a/docs/comparative-analysis.md b/docs/comparative-analysis.md index 425a9a6..6cf1cae 100644 --- a/docs/comparative-analysis.md +++ b/docs/comparative-analysis.md @@ -1,5 +1,5 @@ # **Comparative Analysis of Exercise Types in E-Learning Platforms** -**Benchmark Study for the `learn-content-engine` (package 0.42.1, lesson schema currently 1.19)** +**Benchmark Study for the `learn-content-engine`** **Version:** 1.9 **Date:** September 23, 2026 @@ -11,7 +11,7 @@ ## **Executive Summary** -This document presents a systematic comparative analysis of exercise types across established e-learning platforms (Moodle, H5P, QTI 3.0, Canvas LMS, Duolingo) in the context of the `learn-content-engine`. Two version numbers matter and are easy to conflate: the npm package is at **0.42.1**, the lesson schema it validates against is currently **1.19** (`x-schema-version` in `schema/lesson.schema.json`). This document benchmarks the schema's exercise types. +This document presents a systematic comparative analysis of exercise types across established e-learning platforms (Moodle, H5P, QTI 3.0, Canvas LMS, Duolingo) in the context of the `learn-content-engine`. Two version numbers matter and are easy to conflate: the npm package version and the version of the lesson schema it validates against (`x-schema-version` in `schema/lesson.schema.json`). This document benchmarks the schema's exercise types. The analysis demonstrates that the engine, with its six core exercise types (`matching`, `picture_choice`, `free_text`, `word_tiles`, `cloze`, `multiple_choice`), fully covers the **global standard for text-based foundational assessments**. @@ -191,7 +191,7 @@ flowchart LR Author[Content author] -->|lesson JSON| Core Author -->|lesson JSON with requires_extensions| Ref subgraph Engine[learn-content-engine] - Core[Core types: schema 1.15, ExerciseType enum] + Core[Core types: ExerciseType enum] Ref[Reference extensions: src/examples/ext-ref-*] end Core -->|guaranteed to load| App[adaptive-learner] @@ -199,7 +199,7 @@ flowchart LR Ref -.->|consumer-parity gate| Core ``` -| **Exercise Type Category** | **Moodle** | **H5P** | **QTI 3.0** | **Duolingo** | **learn-content-engine (schema currently 1.19)** | +| **Exercise Type Category** | **Moodle** | **H5P** | **QTI 3.0** | **Duolingo** | **learn-content-engine** | |----------------------------|------------|---------|-------------|--------------|----------------------------------| | **Multiple / Single Choice** | ✓ | ✓ | ✓ | ✓ | ✓ Core (`multiple_choice`, `picture_choice`) | | **Fill-in-the-Blank (Cloze)** | ✓ | ✓ | ✓ | ✓ | ✓ Core (`cloze`) | @@ -534,7 +534,7 @@ stateDiagram-v2 ## **7. Didactic Framework** ### 7.1 Bloom's Taxonomy -The core types (schema currently 1.19) primarily cover the lower levels: +The core types primarily cover the lower levels: - **Remembering:** `free_text`, `cloze`, `matching` - **Understanding:** `multiple_choice`, `picture_choice` - **Applying:** `word_tiles` (limited) @@ -584,7 +584,7 @@ The extensions enable **Constructive Alignment** (Biggs, 1996): Teaching/learnin ## **8. Conclusion** -The `learn-content-engine` (package 0.42.1, schema currently 1.19) is in an **excellent strategic position**: +The `learn-content-engine` is in an **excellent strategic position**: 1. **Standard Parity:** The six core exercise types fully cover the global standard for text-based foundational assessments, and the boundary speaks QTI 2.x and QTI 3.0. 2. **Architectural Maturity:** The `ext:` concept matches modern best practices (QTI 3.0 PCI) and prevents schema bloat. 3. **Didactic Growth Potential:** Every gap this analysis identified is covered, as a reference extension or as the core `variables` field; the higher Bloom levels are reachable without compromising core stability. diff --git a/docs/concepts.md b/docs/concepts.md index f3889be..8263fab 100644 --- a/docs/concepts.md +++ b/docs/concepts.md @@ -103,7 +103,7 @@ inherited by the set's lessons unless a lesson declares its own. ## Schema-version policy (additive) -The lesson schema is versioned (`x-schema-version`, currently `1.19`) and evolves +The lesson schema is versioned (`x-schema-version`) and evolves **additively**: new fields are optional, so **older content stays valid under a newer schema**. For example, v1.5 added the inline `examples` field; a v1.4 lesson without `examples` validates unchanged under v1.5. v1.6 added the native diff --git a/docs/lesson-format.md b/docs/lesson-format.md index a8c768d..769ef67 100644 --- a/docs/lesson-format.md +++ b/docs/lesson-format.md @@ -956,7 +956,12 @@ lockstep and changes nothing else, so `schema_version`'s default stays at `purpose` (what `bridge` lifts) and two line breaks restored after v1.16 (engine#182). v1.19 (engine#242) adds an exercise field, `case_sensitive`; the manifest schema moves its `x-schema-version` in lockstep and changes -nothing else. When comparing your pin +nothing else. v1.20 is a description-only edit again (engine#277, the +`ExerciseVariable` description). Release 0.42.1 first published it under +1.19, against this rule, and 0.42.2 gives it its number. Since 0.42.2 a +ledger test enforces the rule in both directions (engine#279, +`src/schema-version-ledger.test.ts`): content that changes under an +unchanged number fails, and so does a number that rises without a change. When comparing your pin against a new engine release, `x-schema-version` tells you the schema DEFINITION moved; `schema_version` tells you whether your MANIFESTS need a field update. From 3ddc3416facaca369d510e8231258b1a9115b745 Mon Sep 17 00:00:00 2001 From: Asterios Raptis Date: Thu, 22 Oct 2026 13:34:06 +0200 Subject: [PATCH 3/3] chore(release): 0.42.2 (#279) CHANGELOG section for 0.42.2 and an explicit correction of 0.42.1's "x-schema-version stays 1.19". make release-check, prose-check and docs:api:check are green. Co-Authored-By: Claude Opus 5.5 (1M context) --- CHANGELOG.md | 40 +++++++++++++++++++++++++++++++++++++++- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89fb2ad..b4f1abc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,42 @@ All notable changes to `learn-content-engine`. The format is inspired by ## [Unreleased] +## [0.42.2] - 2026-10-22 + +### `x-schema-version` moves with every schema change, and only then (engine#279) + +0.42.1 changed a schema description and kept `x-schema-version` at 1.19, +although the counter bumps on every change to the schema definition, +description-only edits included (docs/lesson-format.md, since #139). Two +different contents were published as 1.19, and a consumer that compares the +number to see whether the definition moved saw nothing. + +- **1.20.** Both schema files move to 1.20, in lockstep as always; the + content is 0.42.1's. `quality-rules.json` and `grading-presets.json` carry + the new `$schema-version`. +- **A ledger gate, both directions.** `src/__fixtures__/schema-baseline/schema-version-ledger.json` + maps each version to the digest of the schema set's content (both files, + `$id` and `x-schema-version` removed). `src/schema-version-ledger.test.ts`, + part of `make release-check`, fails when: + - the content changes under an unchanged number; + - a number rises without a change; + - the two files are out of lockstep; + - two rows share a digest. + Seeded negative probes cover each case, on a ledger that is consistent by + construction. Before the bump the test failed on this repository with "the + schema content changed but x-schema-version is still 1.19". +- **History.** A check over every release tag found content that changed + under an unchanged number seven times. Five predate the rule: 0.7.0, 0.8.1 + and 0.8.2, 0.14.0, 0.20.0. Two came after it: 0.24.1 (1.14) and 0.42.1 + (1.19). A number that rose without a change never occurred. +- **Docs name no version where none is needed.** README, `concepts.md`, + `architecture.md`, `comparative-analysis.md` and the three blog posts in + both languages no longer state the current schema or package version; the + schema file states it. A diagram in `comparative-analysis.md` still said + "schema 1.15" four versions later, out of reach of the version-claims gate. + The manifest `schema_version` default in `lesson-format.md` stays: authors + need it, and it keeps the version-claims gate from scanning blind. + ## [0.42.1] - 2026-10-22 ### A parametric variable's description says what the engine does (engine#277) @@ -19,7 +55,9 @@ description now names both helpers and that the random source is a parameter. Consumers that render the schema's descriptions carried the false sentence: adaptive-learner's generated lesson-format reference publishes it in eight languages and follows on its next re-pin. No type, field or rule changes; -`x-schema-version` stays 1.19. +`x-schema-version` stays 1.19. *Correction (0.42.2): this was wrong. A +description-only edit bumps `x-schema-version` too (docs/lesson-format.md); +0.42.2 gives this content its number, 1.20.* ### The self-hosted Mermaid bundle ships the notices of everything it contains (engine#274) diff --git a/package-lock.json b/package-lock.json index e07fe8b..e6b31f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "learn-content-engine", - "version": "0.42.1", + "version": "0.42.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "learn-content-engine", - "version": "0.42.1", + "version": "0.42.2", "license": "MIT", "dependencies": { "@rgrove/parse-xml": "^4.2.2", diff --git a/package.json b/package.json index 2a7efe6..cd3e0d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "learn-content-engine", - "version": "0.42.1", + "version": "0.42.2", "description": "Framework-agnostic TypeScript engine that parses lesson content from pluggable sources into a canonical lesson object.", "type": "module", "license": "MIT",